pub struct Convert;Expand description
Color conversion utilities
Implementations§
Source§impl Convert
impl Convert
Sourcepub fn backend() -> ColorConversionBackend
pub fn backend() -> ColorConversionBackend
Get current color conversion backend
Sourcepub fn set_backend(backend: ColorConversionBackend) -> Result<()>
pub fn set_backend(backend: ColorConversionBackend) -> Result<()>
Set color conversion backend
Sourcepub fn has_apple_accelerate() -> bool
pub fn has_apple_accelerate() -> bool
Check if Apple Accelerate is available
Sourcepub fn yuyv_to_rgb24(
src_data: &[u8],
src_stride: usize,
width: u32,
height: u32,
) -> Result<Vec<u8>>
pub fn yuyv_to_rgb24( src_data: &[u8], src_stride: usize, width: u32, height: u32, ) -> Result<Vec<u8>>
Convert YUYV to RGB24
§Errors
Returns CcapError::InvalidParameter if src_data is too small for the given dimensions.
Sourcepub fn yuyv_to_bgr24(
src_data: &[u8],
src_stride: usize,
width: u32,
height: u32,
) -> Result<Vec<u8>>
pub fn yuyv_to_bgr24( src_data: &[u8], src_stride: usize, width: u32, height: u32, ) -> Result<Vec<u8>>
Convert YUYV to BGR24
§Errors
Returns CcapError::InvalidParameter if src_data is too small for the given dimensions.
Sourcepub fn rgb_to_bgr(
src_data: &[u8],
src_stride: usize,
width: u32,
height: u32,
) -> Result<Vec<u8>>
pub fn rgb_to_bgr( src_data: &[u8], src_stride: usize, width: u32, height: u32, ) -> Result<Vec<u8>>
Convert RGB to BGR
§Errors
Returns CcapError::InvalidParameter if src_data is too small for the given dimensions.
Sourcepub fn bgr_to_rgb(
src_data: &[u8],
src_stride: usize,
width: u32,
height: u32,
) -> Result<Vec<u8>>
pub fn bgr_to_rgb( src_data: &[u8], src_stride: usize, width: u32, height: u32, ) -> Result<Vec<u8>>
Convert BGR to RGB
§Errors
Returns CcapError::InvalidParameter if src_data is too small for the given dimensions.
Sourcepub fn nv12_to_rgb24(
y_data: &[u8],
y_stride: usize,
uv_data: &[u8],
uv_stride: usize,
width: u32,
height: u32,
) -> Result<Vec<u8>>
pub fn nv12_to_rgb24( y_data: &[u8], y_stride: usize, uv_data: &[u8], uv_stride: usize, width: u32, height: u32, ) -> Result<Vec<u8>>
Convert NV12 to RGB24
§Errors
Returns CcapError::InvalidParameter if buffers are too small for the given dimensions.
Sourcepub fn nv12_to_bgr24(
y_data: &[u8],
y_stride: usize,
uv_data: &[u8],
uv_stride: usize,
width: u32,
height: u32,
) -> Result<Vec<u8>>
pub fn nv12_to_bgr24( y_data: &[u8], y_stride: usize, uv_data: &[u8], uv_stride: usize, width: u32, height: u32, ) -> Result<Vec<u8>>
Convert NV12 to BGR24
§Errors
Returns CcapError::InvalidParameter if buffers are too small for the given dimensions.