al_get_pixel(3alleg5)

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

✨ 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 πŸ’œ


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