logo
pub struct Histogram { /* private fields */ }
Expand description

Generate one shared palette for multiple images

If you’re converting one image at a time, see Attributes::new_image instead

Implementations

Creates histogram object that will be used to collect color statistics from multiple images.

All options should be set on attr before the histogram object is created. Options changed later may not have effect.

“Learns” colors from the image, which will be later used to generate the palette.

Fixed colors added to the image are also added to the histogram. If the total number of fixed colors exceeds 256, this function will fail with LIQ_BUFFER_TOO_SMALL.

Alternative to add_image(). Intead of counting colors in an image, it directly takes an array of colors and their counts.

This function is only useful if you already have a histogram of the image from another source.

Add a color guaranteed to be in the final palette

Generate palette for all images/colors added to the histogram.

Palette generated using this function won’t be improved during remapping. If you’re generating palette for only one image, it’s better not to use the Histogram.

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 alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

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.