pub struct ImageHandle { /* private fields */ }
Expand description
Encoded image.
Implementations§
Source§impl ImageHandle
impl ImageHandle
pub fn item_id(&self) -> ItemId
pub fn width(&self) -> u32
pub fn height(&self) -> u32
pub fn has_alpha_channel(&self) -> bool
pub fn is_premultiplied_alpha(&self) -> bool
pub fn is_primary(&self) -> bool
pub fn luma_bits_per_pixel(&self) -> u8
pub fn chroma_bits_per_pixel(&self) -> u8
Sourcepub fn ispe_width(&self) -> i32
pub fn ispe_width(&self) -> i32
Get the image width from the ‘ispe’ box. This is the original image size without any transformations applied to it. Do not use this unless you know exactly what you are doing.
Sourcepub fn ispe_height(&self) -> i32
pub fn ispe_height(&self) -> i32
Get the image height from the ‘ispe’ box. This is the original image size without any transformations applied to it. Do not use this unless you know exactly what you are doing.
pub fn has_depth_image(&self) -> bool
pub fn number_of_depth_images(&self) -> i32
pub fn depth_image_ids(&self, item_ids: &mut [ItemId]) -> usize
pub fn depth_image_handle(&self, depth_image_id: ItemId) -> Result<Self>
pub fn number_of_thumbnails(&self) -> usize
pub fn thumbnail_ids(&self, item_ids: &mut [ItemId]) -> usize
pub fn thumbnail(&self, thumbnail_id: ItemId) -> Result<Self>
pub fn number_of_metadata_blocks<T>(&self, type_filter: T) -> i32
pub fn metadata_block_ids<T>( &self, item_ids: &mut [ItemId], type_filter: T, ) -> usize
Sourcepub fn metadata_type(&self, metadata_id: ItemId) -> Option<&str>
pub fn metadata_type(&self, metadata_id: ItemId) -> Option<&str>
Return a string indicating the type of the metadata, as specified in the HEIF file. Exif data will have the type string “Exif”. This string will be valid until the next call to a libheif function.
Sourcepub fn metadata_content_type(&self, metadata_id: ItemId) -> Option<&str>
pub fn metadata_content_type(&self, metadata_id: ItemId) -> Option<&str>
For EXIF, the content type is Some("")
.
For XMP, the content type is Some("application/rdf+xml")
.
Sourcepub fn metadata_size(&self, metadata_id: ItemId) -> usize
pub fn metadata_size(&self, metadata_id: ItemId) -> usize
Get the size of the raw metadata, as stored in the HEIF file.
Sourcepub fn metadata_item_uri_type(&self, metadata_id: ItemId) -> Option<&str>
pub fn metadata_item_uri_type(&self, metadata_id: ItemId) -> Option<&str>
Only valid for item type == “uri “, an absolute URI.
pub fn metadata(&self, metadata_id: ItemId) -> Result<Vec<u8>>
Sourcepub fn all_metadata(&self) -> Vec<ImageMetadata>
pub fn all_metadata(&self) -> Vec<ImageMetadata>
Return vector with all image’s metadata items.
Sourcepub fn preferred_decoding_colorspace(&self) -> Result<ColorSpace>
pub fn preferred_decoding_colorspace(&self) -> Result<ColorSpace>
Return the colorspace that libheif
proposes to use for decoding.
Usually, these will be either YCbCr
or Monochrome, but it may also
propose Rgb for images encoded with matrix_coefficients=0
.
It may also return Undefined if the file misses
relevant information to determine this without decoding.
pub fn color_profile_raw(&self) -> Option<ColorProfileRaw>
Sourcepub fn color_profile_nclx(&self) -> Option<ColorProfileNCLX>
pub fn color_profile_nclx(&self) -> Option<ColorProfileNCLX>
NOTE: This function does currently not return an NCLX profile if it is stored in the image bitstream. Only NCLX profiles stored as colr boxes are returned. This may change in the future.
Sourcepub fn add_region_item(
&mut self,
reference_width: u32,
reference_height: u32,
) -> Result<RegionItem>
Available on crate feature v1_18
only.
pub fn add_region_item( &mut self, reference_width: u32, reference_height: u32, ) -> Result<RegionItem>
v1_18
only.Add a region item to an image.
The region item is a collection of regions (point, polyline, polygon, rectangle, ellipse or mask) along with a reference size (width and height) that forms the coordinate basis for the regions.
The concept is to add the region item, then add one or more regions to the region item.
Sourcepub fn region_items(&self) -> Vec<RegionItem>
Available on crate feature v1_18
only.
pub fn region_items(&self) -> Vec<RegionItem>
v1_18
only.Get the region items attached to the image.
Sourcepub fn auxiliary_images<T: Into<Option<AuxiliaryImagesFilter>>>(
&self,
filter: T,
) -> Vec<ImageHandle>
pub fn auxiliary_images<T: Into<Option<AuxiliaryImagesFilter>>>( &self, filter: T, ) -> Vec<ImageHandle>
Returns the vector of auxiliary image handles assigned to this image handle.
Sourcepub fn auxiliary_type(&self) -> Result<String>
pub fn auxiliary_type(&self) -> Result<String>
Returns type of auxiliary image.
Returns an empty string if the image handle isn’t auxiliary.