Struct libnotcurses_sys::examples::utils::Canvas [−][src]
Expand description
A rectangular array of pixels that can be individually colored.
Fields
h: u32The height.
w: u32The width.
buf: Vec<u8>A bytes buffer.
Implementations
New custom colored Canvas.
Returns the canvas size in cartesian coordinates.
Returns
Cartesian coordinates, goes from the bottom-left to the top-right corner.
(beg_y, end_y, beg_x, end_x)
↓ beg_x (-) 0. (+) end_x ↓
↓
·---------------------------· ← end_y (+)
| |
| |
| |
| + | ← 0.
| |
| |
| |
·---------------------------· ← beg_y (-)Returns the canvas size in screen coordinates.
Returns
Screen coordinates, goes from the top-left to the bottom-right corner.
(beg_y, end_y, beg_x, end_x)
↓ beg_x (0) end_x ↓
+---------------------------· ← beg_y (0)
| |
| |
| |
| |
| |
| |
| |
·---------------------------· ← end_yAssigns a color to a pixel, using cartesian coordinates.
Assigns a color to a pixel, using screen coordinates.
Performs conversion from screen coordinates to cartesian coordiantes.
In screen coordinates the origin (0,0) is at the top left:
yincreases towards the bottom.xincreases towards the right.
Performs conversion from cartesian coordinates to screen coordiantes.
In cartesian coordiantes the origin (0,0) is at the center:
yincreases towards the top and decreases towards the bottom.xincreases towards the right and decreases towards the left.
