_getpixel(3alleg4)
π _getpixel, _getpixel15, _getpixel16, _getpixel24, _getpixel32 π
okay bestie, listen up β this is a page from the Allegro manual (that's the 3alleg4 section, iykyk), and it's about the speedrun versions of getpixel(). Five of them. One for each vibe of color depth. Let's go π«Ά
β¨ SYNOPSIS β¨
#include <allegro.h>
int _getpixel(BITMAP *bmp, int x, int y);
int _getpixel15(BITMAP *bmp, int x, int y);
int _getpixel16(BITMAP *bmp, int x, int y);
int _getpixel24(BITMAP *bmp, int x, int y);
int _getpixel32(BITMAP *bmp, int x, int y);
like. five whole functions. one include. we love a clean synopsis β¨
πΈ DESCRIPTION πΈ
So here's the tea, bestie: these are faster inline versions of getpixel() β but they're specialized, one per specific color depth. Not a one-size-fits-all situation. Each one knows exactly how deep your colors go and grabs that pixel accordingly. main character energy π
But β and this is important, no cap β two big caveats:
- They won't work in mode-X. at all. not a vibe.
- They don't do any clipping. like zero. none. so you have to make sure the point actually lies inside the bitmap, or you're on your own π
fr fr, check your bounds yourself. these functions are trusting you and that is a lot of trust to be given π
π RETURN VALUE π
It returns the value of the pixel, in the color format you specified. so whatever depth you picked, that's the flavor of number you get back. slay π
π¦ SEE ALSO π¦
getpixel(3alleg4)β the chill, do-everything, clip-for-you version. the original. the blueprint. π
mwah π this has been the Allegro manual, version 4.4.3, page _getpixel(3alleg4). go forth and read pixels responsibly, bestie πβ¨
π¦ 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