pub trait ColorDepth {
    // Required method
    fn convert_image_with_loss(
        &self,
        image: &RgbImage,
        options: ColorOptions
    ) -> (Vec<Color>, u64);

    // Provided methods
    fn convert_image(
        &self,
        image: &RgbImage,
        options: ColorOptions
    ) -> Vec<Color> { ... }
    fn loss(&self, image: &RgbImage, options: ColorOptions) -> u64 { ... }
}
Expand description

Color depth image converter.

Required Methods§

source

fn convert_image_with_loss( &self, image: &RgbImage, options: ColorOptions ) -> (Vec<Color>, u64)

Convert and retrieve the loss from converting an image.

Provided Methods§

source

fn convert_image(&self, image: &RgbImage, options: ColorOptions) -> Vec<Color>

Convert an RGB image to this color depth.

source

fn loss(&self, image: &RgbImage, options: ColorOptions) -> u64

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

Implementations on Foreign Types§

source§

impl<'a, T: ColorDepth> ColorDepth for &'a T

source§

fn convert_image(&self, image: &RgbImage, options: ColorOptions) -> Vec<Color>

Convert an RGB image to this color depth.

source§

fn loss(&self, image: &RgbImage, options: ColorOptions) -> u64

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

source§

fn convert_image_with_loss( &self, image: &RgbImage, options: ColorOptions ) -> (Vec<Color>, u64)

Implementors§

source§

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

source§

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

source§

impl<M> ColorDepth for MappingColorDepth<M>where M: ColorMapper,

source§

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