Trait retroimg::color::ColorDepth
source · [−]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 { ... }
}
Expand description
Color depth image converter.
Required methods
Provided methods
Convert an RGB image to this color depth.
Implementations on Foreign Types
sourceimpl<'a, T: ColorDepth> ColorDepth for &'a T
impl<'a, T: ColorDepth> ColorDepth for &'a T
sourcefn convert_image(&self, image: &RgbImage, num_colors: Option<u32>) -> Vec<Color>
fn convert_image(&self, image: &RgbImage, num_colors: Option<u32>) -> Vec<Color>
Convert an RGB image to this color depth.
sourcefn loss(&self, image: &RgbImage, num_colors: Option<u32>) -> u64
fn loss(&self, image: &RgbImage, num_colors: Option<u32>) -> u64
Estimate the loss obtained from converting an image. For the best results, greater discrepancies should result in higher loss values.