pub struct Pixels {
pub data: Vec<u8>,
pub width: u16,
pub height: u16,
}Expand description
Raw pixel data buffer. Format depends on the file’s ColorMode: RGBA = 4 bytes/pixel, Grayscale = 2 bytes/pixel, Indexed = 1 byte/pixel.
Fields§
§data: Vec<u8>§width: u16§height: u16Implementations§
Trait Implementations§
Source§impl From<&Pixmap> for Pixels
Converts a tiny_skia::Pixmap reference into Pixels (straight alpha), copying the data.
impl From<&Pixmap> for Pixels
Converts a tiny_skia::Pixmap reference into Pixels (straight alpha), copying the data.
Source§impl From<ImageBuffer<Rgba<u8>, Vec<u8>>> for Pixels
Converts an image::RgbaImage into Pixels (zero-copy, takes ownership of the buffer).
impl From<ImageBuffer<Rgba<u8>, Vec<u8>>> for Pixels
Converts an image::RgbaImage into Pixels (zero-copy, takes ownership of the buffer).
Source§impl From<Pixmap> for Pixels
Converts a tiny_skia::Pixmap (premultiplied alpha) into Pixels (straight alpha).
impl From<Pixmap> for Pixels
Converts a tiny_skia::Pixmap (premultiplied alpha) into Pixels (straight alpha).
impl StructuralPartialEq for Pixels
Source§impl TryFrom<Pixels> for RgbaImage
Converts Pixels into an image::RgbaImage.
impl TryFrom<Pixels> for RgbaImage
Converts Pixels into an image::RgbaImage.
Returns AsepriteError::PixelSizeMismatch if the buffer size is invalid.
Source§impl TryFrom<Pixels> for Pixmap
Converts Pixels (straight alpha) into a tiny_skia::Pixmap (premultiplied alpha).
impl TryFrom<Pixels> for Pixmap
Converts Pixels (straight alpha) into a tiny_skia::Pixmap (premultiplied alpha).
Returns AsepriteError::PixelSizeMismatch if the dimensions are invalid.
Auto Trait Implementations§
impl Freeze for Pixels
impl RefUnwindSafe for Pixels
impl Send for Pixels
impl Sync for Pixels
impl Unpin for Pixels
impl UnsafeUnpin for Pixels
impl UnwindSafe for Pixels
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