pub struct OwnedBitmap { /* private fields */ }Expand description
A bitmap object that has an owned pixel buffer.
This is useful for using the raw pixels in any rust code without binding to the underlying C library.
To create an Ultralight bitmap, use OwnedBitmap::to_bitmap.
Implementations§
Source§impl OwnedBitmap
impl OwnedBitmap
Sourcepub fn from_bitmap(bitmap: &mut Bitmap) -> Option<Self>
pub fn from_bitmap(bitmap: &mut Bitmap) -> Option<Self>
Create an OwnedBitmap from a Bitmap.
This will result in copying all the pixels from the original bitmap.
Sourcepub fn to_bitmap(&self, lib: Arc<Library>) -> Result<Bitmap, BitmapError>
pub fn to_bitmap(&self, lib: Arc<Library>) -> Result<Bitmap, BitmapError>
Create a Bitmap from an OwnedBitmap.
This is useful when we need to call Ultralight logic that require Bitmap.
This function will copy all the pixels from the owned bitmap.
Sourcepub fn format(&self) -> BitmapFormat
pub fn format(&self) -> BitmapFormat
Get the pixel format.
Sourcepub fn bytes_size(&self) -> usize
pub fn bytes_size(&self) -> usize
Get the size in bytes of the pixel buffer.
Sourcepub fn pixels_mut(&mut self) -> Option<&mut [u8]>
pub fn pixels_mut(&mut self) -> Option<&mut [u8]>
Get the mutable pixel buffer slice.
Auto Trait Implementations§
impl Freeze for OwnedBitmap
impl RefUnwindSafe for OwnedBitmap
impl Send for OwnedBitmap
impl Sync for OwnedBitmap
impl Unpin for OwnedBitmap
impl UnwindSafe for OwnedBitmap
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