pub struct ColorSpaceConversion;Expand description
Color space conversion operations
Implementations§
Source§impl ColorSpaceConversion
impl ColorSpaceConversion
Sourcepub fn rgb_to_yuv(
device: &GpuDevice,
input: &[u8],
output: &mut [u8],
width: u32,
height: u32,
color_space: ColorSpace,
) -> Result<()>
pub fn rgb_to_yuv( device: &GpuDevice, input: &[u8], output: &mut [u8], width: u32, height: u32, color_space: ColorSpace, ) -> Result<()>
Convert RGB to YUV
§Arguments
device- GPU deviceinput- Input RGB buffer (packed RGBA format)output- Output YUV buffer (packed YUVA format)width- Image widthheight- Image heightcolor_space- Color space standard (BT.601, BT.709, BT.2020)
§Errors
Returns an error if buffer sizes are invalid or if the GPU operation fails.
Sourcepub fn yuv_to_rgb(
device: &GpuDevice,
input: &[u8],
output: &mut [u8],
width: u32,
height: u32,
color_space: ColorSpace,
) -> Result<()>
pub fn yuv_to_rgb( device: &GpuDevice, input: &[u8], output: &mut [u8], width: u32, height: u32, color_space: ColorSpace, ) -> Result<()>
Convert YUV to RGB
§Arguments
device- GPU deviceinput- Input YUV buffer (packed YUVA format)output- Output RGB buffer (packed RGBA format)width- Image widthheight- Image heightcolor_space- Color space standard (BT.601, BT.709, BT.2020)
§Errors
Returns an error if buffer sizes are invalid or if the GPU operation fails.
Auto Trait Implementations§
impl Freeze for ColorSpaceConversion
impl RefUnwindSafe for ColorSpaceConversion
impl Send for ColorSpaceConversion
impl Sync for ColorSpaceConversion
impl Unpin for ColorSpaceConversion
impl UnsafeUnpin for ColorSpaceConversion
impl UnwindSafe for ColorSpaceConversion
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more