switch to native endianness
This commit is contained in:
parent
1728b9b2c4
commit
0ac42b0793
1 changed files with 3 additions and 3 deletions
|
@ -16,7 +16,7 @@ where
|
|||
{
|
||||
fn into_bytes(self) -> crate::Bytes {
|
||||
self.iter()
|
||||
.flat_map(|subpixel| subpixel.to_be_bytes().as_ref().to_vec())
|
||||
.flat_map(|subpixel| subpixel.to_ne_bytes().as_ref().to_vec())
|
||||
.collect()
|
||||
}
|
||||
}
|
||||
|
@ -42,9 +42,9 @@ where
|
|||
format.width,
|
||||
format.height,
|
||||
bytes
|
||||
.chunks_exact(P::Subpixel::zero().to_be_bytes().as_ref().len())
|
||||
.chunks_exact(P::Subpixel::zero().to_ne_bytes().as_ref().len())
|
||||
.map(|p| {
|
||||
P::Subpixel::from_be_bytes(
|
||||
P::Subpixel::from_ne_bytes(
|
||||
&match <P::Subpixel as FromBytes>::Bytes::try_from(p) {
|
||||
Ok(v) => v,
|
||||
Err(_) => unreachable!("you messed up chunk size!"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue