pub struct DrawTarget<Backing = Vec<u32>> { /* private fields */ }
Expand description

The main type used for drawing

Implementations

Use a previously used vector for the bitmap and extend it to the given size(if needed)

Take ownership of the buffer backing the DrawTarget

Use an existing backing storage for the bitmap

The backing store must be the correct size (width*height elements).

sets a transform that will be applied to all drawing operations

gets the current transform

Pushes a new layer as the drawing target. This is used for implementing group opacity effects.

Pushes a new layer as the drawing target. This is used for implementing group opacity or blend effects.

Draws the most recently pushed layer to the drawing target with the pushed opacity applied.

Draws an image at (x, y) with the size (width, height). This will rescale the image to the destination size.

Draws an image at x, y

Draws src through an untransformed mask positioned at x, y in device space

Strokes path with style and fills the result with src

Fills the rect x, y,, width, height with src. If the result is an integer aligned rectangle performance will be faster than filling a rectangular path.

Fills path with src

Fills the current clip with the solid color solid

Draws src_rect of src at dst. The current transform and clip are ignored

Draws src_rect of src at dst. The current transform and clip are ignored. src_rect is clamped to (0, 0, src.width, src.height).

Blends src_rect of src at dstusing blend mode. The current transform and clip are ignored. src_rect is clamped to (0, 0, src.width, src.height).

Blends src_rect of src at dst using alpha. The current transform and clip are ignored. src_rect is clamped to (0, 0, src.width, src.height).

Returns a reference to the underlying pixel data

Returns a mut reference to the underlying pixel data as ARGB with a representation like: (A << 24) | (R << 16) | (G << 8) | B

Returns a reference to the underlying pixel data as individual bytes with the order BGRA on little endian.

Returns a mut reference to the underlying pixel data as individual bytes with the order BGRA on little endian.

Take ownership of the buffer backing the DrawTarget

Saves the current pixel to a png file at path

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.