[][src]Struct canvas::Layout

pub struct Layout<P> { /* fields omitted */ }

Describes the memory region used for the image.

The underlying buffer may have more data allocated than this region and cause the overhead to be reused when resizing the image. All ways to construct this already check that all pixels within the resulting image can be addressed via an index.

Methods

impl<P> Layout<P>[src]

pub fn width_and_height_for_pixel(
    pixel: Pixel<P>,
    width: usize,
    height: usize
) -> Option<Self>
[src]

pub fn width_and_height(width: usize, height: usize) -> Option<Self> where
    P: AsPixel
[src]

pub fn byte_len(self) -> usize[src]

Get the required bytes for this layout.

pub fn len(self) -> usize[src]

The number of pixels in this layout

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

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

pub fn pixel(self) -> Pixel<P>[src]

pub fn transmute<Q: AsPixel>(self) -> Layout<Q>[src]

Reinterpret to another, same size pixel type.

See transmute_to for details.

pub fn transmute_to<Q>(self, pixel: Pixel<Q>) -> Layout<Q>[src]

Reinterpret to another, same size pixel type.

Panics

Like std::mem::transmute, the size of the two types need to be equal. This ensures that all indices are valid in both directions.

Trait Implementations

impl<P> Eq for Layout<P>[src]

impl<P> PartialEq<Layout<P>> for Layout<P>[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<P> Copy for Layout<P>[src]

impl<P> Clone for Layout<P>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<P> PartialOrd<Layout<P>> for Layout<P>[src]

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<P: AsPixel> Default for Layout<P>[src]

impl<P> Debug for Layout<P>[src]

Auto Trait Implementations

impl<P> Send for Layout<P> where
    P: Send

impl<P> Sync for Layout<P> where
    P: Sync

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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]