We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e74f88f commit d0d626aCopy full SHA for d0d626a
src/pixel.rs
@@ -124,12 +124,12 @@ impl<const N: usize> Pixel<N> {
124
{
125
// credits for the initial idea: @zakarumych
126
let v = if N == 4 {
127
- u32::from_ne_bytes(cast(self.0))
+ u32::from_le_bytes(cast(self.0))
128
} else {
129
- u32::from_ne_bytes([self.0[0], self.0[1], self.0[2], 0xff])
+ u32::from_le_bytes([self.0[0], self.0[1], self.0[2], 0xff])
130
} as u64;
131
let s = ((v & 0xff00_ff00) << 32) | (v & 0x00ff_00ff);
132
- s.wrapping_mul(0x0300_0700_0005_000b_u64).to_le().swap_bytes() as u8 & 63
+ (s.wrapping_mul(0x0300_0700_0005_000b_u64) >> 56) as u8 & 63
133
}
134
135
#[inline]
0 commit comments