Struct image::math::nq::NeuQuant
[−]
[src]
pub struct NeuQuant { /* fields omitted */ }
Neural network color quantizer
Methods
impl NeuQuant
[src]
pub fn new(samplefac: i32, colors: usize, pixels: &[u8]) -> Self
[src]
Creates a new neuronal network and trains it with the supplied data
pub fn init(&mut self, pixels: &[u8])
[src]
Initializes the neuronal network and trains it with the supplied data
pub fn map_pixel(&self, pixel: &mut [u8])
[src]
Maps the pixel in-place to the best-matching color in the color map
pub fn index_of(&self, pixel: &[u8]) -> usize
[src]
Finds the best-matching index in the color map for pixel