Swadge 2024 2.0.0
APIs to develop games for the Magfest Swadge
|
This file contains utilities for Cosplay Crunch microgames, mostly centered around tinting wsg images.
Go to the source code of this file.
Data Structures | |
struct | tintColor_t |
A set of colors used to tint a greyscale image. More... | |
Macros | |
#define | PALETTE_LOWLIGHT c111 |
Palette lowlight color to be tinted in grayscale images. See tintPalette() | |
#define | PALETTE_BASE c222 |
Palette base color to be tinted in grayscale images. See tintPalette() | |
#define | PALETTE_HIGHLIGHT c444 |
Palette hightlight color to be tinted in grayscale images. See tintPalette() | |
Functions | |
void | tintPalette (wsgPalette_t *palette, const tintColor_t *tintColor) |
Modifies a palette to be used for tinting greyscale images. The resulting palette is intended to be used with the wsgPalette* functions. | |
void | drawToCanvas (wsg_t canvas, wsg_t wsg, uint16_t x, uint16_t y) |
Draws a wsg image onto another wsg image. | |
void | drawToCanvasTint (wsg_t canvas, wsg_t wsg, int32_t x, int32_t y, int32_t rotationDeg, const tintColor_t *tintColor) |
Draws a wsg image drawn in greyscale onto another wsg image, tinting the grayscale pixels. This function can be used to tint a greyscale image in place. | |
void | drawToCanvasTile (wsg_t canvas, wsg_t wsg, uint16_t x, uint16_t y) |
Draws a wsg image onto another wsg image without taking transparent pixels into account. | |
struct tintColor_t |
Data Fields | ||
---|---|---|
paletteColor_t | lowlight | |
paletteColor_t | base | |
paletteColor_t | highlight |
#define PALETTE_LOWLIGHT c111 |
Palette lowlight color to be tinted in grayscale images. See tintPalette()
#define PALETTE_BASE c222 |
Palette base color to be tinted in grayscale images. See tintPalette()
#define PALETTE_HIGHLIGHT c444 |
Palette hightlight color to be tinted in grayscale images. See tintPalette()
void tintPalette | ( | wsgPalette_t * | palette, |
const tintColor_t * | tintColor ) |
Modifies a palette to be used for tinting greyscale images. The resulting palette is intended to be used with the wsgPalette*
functions.
palette | The palette to be modified |
tintColor | The color set to apply to the grey tones of the palette |
Draws a wsg image onto another wsg image.
canvas | A wsg to draw onto |
wsg | The image to draw to the canvas |
x | x position to draw the wsg |
y | y position to draw the wsg |
void drawToCanvasTint | ( | wsg_t | canvas, |
wsg_t | wsg, | ||
int32_t | x, | ||
int32_t | y, | ||
int32_t | rotationDeg, | ||
const tintColor_t * | tintColor ) |
Draws a wsg image drawn in greyscale onto another wsg image, tinting the grayscale pixels. This function can be used to tint a greyscale image in place.
canvas | A wsg to draw onto |
wsg | The image to draw to the canvas |
x | x position to draw the wsg |
y | y position to draw the wsg |
rotationDeg | |
tintColor | The color used to tint a greyscale wsg |