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

A reference to a mutable frame.

Implementations

Creates a copy of the given frame.

The plane data is copy-on-write, so this isn’t very expensive by itself.

Judging by the underlying implementation, it seems that any valid core can be used.

Creates a new frame with uninitialized plane data.

Optionally copies the frame properties from the provided prop_src frame.

Safety

The returned frame contains uninitialized plane data. This should be handled carefully. See the docs for std::mem::uninitialized() for more information.

Panics

Panics if the given resolution has components that don’t fit into an i32.

Methods from Deref<Target = Frame<'core>>

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

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Converts to this type from the input type.

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.