Struct exoquant::optimizer::KMeans [] [src]

pub struct KMeans;

A standard K-Means Optimizer.

Each palette entry is moved toward the average of the cluster of input colors it is going to represent to find a locally optimal palette.

Trait Implementations

impl Optimizer for KMeans
[src]

fn step(&self, colors: Vec<Colorf>, histogram: &[ColorCount]) -> Vec<Colorf>

Do one K-Means optimization step and return colors that better represent the histogram. Read more

fn optimize_palette(&self, colorspace: &ColorSpace, palette: &[Color], histogram: &Histogram, num_iterations: usize) -> Vec<Color>

Optimize a given palette with a number of K-Means iteration. Read more

fn is_noop(&self) -> bool

Returns whether this Optimizer is a No-op implementation. Read more