getr_depth(3)
β¨ NAME β¨
getr_depth, getg_depth, getb_depth, geta_depth β bestie, these four icons pull one single color component out of a color, using whatever pixel format you tell them to. They live in the Allegro game programming library. π
πΈ SYNOPSIS πΈ
#include <allegro.h>
int getr_depth(int color_depth, int c);
int getg_depth(int color_depth, int c);
int getb_depth(int color_depth, int c);
int geta_depth(int color_depth, int c);
π DESCRIPTION π
Okay so here's the vibe: you hand these functions a color that's already in the format used by the color depth you specified, and they hand you back one of the red, green, blue, or alpha components. Each component comes back ranging 0-255, no cap. π₯
The alpha one is only meaningful for 32-bit pixels, just so you know β it's giving "only main character in 32-bit" energy. π
Example, because seeing it is believing:
int r, g, b, color_value, bpp;
bpp = bitmap_color_depth(bitmap);
color_value = getpixel(bitmap, 100, 100);
r = getr_depth(bpp, color_value);
g = getg_depth(bpp, color_value);
b = getb_depth(bpp, color_value);
Look at her go. getpixel grabs the raw color, and then the *_depth girlies unpack it piece by piece. Obsessed, honestly. π«Ά
π¦ SEE ALSO π¦
That's the whole page, bestie, no notes. π This one's from the Allegro manual, rocking version 4.4.3, and it's the getr_depth(3) page β so go forth, extract those components, and slay. πβ¨
π¦ where this page comes from
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms