Add support for IEEEFP Gray(32) decoding

This commit is contained in:
Andrew Champion committed 2020-02-06 18:40:41 +00:00
1 parent 119dec5068
commit bbc49291e4
7 files changed
+115 -13

No files matched your search

+21
View File
@@ -100,6 +100,27 @@ pub trait EndianReader: Read {
ByteOrder::BigEndian => <Self as ReadBytesExt>::read_i32::<BigEndian>(self),
}
}
/// Reads an f32
#[inline(always)]
fn read_f32(&mut self) -> Result<f32, io::Error> {
match self.byte_order() {
ByteOrder::LittleEndian => <Self as ReadBytesExt>::read_f32::<LittleEndian>(self),
ByteOrder::BigEndian => <Self as ReadBytesExt>::read_f32::<BigEndian>(self),
}
}
#[inline(always)]
fn read_f32_into(&mut self, buffer: &mut [f32]) -> Result<(), io::Error> {
match self.byte_order() {
ByteOrder::LittleEndian => {
<Self as ReadBytesExt>::read_f32_into::<LittleEndian>(self, buffer)
}
ByteOrder::BigEndian => {
<Self as ReadBytesExt>::read_f32_into::<BigEndian>(self, buffer)
}
}
}
}
/// Reader that decompresses DEFLATE streams