Skip to main content

Crate heifer

Crate heifer 

Source
Expand description

Pure-Rust HEIF/HEIC image decoder (and, later, encoder).

let bytes = std::fs::read("photo.heic").unwrap();
let image = heifer::decode(&bytes).unwrap();
let rgba: Vec<u8> = image.to_rgba8();
println!("{}x{}, alpha: {}", image.width, image.height, image.has_alpha);

This crate ties together the container (heifer_isobmff) and the HEVC codec (heifer_hevc_dec, heifer_hevc_enc).

Re-exports§

pub use image::Image;
pub use metadata::Exif;
pub use metadata::Metadata;
pub use metadata::item_metadata;
pub use metadata::read_metadata;
pub use heifer_hevc_dec;
pub use heifer_hevc_enc;
pub use heifer_isobmff;

Modules§

color
YCbCr to RGB conversion (ITU-T H.273 matrix coefficients).
image
Decoded RGBA images and the geometric transforms of HEIF (crop, rotation, mirror).
image_crate
Integration with the image crate (feature image).
metadata
Image metadata: EXIF, XMP and ICC profile, plus a minimal EXIF (TIFF) reader for the most common fields.

Structs§

Options
Decoding options.

Enums§

Error
Errors produced while decoding a HEIF file.

Functions§

decode
Decodes the primary image of a HEIF/HEIC file, with its alpha channel if any, and applies the crop, rotation and mirror transforms stored in the file. Grid tiles are decoded in parallel on all available cores.
decode_item
Decodes one image item: coded (hvc1) or derived (grid, iovl), then applies its transformative properties.
decode_with_options
Like decode, with options.