Skip to main content

RenderTargetBitmapImpl

Struct RenderTargetBitmapImpl 

Source
pub struct RenderTargetBitmapImpl { /* private fields */ }
Expand description

A render target bitmap: a writeable bitmap that is drawn into through a framebuffer render target over its own pixels.

Implementations§

Source§

impl RenderTargetBitmapImpl

Source

pub fn new(size: PixelSize, dpi: Vector) -> Self

Creates a render target bitmap in the platform’s native pixel format.

Source

pub fn is_corrupted(&self) -> bool

Whether the contents of the bitmap have been lost. Never the case for a bitmap in memory.

Trait Implementations§

Source§

impl IBitmapImpl for RenderTargetBitmapImpl

Source§

fn dpi(&self) -> Vector

The dots per inch (DPI) of the image.
Source§

fn pixel_size(&self) -> PixelSize

The size of the bitmap, in device pixels.
Source§

fn version(&self) -> i32

Version of the pixel data: incremented whenever the content changes.
Source§

fn save( &self, stream: &mut dyn Write, options: &BitmapEncoderOptions, ) -> Result<()>

Saves the bitmap to a stream, encoded as selected by options.
Source§

fn dispose(&self)

Releases the bitmap’s resources.
Source§

fn as_any(&self) -> &dyn Any

Lets the backend recover its concrete type.
Source§

fn as_readable_bitmap(&self) -> Option<&dyn IReadableBitmapImpl>

The bitmap viewed as IReadableBitmapImpl, when its pixels can be read.
Source§

impl IDrawableBitmapImpl for RenderTargetBitmapImpl

Source§

fn draw( &self, gr_context: Option<&dyn ISkiaGrContext>, canvas: &Canvas, source_rect: &Rect, dest_rect: &Rect, sampling_options: SamplingOptions, paint: &Paint, )

Draws the bitmap onto a canvas. Read more
Source§

impl IFramebufferPlatformSurface for RenderTargetBitmapImpl

Source§

fn create_framebuffer_render_target(&self) -> Rc<dyn IFramebufferRenderTarget>

Creates the framebuffer render target of the surface.
Source§

impl IPlatformRenderSurface for RenderTargetBitmapImpl

Source§

fn as_framebuffer_surface(&self) -> Option<&dyn IFramebufferPlatformSurface>

The surface as a framebuffer surface, if it is one.
Source§

fn as_any(&self) -> &dyn Any

Lets the backend recover the concrete surface type.
Source§

fn is_ready(&self) -> bool

Whether the surface is ready to be rendered to.
Source§

fn try_get_surface_kind(&self, _kind: TypeId) -> Option<Rc<dyn Any>>

The surface viewed as a surface kind defined outside this crate: for TypeId::of::<dyn IFoo>() the result holds an Rc<dyn IFoo>.
Source§

fn text_rendering_parameters(&self) -> Option<PlatformTextRenderingParameters>

The text rendering settings of the platform for this surface, when the platform knows them: the render backend asks for them every frame (they follow the settings of the system and the display the surface is on). A backend asks every surface of a top-level and takes the first answer; None from all of them gives the defaults of the backend (docs/porting/text-rendering.md).
Source§

impl IReadableBitmapImpl for RenderTargetBitmapImpl

Source§

fn format(&self) -> Option<PixelFormat>

The pixel format, if known.
Source§

fn alpha_format(&self) -> Option<AlphaFormat>

The alpha format, if known.
Source§

fn lock(&self) -> Rc<dyn ILockedFramebuffer>

Locks the pixels for reading (and writing, for writeable bitmaps).
Source§

impl IRenderTargetBitmapImpl for RenderTargetBitmapImpl

Source§

fn create_drawing_context(&self) -> Box<dyn IDrawingContextImpl>

Creates a drawing context that draws into the bitmap.
Source§

impl IWriteableBitmapImpl for RenderTargetBitmapImpl

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ClassDefaults for T
where T: ?Sized,

Source§

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
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.