AL_GET_PIXEL_FORMAT_BITS(3)
π al_get_pixel_format_bits β Allegro 5 API
okay bestie, so this one is from the Library Functions Manual and it's genuinely one of the chillest little functions in the Allegro 5 API. Let's get into it β¨
πΈ SYNOPSIS πΈ
#include <allegro5/allegro.h>
int al_get_pixel_format_bits(int format)
like, that's it. one include, one call. we love a low-effort icon π«Ά
π DESCRIPTION π
So what does it do? It returns the number of bits that a single pixel of the given format occupies. that's the whole vibe. you hand it a format, it hands you back an int telling you how chunky each pixel is. π
π¦ heads up though: for blocked pixel formats (think compressed formats), this returns0. not a bug, that's just how it is. blocked formats don't play by the per-pixel bit rules, so the function literally cannot give you a number and says0instead. don't @ me, that's canon. π
π SEE ALSO π
ALLEGRO_PIXEL_FORMAT(3)β the format lore, go read it bestieal_get_pixel_size(3)β the sibling function, also very much worth your time β¨
π cute sign-off π
and that's the whole page, bestie β straight from the Allegro reference manual, no cap. go forth and count your bits π ππ
π¦ where this page comes from
- arch rolling: allegro 5.2.11.3-2 Β· Zlib AND BSD-3-Clause AND OFL-1.1 AND LicenseRef-Custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms