pub struct SixelImage { /* private fields */ }Implementations§
Source§impl SixelImage
impl SixelImage
Sourcepub fn new(bytes: &[u8]) -> Result<Self, &'static str>
pub fn new(bytes: &[u8]) -> Result<Self, &'static str>
Constructs a new SixelImage out of an existing slice of serialized sixel bytes
Sourcepub fn pixel_size(&self) -> (usize, usize)
pub fn pixel_size(&self) -> (usize, usize)
Returns the (height, width) of the image in pixels
Sourcepub fn serialize(&self) -> String
pub fn serialize(&self) -> String
Serializes the whole image, returning a stringified sixel representation of it
Sourcepub fn serialize_range(
&self,
start_x_index: usize,
start_y_index: usize,
width: usize,
height: usize,
) -> String
pub fn serialize_range( &self, start_x_index: usize, start_y_index: usize, width: usize, height: usize, ) -> String
Serializes a specific rectangle of this image without manipulating the image itself, x/y coordinates as well as width height are in pixels
Sourcepub fn cut_out(
&mut self,
start_x_index: usize,
start_y_index: usize,
width: usize,
height: usize,
)
pub fn cut_out( &mut self, start_x_index: usize, start_y_index: usize, width: usize, height: usize, )
Manipulates the image in-place, cutting out a rectangle with the specified coordinates. If the rectangle exceeds the image, it will be partially cut out. All x/y and width/height coordinates are in pixels
Trait Implementations§
Source§impl Clone for SixelImage
impl Clone for SixelImage
Source§fn clone(&self) -> SixelImage
fn clone(&self) -> SixelImage
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 moreAuto Trait Implementations§
impl Freeze for SixelImage
impl RefUnwindSafe for SixelImage
impl Send for SixelImage
impl Sync for SixelImage
impl Unpin for SixelImage
impl UnwindSafe for SixelImage
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