#[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
impl SixelDither
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Creates a new SixelDither.
Sourcepub fn create(ncolors: i32) -> Result<Self>
pub fn create(ncolors: i32) -> Result<Self>
Creates a new SixelDither with the provided number of colors.
Sourcepub fn get(builtin_dither: BuiltinPalette) -> Result<Self>
pub fn get(builtin_dither: BuiltinPalette) -> Result<Self>
Creates a new SixelDither from a predefined palette.
Sourcepub fn initialize(
&mut self,
data: &[u8],
width: usize,
height: usize,
palette_config: PaletteConfig,
) -> Result<()>
pub fn initialize( &mut self, data: &[u8], width: usize, height: usize, palette_config: PaletteConfig, ) -> Result<()>
Initializes the SixelDither.
Sourcepub fn apply_palette(
&mut self,
pixels: &[u8],
width: usize,
height: usize,
) -> Result<Vec<u8>>
pub fn apply_palette( &mut self, pixels: &[u8], width: usize, height: usize, ) -> Result<Vec<u8>>
Apply the palette to the SixelDither.
Source§impl SixelDither
impl SixelDither
Trait Implementations§
Source§impl Clone for SixelDither
impl Clone for SixelDither
Source§fn clone(&self) -> SixelDither
fn clone(&self) -> SixelDither
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for SixelDither
impl Debug for SixelDither
Source§impl Default for SixelDither
impl Default for SixelDither
Source§fn default() -> SixelDither
fn default() -> SixelDither
Returns the “default value” for a type. Read more
Source§impl PartialEq for SixelDither
impl PartialEq for SixelDither
impl StructuralPartialEq for SixelDither
Auto Trait Implementations§
impl Freeze for SixelDither
impl RefUnwindSafe for SixelDither
impl Send for SixelDither
impl Sync for SixelDither
impl Unpin for SixelDither
impl UnwindSafe for SixelDither
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more