masked_stretch_blit(3)

πŸ“¦ version 4.4.3.1, in fedora 43, fedora 44

✨ NAME ✨

masked_stretch_blit β€” scales a rectangular area skipping pixels with the mask color. It's from the Allegro game programming library, bestie, and it's giving "blit but make it fashion" πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <allegro.h>

void masked_stretch_blit(BITMAP *source, BITMAP *dest, int source_x,
source_y, source_w, source_h, int dest_x, dest_y, dest_w, dest_h);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so picture masked_blit(), right? iconic. now imagine that but it can scale images, so the source and destination rectangles do not need to be the same size. that's the whole vibe. stretch it, shrink it, whatever β€” the mask color pixels get skipped like they're not even invited 🫢

⚠️ but listen. this routine does not do as much safety checking as the regular masked_blit(). specifically: you must take care not to copy from areas outside the source bitmap. no cap, it will not hold your hand on that one 😭

Also β€” and this is important β€” the source must be a memory bitmap. not optional, not negotiable, that's the rule 🌸

Example, because seeing it is believing:

BITMAP *hud_overlay;
...
/* Stretch hud overlay over the screen. */
masked_stretch_blit(hud_overlay, screen, 0, 0,
                    hud_overlay->w, hud_overlay->h,
                    0, 0, SCREEN_W, SCREEN_H);

like?? stretch that hud overlay across the whole screen, main character energy only πŸ‘‘


πŸ‘€ SEE ALSO πŸ‘€

the besties, the squad, the ones you should also go read:


mwah πŸ’‹ that's the page, bestie. this one lives in the Allegro manual, version 4.4.3, and yes the footer is literally just masked_stretch_blit(3) down there keeping it cute. slay, stay masked, stay stretched, periodt πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from