Skip to main content

IBitmapImpl

Trait IBitmapImpl 

Source
pub trait IBitmapImpl {
    // Required methods
    fn dpi(&self) -> Vector;
    fn pixel_size(&self) -> PixelSize;
    fn version(&self) -> i32;
    fn save(
        &self,
        stream: &mut dyn Write,
        options: &BitmapEncoderOptions,
    ) -> Result<()>;
    fn dispose(&self);
    fn as_any(&self) -> &dyn Any;

    // Provided method
    fn as_readable_bitmap(&self) -> Option<&dyn IReadableBitmapImpl> { ... }
}
Expand description

Defines the platform-specific interface for a bitmap.

Required Methods§

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.

Provided Methods§

Source

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

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

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§