pub struct RawImage {
pub data: Vec<u8>,
pub width: u32,
pub height: u32,
pub format: PixelFormat,
pub stride: usize,
}Expand description
Raw image data container
Fields§
§data: Vec<u8>Pixel data
width: u32Image width in pixels
height: u32Image height in pixels
format: PixelFormatPixel format
stride: usizeStride (bytes per row, may include padding)
Implementations§
Source§impl RawImage
impl RawImage
Sourcepub fn new(data: Vec<u8>, width: u32, height: u32, format: PixelFormat) -> Self
pub fn new(data: Vec<u8>, width: u32, height: u32, format: PixelFormat) -> Self
Create a new RawImage
Sourcepub fn with_stride(
data: Vec<u8>,
width: u32,
height: u32,
format: PixelFormat,
stride: usize,
) -> Self
pub fn with_stride( data: Vec<u8>, width: u32, height: u32, format: PixelFormat, stride: usize, ) -> Self
Create a new RawImage with custom stride
Sourcepub fn pixel_count(&self) -> usize
pub fn pixel_count(&self) -> usize
Get the pixel count
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RawImage
impl RefUnwindSafe for RawImage
impl Send for RawImage
impl Sync for RawImage
impl Unpin for RawImage
impl UnwindSafe for RawImage
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