getr8(3alleg4)
π getr8 β the "gimme just the red/green/blue bestie" collection π
okay so this is a whole family of functions from the Allegro game programming library, and they're all about pulling one single colour component out of a pixel. yes, the whole squad showed up. let's go π«Ά
β¨ NAME β¨
getr8, getg8, getb8, getr15, getg15, getb15, getr16, getg16, getb16, getr24, getg24, getb24, getr32, getg32, getb32 β extract a colour component from the specified pixel format. Allegro game programming library. π
π SYNOPSIS π
#include <allegro.h>
int getr8(int c);
int getg8(int c);
int getb8(int c);
int getr15(int c);
int getg15(int c);
int getb15(int c);
int getr16(int c);
int getg16(int c);
int getb16(int c);
int getr24(int c);
int getg24(int c);
int getb24(int c);
int getr32(int c);
int getg32(int c);
int getb32(int c);
π DESCRIPTION π
so like. you hand one of these a colour that's in a display dependent format, and it hands you back one of the red, green, or blue components β and that component is ranging 0-255, no cap. that's the whole vibe. the number at the end of each name is just telling you which pixel depth it's built for, bestie. β¨
here's the example, literally copied exactly because I would never do you like that:
int r, g, b, color_value;
color_value = _getpixel15(screen, 100, 100);
r = getr15(color_value);
g = getg15(color_value);
b = getb15(color_value);
see? grab the pixel, then break it down into its little r/g/b pieces. it's giving forensics. π₯
π¦ SEE ALSO π¦
mwah π that's the page! this was Allegro version 4.4.3, and honestly she ate. go extract some components, bestie, you've got this. πβ¨π
π¦ where this page comes from
- debian bookworm: allegro4-doc 2:4.4.3.1-3 Β· Allegro-gift-ware
- debian trixie: allegro4-doc 2:4.4.3.1-5 Β· Allegro-gift-ware
- ubuntu jammy: allegro4-doc 2:4.4.3.1-2 Β· Allegro-gift-ware
- ubuntu noble: allegro4-doc 2:4.4.3.1-4.1build3 Β· Allegro-gift-ware
- ubuntu questing: allegro4-doc 2:4.4.3.1-6
- ubuntu resolute: allegro4-doc 2:4.4.3.1-7 Β· Allegro-gift-ware
- ubuntu stonking: allegro4-doc 2:4.4.3.1-9 Β· Allegro-gift-ware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms