pub struct StridedBufferRef<'data> { /* private fields */ }Expand description
A reference to byte of a strided matrix.
Implementations§
Source§impl<'data> StridedBufferRef<'data>
impl<'data> StridedBufferRef<'data>
Sourcepub fn new(image: &'data Image<impl StridedLayout>) -> Self
pub fn new(image: &'data Image<impl StridedLayout>) -> Self
Construct a reference to a strided image buffer.
Sourcepub fn with_bytes(layout: StridedBytes, content: &'data [u8]) -> Option<Self>
pub fn with_bytes(layout: StridedBytes, content: &'data [u8]) -> Option<Self>
View bytes under a certain strided layout.
Unlike an image, the data need only be aligned to the element mentioned in the layout and
not to the maximum alignment.
pub fn with_repeated_element<T: AsTexel>( el: &'data T, width: usize, height: usize, ) -> Self
Sourcepub fn shrink_element(&mut self, new: TexelLayout) -> TexelLayout
pub fn shrink_element(&mut self, new: TexelLayout) -> TexelLayout
Shrink the element’s size or alignment.
Sourcepub fn as_ref(&self) -> StridedBufferRef<'_>
pub fn as_ref(&self) -> StridedBufferRef<'_>
Borrow this as a reference to a strided byte matrix.
Auto Trait Implementations§
impl<'data> Freeze for StridedBufferRef<'data>
impl<'data> RefUnwindSafe for StridedBufferRef<'data>
impl<'data> Send for StridedBufferRef<'data>
impl<'data> Sync for StridedBufferRef<'data>
impl<'data> Unpin for StridedBufferRef<'data>
impl<'data> UnsafeUnpin for StridedBufferRef<'data>
impl<'data> UnwindSafe for StridedBufferRef<'data>
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