pub struct DitherConfig {
pub mode: DitherMode,
pub serpentine: bool,
pub exposure: f64,
pub saturation: f64,
pub shadows: f64,
pub highlights: f64,
pub tone: ToneCompression,
pub gamut: GamutCompression,
}Expand description
Configuration for dither(). All fields have sensible defaults.
Construct with struct-update syntax:
dither(&img, palette, DitherConfig { mode: DitherMode::Burkes, ..Default::default() });Pre-processing pipeline (applied in order, each step is a no-op at its identity value):
exposure → saturation → shadows/highlights → tone → gamut → dither.
Fields§
§mode: DitherModeDithering algorithm.
serpentine: boolUse serpentine scanning for error diffusion (alternates row direction). Ignored for
None and Ordered.
exposure: f64Linear-RGB exposure multiplier. 1.0 = no change, 2.0 = +1 stop, 0.5 = -1 stop.
saturation: f64OKLab saturation multiplier. 1.0 = no change, 0.0 = grayscale, >1.0 = boost. Hue-preserving.
shadows: f64Shadow lift strength (lower-half S-curve). 0.0 = identity, 1.0 = strong lift.
highlights: f64Highlight compression strength (upper-half S-curve). 0.0 = identity, 1.0 = strong.
tone: ToneCompressionDynamic-range compression. Auto = histogram-based; Fixed(s) = manual blend strength.
gamut: GamutCompressionGamut compression. Auto = full strength on out-of-gamut; Fixed(s) = manual.
Trait Implementations§
Source§impl Clone for DitherConfig
impl Clone for DitherConfig
Source§fn clone(&self) -> DitherConfig
fn clone(&self) -> DitherConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DitherConfig
impl Debug for DitherConfig
Source§impl Default for DitherConfig
impl Default for DitherConfig
Source§impl PartialEq for DitherConfig
impl PartialEq for DitherConfig
Source§fn eq(&self, other: &DitherConfig) -> bool
fn eq(&self, other: &DitherConfig) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for DitherConfig
Auto Trait Implementations§
impl Freeze for DitherConfig
impl RefUnwindSafe for DitherConfig
impl Send for DitherConfig
impl Sync for DitherConfig
impl Unpin for DitherConfig
impl UnsafeUnpin for DitherConfig
impl UnwindSafe for DitherConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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