getpixel(3)

NAME
getpixel - Reads a pixel from a bitmap. Allegro game programming library.

SYNOPSIS
#include <allegro.h>

int getpixel(BITMAP *bmp, int x, int y);

DESCRIPTION
Reads a pixel from point (x, y) in the bitmap.

RETURN VALUE
Returns -1 if the point lies outside the bitmap (ignoring the clipping rectangle), otherwise the value of the pixel in the color format of the bitmap. Warning: -1 is also a valid value for pixels contained in 32-bit bitmaps with alpha channel (when R,G,B,A are all equal to 255) so you can't use the test against -1 as a predicate for such bitmaps. In this cases, the only reliable predicate is is_inside_bitmap().

SEE ALSO
putpixel(3), _getpixel(3), is_inside_bitmap(3), ex12bit(3), exalpha(3), exflame(3), exlights(3)