2
Copyright (C) 2003-2004 Douglas Thain and the University of Wisconsin
3
Copyright (C) 2005- The University of Notre Dame
4
This software is distributed under the GNU General Public License.
5
See the file COPYING for details.
11
struct bitmap * bitmap_create( int w, int h );
12
void bitmap_delete( struct bitmap *b );
14
int bitmap_get( struct bitmap *b, int x, int y );
15
void bitmap_set( struct bitmap *b, int x, int y, int value );
16
int bitmap_width( struct bitmap *b );
17
int bitmap_height( struct bitmap *b );
18
void bitmap_reset( struct bitmap *b, int value );
19
int *bitmap_data( struct bitmap *b );
21
void bitmap_rotate_clockwise( struct bitmap *s, struct bitmap *t );
22
void bitmap_rotate_counterclockwise( struct bitmap *s, struct bitmap *t );
24
int bitmap_average( struct bitmap *s );
25
void bitmap_smooth( struct bitmap *s, struct bitmap *t, int msize );
26
void bitmap_subset( struct bitmap *s, int x, int y, struct bitmap *t );
27
void bitmap_convolve( struct bitmap *s, struct bitmap *t, int (*f)( int x ) );
28
void bitmap_copy( struct bitmap *s, struct bitmap *t );
30
struct bitmap * bitmap_load_any( const char *path );
32
struct bitmap * bitmap_load_raw( const char *file );
33
struct bitmap * bitmap_load_bmp( const char *file );
34
struct bitmap * bitmap_load_pcx( const char *file );
35
struct bitmap * bitmap_load_sgi_rgb( const char *file );
36
struct bitmap * bitmap_load_jpeg( const char *file );
38
int bitmap_save_raw( struct bitmap *b, const char *file );
39
int bitmap_save_bmp( struct bitmap *b, const char *file );
40
int bitmap_save_jpeg( struct bitmap *b, const char *file );
43
/** Create a 32-bit RGBA value from 8-bit red, green, blue, and alpha values */
44
#define MAKE_RGBA(r,g,b,a) ( (((int)(a))<<24) | (((int)(r))<<16) | (((int)(g))<<8) | (((int)(b))<<0) )
48
/** Extract an 8-bit red value from a 32-bit RGBA value. */
49
#define GET_RED(rgba) (( (rgba)>>16 ) & 0xff )
53
/** Extract an 8-bit green value from a 32-bit RGBA value. */
54
#define GET_GREEN(rgba) (( (rgba)>>8 ) & 0xff )
58
/** Extract an 8-bit blue value from a 32-bit RGBA value. */
59
#define GET_BLUE(rgba) (( (rgba)>>0 ) & 0xff )
63
/** Extract an 8-bit alpha value from a 32-bit RGBA value. */
64
#define GET_ALPHA(rgba) (( (rgba)>>24 ) & 0xff)