#[non_exhaustive]pub enum TagValue {
Show 18 variants
Byte(u8),
Short(u16),
SignedByte(i8),
SignedShort(i16),
Signed(i32),
SignedBig(i64),
Unsigned(u32),
UnsignedBig(u64),
Float(f32),
Double(f64),
List(Vec<TagValue>),
Rational(u32, u32),
RationalBig(u64, u64),
SRational(i32, i32),
SRationalBig(i64, i64),
Ascii(String),
Ifd(u32),
IfdBig(u64),
}Expand description
A dynamically-typed value parsed from a TIFF IFD entry.
Each variant corresponds to one of the TIFF data types. Multi-value entries are represented
as TagValue::List.
Conversion methods like into_u16 and
into_f64_vec handle widening casts and return an error on
type mismatches.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Byte(u8)
8-bit unsigned integer (TIFF type BYTE).
Short(u16)
16-bit unsigned integer (TIFF type SHORT).
SignedByte(i8)
8-bit signed integer (TIFF type SBYTE).
SignedShort(i16)
16-bit signed integer (TIFF type SSHORT).
Signed(i32)
32-bit signed integer (TIFF type SLONG).
SignedBig(i64)
64-bit signed integer (BigTIFF type SLONG8).
Unsigned(u32)
32-bit unsigned integer (TIFF type LONG).
UnsignedBig(u64)
64-bit unsigned integer (BigTIFF type LONG8).
Float(f32)
32-bit IEEE floating point (TIFF type FLOAT).
Double(f64)
64-bit IEEE floating point (TIFF type DOUBLE).
List(Vec<TagValue>)
A sequence of values from a multi-count IFD entry.
Rational(u32, u32)
Unsigned rational: numerator and denominator (TIFF type RATIONAL).
RationalBig(u64, u64)
Unsigned rational with 64-bit components (BigTIFF).
SRational(i32, i32)
Signed rational: numerator and denominator (TIFF type SRATIONAL).
SRationalBig(i64, i64)
Signed rational with 64-bit components (BigTIFF).
Ascii(String)
ASCII string parsed from TIFF type ASCII
Ifd(u32)
32-bit IFD offset (TIFF type IFD).
IfdBig(u64)
64-bit IFD offset (BigTIFF type IFD8).
Implementations§
Source§impl TagValue
impl TagValue
Sourcepub fn into_u8(self) -> TiffResult<u8>
pub fn into_u8(self) -> TiffResult<u8>
Convert this TagValue into a u8, returning an error if the type is incompatible.
Sourcepub fn into_i8(self) -> TiffResult<i8>
pub fn into_i8(self) -> TiffResult<i8>
Convert this TagValue into an i8, returning an error if the type is incompatible.
Sourcepub fn into_u16(self) -> TiffResult<u16>
pub fn into_u16(self) -> TiffResult<u16>
Convert this TagValue into a u16, returning an error if the type is incompatible.
Sourcepub fn into_i16(self) -> TiffResult<i16>
pub fn into_i16(self) -> TiffResult<i16>
Convert this TagValue into an i16, returning an error if the type is incompatible.
Sourcepub fn into_u32(self) -> TiffResult<u32>
pub fn into_u32(self) -> TiffResult<u32>
Convert this TagValue into a u32, returning an error if the type is incompatible.
Sourcepub fn into_i32(self) -> TiffResult<i32>
pub fn into_i32(self) -> TiffResult<i32>
Convert this TagValue into an i32, returning an error if the type is incompatible.
Sourcepub fn into_u64(self) -> TiffResult<u64>
pub fn into_u64(self) -> TiffResult<u64>
Convert this TagValue into a u64, returning an error if the type is incompatible.
Sourcepub fn into_i64(self) -> TiffResult<i64>
pub fn into_i64(self) -> TiffResult<i64>
Convert this TagValue into an i64, returning an error if the type is incompatible.
Sourcepub fn into_f32(self) -> TiffResult<f32>
pub fn into_f32(self) -> TiffResult<f32>
Convert this TagValue into a f32, returning an error if the type is incompatible.
Sourcepub fn into_f64(self) -> TiffResult<f64>
pub fn into_f64(self) -> TiffResult<f64>
Convert this TagValue into a f64, returning an error if the type is incompatible.
Sourcepub fn into_string(self) -> TiffResult<String>
pub fn into_string(self) -> TiffResult<String>
Convert this TagValue into a String, returning an error if the type is incompatible.
Sourcepub fn into_u32_vec(self) -> TiffResult<Vec<u32>>
pub fn into_u32_vec(self) -> TiffResult<Vec<u32>>
Convert this TagValue into a Vec<u32>, returning an error if the type is incompatible.
Sourcepub fn into_u8_vec(self) -> TiffResult<Vec<u8>>
pub fn into_u8_vec(self) -> TiffResult<Vec<u8>>
Convert this TagValue into a Vec<u8>, returning an error if the type is incompatible.
Sourcepub fn into_u16_vec(self) -> TiffResult<Vec<u16>>
pub fn into_u16_vec(self) -> TiffResult<Vec<u16>>
Convert this TagValue into a Vec<u16>, returning an error if the type is incompatible.
Sourcepub fn into_i32_vec(self) -> TiffResult<Vec<i32>>
pub fn into_i32_vec(self) -> TiffResult<Vec<i32>>
Convert this TagValue into a Vec<i32>, returning an error if the type is incompatible.
Sourcepub fn into_f32_vec(self) -> TiffResult<Vec<f32>>
pub fn into_f32_vec(self) -> TiffResult<Vec<f32>>
Convert this TagValue into a Vec<f32>, returning an error if the type is incompatible.
Sourcepub fn into_f64_vec(self) -> TiffResult<Vec<f64>>
pub fn into_f64_vec(self) -> TiffResult<Vec<f64>>
Convert this TagValue into a Vec<f64>, returning an error if the type is incompatible.
Sourcepub fn into_u64_vec(self) -> TiffResult<Vec<u64>>
pub fn into_u64_vec(self) -> TiffResult<Vec<u64>>
Convert this TagValue into a Vec<u64>, returning an error if the type is incompatible.
Sourcepub fn into_i64_vec(self) -> TiffResult<Vec<i64>>
pub fn into_i64_vec(self) -> TiffResult<Vec<i64>>
Convert this TagValue into a Vec<i64>, returning an error if the type is incompatible.