Struct framing::video::PlanarFrame [] [src]

pub struct PlanarFrame<T> { /* fields omitted */ }

A planar frame.

Each plane is made up of one-byte subpixels, and the planes are stored contiguously in memory, in the order specified by the pixel itself. So, for example, a BGRA planar frame would have all the B bytes in order, then all the G bytes, then the R bytes, and finally the A bytes, with each plane covering the entire image in row-major order.

Methods

impl<T: ByteChannels> PlanarFrame<T>
[src]

Creates a new frame backed by the provided byte source.

Panics

Panics if the length of the buffer is not width * height * bytes_per_pixel.

Returns a read-only view into the frame's byte source.

This function is not as slow as you'd expect, because Bytes is actually reference-counted.

Creates a new frame using the given function to fill the buffer. It is guaranteed that the mapping will be called exactly once for each of the integers in the range [0, width) * [0, height).

Trait Implementations

impl<T: Clone> Clone for PlanarFrame<T>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T: Debug> Debug for PlanarFrame<T>
[src]

Formats the value using the given formatter.

impl<T: ByteChannels> VideoFrame for PlanarFrame<T>
[src]

The kind of pixel that the frame is made of.

The width of the frame in pixels.

The height of the frame in pixels.

Gets the pixel at the specified zero-indexed coordinates. Read more