pub struct TiffDecoder { /* private fields */ }Expand description
Decodes a TIFF stream.
Implementations§
Source§impl TiffDecoder
impl TiffDecoder
Sourcepub fn new<S>(source: S, limits: Limits) -> Result<TiffDecoder, PixelsError>where
S: Source,
pub fn new<S>(source: S, limits: Limits) -> Result<TiffDecoder, PixelsError>where
S: Source,
Read and parse a TIFF, decoding its first page.
§Errors
Returns PixelsError::Malformed for a bad header or directory,
PixelsError::Unsupported for a layout this codec does not
implement, or PixelsError::LimitExceeded if the image exceeds
limits.
Sourcepub fn with_page<S>(
source: S,
limits: Limits,
page: u32,
) -> Result<TiffDecoder, PixelsError>where
S: Source,
pub fn with_page<S>(
source: S,
limits: Limits,
page: u32,
) -> Result<TiffDecoder, PixelsError>where
S: Source,
Read and parse a TIFF, decoding page page (0 is the first).
A multi-page TIFF is a chain of image directories, one per page —
a stack of scans or faxes. Every page is counted when the file is
opened (Decoder::pages), reading only each directory’s size and
link, and only the chosen page is parsed and decoded.
§Errors
As TiffDecoder::new, and PixelsError::InvalidArgument if the
file has no page page.
Sourcepub const fn byte_order(&self) -> ByteOrder
pub const fn byte_order(&self) -> ByteOrder
The byte order the file declared.
Trait Implementations§
Source§impl Debug for TiffDecoder
impl Debug for TiffDecoder
Source§impl Decoder for TiffDecoder
impl Decoder for TiffDecoder
Source§fn exif(&self) -> Option<&[u8]>
fn exif(&self) -> Option<&[u8]>
The page’s descriptive tags (make, model, date, resolution, orientation, …) and its Exif and GPS directories, laid out as an EXIF block.
Source§fn source_info(&self) -> SourceInfo
fn source_info(&self) -> SourceInfo
Density, compression, bit depth and palette.
Source§fn descriptor(&self) -> ImageDescriptor
fn descriptor(&self) -> ImageDescriptor
Source§fn orientation(&self) -> Orientation
fn orientation(&self) -> Orientation
Source§fn icc_profile(&self) -> Option<&[u8]>
fn icc_profile(&self) -> Option<&[u8]>
Source§fn capability(&self) -> DecodeCapability
fn capability(&self) -> DecodeCapability
Source§fn read_row(&mut self, out: &mut [u8]) -> Result<(), PixelsError>
fn read_row(&mut self, out: &mut [u8]) -> Result<(), PixelsError>
out. Read moreSource§fn read_region(
&mut self,
region: Region,
out: &mut TileMut<'_>,
) -> Result<(), PixelsError>
fn read_region( &mut self, region: Region, out: &mut TileMut<'_>, ) -> Result<(), PixelsError>
out. Read moreSource§fn animation(&self) -> Option<Animation>
fn animation(&self) -> Option<Animation>
Source§fn reduced_descriptor(&self, target: (u32, u32)) -> Option<ImageDescriptor>
fn reduced_descriptor(&self, target: (u32, u32)) -> Option<ImageDescriptor>
target or larger, when
the format lets it reach that size more cheaply than a full decode. Read more