1getpixel(3) Allegro manual getpixel(3)
2
3
4
6 getpixel - Reads a pixel from a bitmap. Allegro game programming
7 library.
8
10 #include <allegro.h>
11
12
13 int getpixel(BITMAP *bmp, int x, int y);
14
16 Reads a pixel from point (x, y) in the bitmap.
17
19 Returns -1 if the point lies outside the bitmap (ignoring the clipping
20 rectangle), otherwise the value of the pixel in the color format of the
21 bitmap.
22
23 Warning: -1 is also a valid value for pixels contained in 32-bit bit‐
24 maps with alpha channel (when R,G,B,A are all equal to 255) so you
25 can't use the test against -1 as a predicate for such bitmaps. In this
26 cases, the only reliable predicate is is_inside_bitmap().
27
28 To extract the individual color components, use the getr() / getg() /
29 getb() / geta() family of functions.
30
31
33 putpixel(3), _getpixel(3), is_inside_bitmap(3), getr(3), getg(3),
34 getb(3), geta(3), ex12bit(3), exalpha(3), exflame(3), exlights(3)
35
36
37
38Allegro version 4.2.3 getpixel(3)