#[repr(u16)]pub enum TiffType {
Show 16 variants
Byte = 1,
Ascii = 2,
Short = 3,
Long = 4,
Rational = 5,
SByte = 6,
Undefined = 7,
SShort = 8,
SLong = 9,
SRational = 10,
Float = 11,
Double = 12,
Ifd = 13,
Long8 = 16,
SLong8 = 17,
Ifd8 = 18,
}Expand description
TIFF data type codes.
These are the 12 standard data types defined by the TIFF specification, plus IFD/IFD8 for pointer types.
Variants§
Byte = 1
8-bit unsigned integer
Ascii = 2
8-bit byte containing ASCII character (null-terminated)
Short = 3
16-bit unsigned integer
Long = 4
32-bit unsigned integer
Rational = 5
Two LONGs: numerator and denominator
SByte = 6
8-bit signed integer
Undefined = 7
8-bit byte that may contain anything
SShort = 8
16-bit signed integer
SLong = 9
32-bit signed integer
SRational = 10
Two SLONGs: numerator and denominator
Float = 11
Single precision IEEE floating point (4 bytes)
Double = 12
Double precision IEEE floating point (8 bytes)
Ifd = 13
32-bit unsigned integer offset to IFD
Long8 = 16
64-bit unsigned integer (BigTIFF)
SLong8 = 17
64-bit signed integer (BigTIFF)
Ifd8 = 18
64-bit unsigned integer offset to IFD (BigTIFF)
Implementations§
Source§impl TiffType
impl TiffType
Sourcepub fn from_u16(value: u16) -> Option<Self>
pub fn from_u16(value: u16) -> Option<Self>
Parse a type code from u16, returning None for unknown types.
Sourcepub fn fits_inline(&self, count: u32) -> bool
pub fn fits_inline(&self, count: u32) -> bool
Returns whether a value of this type with the given count fits inline in an IFD entry.
Standard TIFF IFD entries have 4 bytes for the value/offset field. If the total data size fits in 4 bytes, it’s stored inline.
Sourcepub fn fits_inline_bigtiff(&self, count: u64) -> bool
pub fn fits_inline_bigtiff(&self, count: u64) -> bool
Returns whether a value of this type with the given count fits inline in a BigTIFF entry.
BigTIFF IFD entries have 8 bytes for the value/offset field.
Trait Implementations§
Source§impl BinRead for TiffType
impl BinRead for TiffType
Source§fn read_options<R: Read + Seek>(
__binrw_generated_var_reader: &mut R,
__binrw_generated_var_endian: Endian,
__binrw_generated_var_arguments: Self::Args<'_>,
) -> BinResult<Self>
fn read_options<R: Read + Seek>( __binrw_generated_var_reader: &mut R, __binrw_generated_var_endian: Endian, __binrw_generated_var_arguments: Self::Args<'_>, ) -> BinResult<Self>
Source§fn read_be<R>(reader: &mut R) -> Result<Self, Error>
fn read_be<R>(reader: &mut R) -> Result<Self, Error>
Self from the reader using default arguments and assuming
big-endian byte order. Read moreSource§fn read_le<R>(reader: &mut R) -> Result<Self, Error>
fn read_le<R>(reader: &mut R) -> Result<Self, Error>
Self from the reader using default arguments and assuming
little-endian byte order. Read moreSource§fn read_ne<R>(reader: &mut R) -> Result<Self, Error>
fn read_ne<R>(reader: &mut R) -> Result<Self, Error>
T from the reader assuming native-endian byte order. Read moreSource§fn read_be_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
fn read_be_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
Self from the reader, assuming big-endian byte order, using the
given arguments. Read moreSource§impl BinWrite for TiffType
impl BinWrite for TiffType
Source§fn write_options<W: Write + Seek>(
&self,
__binrw_generated_var_writer: &mut W,
__binrw_generated_var_endian: Endian,
__binrw_generated_var_arguments: Self::Args<'_>,
) -> BinResult<()>
fn write_options<W: Write + Seek>( &self, __binrw_generated_var_writer: &mut W, __binrw_generated_var_endian: Endian, __binrw_generated_var_arguments: Self::Args<'_>, ) -> BinResult<()>
Source§fn write_be<W>(&self, writer: &mut W) -> Result<(), Error>
fn write_be<W>(&self, writer: &mut W) -> Result<(), Error>
Self to the writer assuming big-endian byte order. Read moreSource§fn write_le<W>(&self, writer: &mut W) -> Result<(), Error>
fn write_le<W>(&self, writer: &mut W) -> Result<(), Error>
Self to the writer assuming little-endian byte order. Read moreSource§fn write_ne<W>(&self, writer: &mut W) -> Result<(), Error>
fn write_ne<W>(&self, writer: &mut W) -> Result<(), Error>
Self to the writer assuming native-endian byte order. Read moreSource§fn write_be_args<W>(
&self,
writer: &mut W,
args: Self::Args<'_>,
) -> Result<(), Error>
fn write_be_args<W>( &self, writer: &mut W, args: Self::Args<'_>, ) -> Result<(), Error>
Self to the writer, assuming big-endian byte order, using the
given arguments. Read moreimpl Copy for TiffType
impl Eq for TiffType
impl StructuralPartialEq for TiffType
Auto Trait Implementations§
impl Freeze for TiffType
impl RefUnwindSafe for TiffType
impl Send for TiffType
impl Sync for TiffType
impl Unpin for TiffType
impl UnsafeUnpin for TiffType
impl UnwindSafe for TiffType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more