From 768e0d4af7c742cd08777556085b8d542583f7d0 Mon Sep 17 00:00:00 2001 From: Etienne Prothon Date: Wed, 5 Aug 2020 15:34:28 +0200 Subject: [PATCH] feat: Add tag to single f32 or f64 --- src/decoder/mod.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/decoder/mod.rs b/src/decoder/mod.rs index c4b8fed..fced943 100644 --- a/src/decoder/mod.rs +++ b/src/decoder/mod.rs @@ -632,6 +632,16 @@ impl Decoder { self.get_tag(tag)?.into_u32() } + /// Tries to retrieve a tag and convert it to the desired type. + pub fn get_tag_f32(&mut self, tag: Tag) -> TiffResult { + self.get_tag(tag)?.into_f32() + } + + /// Tries to retrieve a tag and convert it to the desired type. + pub fn get_tag_f64(&mut self, tag: Tag) -> TiffResult { + self.get_tag(tag)?.into_f64() + } + /// Tries to retrieve a tag and convert it to the desired type. pub fn get_tag_u32_vec(&mut self, tag: Tag) -> TiffResult> { self.get_tag(tag)?.into_u32_vec()