feat: Add tag to single f32 or f64

This commit is contained in:
Etienne Prothon committed 2020-08-05 15:34:28 +02:00
1 parent 3b0da4d1ae
commit 768e0d4af7
1 file changed
+10
+10
View File
@@ -632,6 +632,16 @@ impl<R: Read + Seek> Decoder<R> {
self.get_tag(tag)?.into_u32() 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<f32> {
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<f64> {
self.get_tag(tag)?.into_f64()
}
/// Tries to retrieve a tag and convert it to the desired type. /// Tries to retrieve a tag and convert it to the desired type.
pub fn get_tag_u32_vec(&mut self, tag: Tag) -> TiffResult<Vec<u32>> { pub fn get_tag_u32_vec(&mut self, tag: Tag) -> TiffResult<Vec<u32>> {
self.get_tag(tag)?.into_u32_vec() self.get_tag(tag)?.into_u32_vec()