bitmap_color_depth(3alleg4)
β¨ NAME β¨
bitmap_color_depth β ok so bestie, this is the lil function that tells you the color depth of whatever bitmap you hand it π
And yes, this whole page lives in the Allegro manual, section 3alleg4, aka the Allegro game programming library. Iconic.
πΈ SYNOPSIS πΈ
#include <allegro.h>
int bitmap_color_depth(BITMAP *bmp);
π DESCRIPTION π
So you pass in a bitmap, right? And it returns the color depth of the specified bitmap. That's it. That's the whole vibe. π¦
And the depths you might get back are literally just: 8, 15, 16, 24, or 32. No cap. Those are the five.
Here's the example from the page, and honestly? She's giving practical queen energy:
switch (bitmap_color_depth(screen)) {
case 8:
/* Access screen using optimized 8-bit code. */
break;
default:
/* Use generic slow functions. */
break;
}
Lowkey the takeaway here is: check the depth, and if you're in that 8 case you can flex with optimized 8-bit code. Anything else? You're on the generic slow functions. Not a read, just the facts π
π«Ά SEE ALSO π«Ά
set_color_depth(3alleg4)bitmap_mask_color(3alleg4)ex3d(3alleg4)exlights(3alleg4)exscn3d(3alleg4)exswitch(3alleg4)extrans(3alleg4)exupdate(3alleg4)exzbuf(3alleg4)
Anyway bestie, that's the whole page! This one came to you straight from the Allegro manual, courtesy of Allegro version 4.4.3 π go forth and check your color depths, mwah πβ¨
π¦ 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