Trait retroimg::color::ColorDepth
source · 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§
sourcefn convert_image_with_loss(
&self,
image: &RgbImage,
options: ColorOptions
) -> (Vec<Color>, u64)
fn convert_image_with_loss( &self, image: &RgbImage, options: ColorOptions ) -> (Vec<Color>, u64)
Convert and retrieve the loss from converting an image.
Provided Methods§
sourcefn convert_image(&self, image: &RgbImage, options: ColorOptions) -> Vec<Color>
fn convert_image(&self, image: &RgbImage, options: ColorOptions) -> Vec<Color>
Convert an RGB image to this color depth.
sourcefn loss(&self, image: &RgbImage, options: ColorOptions) -> u64
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
impl<'a, T: ColorDepth> ColorDepth for &'a T
source§fn convert_image(&self, image: &RgbImage, options: ColorOptions) -> Vec<Color>
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
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.