bitmap_mask_color(3alleg4)
π NAME π
okay so bitmap_mask_color β it hands you back the mask color of the bitmap you point at, bestie. it's from the Allegro game programming library, iykyk. π
β¨ SYNOPSIS β¨
#include <allegro.h>
int bitmap_mask_color(BITMAP *bmp);
π¦ DESCRIPTION π¦
so basically this function returns the mask color for whichever bitmap you pass in β and that's the value that gets skipped when sprites are being drawn. lowkey iconic behavior honestly.
here's the tea on what that color actually is:
- for 256-color bitmaps it's zero.
- for truecolor bitmaps it's bright pink β like, maximum red and maximum blue, and zero green. periodt. π
a super frequent glow-up move with this function is clearing a bitmap with the mask color so you can later use that bitmap with masked_blit() or draw_sprite() after you've drawn other stuff on it. it's giving main character energy fr fr.
example, bestie:
/* Replace mask color with another color. */
for (y = 0; y h; y++)
for (x = 0; x w; x++)
if (getpixel(bmp, x, y) == bitmap_mask_color(bmp))
putpixel(bmp, x, y, another_color);
not me looping over every pixel and vibe-checking it against the mask color π but yes, that's literally the move.
π SEE ALSO π
MASK_COLOR_8(3alleg4)set_color_depth(3alleg4)bitmap_color_depth(3alleg4)ex3d(3alleg4)exmouse(3alleg4)expat(3alleg4)
okay that's the whole page, bestie!! this was Allegro version 4.4.3, and yeah β bitmap_mask_color(3alleg4) said everything it needed to say. stay masked, stay slay π«ΆππΈ
π¦ 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