mirror of
https://github.com/storytold/photocraft.git
synced 2026-10-24 09:57:08 -06:00
io/affinity: as_chunks for the mask's grey extraction (clippy 1.99)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UHgFEHEsefoQoBParH47JA
(cherry picked from commit 20275685b1)
This commit is contained in:
@@ -524,7 +524,7 @@ impl Builder {
|
||||
|
||||
fn mask(&mut self, img: &af::Image, to_doc: Affine) -> Option<Surface> {
|
||||
let (w, h, rgba) = self.pixels(img)?;
|
||||
let grey: Vec<u8> = rgba.chunks_exact(4).map(|p| p[0]).collect();
|
||||
let grey: Vec<u8> = rgba.as_chunks::<4>().0.iter().map(|p| p[0]).collect();
|
||||
let m = to_doc.mul(&affine(img.transform));
|
||||
self.resample(w, h, &grey, m, 1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user