Skip to content

Commit

Permalink
Refactor: always screencopy full output, new FrameGuard and ScreenCap…
Browse files Browse the repository at this point in the history
…turer

Split of "Move from log to tracing"
  • Loading branch information
Decodetalkers authored and AndreasBackx committed Oct 25, 2023
1 parent a5f1e10 commit ac951cb
Show file tree
Hide file tree
Showing 4 changed files with 295 additions and 321 deletions.
14 changes: 2 additions & 12 deletions libwayshot/src/image_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ pub(crate) fn rotate_image_buffer(
width: u32,
height: u32,
) -> RgbaImage {
let final_buffer = match transform {
tracing::debug!("Rotating image buffer");
match transform {
Transform::_90 => image::imageops::rotate90(&image),
Transform::_180 => image::imageops::rotate180(&image),
Transform::_270 => image::imageops::rotate270(&image),
Expand All @@ -26,16 +27,5 @@ pub(crate) fn rotate_image_buffer(
image::imageops::rotate270(&flipped_buffer)
}
_ => image,
};

if final_buffer.dimensions() == (width, height) {
return final_buffer;
}

image::imageops::resize(
&final_buffer,
width,
height,
image::imageops::FilterType::Gaussian,
)
}
Loading

0 comments on commit ac951cb

Please sign in to comment.