[−][src]Struct canvas::Layout
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]
pixel: Pixel<P>,
width: usize,
height: usize
) -> Option<Self>
pub fn width_and_height(width: usize, height: usize) -> Option<Self> where
P: AsPixel, [src]
P: AsPixel,
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> Copy for Layout<P>[src]
impl<P: AsPixel> Default for Layout<P>[src]
impl<P> Clone for Layout<P>[src]
Auto Trait Implementations
Blanket Implementations
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,