fast image operations
fixup
| -rw-r--r-- | Cargo.toml | 6 | ||||
| -rw-r--r-- | src/pixels/blending.rs | 4 | ||||
| -rw-r--r-- | src/pixels/convert.rs | 8 |
3 files changed, 9 insertions, 9 deletions
@@ -1,6 +1,6 @@ [package] name = "fimg" -version = "0.4.49" +version = "0.4.50" authors = ["bend-n <[email protected]>"] license = "MIT" edition = "2024" @@ -24,8 +24,8 @@ minifb = { version = "0.25.0", default-features = false, features = [ "wayland", ], optional = true } wgpu = { version = "0.19.1", default-features = false, optional = true } -atools = "0.1.4" -qwant = { version = "1.0.0", optional = true } +atools = "0.1.9" +qwant = { version = "1.0.2", optional = true } libc = "0.2.154" hinted = { version = "1.0.0", features = ["nightly"] } lower = "0.2.0" diff --git a/src/pixels/blending.rs b/src/pixels/blending.rs index 33beecf..cecc742 100644 --- a/src/pixels/blending.rs +++ b/src/pixels/blending.rs @@ -49,8 +49,8 @@ impl Blend<4> for [u8; 4] { return; }; self[..3].copy_from_slice( - &fg.trunc() - .zip(bg.trunc()) + &fg.init() + .zip(bg.init()) .map(|(f, b)| (f * fg[3] + b * bg[3] * (1.0 - fg[3])) / a) .unfloat(), ); diff --git a/src/pixels/convert.rs b/src/pixels/convert.rs index d36652f..0f26312 100644 --- a/src/pixels/convert.rs +++ b/src/pixels/convert.rs @@ -17,7 +17,7 @@ impl<const N: usize> PFrom<N> for [u8; N] { pub type Y = [u8; 1]; impl PFrom<2> for Y { fn pfrom(f: YA) -> Self { - f.trunc() + f.init() } } @@ -29,7 +29,7 @@ impl PFrom<3> for Y { impl PFrom<4> for Y { fn pfrom(f: RGBA) -> Self { - PFrom::pfrom(f.trunc()) + PFrom::pfrom(f.init()) } } @@ -49,7 +49,7 @@ impl PFrom<3> for YA { impl PFrom<4> for YA { fn pfrom(f: RGBA) -> Self { - Y::pfrom(f.trunc()).join(255) + Y::pfrom(f.init()).join(255) } } @@ -70,7 +70,7 @@ impl PFrom<2> for RGB { impl PFrom<4> for RGB { fn pfrom(f: RGBA) -> Self { - f.trunc() + f.init() } } |