Struct SixelDither

Source
#[repr(C)]
pub struct SixelDither {
Show 18 fields pub palette: Vec<u8>, pub cache_table: Vec<u16>, pub req_colors: usize, pub ncolors: usize, pub orig_colors: usize, pub optimized: bool, pub optimize_palette: bool, pub complexion: i32, pub body_only: bool, pub method_for_largest: MethodForLargest, pub method_for_rep: MethodForRep, pub method_for_diffuse: MethodForDiffuse, pub quality_mode: QualityMode, pub key_color: i32, pub pixel_format: PixelFormat, pub height: usize, pub width: usize, pub depth: usize,
}
Expand description

Represents dither in a Sixel image.

Fields§

§palette: Vec<u8>§cache_table: Vec<u16>§req_colors: usize§ncolors: usize§orig_colors: usize§optimized: bool§optimize_palette: bool§complexion: i32§body_only: bool§method_for_largest: MethodForLargest§method_for_rep: MethodForRep§method_for_diffuse: MethodForDiffuse§quality_mode: QualityMode§key_color: i32§pixel_format: PixelFormat§height: usize§width: usize§depth: usize

Implementations§

Source§

impl SixelDither

Source

pub const fn new() -> Self

Creates a new SixelDither.

Source

pub fn create(ncolors: i32) -> Result<Self>

Creates a new SixelDither with the provided number of colors.

Source

pub fn get(builtin_dither: BuiltinPalette) -> Result<Self>

Creates a new SixelDither from a predefined palette.

Source

pub fn initialize( &mut self, data: &[u8], width: usize, height: usize, palette_config: PaletteConfig, ) -> Result<()>

Initializes the SixelDither.

Source

pub fn apply_palette( &mut self, pixels: &[u8], width: usize, height: usize, ) -> Result<Vec<u8>>

Apply the palette to the SixelDither.

Source§

impl SixelDither

Source

pub fn make_palette(&mut self, data: &[u8]) -> Result<Vec<u8>>

Creates a color palette.

Source

pub fn quant_apply_palette(&mut self, data: &mut [u8]) -> Result<Vec<u8>>

Applies color palette into the specified pixel buffers.

Trait Implementations§

Source§

impl Clone for SixelDither

Source§

fn clone(&self) -> SixelDither

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SixelDither

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SixelDither

Source§

fn default() -> SixelDither

Returns the “default value” for a type. Read more
Source§

impl PartialEq for SixelDither

Source§

fn eq(&self, other: &SixelDither) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for SixelDither

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.