pub struct ColorConversionKernel { /* private fields */ }Expand description
Color space conversion kernel
Implementations§
Source§impl ColorConversionKernel
impl ColorConversionKernel
Sourcepub fn new(conversion: ColorConversion, color_space: ColorSpace) -> Self
pub fn new(conversion: ColorConversion, color_space: ColorSpace) -> Self
Create a new color conversion kernel
Sourcepub fn rgb_to_yuv(color_space: ColorSpace) -> Self
pub fn rgb_to_yuv(color_space: ColorSpace) -> Self
Create an RGB to YUV conversion kernel
Sourcepub fn yuv_to_rgb(color_space: ColorSpace) -> Self
pub fn yuv_to_rgb(color_space: ColorSpace) -> Self
Create a YUV to RGB conversion kernel
Sourcepub fn execute(
&self,
device: &GpuDevice,
input: &[u8],
output: &mut [u8],
width: u32,
height: u32,
) -> Result<()>
pub fn execute( &self, device: &GpuDevice, input: &[u8], output: &mut [u8], width: u32, height: u32, ) -> Result<()>
Sourcepub fn conversion(&self) -> ColorConversion
pub fn conversion(&self) -> ColorConversion
Get the conversion type
Sourcepub fn color_space(&self) -> ColorSpace
pub fn color_space(&self) -> ColorSpace
Get the color space
Sourcepub fn output_size(width: u32, height: u32, channels: u32) -> usize
pub fn output_size(width: u32, height: u32, channels: u32) -> usize
Calculate output buffer size
Sourcepub fn estimate_flops(
width: u32,
height: u32,
conversion: ColorConversion,
) -> u64
pub fn estimate_flops( width: u32, height: u32, conversion: ColorConversion, ) -> u64
Estimate FLOPS for color conversion
Auto Trait Implementations§
impl Freeze for ColorConversionKernel
impl RefUnwindSafe for ColorConversionKernel
impl Send for ColorConversionKernel
impl Sync for ColorConversionKernel
impl Unpin for ColorConversionKernel
impl UnsafeUnpin for ColorConversionKernel
impl UnwindSafe for ColorConversionKernel
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