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 ifd::Ifd;

Modules§

cache
LRU cache for decompressed strips and tiles.
constants
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.
RasterLayout
Raster layout information normalized from TIFF tags.
Tag
A parsed TIFF tag.
TiffFile
A memory-mapped TIFF file handle.

Enums§

ByteOrder
Byte order indicator from the TIFF header.
TagType
TIFF data type codes.
TagValue
Decoded tag value.

Traits§

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