logo
pub struct Image<'a> { /* private fields */ }
Expand description

Describes image dimensions for the library.

Implementations

Describe dimensions of a slice of RGBA pixels.

bitmap must be either &[u8] or a slice with one element per pixel (&[RGBA]).

Use 0. for gamma if the image is sRGB (most images are).

Generate rows on demand using a callback function.

The callback function must be cheap (e.g. just byte-swap pixels). It will be called multiple times per row. May be called in any order from any thread.

The user data must be compatible with a primitive pointer (i.e. not a slice, not a Trait object. Box it if you must).

Stride is in pixels. Allows defining regions of larger images or images with padding without copying.

Create new image by copying bitmap to an internal buffer, so that it makes a self-contained type.

Width of the image in pixels

Height of the image in pixels

Reserves a color in the output palette created from this image. It behaves as if the given color was used in the image and was very important.

RGB values of liq_color are assumed to have the same gamma as the image.

It must be called before the image is quantized.

Returns error if more than 256 colors are added. If image is quantized to fewer colors than the number of fixed colors added, then excess fixed colors will be ignored.

Remap pixels assuming they will be displayed on this background.

Pixels that match the background color will be made transparent if there’s a fully transparent color available in the palette.

The background image’s pixels must outlive this image

Set which pixels are more important (and more likely to get a palette entry)

The map must be width×height pixels large. Higher numbers = more important.

Trait Implementations

Executes the destructor for this type. 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 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.