Struct ggez::graphics::CanvasGeneric[][src]

pub struct CanvasGeneric<Spec> where
    Spec: BackendSpec
{ /* fields omitted */ }
Expand description

A generic canvas independent of graphics backend. This type should never need to be used directly; use graphics::Canvas instead.

Implementations

Gets the backend Image that is being rendered to.

Note that this will be flipped but otherwise the same, use the to_image function for the unflipped version.

Gets the backend Target that is being rendered to.

Return the width of the canvas.

Return the height of the canvas.

Returns the dimensions of the canvas.

Get the filter mode for the canvas.

Set the filter mode for the canvas.

Create a new Canvas with the given size and number of samples.

Create a new Canvas with the current window dimensions.

Creates an Image with the content of its raw counterpart but transformed to behave like a normal Image.

Dumps the flipped Canvas’s data to a Vec of u8 RBGA8 values.

Encode the Canvas’s content to the given file format and write it out to the given path.

See the filesystem module docs for where exactly the file will end up.

If the canvas is multi-sampled this function resolves the internal multi-sampled texture into a non-multi-sampled texture that can actually be drawn.

ggez calls this automatically when you try to draw the canvas onto another target, or when you copy the underlying image using to_image(), to_rgba8() or encode().

You shouldn’t need to call this manually, unless you want to access the raw image after something has been drawn on the canvas, but before the canvas has been drawn onto another target itself.

Trait Implementations

Formats the value using the given formatter. Read more

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

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

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.