Main Page | Modules | Directories | File List | Globals

Bitmap handling


Functions

caca_bitmap * caca_create_bitmap (unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int)
void caca_set_bitmap_palette (struct caca_bitmap *, unsigned int r[], unsigned int g[], unsigned int b[], unsigned int a[])
 Set the palette of an 8bpp bitmap object.
void caca_draw_bitmap (int, int, int, int, struct caca_bitmap const *, void *)
 Draw a bitmap on the screen.
void caca_free_bitmap (struct caca_bitmap *)
 Free the memory associated with a bitmap.

Detailed Description

These functions provide high level routines for bitmap allocation and rendering.

Function Documentation

void caca_draw_bitmap int  x1,
int  y1,
int  x2,
int  y2,
struct caca_bitmap const *  bitmap,
void *  pixels
 

Draw a bitmap at the given coordinates. The bitmap can be of any size and will be stretched to the text area.

Parameters:
x1 X coordinate of the upper-left corner of the drawing area.
y1 Y coordinate of the upper-left corner of the drawing area.
x2 X coordinate of the lower-right corner of the drawing area.
y2 Y coordinate of the lower-right corner of the drawing area.
bitmap Bitmap object to be drawn.
pixels Bitmap's pixels.

void caca_free_bitmap struct caca_bitmap *  bitmap  ) 
 

Free the memory allocated by caca_create_bitmap().

Parameters:
bitmap Bitmap object.

void caca_set_bitmap_palette struct caca_bitmap *  bitmap,
unsigned int  red[],
unsigned int  green[],
unsigned int  blue[],
unsigned int  alpha[]
 

Set the palette of an 8 bits per pixel bitmap. Values should be between 0 and 4095 (0xfff).

Parameters:
bitmap Bitmap object.
red Array of 256 red values.
green Array of 256 green values.
blue Array of 256 blue values.
alpha Array of 256 alpha values.