mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-24 17:56:50 -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
@@ -204,7 +204,7 @@ pub(crate) fn compose(cmy: &[u8], k: &[u8], background: Option<[u8; 4]>) -> Vec<
|
||||
let mut out = Vec::with_capacity(cmy.len());
|
||||
// Runs of one colour convert once.
|
||||
let mut last: Option<([u8; 8], [u8; 4])> = None;
|
||||
for (p, q) in cmy.chunks_exact(4).zip(k.chunks_exact(4)) {
|
||||
for (p, q) in cmy.as_chunks::<4>().0.iter().zip(k.as_chunks::<4>().0) {
|
||||
let key = [p[0], p[1], p[2], p[3], q[0], q[1], q[2], q[3]];
|
||||
let px = match (&last, &bg) {
|
||||
_ if p[3] == 0 => [0; 4],
|
||||
|
||||
Reference in New Issue
Block a user