[][src]Struct imagequant::Attributes

pub struct Attributes { /* fields omitted */ }

Settings for the conversion proces. Start here.

Methods

impl Attributes[src]

pub fn new() -> Self[src]

New handle for library configuration

See also new_image()

pub fn set_max_colors(&mut self, value: i32) -> liq_error[src]

It's better to use set_quality()

pub fn set_min_posterization(&mut self, value: i32) -> liq_error[src]

Number of least significant bits to ignore.

Useful for generating palettes for VGA, 15-bit textures, or other retro platforms.

pub fn min_posterization(&mut self) -> i32[src]

Returns number of bits of precision truncated

pub fn set_quality(&mut self, min: u32, max: u32) -> liq_error[src]

Range 0-100, roughly like JPEG.

If minimum quality can't be met, quantization will fail.

Default is min 0, max 100.

pub fn quality(&mut self) -> (u32, u32)[src]

Reads values set with set_quality

pub fn set_speed(&mut self, value: i32) -> liq_error[src]

1-10.

Faster speeds generate images of lower quality, but may be useful for real-time generation of images.

pub fn set_last_index_transparent(&mut self, value: bool)[src]

Move transparent color to the last entry in the palette

This is less efficient for PNG, but required by some broken software

pub fn speed(&mut self) -> i32[src]

Return currently set speed/quality trade-off setting

pub fn max_colors(&mut self) -> i32[src]

Return max number of colors set

pub fn new_image<'a, RGBA: Copy>(
    &self,
    bitmap: &'a [RGBA],
    width: usize,
    height: usize,
    gamma: f64
) -> Result<Image<'a>, liq_error>
[src]

Describe dimensions of a slice of RGBA pixels

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

pub fn new_image_stride<'a, RGBA: Copy>(
    &self,
    bitmap: &'a [RGBA],
    width: usize,
    height: usize,
    stride: usize,
    gamma: f64
) -> Result<Image<'a>, liq_error>
[src]

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

pub fn new_histogram(&self) -> Histogram[src]

Create new histogram

Use to make one palette suitable for many images

pub fn quantize(
    &mut self,
    image: &Image
) -> Result<QuantizationResult, liq_error>
[src]

Generate palette for the image

Trait Implementations

impl Send for Attributes[src]

impl Drop for Attributes[src]

impl Clone for Attributes[src]

impl Default for Attributes[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]