Enum ndi::FourCCVideoType
source · [−]pub enum FourCCVideoType {
UYVY,
UYVA,
P216,
PA16,
YV12,
I420,
NV12,
BGRA,
BGRX,
RGBA,
RGBX,
}
Expand description
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
sourceimpl Clone for FourCCVideoType
impl Clone for FourCCVideoType
sourcefn clone(&self) -> FourCCVideoType
fn clone(&self) -> FourCCVideoType
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for FourCCVideoType
impl Debug for FourCCVideoType
sourceimpl PartialEq<FourCCVideoType> for FourCCVideoType
impl PartialEq<FourCCVideoType> for FourCCVideoType
sourceimpl TryFrom<u32> for FourCCVideoType
impl TryFrom<u32> for FourCCVideoType
impl Copy for FourCCVideoType
impl Eq for FourCCVideoType
impl StructuralEq for FourCCVideoType
impl StructuralPartialEq for FourCCVideoType
Auto Trait Implementations
impl RefUnwindSafe for FourCCVideoType
impl Send for FourCCVideoType
impl Sync for FourCCVideoType
impl Unpin for FourCCVideoType
impl UnwindSafe for FourCCVideoType
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more