pub struct Surface<'a, const COMPONENTS: usize> {
pub data: &'a [u8],
pub width: u32,
pub height: u32,
pub stride: u32,
}Expand description
Describes a 2D image to block-compress.
Fields§
§data: &'a [u8]The pixel data for the image.
The data does not need to be tightly packed, but if it isn’t, stride must be different from width * 4.
Expected to be at least stride * height.
width: u32The width of the image in texels.
height: u32The height of the image in texels.
stride: u32The stride between the rows of the image, in bytes.
If data is tightly packed, this is expected to be width * 4.
Trait Implementations§
impl<'a, const COMPONENTS: usize> Copy for Surface<'a, COMPONENTS>
Auto Trait Implementations§
impl<'a, const COMPONENTS: usize> Freeze for Surface<'a, COMPONENTS>
impl<'a, const COMPONENTS: usize> RefUnwindSafe for Surface<'a, COMPONENTS>
impl<'a, const COMPONENTS: usize> Send for Surface<'a, COMPONENTS>
impl<'a, const COMPONENTS: usize> Sync for Surface<'a, COMPONENTS>
impl<'a, const COMPONENTS: usize> Unpin for Surface<'a, COMPONENTS>
impl<'a, const COMPONENTS: usize> UnwindSafe for Surface<'a, COMPONENTS>
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