pub struct IfdDecoder<'lt> { /* private fields */ }Expand description
Reads a directory’s tag values from an underlying stream.
Implementations§
Source§impl IfdDecoder<'_>
impl IfdDecoder<'_>
Sourcepub fn find_entry(&self, tag: Tag) -> Option<Entry>
pub fn find_entry(&self, tag: Tag) -> Option<Entry>
Retrieve the IFD entry for a given tag, if it exists.
The entry contains the metadata of the value, that is its type and count from which we can calculate a total byte size.
Sourcepub fn find_tag(&mut self, tag: Tag) -> TiffResult<Option<Value>>
pub fn find_tag(&mut self, tag: Tag) -> TiffResult<Option<Value>>
Tries to retrieve a tag.
Return Ok(None) if the tag is not present.
Sourcepub fn find_tag_buf(
&mut self,
tag: Tag,
buf: &mut ValueBuffer,
) -> TiffResult<Option<Entry>>
pub fn find_tag_buf( &mut self, tag: Tag, buf: &mut ValueBuffer, ) -> TiffResult<Option<Entry>>
Retrieve a tag and reproduce its bytes into the provided buffer.
The buffer is unmodified if the tag is not present.
Sourcepub fn find_tag_bytes(
&mut self,
tag: Tag,
buf: &mut [u8],
offset: u64,
) -> TiffResult<Option<usize>>
pub fn find_tag_bytes( &mut self, tag: Tag, buf: &mut [u8], offset: u64, ) -> TiffResult<Option<usize>>
Read bytes of a tag’s value into a byte buffer.
Sourcepub fn find_tag_unsigned<T: TryFrom<u64>>(
&mut self,
tag: Tag,
) -> TiffResult<Option<T>>
pub fn find_tag_unsigned<T: TryFrom<u64>>( &mut self, tag: Tag, ) -> TiffResult<Option<T>>
Tries to retrieve a tag and convert it to the desired unsigned type.
Sourcepub fn find_tag_unsigned_vec<T: TryFrom<u64>>(
&mut self,
tag: Tag,
) -> TiffResult<Option<Vec<T>>>
pub fn find_tag_unsigned_vec<T: TryFrom<u64>>( &mut self, tag: Tag, ) -> TiffResult<Option<Vec<T>>>
Tries to retrieve a vector of all a tag’s values and convert them to the desired unsigned type.
Sourcepub fn get_tag_unsigned<T: TryFrom<u64>>(&mut self, tag: Tag) -> TiffResult<T>
pub fn get_tag_unsigned<T: TryFrom<u64>>(&mut self, tag: Tag) -> TiffResult<T>
Tries to retrieve a tag and convert it to the desired unsigned type. Returns an error if the tag is not present.
Sourcepub fn get_tag(&mut self, tag: Tag) -> TiffResult<Value>
pub fn get_tag(&mut self, tag: Tag) -> TiffResult<Value>
Tries to retrieve a tag. Returns an error if the tag is not present
Sourcepub fn get_tag_u32(&mut self, tag: Tag) -> TiffResult<u32>
pub fn get_tag_u32(&mut self, tag: Tag) -> TiffResult<u32>
Tries to retrieve a tag and convert it to the desired type.
pub fn get_tag_u64(&mut self, tag: Tag) -> TiffResult<u64>
Sourcepub fn get_tag_f32(&mut self, tag: Tag) -> TiffResult<f32>
pub fn get_tag_f32(&mut self, tag: Tag) -> TiffResult<f32>
Tries to retrieve a tag and convert it to the desired type.
Sourcepub fn get_tag_f64(&mut self, tag: Tag) -> TiffResult<f64>
pub fn get_tag_f64(&mut self, tag: Tag) -> TiffResult<f64>
Tries to retrieve a tag and convert it to the desired type.
Sourcepub 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>>
Tries to retrieve a tag and convert it to the desired type.
pub fn get_tag_u16_vec(&mut self, tag: Tag) -> TiffResult<Vec<u16>>
pub fn get_tag_u64_vec(&mut self, tag: Tag) -> TiffResult<Vec<u64>>
Sourcepub fn get_tag_f32_vec(&mut self, tag: Tag) -> TiffResult<Vec<f32>>
pub fn get_tag_f32_vec(&mut self, tag: Tag) -> TiffResult<Vec<f32>>
Tries to retrieve a tag and convert it to the desired type.
Sourcepub fn get_tag_f64_vec(&mut self, tag: Tag) -> TiffResult<Vec<f64>>
pub fn get_tag_f64_vec(&mut self, tag: Tag) -> TiffResult<Vec<f64>>
Tries to retrieve a tag and convert it to the desired type.
Sourcepub fn get_tag_u8_vec(&mut self, tag: Tag) -> TiffResult<Vec<u8>>
pub fn get_tag_u8_vec(&mut self, tag: Tag) -> TiffResult<Vec<u8>>
Tries to retrieve a tag and convert it to a 8bit vector.
Sourcepub fn get_tag_ascii_string(&mut self, tag: Tag) -> TiffResult<String>
pub fn get_tag_ascii_string(&mut self, tag: Tag) -> TiffResult<String>
Tries to retrieve a tag and convert it to a ascii vector.