ALLEGRO_LOCKED_REGION(3)

πŸ“¦
version 5.2.11.3 Β· 3 versions
, in arch rolling

ALLEGRO_LOCKED_REGION(3) β€” Library Functions Manual, Allegro 5 API πŸ’…

πŸŽ€ NAME πŸŽ€

ALLEGRO_LOCKED_REGION β€” Allegro 5 API ✨

🌸 SYNOPSIS 🌸

#include <allegro5/allegro.h>

typedef struct ALLEGRO_LOCKED_REGION ALLEGRO_LOCKED_REGION;

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so bestie, if you wanna manually edit or read from a bitmap, you are required to lock it first. No cap. The ALLEGRO_LOCKED_REGION structure is the glow-up that represents the locked region of the bitmap. And this call works with any bitmap, including memory bitmaps. πŸ’–

typedef struct ALLEGRO_LOCKED_REGION {
   void *data;
   int format;
   int pitch;
   int pixel_size;
} ALLEGRO_LOCKED_REGION;
  • data β€” points to the leftmost pixel of the first row (row 0) of the locked region. For blocked formats, this points to the leftmost block of the first row of blocks. 🫢
  • format β€” indicates the pixel format of the data. ✨
  • pitch β€” gives the size in bytes of a single row (also known as the stride). The pitch may be greater than width * pixel_size due to padding; this is not uncommon. It is also not uncommon for the pitch to be negative (the bitmap may be upside down). For blocked formats, row refers to the row of blocks, not of pixels. Ngl, pitch is giving β€œtrust me bestie, read the stride” 😭
  • pixel_size β€” is the number of bytes used to represent a single block of pixels for the pixel format of this locked region. For most formats (and historically, this used to be true for all formats), this is just the size of a single pixel, but for blocked pixel formats this value is different. πŸ’…

πŸ‘‘ SEE ALSO πŸ‘‘


source/version: Allegro reference manual Β· footer title: ALLEGRO_LOCKED_REGION(3) Β· date: not listed in the original footer, so we are not making one up β€” byeee bestie, slay your bitmaps πŸ«ΆπŸ’–

πŸ“¦ where this page comes from
  • arch rolling: allegro 5.2.11.3-2 Β· Zlib AND BSD-3-Clause AND OFL-1.1 AND LicenseRef-Custom
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms