Generic Palette Functions
[Palette System]

Functions


Detailed Description

The Generic Palette Functions module provides functions to load 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)

Function Documentation

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.

Parameters:
[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.
Note:
This function has been written by Cearn. If you're interested in the source code, you can get it from http://forum.gbadev.org/viewtopic.php?t=6721

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.

Parameters:
[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.

Parameters:
[in] pPaletteMemory Pointer to palette memory. Address must be halfword aligned.
[in] Count Amount of colors to invert


Generated on Mon Apr 9 16:39:01 2007 for HEL Library by  doxygen 1.5.1