pub trait ColorMatch: ToLab + ToSrgb {
// Required methods
fn mean(&self) -> [f32; 3];
fn std(&self, mean: &[f32; 3]) -> [f32; 3];
fn match_palette(&self, other: &impl ColorMatch) -> Self;
fn equalize(&self) -> Self;
}Required Methods§
Sourcefn std(&self, mean: &[f32; 3]) -> [f32; 3]
fn std(&self, mean: &[f32; 3]) -> [f32; 3]
Compute the stadndard deviation of the color channel distributions.
Sourcefn match_palette(&self, other: &impl ColorMatch) -> Self
fn match_palette(&self, other: &impl ColorMatch) -> Self
Transfer the color palette of the other onto self, using the Reinhard color transfer algorithm.
See: https://api.semanticscholar.org/CorpusID:14088925
It matches the mean and standard deviations in the Oklab color space, then projects
back to Srgb.
Sourcefn equalize(&self) -> Self
fn equalize(&self) -> Self
Equalize the color distribution.
See: https://docs.opencv.org/4.x/d5/daf/tutorial_py_histogram_equalization.html
It spreads out the distribution such that they cover the full color space.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.