mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-14 22:42:46 +00:00
Use array chunks for raster pixels
This commit is contained in:
1 file changed
+1
-1
@@ -181,7 +181,7 @@ pub fn classify_tone(bytes: &[u8]) -> Option<ToneClass> {
|
||||
let rgba = decoded.convert(ChannelLayout::Rgba, SampleType::U8);
|
||||
let mut opaque = true;
|
||||
let mut two_level = true;
|
||||
for p in rgba.data().chunks_exact(4) {
|
||||
for p in rgba.data().as_chunks::<4>().0 {
|
||||
match p[3] {
|
||||
0 => opaque = false,
|
||||
255 if p[0] == p[1] && p[1] == p[2] => two_level &= p[0] == 0 || p[0] == 255,
|
||||
|
||||
Reference in new issue
Block a user