Struct image_texel::image::StridedBufferRef
source · [−]pub struct StridedBufferRef<'data> { /* private fields */ }Expand description
A reference to byte of a strided matrix.
Implementations
sourceimpl<'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> RefUnwindSafe for StridedBufferRef<'data>
impl<'data> Send for StridedBufferRef<'data>
impl<'data> Sync for StridedBufferRef<'data>
impl<'data> Unpin for StridedBufferRef<'data>
impl<'data> UnwindSafe for StridedBufferRef<'data>
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