vizia::vg

Type Alias Bitmap

pub type Bitmap = Handle<SkBitmap>;
Expand description

Bitmap describes a two-dimensional raster pixel array. Bitmap is built on ImageInfo, containing integer width and height, ColorType and AlphaType describing the pixel format, and ColorSpace describing the range of colors. Bitmap points to PixelRef, which describes the physical array of pixels. ImageInfo bounds may be located anywhere fully inside PixelRef bounds.

Bitmap can be drawn using crate::Canvas. Bitmap can be a drawing destination for crate::Canvas draw member functions. Bitmap flexibility as a pixel container limits some optimizations available to the target platform.

If pixel array is primarily read-only, use Image for better performance.

If pixel array is primarily written to, use crate::Surface for better performance.

Declaring Bitmap const prevents altering ImageInfo: the Bitmap height, width, and so on cannot change. It does not affect PixelRef: a caller may write its pixels. Declaring Bitmap const affects Bitmap configuration, not its contents.

Bitmap is not thread safe. Each thread must have its own copy of Bitmap fields, although threads may share the underlying pixel array.

Aliased Typeยง

struct Bitmap(/* private fields */);