Skip to main content

Crate tiff_reader

Crate tiff_reader 

Source
Expand description

Pure-Rust, read-only TIFF and BigTIFF decoder.

Supports:

  • TIFF (classic): II/MM byte order mark + version 42
  • BigTIFF: II/MM byte order mark + version 43
  • Sources: mmap, in-memory bytes, or any custom random-access source

§Example

use tiff_reader::TiffFile;

let file = TiffFile::open("image.tif").unwrap();
println!("byte order: {:?}", file.byte_order());
println!("IFD count: {}", file.ifd_count());

let ifd = file.ifd(0).unwrap();
println!("  width: {}", ifd.width());
println!("  height: {}", ifd.height());
println!("  bits per sample: {:?}", ifd.bits_per_sample());

let pixels: ndarray::ArrayD<u16> = file.read_image(0).unwrap();

Re-exports§

pub use error::Error as TiffError;
pub use header::ByteOrder;
pub use ifd::Ifd;
pub use ifd::RasterLayout;
pub use tag::Tag;
pub use tag::TagValue;

Modules§

cache
LRU cache for decompressed strips and tiles.
error
filters
Compression filter pipeline for TIFF strip/tile decompression.
header
ifd
io
source
Random-access source abstraction used by the TIFF decoder.
strip
Strip-based data access for TIFF images.
tag
tile
Tile-based data access for TIFF images.

Structs§

OpenOptions
Configuration for opening a TIFF file.
TiffFile
A memory-mapped TIFF file handle.

Traits§

TiffSample
Types that can be read directly from a decoded TIFF raster.