Struct visioncortex::ColorImage
source · pub struct ColorImage {
pub pixels: Vec<u8>,
pub width: usize,
pub height: usize,
}Expand description
Image with 4 bytes per pixel
Fields§
§pixels: Vec<u8>§width: usize§height: usizeImplementations§
source§impl ColorImage
impl ColorImage
pub fn new() -> Self
pub fn new_w_h(width: usize, height: usize) -> Self
pub fn iter(&self) -> ColorImageIter<'_> ⓘ
pub fn get_pixel(&self, x: usize, y: usize) -> Color
pub fn get_pixel_at_point_safe(&self, p: PointI32) -> Option<Color>
pub fn get_pixel_safe(&self, x: i32, y: i32) -> Option<Color>
pub fn get_pixel_at(&self, index: usize) -> Color
pub fn set_pixel(&mut self, x: usize, y: usize, color: &Color)
pub fn set_pixel_at(&mut self, index: usize, color: &Color)
pub fn to_binary_image<F>(&self, f: F) -> BinaryImagewhere F: Fn(Color) -> bool,
pub fn sample_pixel_at(&self, p: PointF32) -> Color
pub fn sample_pixel_at_safe(&self, p: PointF32) -> Option<Color>
Trait Implementations§
source§impl Clone for ColorImage
impl Clone for ColorImage
source§fn clone(&self) -> ColorImage
fn clone(&self) -> ColorImage
Returns a copy 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 Default for ColorImage
impl Default for ColorImage
source§fn default() -> ColorImage
fn default() -> ColorImage
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for ColorImage
impl Send for ColorImage
impl Sync for ColorImage
impl Unpin for ColorImage
impl UnwindSafe for ColorImage
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