getpixel(3) - Linux man page
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
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().
To extract the individual color components, use the getr() / getg() / getb() / geta() family of functions.
