pub struct TiffFile { /* private fields */ }Expand description
A memory-mapped TIFF file handle.
Implementations§
Source§impl TiffFile
impl TiffFile
Sourcepub fn open<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn open<P: AsRef<Path>>(path: P) -> Result<Self>
Open a TIFF file from disk using memory-mapped I/O.
Sourcepub fn open_with_options<P: AsRef<Path>>(
path: P,
options: OpenOptions,
) -> Result<Self>
pub fn open_with_options<P: AsRef<Path>>( path: P, options: OpenOptions, ) -> Result<Self>
Open a TIFF file from disk with explicit decoder options.
Sourcepub fn from_bytes(data: Vec<u8>) -> Result<Self>
pub fn from_bytes(data: Vec<u8>) -> Result<Self>
Open a TIFF file from an owned byte buffer (WASM-compatible).
Sourcepub fn from_bytes_with_options(
data: Vec<u8>,
options: OpenOptions,
) -> Result<Self>
pub fn from_bytes_with_options( data: Vec<u8>, options: OpenOptions, ) -> Result<Self>
Open a TIFF file from bytes with explicit decoder options.
Sourcepub fn from_source(source: SharedSource) -> Result<Self>
pub fn from_source(source: SharedSource) -> Result<Self>
Open a TIFF file from an arbitrary random-access source.
Sourcepub fn from_source_with_options(
source: SharedSource,
options: OpenOptions,
) -> Result<Self>
pub fn from_source_with_options( source: SharedSource, options: OpenOptions, ) -> Result<Self>
Open a TIFF file from an arbitrary random-access source with options.
Sourcepub fn byte_order(&self) -> ByteOrder
pub fn byte_order(&self) -> ByteOrder
Returns the byte order of the TIFF file.
Sourcepub fn is_bigtiff(&self) -> bool
pub fn is_bigtiff(&self) -> bool
Returns true if this is a BigTIFF file.
Sourcepub fn source(&self) -> &dyn TiffSource
pub fn source(&self) -> &dyn TiffSource
Returns the backing source.
Sourcepub fn read_image_bytes(&self, ifd_index: usize) -> Result<Vec<u8>>
pub fn read_image_bytes(&self, ifd_index: usize) -> Result<Vec<u8>>
Decode an image into native-endian interleaved sample bytes.
Sourcepub fn read_window_bytes(
&self,
ifd_index: usize,
row_off: usize,
col_off: usize,
rows: usize,
cols: usize,
) -> Result<Vec<u8>>
pub fn read_window_bytes( &self, ifd_index: usize, row_off: usize, col_off: usize, rows: usize, cols: usize, ) -> Result<Vec<u8>>
Decode a pixel window into native-endian interleaved sample bytes.
Sourcepub fn read_window<T: TiffSample>(
&self,
ifd_index: usize,
row_off: usize,
col_off: usize,
rows: usize,
cols: usize,
) -> Result<ArrayD<T>>
pub fn read_window<T: TiffSample>( &self, ifd_index: usize, row_off: usize, col_off: usize, rows: usize, cols: usize, ) -> Result<ArrayD<T>>
Decode a window into a typed ndarray.
Single-band rasters are returned as shape [rows, cols].
Multi-band rasters are returned as shape [rows, cols, samples_per_pixel].
Sourcepub fn read_image<T: TiffSample>(&self, ifd_index: usize) -> Result<ArrayD<T>>
pub fn read_image<T: TiffSample>(&self, ifd_index: usize) -> Result<ArrayD<T>>
Decode an image into a typed ndarray.
Single-band rasters are returned as shape [height, width].
Multi-band rasters are returned as shape [height, width, samples_per_pixel].
Auto Trait Implementations§
impl Freeze for TiffFile
impl !RefUnwindSafe for TiffFile
impl Send for TiffFile
impl Sync for TiffFile
impl Unpin for TiffFile
impl UnsafeUnpin for TiffFile
impl !UnwindSafe for TiffFile
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> 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