pub struct BitmapTarget<'a> { /* private fields */ }Expand description
A struct provides a RenderContext and then can have its bitmap extracted.
Implementations§
Source§impl<'a> BitmapTarget<'a>
impl<'a> BitmapTarget<'a>
Sourcepub fn render_context(&mut self) -> WebRenderContext<'_>
pub fn render_context(&mut self) -> WebRenderContext<'_>
Get a piet RenderContext for the bitmap.
Sourcepub fn to_image_buf(&mut self, fmt: ImageFormat) -> Result<ImageBuf, Error>
pub fn to_image_buf(&mut self, fmt: ImageFormat) -> Result<ImageBuf, Error>
Get an in-memory pixel buffer from the bitmap.
Sourcepub fn copy_raw_pixels(
&mut self,
fmt: ImageFormat,
buf: &mut [u8],
) -> Result<usize, Error>
pub fn copy_raw_pixels( &mut self, fmt: ImageFormat, buf: &mut [u8], ) -> Result<usize, Error>
Get raw RGBA pixels from the bitmap by copying them into buf. If all the pixels were
copied, returns the number of bytes written. If buf wasn’t big enough, returns an error
and doesn’t write anything.
Auto Trait Implementations§
impl<'a> Freeze for BitmapTarget<'a>
impl<'a> RefUnwindSafe for BitmapTarget<'a>
impl<'a> !Send for BitmapTarget<'a>
impl<'a> !Sync for BitmapTarget<'a>
impl<'a> Unpin for BitmapTarget<'a>
impl<'a> UnwindSafe for BitmapTarget<'a>
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
Source§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
Source§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.