pub struct Gray16 {
pub pix: Vec<u8>,
pub stride: usize,
/* private fields */
}Expand description
Gray16 is an in-memory image whose At method returns color::Gray16 values.
Fields§
§pix: Vec<u8>pix holds the image’s pixels, as gray values in big-endian format. The pixel at (x, y) starts at pix[(y-Rect.min.y)*stride + (x-Rect.min.x)*2].
stride: usizestride is the pix stride (in bytes) between vertically adjacent pixels.
Implementations§
Trait Implementations§
Source§impl Image for Gray16
impl Image for Gray16
Source§fn opaque(&self) -> bool
fn opaque(&self) -> bool
opaque scans the entire image and reports whether it is fully opaque.
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 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 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 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 Gray16
impl RefUnwindSafe for Gray16
impl Send for Gray16
impl Sync for Gray16
impl Unpin for Gray16
impl UnsafeUnpin for Gray16
impl UnwindSafe for Gray16
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