[−][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.
pub fn map<Q: AsPixel>(self) -> Option<Layout<Q>>
[src]
Utility method to change the pixel type without changing the dimensions.
pub fn map_to<Q>(self, pixel: Pixel<Q>) -> Option<Layout<Q>>
[src]
Utility method to change the pixel type without changing the dimensions.
Trait Implementations
impl<P> Clone for Layout<P>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<P> Copy for Layout<P>
[src]
impl<P> Debug for Layout<P>
[src]
impl<P: AsPixel> Default for Layout<P>
[src]
impl<P> Eq for Layout<P>
[src]
impl<P> PartialEq<Layout<P>> for Layout<P>
[src]
impl<P> PartialOrd<Layout<P>> for Layout<P>
[src]
Auto Trait Implementations
impl<P> RefUnwindSafe for Layout<P> where
P: RefUnwindSafe,
P: RefUnwindSafe,
impl<P> Send for Layout<P> where
P: Send,
P: Send,
impl<P> Sync for Layout<P> where
P: Sync,
P: Sync,
impl<P> Unpin for Layout<P> where
P: Unpin,
P: Unpin,
impl<P> UnwindSafe for Layout<P> where
P: UnwindSafe,
P: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &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> 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, 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>,