[−][src]Trait kmeans_colors::Sort
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>>
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.
Implementations on Foreign Types
impl<Wp: WhitePoint> Sort for Lab<Wp>
[src]
fn get_dominant_color(data: &[CentroidData<Self>]) -> Option<Self>
[src]
fn sort_indexed_colors(
centroids: &Vec<Self>,
indices: &[u8]
) -> Vec<CentroidData<Self>>
[src]
centroids: &Vec<Self>,
indices: &[u8]
) -> Vec<CentroidData<Self>>
impl Sort for Srgb
[src]
fn get_dominant_color(data: &[CentroidData<Self>]) -> Option<Self>
[src]
fn sort_indexed_colors(
centroids: &Vec<Self>,
indices: &[u8]
) -> Vec<CentroidData<Self>>
[src]
centroids: &Vec<Self>,
indices: &[u8]
) -> Vec<CentroidData<Self>>