[][src]Struct pixel_canvas::image::Image

pub struct Image { /* fields omitted */ }

An image for editing.

It dereferences to a slice of Color, so you can directly manipulate pixels via regular (mutable) slice methods. In addition, you can index into the image by (row, column) pairs.

Methods

impl Image[src]

pub fn width(&self) -> usize[src]

The width of the image in pixels.

pub fn height(&self) -> usize[src]

The height of the image in pixels.

pub fn new(width: usize, height: usize) -> Image[src]

Create an all-black image with the given dimensions.

pub fn fill(&mut self, color: Color)[src]

Fill the image with a single solid color.

Trait Implementations

impl Deref for Image[src]

type Target = [Color]

The resulting type after dereferencing.

impl DerefMut for Image[src]

impl Index<RC> for Image[src]

type Output = Color

The returned type after indexing.

impl Index<XY> for Image[src]

type Output = Color

The returned type after indexing.

impl IndexMut<RC> for Image[src]

impl IndexMut<XY> for Image[src]

impl<'a> Texture2dDataSource<'a> for &'a Image[src]

type Data = u8

The type of each pixel.

Auto Trait Implementations

impl Send for Image

impl Unpin for Image

impl Sync for Image

impl UnwindSafe for Image

impl RefUnwindSafe for Image

Blanket Implementations

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

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

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.

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

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

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