pub struct Bitmap {
pub pixel_type: PixelType,
pub width: u32,
pub height: u32,
pub stride: usize,
pub data: Vec<u8>,
}Fields§
§pixel_type: PixelType§width: u32§height: u32§stride: usize§data: Vec<u8>Implementations§
Source§impl Bitmap
impl Bitmap
pub fn new( pixel_type: PixelType, width: u32, height: u32, data: Vec<u8>, ) -> Result<Self>
pub fn zeros(pixel_type: PixelType, width: u32, height: u32) -> Result<Self>
pub fn bytes_per_pixel(&self) -> usize
pub fn as_bytes(&self) -> &[u8] ⓘ
pub fn into_bytes(self) -> Vec<u8> ⓘ
pub fn to_u16_vec(&self) -> Result<Vec<u16>>
pub fn to_f32_vec(&self) -> Result<Vec<f32>>
Trait Implementations§
impl Eq for Bitmap
impl StructuralPartialEq for Bitmap
Auto Trait Implementations§
impl Freeze for Bitmap
impl RefUnwindSafe for Bitmap
impl Send for Bitmap
impl Sync for Bitmap
impl Unpin for Bitmap
impl UnsafeUnpin for Bitmap
impl UnwindSafe for Bitmap
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