|
Swadge ESP32-S2
APIs to develop for the Magfest Swadge
|
Provides a canvas to paint with low memory requirements.
Functions | |
| 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. | |
| void canvasBlankInit | ( | wsg_t * | canvas, |
| int | width, | ||
| int | height, | ||
| paletteColor_t | startColor, | ||
| bool | spiRam ) |
Initializes a blank canvas to the dimensions and color provided.
| 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. |
| 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.
| 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. |
| 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.
| 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 |
| 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.
| 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 |
| 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.
| 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 |