Functions | |
void | hel_PalBlend (u16 *pTarget, const u16 *pSourceA, const u16 *pSourceB, u32 Step, u32 Count) |
Blend between palettes. | |
void | hel_PalClear (void *pPaletteMemory, u32 Count, u32 Color) |
Clear colors of a palette with a specific color. | |
void | hel_PalInvert (void *pPaletteMemory, u32 Count) |
Invert colors of a palette. |
Palettes
to Vram, save from Vram, as well as functions to manipulate them.
Functions expect incoming colors in BGR555 format. You can use the RGB_SET
macro to compose colors to such a format.
RGB_SET(r,g,b)
The components red, green and blue have to be between 0 and 31. Here are a few examples:
// R G B RGB_SET( 0, 0, 0) // Black RGB_SET(31,31,31) // White RGB_SET(31, 0,31) // Magenta RGB_SET( 0,31, 0) // Green
Sometimes you might want to extract a specific component only. This can be done with one the following macros:
RGB_GET_R(rgb) RGB_GET_G(rgb) RGB_GET_B(rgb)
void hel_PalBlend | ( | u16 * | pTarget, | |
const u16 * | pSourceA, | |||
const u16 * | pSourceB, | |||
u32 | Step, | |||
u32 | Count | |||
) |
Blend between palettes.
The hel_PalBlend function blends colors between two palettes and stores the resulting colors at the address specified by Target
.
[in] | pTarget | Target address of blended colors |
[in] | pPaletteA | First source palette |
[in] | pPaletteB | Second source palette |
[in] | Weight | Blendweight. The Weight can be between 0..31. 0 means colors are completely taken from pPaletteA , 31 means colors are completely taken from pPaletteB . |
void hel_PalClear | ( | void * | pPaletteMemory, | |
u32 | Count, | |||
u32 | Color | |||
) |
Clear colors of a palette with a specific color.
The hel_PalClear function clears the amount of Count
colors of the palette specified by pPaletteMemory
, with the specified Color
.
[in] | pPaletteMemory | Pointer to palette memory. Address must be halfword aligned. |
[in] | Count | Amount of palette entries to clear |
[in] | Color | Color in BGR555 format |
void hel_PalInvert | ( | void * | pPaletteMemory, | |
u32 | Count | |||
) |
Invert colors of a palette.
The hel_PalInvert function inverts colors of the palette at pPaletteMemory
.
[in] | pPaletteMemory | Pointer to palette memory. Address must be halfword aligned. |
[in] | Count | Amount of colors to invert |