Main Page | Modules | Directories | File List | Globals

bitmap.c File Reference

Bitmap blitting. More...


Functions

caca_bitmap * caca_create_bitmap (unsigned int bpp, unsigned int w, unsigned int h, unsigned int pitch, unsigned int rmask, unsigned int gmask, unsigned int bmask, unsigned int amask)
 Create an internal 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 8bpp bitmap object.
void caca_free_bitmap (struct caca_bitmap *bitmap)
 Free the memory associated with a bitmap.
void caca_draw_bitmap (int x1, int y1, int x2, int y2, struct caca_bitmap const *bitmap, void *pixels)
 Draw a bitmap on the screen.


Detailed Description

Version:
$Id: bitmap.c 248 2004-01-14 10:34:20Z sam $
Author:
Sam Hocevar <sam@zoy.org> This file contains bitmap blitting functions.

Function Documentation

struct caca_bitmap* caca_create_bitmap unsigned int  bpp,
unsigned int  w,
unsigned int  h,
unsigned int  pitch,
unsigned int  rmask,
unsigned int  gmask,
unsigned int  bmask,
unsigned int  amask
 

Create a bitmap structure from its coordinates (depth, width, height and pitch) and pixel mask values. If the depth is 8 bits per pixel, the mask values are ignored and the colour palette should be set using the caca_set_bitmap_palette() function. For depths greater than 8 bits per pixel, a zero alpha mask causes the alpha values to be ignored.

Parameters:
bpp Bitmap depth in bits per pixel.
w Bitmap width in pixels.
h Bitmap height in pixels.
pitch Bitmap pitch in bytes.
rmask Bitmask for red values.
gmask Bitmask for green values.
bmask Bitmask for blue values.
amask Bitmask for alpha values.
Returns:
Bitmap object, or NULL upon error.