.\" Generated by the Allegro makedoc utility .TH getpixel 3alleg4 "version 4.4.3" "Allegro" "Allegro manual" .SH NAME getpixel \- Reads a pixel from a bitmap. Allegro game programming library.\& .SH SYNOPSIS .B #include .sp .B int getpixel(BITMAP *bmp, int x, int y); .SH DESCRIPTION Reads a pixel from point (x, y) in the bitmap. .SH "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(). To extract the individual color components, use the getr() / getg() / getb() / geta() family of functions. .SH SEE ALSO .BR putpixel (3alleg4), .BR _getpixel (3alleg4), .BR is_inside_bitmap (3alleg4), .BR getr (3alleg4), .BR getg (3alleg4), .BR getb (3alleg4), .BR geta (3alleg4), .BR ex12bit (3alleg4), .BR exalpha (3alleg4), .BR exflame (3alleg4), .BR exlights (3alleg4)