pub struct Frame<'core> { /* private fields */ }
Expand description

One frame of a clip.

Implementations

Returns the frame format.

Returns the width of a plane, in pixels.

The width depends on the plane number because of the possible chroma subsampling.

Panics

Panics if plane >= format().plane_count().

Returns the height of a plane, in pixels.

The height depends on the plane number because of the possible chroma subsampling.

Panics

Panics if plane >= format().plane_count().

Returns the resolution of a plane.

The resolution depends on the plane number because of the possible chroma subsampling.

Panics

Panics if plane is invalid for this frame.

Returns the distance in bytes between two consecutive lines of a plane.

Panics

Panics if plane >= format().plane_count().

Returns a slice of a plane’s pixel row.

Panics

Panics if the requested plane, row or component type is invalid.

Returns a mutable slice of a plane’s pixel row.

Panics

Panics if the requested plane, row or component type is invalid.

Returns a slice of the plane’s pixels.

The length of the returned slice is height() * width(). If the pixel data has non-zero padding (that is, stride() is larger than width()), an error is returned, since returning the data slice would open access to uninitialized bytes.

Panics

Panics if the requested plane or component type is invalid.

Returns a mutable slice of the plane’s pixels.

The length of the returned slice is height() * width(). If the pixel data has non-zero padding (that is, stride() is larger than width()), an error is returned, since returning the data slice would open access to uninitialized bytes.

Panics

Panics if the requested plane or component type is invalid.

Returns a pointer to the plane’s pixels.

The pointer points to an array with a length of height() * stride() and is valid for as long as the frame is alive.

Panics

Panics if plane >= format().plane_count().

Returns a mutable pointer to the plane’s pixels.

The pointer points to an array with a length of height() * stride() and is valid for as long as the frame is alive.

Panics

Panics if plane >= format().plane_count().

Returns a slice of a plane’s pixel row.

The length of the returned slice is equal to width() * format().bytes_per_sample().

Panics

Panics if plane >= format().plane_count() or if row >= height().

Returns a mutable slice of a plane’s pixel row.

The length of the returned slice is equal to width() * format().bytes_per_sample().

Panics

Panics if plane >= format().plane_count() or if row >= height().

Returns a slice of the plane’s pixels.

The length of the returned slice is height() * width() * format().bytes_per_sample(). If the pixel data has non-zero padding (that is, stride() is larger than width()), an error is returned, since returning the data slice would open access to uninitialized bytes.

Panics

Panics if plane >= format().plane_count() or if row >= height().

Returns a mutable slice of the plane’s pixels.

The length of the returned slice is height() * width() * format().bytes_per_sample(). If the pixel data has non-zero padding (that is, stride() is larger than width()), an error is returned, since returning the data slice would open access to uninitialized bytes.

Panics

Panics if plane >= format().plane_count() or if row >= height().

Returns a map of frame’s properties.

Returns a mutable map of frame’s properties.

Trait Implementations

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.