Skip to main content

Track

Struct Track 

Source
pub struct Track { /* private fields */ }
Available on crate feature v1_20 only.

Implementations§

Source§

impl Track

Source

pub fn id(&self) -> u32

Get the ID of the track.

The track ID will never be 0.

Source

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.

Source

pub fn has_alpha_channel(&self) -> bool

Available on crate feature v1_21 only.
Source

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.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Drop for Track

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl Freeze for Track

§

impl RefUnwindSafe for Track

§

impl !Send for Track

§

impl !Sync for Track

§

impl Unpin for Track

§

impl UnsafeUnpin for Track

§

impl UnwindSafe for Track

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.