al_get_pixel(3alleg5)
β¨ NAME β¨
al_get_pixel β it's the Allegro 5 API function that goes and fetches a pixel's colour for you, bestie π (yes this is from the Allegro reference manual, the 3alleg5 manual, and we're gonna get into it).
πΈ SYNOPSIS πΈ
#include <allegro5/allegro.h>
ALLEGRO_COLOR al_get_pixel(ALLEGRO_BITMAP *bitmap, int x, int y)
okay so that's the whole vibe: you hand it a bitmap, an x, and a y, and it hands you back an ALLEGRO_COLOR. iconic π
π¦ DESCRIPTION π¦
So basically: al_get_pixel gets you a pixel's colour value from the bitmap you specified. that's it, that's the whole job π
β οΈ but listen β this operation is slow on non-memory bitmaps. like, no cap, slow slow. so if you're gonna call it a bunch of times on the same bitmap, consider locking the bitmap first. fr fr, your future self will thank you π
π SEE ALSO π
ALLEGRO_COLOR(3alleg5)β the colour type you get back, go meet it πal_put_pixel(3alleg5)β the putter to this getter, they're a matching set π«Άal_lock_bitmap(3alleg5)β the one you lock with when you're doing lots of pixels and don't wanna suffer π
k that's the whole page, mwah π this was pulled straight from the Allegro reference manual, page al_get_pixel(3alleg5) β Allegro 5 API energy all the way through, 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