pub trait DitherMethod2D: Send + Sync {
// Required method
fn compute(&self, x: u32, y: u32) -> f32;
// Provided methods
fn dither_2d<T>(
&self,
value: T,
min: T,
one: T,
dither_amplitude: T,
x: u32,
y: u32,
) -> T
where T: DitherFloat,
Self: Sized { ... }
fn simple_dither_2d<T>(&self, value: T, one: T, x: u32, y: u32) -> T
where T: DitherFloat + Number + CastableFrom<f32>,
Self: Sized { ... }
fn dither_slice_2d<T>(
&self,
values: &mut [T],
width: usize,
min: T,
one: T,
dither_amplitude: T,
)
where T: DitherFloat + Send + Sync,
Self: Sized { ... }
fn simple_dither_slice_2d<T>(&self, values: &mut [T], width: usize, one: T)
where T: DitherFloat + Number + CastableFrom<f32> + Send + Sync,
Self: Sized { ... }
}Expand description
Trait for 2D dithering methods.
Required Methods§
Provided Methods§
Sourcefn dither_2d<T>(
&self,
value: T,
min: T,
one: T,
dither_amplitude: T,
x: u32,
y: u32,
) -> Twhere
T: DitherFloat,
Self: Sized,
fn dither_2d<T>(
&self,
value: T,
min: T,
one: T,
dither_amplitude: T,
x: u32,
y: u32,
) -> Twhere
T: DitherFloat,
Self: Sized,
Dither a single value using 2D coordinates.
Sourcefn simple_dither_2d<T>(&self, value: T, one: T, x: u32, y: u32) -> T
fn simple_dither_2d<T>(&self, value: T, one: T, x: u32, y: u32) -> T
Simple dither for a single value using 2D coordinates.
Sourcefn dither_slice_2d<T>(
&self,
values: &mut [T],
width: usize,
min: T,
one: T,
dither_amplitude: T,
)
fn dither_slice_2d<T>( &self, values: &mut [T], width: usize, min: T, one: T, dither_amplitude: T, )
Dither a 2D image stored as a flat slice (parallel version).
Sourcefn simple_dither_slice_2d<T>(&self, values: &mut [T], width: usize, one: T)
fn simple_dither_slice_2d<T>(&self, values: &mut [T], width: usize, one: T)
Simple dither for a 2D image stored as a flat slice (parallel version).