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]
&self,
image: &RgbImage,
num_colors: Option<u32>
) -> (Vec<Color>, u64)
Convert and retrieve the loss from converting an image.
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.
Implementations on Foreign Types
impl<'a, T: ColorDepth> ColorDepth for &'a T
[src]
impl<'a, T: ColorDepth> ColorDepth for &'a T
[src]fn convert_image_with_loss(
&self,
image: &RgbImage,
num_colors: Option<u32>
) -> (Vec<Color>, u64)
[src]
&self,
image: &RgbImage,
num_colors: Option<u32>
) -> (Vec<Color>, u64)
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.
Implementors
impl<B, F> ColorDepth for BackForePalette<B, F> where
B: AsRef<[[u8; 3]]>,
F: AsRef<[[u8; 3]]>,
[src]
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<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<M> ColorDepth for MappingColorDepth<M> where
M: ColorMapper,
[src]