ALLEGRO_LOCKED_REGION(3)
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 thedata. β¨pitchβ gives the size in bytes of a single row (also known as the stride). The pitch may be greater thanwidth * pixel_sizedue 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,rowrefers 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