al_get_pixel_size(3alleg5)
β¨ al_get_pixel_size β¨
okay bestie, welcome to the Allegro 5 API π this one's a lil baby function but it's lowkey iconic, so let's get into it.
πΈ SYNOPSIS πΈ
#include <allegro5/allegro.h>
int al_get_pixel_size(int format)
like, that's it. one header, one function, one int in, one int out. no cap. π«Ά
π¦ DESCRIPTION π¦
so the way that this works is: you hand it a format, and it tells you how many bytes one single pixel of that format takes up. that's the whole vibe check. π
β οΈ but bestie, listen β for blocked pixel formats (think compressed formats, the fancy ones), this thing returns 0. not a bug, that's just how it is. don't come for me. π
π SEE ALSO π
ALLEGRO_PIXEL_FORMAT(3alleg5)β the format lore πal_get_pixel_format_bits(3alleg5)β the bits-y sibling, go say hi π
Allegro reference manual Β· al_get_pixel_size(3alleg5) Β· 3alleg5 β¨
and that's a wrap, bestie!! this page came straight outta the Allegro reference manual, for the al_get_pixel_size(3alleg5) era of the 3alleg5 manual β go forth and count those bytes, you main character π¦π periodt.
π¦ where this page comes from
- debian trixie: allegro5-doc 2:5.2.10.1+dfsg-1 Β· Zlib
- ubuntu questing: allegro5-doc 2:5.2.10.1+dfsg-1build1
- ubuntu resolute: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- ubuntu stonking: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms