pub struct PixelLayout {
pub size: [u32; 2],
pub row_bytes: u32,
pub format: PixelFormat,
pub alpha: AlphaType,
}Expand description
PixelLayout describes top-to-bottom rows of sRGB image samples.
Fields§
§size: [u32; 2]size is the image width and height in pixels.
row_bytes: u32row_bytes includes any padding between adjacent rows.
format: PixelFormatformat is the channel order within each pixel.
alpha: AlphaTypealpha describes the color/alpha relationship.
Implementations§
Source§impl PixelLayout
impl PixelLayout
Sourcepub fn packed(
size: [u32; 2],
format: PixelFormat,
alpha: AlphaType,
) -> PixelLayout
pub fn packed( size: [u32; 2], format: PixelFormat, alpha: AlphaType, ) -> PixelLayout
packed describes rows with no padding in the given format and alpha.
Sourcepub fn byte_len(self) -> Result<usize, ImageError>
pub fn byte_len(self) -> Result<usize, ImageError>
byte_len checks dimensions and row stride before computing storage size.
Trait Implementations§
Source§impl Clone for PixelLayout
impl Clone for PixelLayout
Source§fn clone(&self) -> PixelLayout
fn clone(&self) -> PixelLayout
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PixelLayout
Source§impl Debug for PixelLayout
impl Debug for PixelLayout
impl Eq for PixelLayout
Source§impl PartialEq for PixelLayout
impl PartialEq for PixelLayout
impl StructuralPartialEq for PixelLayout
Auto Trait Implementations§
impl Forget for PixelLayout
impl Freeze for PixelLayout
impl Move for PixelLayout
impl RefUnwindSafe for PixelLayout
impl Send for PixelLayout
impl Sync for PixelLayout
impl Unpin for PixelLayout
impl UnsafeUnpin for PixelLayout
impl UnwindSafe for PixelLayout
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.