mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-29 12:17:14 -06:00
M14.4: as_chunks for the pixel loops main gained since the no-panics branch
Same treatment as the branch's `as_chunks` commit (Rust 1.99's `chunks_exact_to_as_chunks` lint) for the flattener's coverage pass, the CMYK ink compositor, the Flattener Preview highlight and four test helpers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
1a5f7f6441
commit
7fb07bb3db
@@ -325,7 +325,7 @@ fn render(
|
||||
.highlight_art(&shot.doc, h)
|
||||
.map(|art| r.render(&art, w, hh, view, &RenderOptions { skip_templates: true, ..Default::default() }));
|
||||
let red = [color.r(), color.g(), color.b()].map(f32::from);
|
||||
for (i, p) in img.pixels.chunks_exact_mut(4).enumerate() {
|
||||
for (i, p) in img.pixels.as_chunks_mut::<4>().0.iter_mut().enumerate() {
|
||||
// A light grey of the art, so the highlight stands out.
|
||||
let luma = 0.299 * p[0] as f32 + 0.587 * p[1] as f32 + 0.114 * p[2] as f32;
|
||||
let grey = 96.0 + luma * 0.62;
|
||||
|
||||
Reference in New Issue
Block a user