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

Remapping step, computed from Attributes::quantize()

Implementations

Set to 1.0 to get nice smooth image

The default is sRGB gamma (~1/2.2)

Approximate gamma correction value used for the output

Colors are converted from input gamma to this gamma

Number 0-100 guessing how nice the input image will look if remapped to this palette

Approximate mean square error of the palette

Approximate mean square error of the palette used for the most recent remapping

Palette remapping error mapped back to 0-100 scale, same as the scale in Attributes::set_quality()

The final palette

It’s slighly better if you get palette from the remapped() call instead

Callback called at various point of processing, which gets percentage of progress done, and can return ControlFlow::Break to abort further processing

Remap image into a palette + indices.

Returns the palette and a 1-byte-per-pixel uncompressed bitmap

Remap image into an existing buffer.

This is a low-level call for use when existing memory has to be reused. Use remapped() if possible.

Writes 1-byte-per-pixel uncompressed bitmap into the pre-allocated buffer.

You should call palette() after this call, but not before it, because remapping refines the palette.

The final palette, copied.

It’s slighly better if you get palette from the remapped() call instead

Trait Implementations

Formats the value using the given formatter. Read more

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.