Provides a canvas to paint with low memory requirements.
- Author
- Jeremy Stintzcum (jerem.nosp@m.y.st.nosp@m.intzc.nosp@m.um@g.nosp@m.mail..nosp@m.com)
- Version
- 1.0
- Date
- 2025-09-02
- Copyright
- Copyright (c) 2025
|
void | canvasBlankInit (wsg_t *canvas, int width, int height, paletteColor_t startColor, bool spiRam) |
| Initializes a blank canvas to the dimensions and color provided.
|
|
void | canvasDrawSimple (wsg_t *canvas, cnfsFileIdx_t image, int startX, int startY) |
| Draws a image to the canvas at the specified coordinates relative to the canvas.
|
|
void | canvasDrawSimplePal (wsg_t *canvas, cnfsFileIdx_t image, int startX, int startY, wsgPalette_t *pal) |
| Draws a image to the canvas at the specified coordinates relative to the canvas and applies a palette.
|
|
void | canvasDraw (wsg_t *canvas, cnfsFileIdx_t image, int startX, int startY, bool flipX, bool flipY, int32_t rotateDeg) |
| Draws an image to the canvas at a specified angle.
|
|
void | canvasDrawPal (wsg_t *canvas, cnfsFileIdx_t image, int startX, int startY, bool flipX, bool flipY, int32_t rotateDeg, wsgPalette_t *pal) |
| Draws an image to the canvas at a specified angle.
|
|
◆ canvasBlankInit()
void canvasBlankInit |
( |
wsg_t * | canvas, |
|
|
int | width, |
|
|
int | height, |
|
|
paletteColor_t | startColor, |
|
|
bool | spiRam ) |
Initializes a blank canvas to the dimensions and color provided.
- Parameters
-
canvas | WSG to save the canvas too. Use a standard wsg_t and provide the pointer |
width | Width in pixels of the desired canvas |
height | Height in pixels of the desired canvas |
startColor | The initial color. Can be any paletteColor_t including cTransparent |
spiRam | Whether or not to load the pixel data into SPIRAM. |
◆ canvasDrawSimple()
void canvasDrawSimple |
( |
wsg_t * | canvas, |
|
|
cnfsFileIdx_t | image, |
|
|
int | startX, |
|
|
int | startY ) |
Draws a image to the canvas at the specified coordinates relative to the canvas.
- Parameters
-
canvas | WSG to save changes to. Will work with any WSG, cannot be reverted |
image | New cnfsFileIdx_t to apply to the canvas |
startX | X position on canvas. Negative moves left, positive moves right. Pixels not on canvas are cropped. |
startY | Y position on canvas. Negative moves left, positive moves right. Pixels not on canvas are cropped. |
◆ canvasDrawSimplePal()
void canvasDrawSimplePal |
( |
wsg_t * | canvas, |
|
|
cnfsFileIdx_t | image, |
|
|
int | startX, |
|
|
int | startY, |
|
|
wsgPalette_t * | pal ) |
Draws a image to the canvas at the specified coordinates relative to the canvas and applies a palette.
- Parameters
-
canvas | WSG to save changes to. Will work with any WSG, cannot be reverted |
image | New cnfsFileIdx_t to apply to the canvas |
startX | X position on canvas. Negative moves left, positive moves right. Pixels not on canvas are cropped. |
startY | Y position on canvas. Negative moves left, positive moves right. Pixels not on canvas are cropped. |
pal | Palette data to use to transform the image |
◆ canvasDraw()
void canvasDraw |
( |
wsg_t * | canvas, |
|
|
cnfsFileIdx_t | image, |
|
|
int | startX, |
|
|
int | startY, |
|
|
bool | flipX, |
|
|
bool | flipY, |
|
|
int32_t | rotateDeg ) |
Draws an image to the canvas at a specified angle.
- Parameters
-
canvas | WSG to save changes to. Will work with any WSG, cannot be reverted |
image | New cnfsFileIdx_t to apply to the canvas |
startX | X position on canvas. Negative moves left, positive moves right. Pixels not on canvas are cropped. |
startY | Y position on canvas. Negative moves left, positive moves right. Pixels not on canvas are cropped. |
flipX | Flips applied image in the x direction |
flipY | Flips applied image in the Y direction |
rotateDeg | Angle to draw the image at |
◆ canvasDrawPal()
void canvasDrawPal |
( |
wsg_t * | canvas, |
|
|
cnfsFileIdx_t | image, |
|
|
int | startX, |
|
|
int | startY, |
|
|
bool | flipX, |
|
|
bool | flipY, |
|
|
int32_t | rotateDeg, |
|
|
wsgPalette_t * | pal ) |
Draws an image to the canvas at a specified angle.
- Parameters
-
canvas | WSG to save changes to. Will work with any WSG, cannot be reverted |
image | New cnfsFileIdx_t to apply to the canvas |
startX | X position on canvas. Negative moves left, positive moves right. Pixels not on canvas are cropped. |
startY | Y position on canvas. Negative moves left, positive moves right. Pixels not on canvas are cropped. |
flipX | Flips applied image in the x direction |
flipY | Flips applied image in the Y direction |
rotateDeg | Angle to draw the image at |
pal | Palette data to use to transform the image |