1getr_depth(3) Allegro manual getr_depth(3)
2
3
4
6 getr_depth, getg_depth, getb_depth, geta_depth - Extract a color compo‐
7 nent from a color in a specified pixel format. Allegro game programming
8 library.
9
11 #include <allegro.h>
12
13
14 int getr_depth(int color_depth, int c);
15
16 int getg_depth(int color_depth, int c);
17
18 int getb_depth(int color_depth, int c);
19
20 int geta_depth(int color_depth, int c);
21
23 Given a color in the format being used by the specified color depth,
24 these functions extract one of the red, green, blue, or alpha compo‐
25 nents (ranging 0-255). The alpha part is only meaningful for 32-bit
26 pixels. Example:
27
28 int r, g, b, color_value, bpp;
29
30 bpp = bitmap_color_depth(bitmap);
31 color_value = getpixel(bitmap, 100, 100);
32 r = getr_depth(bpp, color_value);
33 g = getg_depth(bpp, color_value);
34 b = getb_depth(bpp, color_value);
35
36
38 getr(3), getr8(3), geta32(3), makecol(3), set_color_depth(3),
39 exlights(3)
40
41
42
43Allegro version 4.2.2 getr_depth(3)