[−][src]Struct imagequant::Attributes
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]
&self,
bitmap: &'a [RGBA],
width: usize,
height: usize,
gamma: f64
) -> Result<Image<'a>, liq_error>
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]
&self,
bitmap: &'a [RGBA],
width: usize,
height: usize,
stride: usize,
gamma: f64
) -> Result<Image<'a>, liq_error>
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]
&mut self,
image: &Image
) -> Result<QuantizationResult, liq_error>
Generate palette for the image
Trait Implementations
impl Send for Attributes
[src]
impl Drop for Attributes
[src]
impl Clone for Attributes
[src]
fn clone(&self) -> Attributes
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Default for Attributes
[src]
fn default() -> Attributes
[src]
Auto Trait Implementations
impl !Sync for Attributes
impl Unpin for Attributes
impl UnwindSafe for Attributes
impl RefUnwindSafe for Attributes
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,