pub struct Alpha16 {
pub pix: Vec<u8>,
pub stride: usize,
/* private fields */
}Expand description
Alpha16 is an in-memory image whose At method returns color::Alpha16 values.
Fields§
§pix: Vec<u8>§stride: usizestride is the pix stride (in bytes) between vertically adjacent pixels.
Implementations§
Trait Implementations§
Source§impl Image for Alpha16
impl Image for Alpha16
Source§fn color_model(&self) -> Model
fn color_model(&self) -> Model
color_model returns the Image’s color model.
Source§fn bounds(&self) -> &Rectangle
fn bounds(&self) -> &Rectangle
bounds returns the domain for which At can return non-zero color::
The bounds do not necessarily contain the point (0, 0).
Source§fn at(&self, x: isize, y: isize) -> Color
fn at(&self, x: isize, y: isize) -> Color
at returns the color of the pixel at (x, y).
at(bounds().min.x, bounds().min.y) returns the upper-left pixel of the grid.
at(bounds().max.x-1, bounds().max.y-1) returns the lower-right one.
fn set(&mut self, x: isize, y: isize, c: &Color)
Source§fn opaque(&self) -> bool
fn opaque(&self) -> bool
opaque scans the entire image and reports whether it is fully opaque.
Source§fn stride(&self) -> usize
fn stride(&self) -> usize
stride returns the pix stride (in bytes) between vertically adjacent pixels.
Source§fn pix(&self) -> &Vec<u8> ⓘ
fn pix(&self) -> &Vec<u8> ⓘ
pix returns the image pixel data. Format of the data depends on the image type.
Source§fn get_pix_mutable(&mut self) -> &mut Vec<u8> ⓘ
fn get_pix_mutable(&mut self) -> &mut Vec<u8> ⓘ
get_pix_mutable returns the image data for editing.
Format of the data depends on the image type.
Source§fn bytes_per_pixel(&self) -> usize
fn bytes_per_pixel(&self) -> usize
bytes_per_pixel return how many bytes is used per pixel
Source§fn deep_equal(&self, other: &dyn Image) -> bool
fn deep_equal(&self, other: &dyn Image) -> bool
deep_equal checks that two images are exactly the same
Auto Trait Implementations§
impl Freeze for Alpha16
impl RefUnwindSafe for Alpha16
impl Send for Alpha16
impl Sync for Alpha16
impl Unpin for Alpha16
impl UnwindSafe for Alpha16
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