Struct visioncortex::ColorImage[][src]

pub struct ColorImage {
    pub pixels: Vec<u8>,
    pub width: usize,
    pub height: usize,
}

Image with 4 bytes per pixel

Fields

pixels: Vec<u8>width: usizeheight: usize

Implementations

impl ColorImage[src]

pub fn new() -> Self[src]

pub fn new_w_h(width: usize, height: usize) -> Self[src]

pub fn iter(&self) -> ColorImageIter<'_>

Notable traits for ColorImageIter<'_>

impl Iterator for ColorImageIter<'_> type Item = Color;
[src]

pub fn get_pixel(&self, x: usize, y: usize) -> Color[src]

pub fn get_pixel_at_point_safe(&self, p: PointI32) -> Option<Color>[src]

pub fn get_pixel_safe(&self, x: i32, y: i32) -> Option<Color>[src]

pub fn get_pixel_at(&self, index: usize) -> Color[src]

pub fn set_pixel(&mut self, x: usize, y: usize, color: &Color)[src]

pub fn set_pixel_at(&mut self, index: usize, color: &Color)[src]

pub fn to_binary_image<F>(&self, f: F) -> BinaryImage where
    F: Fn(Color) -> bool
[src]

pub fn sample_pixel_at(&self, p: PointF32) -> Color[src]

pub fn sample_pixel_at_safe(&self, p: PointF32) -> Option<Color>[src]

Trait Implementations

impl Clone for ColorImage[src]

impl Default for ColorImage[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.