Trait retroimg::color::ColorDepth[][src]

pub trait ColorDepth {
    fn convert_image_with_loss(
        &self,
        image: &RgbImage,
        num_colors: Option<u32>
    ) -> (Vec<Color>, u64); fn convert_image(
        &self,
        image: &RgbImage,
        num_colors: Option<u32>
    ) -> Vec<Color> { ... }
fn loss(&self, image: &RgbImage, num_colors: Option<u32>) -> u64 { ... } }

Color depth image converter.

Required methods

fn convert_image_with_loss(
    &self,
    image: &RgbImage,
    num_colors: Option<u32>
) -> (Vec<Color>, u64)
[src]

Convert and retrieve the loss from converting an image.

Loading content...

Provided methods

fn convert_image(&self, image: &RgbImage, num_colors: Option<u32>) -> Vec<Color>[src]

Convert an RGB image to this color depth.

fn loss(&self, image: &RgbImage, num_colors: Option<u32>) -> u64[src]

Estimate the loss obtained from converting an image. For the best results, greater discrepancies should result in higher loss values.

Loading content...

Implementations on Foreign Types

impl<'a, T: ColorDepth> ColorDepth for &'a T[src]

fn convert_image(&self, image: &RgbImage, num_colors: Option<u32>) -> Vec<Color>[src]

Convert an RGB image to this color depth.

fn loss(&self, image: &RgbImage, num_colors: Option<u32>) -> u64[src]

Estimate the loss obtained from converting an image. For the best results, greater discrepancies should result in higher loss values.

Loading content...

Implementors

impl<B, F> ColorDepth for BackForePalette<B, F> where
    B: AsRef<[[u8; 3]]>,
    F: AsRef<[[u8; 3]]>, 
[src]

impl<C, P> ColorDepth for BestPalette<C> where
    C: Deref<Target = [P]>,
    P: ColorDepth
[src]

impl<M> ColorDepth for MappingColorDepth<M> where
    M: ColorMapper
[src]

impl<T> ColorDepth for FixedPalette<T> where
    T: AsRef<[[u8; 3]]>, 
[src]

Loading content...