pub struct CpuAccelerator { /* private fields */ }Expand description
Pure-CPU accelerator backed by rayon parallel iterators.
This implementation is always available and provides correct (if slower) results even when no GPU is present.
Implementations§
Source§impl CpuAccelerator
impl CpuAccelerator
Sourcepub fn num_threads(&self) -> usize
pub fn num_threads(&self) -> usize
Number of worker threads.
Trait Implementations§
Source§impl Default for CpuAccelerator
impl Default for CpuAccelerator
Source§impl GpuAccelerator for CpuAccelerator
impl GpuAccelerator for CpuAccelerator
Source§fn rgb_to_yuv(
&self,
input: &[u8],
output: &mut [u8],
width: u32,
height: u32,
) -> Result<()>
fn rgb_to_yuv( &self, input: &[u8], output: &mut [u8], width: u32, height: u32, ) -> Result<()>
Convert packed RGBA data to packed YUVA using BT.601 coefficients. Read more
Source§fn yuv_to_rgb(
&self,
input: &[u8],
output: &mut [u8],
width: u32,
height: u32,
) -> Result<()>
fn yuv_to_rgb( &self, input: &[u8], output: &mut [u8], width: u32, height: u32, ) -> Result<()>
Convert packed YUVA data to packed RGBA using BT.601 coefficients. Read more
Source§fn scale_bilinear(
&self,
input: &[u8],
src_width: u32,
src_height: u32,
output: &mut [u8],
dst_width: u32,
dst_height: u32,
) -> Result<()>
fn scale_bilinear( &self, input: &[u8], src_width: u32, src_height: u32, output: &mut [u8], dst_width: u32, dst_height: u32, ) -> Result<()>
Resize packed RGBA image using bilinear interpolation. Read more
Source§fn gaussian_blur(
&self,
input: &[u8],
output: &mut [u8],
width: u32,
height: u32,
sigma: f32,
) -> Result<()>
fn gaussian_blur( &self, input: &[u8], output: &mut [u8], width: u32, height: u32, sigma: f32, ) -> Result<()>
Apply a separable Gaussian blur to a packed RGBA image. Read more
Source§fn edge_detect(
&self,
input: &[u8],
output: &mut [u8],
width: u32,
height: u32,
) -> Result<()>
fn edge_detect( &self, input: &[u8], output: &mut [u8], width: u32, height: u32, ) -> Result<()>
Detect edges using the Sobel operator on a packed RGBA image. Read more
Source§fn sharpen(
&self,
input: &[u8],
output: &mut [u8],
width: u32,
height: u32,
amount: f32,
) -> Result<()>
fn sharpen( &self, input: &[u8], output: &mut [u8], width: u32, height: u32, amount: f32, ) -> Result<()>
Sharpen a packed RGBA image using an unsharp mask. Read more
Source§fn dct_2d(
&self,
input: &[f32],
output: &mut [f32],
width: u32,
height: u32,
) -> Result<()>
fn dct_2d( &self, input: &[f32], output: &mut [f32], width: u32, height: u32, ) -> Result<()>
Compute the 2-D Type-II DCT on a grid of
f32 values. Read moreSource§fn idct_2d(
&self,
input: &[f32],
output: &mut [f32],
width: u32,
height: u32,
) -> Result<()>
fn idct_2d( &self, input: &[f32], output: &mut [f32], width: u32, height: u32, ) -> Result<()>
Auto Trait Implementations§
impl Freeze for CpuAccelerator
impl RefUnwindSafe for CpuAccelerator
impl Send for CpuAccelerator
impl Sync for CpuAccelerator
impl Unpin for CpuAccelerator
impl UnsafeUnpin for CpuAccelerator
impl UnwindSafe for CpuAccelerator
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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