[][src]Trait nanachi::buffer::Buffer

pub trait Buffer<P: Pixel> {
    pub fn dimensions(&self) -> (u32, u32);
pub fn get_pixel(&self, x: u32, y: u32) -> &P;
pub fn get_pixel_mut(&mut self, x: u32, y: u32) -> &mut P;
pub fn put_pixel(&mut self, x: u32, y: u32, pixel: P); }

A trait for represents an image.

Required methods

pub fn dimensions(&self) -> (u32, u32)

Get (width, height).

pub fn get_pixel(&self, x: u32, y: u32) -> &P

Get pixel by x and y.

pub fn get_pixel_mut(&mut self, x: u32, y: u32) -> &mut P

Get mut pixel by x and y.

pub fn put_pixel(&mut self, x: u32, y: u32, pixel: P)

Put a pixel.

Loading content...

Implementations on Foreign Types

impl<S: Primitive + 'static, P: Pixel + Pixel<Subpixel = S> + 'static> Buffer<P> for ImageBuffer<P, Vec<S>>[src]

Loading content...

Implementors

impl<P: Pixel> Buffer<P> for GenericBuffer<P>[src]

Loading content...