pub enum FourCCVideoType {
    UYVY,
    UYVA,
    P216,
    PA16,
    YV12,
    I420,
    NV12,
    BGRA,
    BGRX,
    RGBA,
    RGBX,
}
Expand description

The FourCC type of a VideoData frame

When running in a YUV color space, the following standards are applied:

ResolutionStandard
SD ResolutionsBT.601
HD resolutions >(720,576)Rec.709
UHD resolutions > (1920,1080)Rec.2020
AlphaFull range for data type (2^8 for 8-bit, 2^16 for 16-bit)

Variants

UYVY

A buffer in the “UYVY” FourCC and represents a 4:2:2 image in YUV color space.

There is a Y sample at every pixel, and U and V sampled at every second pixel horizontally on each line. A macro-pixel contains 2 pixels in 1 DWORD. The ordering of these pixels is U0, Y0, V0, Y1.

UYVA

A buffer that represents a 4:2:2:4 image in YUV color space.

There is a Y sample at every pixels with U,V sampled at every second pixel horizontally. There are two planes in memory, the first being the UYVY color plane, and the second the alpha plane that immediately follows the first. For instance, if you have an image with p_data and stride, then the planes are located as follows:

uint8_t *p_uyvy = (uint8_t*)p_data;
uint8_t *p_alpha = p_uyvy + stride*yres;

P216

A 4:2:2 buffer in semi-planar format with full 16bpp color precision.

This is formed from two buffers in memory, the first is a 16bpp luminance buffer and the second is a buffer of U,V pairs in memory. This can be considered as a 16bpp version of NV12.

For instance, if you have an image with p_data and stride, then the planes are located as follows:

uint16_t *p_y = (uint16_t*)p_data;
uint16_t *p_uv = (uint16_t*)(p_data + stride*yres);

As a matter of illustration, a completely packed image would have stride as xres*sizeof(uint16_t).

PA16

A 4:2:2:4 buffer in semi-planar format with full 16bpp color and alpha precision.

This is formed from three buffers in memory. The first is a 16bpp luminance buffer, and the second is a buffer of U,V pairs in memory. A single plane alpha channel at 16bpp follows the U,V pairs.

For instance, if you have an image with p_data and stride, then the planes are located as follows:

uint16_t *p_y = (uint16_t*)p_data;
uint16_t *p_uv = p_y + stride*yres;
uint16_t *p_alpha = p_uv + stride*yres;

To illustrate, a completely packed image would have stride as xres*sizeof(uint16_t).

YV12

A planar 4:2:0 in Y, U, V planes in memory.

For instance, if you have an image with p_data and stride, then the planes are located as follows:

uint8_t *p_y = (uint8_t*)p_data;
uint8_t *p_u = p_y + stride*yres;
uint8_t *p_v = p_u + (stride/2)*(yres/2);
As a matter of illustration, a completely packed image would have stride as `xres*sizeof(uint8_t)`.

I420

A planar 4:2:0 in Y, U, V planes in memory with the U, V planes reversed from the YV12 format.

For instance, if you have an image with p_data and stride, then the planes are located as follows:

uint8_t *p_y = (uint8_t*)p_data;
uint8_t *p_v = p_y + stride*yres;
uint8_t *p_u = p_v + (stride/2)*(yres/2);

To illustrate, a completely packed image would have stride as xres*sizeof(uint8_t).

NV12

A semi planar 4:2:0 in Y, UV planes in memory.

The luminance plane is at the lowest memory address with the UV pairs immediately following them.

For instance, if you have an image with p_data and stride, then the planes are located as follows:

uint8_t *p_y = (uint8_t*)p_data;
uint8_t *p_uv = p_y + stride*yres;

To illustrate, a completely packed image would have stride as xres*sizeof(uint8_t).

BGRA

A 4:4:4:4, 8-bit image of red, green, blue and alpha components

in memory order blue, green, red, alpha. This data is not pre-multiplied.

BGRX

A 4:4:4, 8-bit image of red, green, blue components in memory order blue, green, red, 255. This data is not pre-multiplied.

This is identical to BGRA, but is provided as a hint that all alpha channel values are 255, meaning that alpha compositing may be avoided. The lack of an alpha channel is used by the SDK to improve performance when possible.

RGBA

A 4:4:4:4, 8-bit image of red, green, blue and alpha components

in memory order red, green, blue, alpha. This data is not pre-multiplied.

RGBX

A 4:4:4, 8-bit image of red, green, blue components

in memory order red, green, blue, 255. This data is not pre-multiplied. This is identical to RGBA, but is provided as a hint that all alpha channel values are 255, meaning that alpha compositing may be avoided. The lack of an alpha channel is used by the SDK to improve performance when possible.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

The type returned in the event of a conversion error.

Performs the conversion.

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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

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.