Struct image_texel::layout::Matrix
source · [−]pub struct Matrix<P> { /* private fields */ }
Expand description
A matrix of packed texels (channel groups).
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.
Implementations
sourceimpl<P> Layout<P>
impl<P> Layout<P>
pub fn width_and_height_for_texel(
pixel: Texel<P>,
width: usize,
height: usize
) -> Option<Self>
pub fn width_and_height(width: usize, height: usize) -> Option<Self> where
P: AsTexel,
pub const fn empty(pixel: Texel<P>) -> Self
pub fn with_matrix(pixel: Texel<P>, matrix: MatrixBytes) -> Option<Self>
pub fn into_matrix_bytes(self) -> MatrixBytes
pub fn width(self) -> usize
pub fn height(self) -> usize
pub fn pixel(self) -> Texel<P>
sourcepub fn transmute<Q: AsTexel>(self) -> Layout<Q>
pub fn transmute<Q: AsTexel>(self) -> Layout<Q>
Reinterpret to another, same size pixel type.
See transmute_to
for details.
sourcepub fn transmute_to<Q>(self, pixel: Texel<Q>) -> Layout<Q>
pub fn transmute_to<Q>(self, pixel: Texel<Q>) -> Layout<Q>
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
sourceimpl<P> From<Matrix<P>> for MatrixBytes
impl<P> From<Matrix<P>> for MatrixBytes
sourceimpl<P> MatrixLayout for Matrix<P>
impl<P> MatrixLayout for Matrix<P>
sourcefn matrix(&self) -> MatrixBytes
fn matrix(&self) -> MatrixBytes
The valid matrix specification of this layout. Read more
sourceimpl<P> PartialOrd<Matrix<P>> for Layout<P>
impl<P> PartialOrd<Matrix<P>> for Layout<P>
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<P> Raster<P> for Matrix<P>
impl<P> Raster<P> for Matrix<P>
Note: on 64-bit targets only the first u32::MAX
dimensions appear accessible.
sourceimpl<P> SliceLayout for Layout<P>
impl<P> SliceLayout for Layout<P>
sourceimpl<P: AsTexel> StridedLayout for Matrix<P>
impl<P: AsTexel> StridedLayout for Matrix<P>
sourcefn strided(&self) -> StridedBytes
fn strided(&self) -> StridedBytes
The valid strided specification of this layout. Read more
impl<P> Copy for Layout<P>
impl<P> Eq for Layout<P>
Auto Trait Implementations
impl<P> RefUnwindSafe for Matrix<P> where
P: RefUnwindSafe,
impl<P> Send for Matrix<P> where
P: Send,
impl<P> Sync for Matrix<P> where
P: Sync,
impl<P> Unpin for Matrix<P> where
P: Unpin,
impl<P> UnwindSafe for Matrix<P> where
P: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more