al_get_pixel_size(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ 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 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