Struct rexif::IfdEntry
[−]
[src]
pub struct IfdEntry { pub namespace: Namespace, pub tag: u16, pub format: IfdFormat, pub count: u32, pub data: Vec<u8>, pub ifd_data: Vec<u8>, pub ext_data: Vec<u8>, pub le: bool, }
Structure that represents a parsed IFD entry of a TIFF image
Fields
namespace: Namespace
Namespace of the entry. Standard is a tag found in normal TIFF IFD structure, other namespaces are entries found e.g. within MarkerNote blobs that are manufacturer-specific.
tag: u16
IFD tag value, may or not be an EXIF tag
format: IfdFormat
IFD data format
count: u32
Number of items, each one in the data format specified by format
data: Vec<u8>
Raw data as a vector of bytes. Length is sizeof(format) * count. Depending on its size, it came from different parts of the image file.
ifd_data: Vec<u8>
Raw data contained within the IFD structure. If count * sizeof(format) >= 4, this item contains the offset where the actual data can be found
ext_data: Vec<u8>
Raw data contained outside of the IFD structure and pointed by ifd_data, if data would not fit within the IFD structure
le: bool
If true, integer and offset formats must be parsed from raw data as little-endian. If false, integer and offset formats must be parsed from raw data as big-endian.
It is important to have 'endianess' per IFD entry, because some manufacturer-specific entries may have fixed endianess (regardeless of TIFF container's general endianess).
Methods
impl IfdEntry
[src]
fn data_as_offset(&self) -> usize
Casts IFD entry data into an offset. Not very useful for the crate client. The call can't fail, but the caller must be sure that the IFD entry uses the IFD data area as an offset (i.e. when the tag is a Sub-IFD tag, or when there are more than 4 bytes of data and it would not fit within IFD).
fn size(&self) -> u8
Returns the size of an individual element (e.g. U8=1, U16=2...). Every IFD entry contains an array of elements, so this is NOT the size of the whole entry!
fn length(&self) -> usize
Total length of the whole IFD entry (element count x element size)
fn in_ifd(&self) -> bool
Returns true if data is contained within the IFD structure, false when data can be found elsewhere in the image (and IFD structure contains the data offset, instead of data).
fn copy_data(&mut self, contents: &[u8]) -> bool
Copies data from IFD entry section reserved for data (up to 4 bytes), or from another part of the image file (when data wouldn't fit in IFD structure). In either case, the data member will contain the data of interest after this call.
Trait Implementations
impl Clone for IfdEntry
[src]
fn clone(&self) -> IfdEntry
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more