Skip to content

Commit

Permalink
update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
owenthewizard committed Nov 26, 2024
1 parent 936a34d commit 88822cc
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 45 deletions.
81 changes: 45 additions & 36 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ maintenance = { status = "actively-developed" }
blend-srgb = { version = "0.1", optional = true }
imagefmt = { version = "4", default-features = false, optional = true }
imgref = "1"
itertools = { version = "0.12", optional = true }
itertools = { version = "0.13", optional = true }
libc = "0.2" # should be same as xcb
num_cpus = "1"
rayon = { version = "1", optional = true }
Expand Down
8 changes: 4 additions & 4 deletions src/brightness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,27 @@ impl BrightnessAdj for ImgRefMut<'_, BGRA8> {
fn brighten(&mut self, amt: NonZeroU8) {
#[cfg(not(feature = "threads"))]
for pixel in self.pixels_mut() {
*pixel = pixel.map_c(|c| c.saturating_add(amt.get()));
*pixel = pixel.map_colors(|c| c.saturating_add(amt.get()));
}

#[cfg(feature = "threads")]
self.rows_mut().par_bridge().for_each(|row| {
for pixel in row.iter_mut() {
*pixel = pixel.map_c(|c| c.saturating_add(amt.get()));
*pixel = pixel.map_colors(|c| c.saturating_add(amt.get()));
}
});
}

fn darken(&mut self, amt: NonZeroU8) {
#[cfg(not(feature = "threads"))]
for pixel in self.pixels_mut() {
*pixel = pixel.map_c(|c| c.saturating_sub(amt.get()));
*pixel = pixel.map_colors(|c| c.saturating_sub(amt.get()));
}

#[cfg(feature = "threads")]
self.rows_mut().par_bridge().for_each(|row| {
for pixel in row.iter_mut() {
*pixel = pixel.map_c(|c| c.saturating_sub(amt.get()));
*pixel = pixel.map_colors(|c| c.saturating_sub(amt.get()));
}
});
}
Expand Down
8 changes: 4 additions & 4 deletions src/overlay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ impl Compose for ImgRefMut<'_, BGRA8> {
.zip(m.pixels())
.filter(|(_, mask_px)| mask_px.a > MASK_THRESHOLD)
{
*view_px = view_px.map_c(|c| !c);
*view_px = view_px.map_colors(|c| !c);
}

#[cfg(feature = "threads")]
Expand All @@ -86,19 +86,19 @@ impl Compose for ImgRefMut<'_, BGRA8> {
.zip(mask_row.iter().copied())
.filter(|(_, mask_px)| mask_px.a > MASK_THRESHOLD)
{
*view_px = view_px.map_c(|c| !c);
*view_px = view_px.map_colors(|c| !c);
}
});
} else {
#[cfg(not(feature = "threads"))]
for pixel in self.pixels_mut() {
*pixel = pixel.map_c(|c| !c);
*pixel = pixel.map_colors(|c| !c);
}

#[cfg(feature = "threads")]
self.rows_mut().par_bridge().for_each(|r| {
for pixel in r.iter_mut() {
*pixel = pixel.map_c(|c| !c);
*pixel = pixel.map_colors(|c| !c);
}
});
}
Expand Down

0 comments on commit 88822cc

Please sign in to comment.