pub struct WriteableBitmapImpl { /* private fields */ }Expand description
Skia based writeable bitmap.
The UI thread writes the pixels and the render thread draws them: the pixels and the image drawn from them are under one lock.
Implementations§
Source§impl WriteableBitmapImpl
impl WriteableBitmapImpl
Sourcepub fn from_stream(stream: &mut dyn Read) -> Result<Arc<Self>>
pub fn from_stream(stream: &mut dyn Read) -> Result<Arc<Self>>
Creates a writeable bitmap from the given stream.
Sourcepub fn from_stream_to_size(
stream: &mut dyn Read,
decode_size: i32,
horizontal: bool,
interpolation_mode: BitmapInterpolationMode,
) -> Result<Arc<Self>>
pub fn from_stream_to_size( stream: &mut dyn Read, decode_size: i32, horizontal: bool, interpolation_mode: BitmapInterpolationMode, ) -> Result<Arc<Self>>
Creates a writeable bitmap from a stream, decoded so that its width
(horizontal) or height is decode_size.
Sourcepub fn new(
size: PixelSize,
dpi: Vector,
format: PixelFormat,
alpha_format: AlphaFormat,
) -> Arc<Self> ⓘ
pub fn new( size: PixelSize, dpi: Vector, format: PixelFormat, alpha_format: AlphaFormat, ) -> Arc<Self> ⓘ
Creates a writeable bitmap with the given size, DPI and formats. The pixels start out transparent.
§Panics
Panics when the pixel format is unknown to Skia or the pixels cannot be allocated.
Sourcepub fn get_snapshot(&self) -> Image
pub fn get_snapshot(&self) -> Image
Gets a snapshot of the bitmap: an image holding a copy of the current pixels.
Trait Implementations§
Source§impl IBitmapImpl for WriteableBitmapImpl
impl IBitmapImpl for WriteableBitmapImpl
Source§fn pixel_size(&self) -> PixelSize
fn pixel_size(&self) -> PixelSize
The size of the bitmap, in device pixels.
Source§fn save(
&self,
stream: &mut dyn Write,
options: &BitmapEncoderOptions,
) -> Result<()>
fn save( &self, stream: &mut dyn Write, options: &BitmapEncoderOptions, ) -> Result<()>
Saves the bitmap to a stream, encoded as selected by
options.Source§fn as_readable_bitmap(&self) -> Option<&dyn IReadableBitmapImpl>
fn as_readable_bitmap(&self) -> Option<&dyn IReadableBitmapImpl>
The bitmap viewed as
IReadableBitmapImpl, when its pixels can be
read.Source§impl IReadableBitmapImpl for WriteableBitmapImpl
impl IReadableBitmapImpl for WriteableBitmapImpl
Source§fn format(&self) -> Option<PixelFormat>
fn format(&self) -> Option<PixelFormat>
The pixel format, if known.
Source§fn alpha_format(&self) -> Option<AlphaFormat>
fn alpha_format(&self) -> Option<AlphaFormat>
The alpha format, if known.
Source§fn lock(&self) -> Rc<dyn ILockedFramebuffer>
fn lock(&self) -> Rc<dyn ILockedFramebuffer>
Locks the pixels for reading (and writing, for writeable bitmaps).
impl IWriteableBitmapImpl for WriteableBitmapImpl
Auto Trait Implementations§
impl !Freeze for WriteableBitmapImpl
impl RefUnwindSafe for WriteableBitmapImpl
impl Send for WriteableBitmapImpl
impl Sync for WriteableBitmapImpl
impl Unpin for WriteableBitmapImpl
impl UnsafeUnpin for WriteableBitmapImpl
impl UnwindSafe for WriteableBitmapImpl
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> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read more