Add support for IEEEFP 32 and 64 bit encoding

This commit is contained in:
Andrew Champion committed 2020-02-10 13:21:16 +00:00
1 parent a41e33e42a
commit 8d4bdce7aa
5 files changed
+185 -1

No files matched your search

+14
View File
@@ -93,6 +93,20 @@ impl<W: Write> TiffWriter<W> {
Ok(())
}
pub fn write_f32(&mut self, n: f32) -> Result<(), io::Error> {
self.writer.write_f32::<NativeEndian>(n)?;
self.offset += 4;
Ok(())
}
pub fn write_f64(&mut self, n: f64) -> Result<(), io::Error> {
self.writer.write_f64::<NativeEndian>(n)?;
self.offset += 8;
Ok(())
}
pub fn pad_word_boundary(&mut self) -> Result<(), io::Error> {
if self.offset % 4 != 0 {
let padding = [0, 0, 0];