[][src]Trait kmeans_colors::Sort

pub trait Sort: Sized + Calculate {
    fn get_dominant_color(data: &[CentroidData<Self>]) -> Option<Self>;
fn sort_indexed_colors(
        centroids: &Vec<Self>,
        indices: &[u8]
    ) -> Vec<CentroidData<Self>>; }

A trait for sorting indexed k-means colors.

Required methods

fn get_dominant_color(data: &[CentroidData<Self>]) -> Option<Self>

Returns the centroid with the largest percentage.

fn sort_indexed_colors(
    centroids: &Vec<Self>,
    indices: &[u8]
) -> Vec<CentroidData<Self>>

Sorts centroids by luminosity and calculates the percentage of each color in the buffer. Returns a CentroidResult sorted from darkest to lightest.

Loading content...

Implementations on Foreign Types

impl<Wp: WhitePoint> Sort for Lab<Wp>[src]

impl Sort for Srgb[src]

Loading content...

Implementors

Loading content...