pub struct NeuQuant { /* private fields */ }

Implementations

Creates a new neuronal network and trains it with the supplied data.

Pixels are assumed to be in RGBA format. colors should be $>=64$. samplefac determines the faction of the sample that will be used to train the network. Its value must be in the range $[1, 30]$. A value of $1$ thus produces the best result but is also slowest. $10$ is a good compromise between speed and quality.

Initializes the neuronal network and trains it with the supplied data.

This method gets called by Self::new.

Maps the rgba-pixel in-place to the best-matching color in the color map.

Finds the best-matching index in the color map.

pixel is assumed to be in RGBA format.

Lookup pixel values for color at idx in the colormap.

Returns the RGBA color map calculated from the sample.

Returns the RGBA color map calculated from the sample.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.