pub struct TiffParser<R> { /* private fields */ }Expand description
TIFF file parser.
Implementations§
Source§impl<R: Read + Seek> TiffParser<R>
impl<R: Read + Seek> TiffParser<R>
Sourcepub fn header(&self) -> &TiffHeader
pub fn header(&self) -> &TiffHeader
Get the parsed header.
Sourcepub fn byte_order(&self) -> ByteOrder
pub fn byte_order(&self) -> ByteOrder
Get the byte order.
Sourcepub fn is_bigtiff(&self) -> bool
pub fn is_bigtiff(&self) -> bool
Check if this is a BigTIFF file.
Sourcepub fn parse_ifd_at(&mut self, offset: u64) -> RawResult<Ifd>
pub fn parse_ifd_at(&mut self, offset: u64) -> RawResult<Ifd>
Parse an IFD at the given offset.
Sourcepub fn walk_ifd_chain(&mut self) -> RawResult<Vec<Ifd>>
pub fn walk_ifd_chain(&mut self) -> RawResult<Vec<Ifd>>
Walk the IFD chain starting from IFD0.
Sourcepub fn parse_ifd0(&mut self) -> RawResult<Ifd>
pub fn parse_ifd0(&mut self) -> RawResult<Ifd>
Parse IFD0 (the first/main IFD) without validation.
Sourcepub fn read_value(&mut self, entry: &IfdEntry) -> RawResult<TiffValue>
pub fn read_value(&mut self, entry: &IfdEntry) -> RawResult<TiffValue>
Read the value for an IFD entry.
Sourcepub fn read_bytes(&mut self, count: usize) -> RawResult<Vec<u8>>
pub fn read_bytes(&mut self, count: usize) -> RawResult<Vec<u8>>
Read a specified number of bytes from the current position.
Sourcepub fn validate_complete(&mut self) -> RawResult<()>
pub fn validate_complete(&mut self) -> RawResult<()>
Validate that all IFD data references are within file bounds.
This method walks the entire IFD structure and verifies that:
- All IFD offsets are within file bounds
- All value data referenced by entries (that’s not inline) is within bounds
- No truncated data exists
Returns an error if any data would extend past the end of the file.
Auto Trait Implementations§
impl<R> Freeze for TiffParser<R>where
R: Freeze,
impl<R> RefUnwindSafe for TiffParser<R>where
R: RefUnwindSafe,
impl<R> Send for TiffParser<R>where
R: Send,
impl<R> Sync for TiffParser<R>where
R: Sync,
impl<R> Unpin for TiffParser<R>where
R: Unpin,
impl<R> UnsafeUnpin for TiffParser<R>where
R: UnsafeUnpin,
impl<R> UnwindSafe for TiffParser<R>where
R: UnwindSafe,
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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