pub struct Track { /* private fields */ }v1_20 only.Implementations§
Source§impl Track
impl Track
Sourcepub fn handler_type(&self) -> TrackType
pub fn handler_type(&self) -> TrackType
Get the four-cc track handler type.
Typical codes are “vide” for video sequences, “pict” for image sequences,
“meta” for metadata tracks.
These are defined in track_types module, but files may also contain other types.
pub fn has_alpha_channel(&self) -> bool
v1_21 only.Sourcepub fn timescale(&self) -> u32
pub fn timescale(&self) -> u32
Get the timescale (clock ticks per second) for this track.
Note that this can be different from the timescale used at sequence level.
Sourcepub fn image_resolution(&self) -> Result<ImageResolution>
pub fn image_resolution(&self) -> Result<ImageResolution>
Get the image resolution of the track.
If the track is no visual track, an error is returned.
Sourcepub fn decode_next_image(
&self,
color_space: ColorSpace,
decoding_options: Option<DecodingOptions>,
) -> Result<Image>
pub fn decode_next_image( &self, color_space: ColorSpace, decoding_options: Option<DecodingOptions>, ) -> Result<Image>
Decode the next image in the sequence track.
If there is no more image in the sequence,
error with code HeifErrorCode::EndOfSequence
will be returned.
The parameters color_space and decoding_options are similar to
LibHeif::decode().
If you want to let libheif decide the output colorspace and chroma,
set color_space parameter to ColorSpace::Undefined.
Usually, libheif will return the image in the input colorspace,
but it may also modify it for example when it has to rotate the image.
If you want to get the image in a specific colorspace/chroma format,
you can specify this and libheif will convert the image to match this format.