Struct drawille::Canvas[][src]

pub struct Canvas { /* fields omitted */ }
Expand description

A canvas object that can be used to draw to the terminal using Braille characters.

Implementations

Creates a new Canvas with the given width and height.

Note that the Canvas can still draw outside the given dimensions (expanding the canvas) if a pixel is set outside the dimensions.

Clears the canvas.

Sets a pixel at the specified coordinates.

Sets a pixel at the specified coordinates. specifying the color of the braille char

Sets a letter at the specified coordinates.

Draws text at the specified coordinates (top-left of the text) up to max_width length

Deletes a pixel at the specified coordinates.

Toggles a pixel at the specified coordinates.

Detects whether the pixel at the given coordinates is set.

Returns a Vec of each row of the Canvas.

Note that each row is actually four pixels high due to the fact that a single Braille character spans two by four pixels.

Draws the canvas to a String and returns it.

Draws a line from (x1, y1) to (x2, y2) onto the Canvas.

Draws a line from (x1, y1) to (x2, y2) onto the Canvas specifying the color of the line

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. 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.