pub struct HeicFile { /* private fields */ }Expand description
A parsed HEIC/HEIF file.
Construct with HeicFile::open. Opening only parses the container (cheap);
the CPU-heavy HEVC decode happens in decode_primary
and decode_aux.
Implementations§
Source§impl HeicFile
impl HeicFile
Sourcepub fn open(data: Vec<u8>) -> RawResult<Self>
pub fn open(data: Vec<u8>) -> RawResult<Self>
Parse a HEIC file from its raw bytes.
Only the container is parsed here, so this is cheap. The auxiliary-image table is populated up front; pixel decoding is deferred.
§Errors
Returns RawError::Format if data is not a readable HEIC file.
Sourcepub fn decode_primary(&self) -> RawResult<RgbImage>
pub fn decode_primary(&self) -> RawResult<RgbImage>
Decode the primary image to a 16-bit RGB image.
Geometric transforms (irot/imir) and grid (tiled) stitching are
already applied; HDR (10/12-bit) sources are scaled to the full 16-bit
range.
Sourcepub fn metadata(&self) -> ImageMetadata
pub fn metadata(&self) -> ImageMetadata
Extract embedded EXIF/XMP/ICC and full typed metadata.
Sourcepub fn aux_images(&self) -> &[HeicAuxImage]
pub fn aux_images(&self) -> &[HeicAuxImage]
All auxiliary images (thumbnails, depth maps, HDR gain maps, auxiliary).
Sourcepub fn decode_aux(&self, aux: &HeicAuxImage) -> RawResult<RgbImage>
pub fn decode_aux(&self, aux: &HeicAuxImage) -> RawResult<RgbImage>
Decode a specific auxiliary image to a 16-bit RGB image.
Single-channel sources (depth maps, gain maps) are returned as grayscale-expanded RGB.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HeicFile
impl RefUnwindSafe for HeicFile
impl Send for HeicFile
impl Sync for HeicFile
impl Unpin for HeicFile
impl UnsafeUnpin for HeicFile
impl UnwindSafe for HeicFile
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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