Image palettes
[Images]
Detailed Description
Palette for 4 and 8-bit images.
Function Documentation
OSL_PALETTE* oslCreatePaletteEx |
( |
int |
size, |
|
|
int |
location, |
|
|
short |
pixelFormat | |
|
) |
| | |
Creates a new (empty) palette with the specified pixelFormat.
- Parameters:
-
| size | Number of colors of the palette. |
| location | Location where to put the palette. Always put it in RAM for now (OSL_IN_RAM). |
| pixelFormat | Pixel format of each palette entry. It should always be OSL_PF_8888 as palettes are rather small in size. |
Remember that raw access to palette is cached, so you must uncache it after having filled it. Look at oslGetImageLine and oslGetImagePixelAdr for more information.
OSL_PALETTE* oslCreatePalette |
( |
int |
size, |
|
|
short |
pixelFormat | |
|
) |
| | [inline] |
Creates a palette. Simpler function without the location argument.
OSL_PALETTE* oslCreatePaletteFrom |
( |
void * |
data, |
|
|
int |
size, |
|
|
short |
pixelFormat | |
|
) |
| | |
Creates a palette from existing data. Please note that data is not copied to a new location but used as is! You just have to specify the palette size and pixelFormat.
Deletes an existing palette. If the palette was created with oslCreatePaletteFrom, the data is not freed or anything, it's left as it was before, only the OSL_PALETTE structure is freed.
Returns a color entry from a palette. The color will be in the same pixelformat as the palette (16 or 32 bits).
Uncaches a palette. As with oslUncacheData, always uncache a palette after you've accessed it in a cached way (pal->data). Look at oslCreatePalette for more info.