1ALLEGRO_LOCKED_REGION(3) Library Functions Manual ALLEGRO_LOCKED_REGION(3)
2
3
4
6 ALLEGRO_LOCKED_REGION
7
9 #include <allegro5/allegro.h>
10
11 typedef struct ALLEGRO_LOCKED_REGION ALLEGRO_LOCKED_REGION;
12
14 Users who wish to manually edit or read from a bitmap are required to
15 lock it first. The ALLEGRO_LOCKED_REGION structure represents the
16 locked region of the bitmap. This call will work with any bitmap,
17 including memory bitmaps.
18
19 typedef struct ALLEGRO_LOCKED_REGION {
20 void *data;
21 int format;
22 int pitch;
23 int pixel_size;
24 } ALLEGRO_LOCKED_REGION;
25
26 · data points to the leftmost pixel of the first row (row 0) of the
27 locked region.
28
29 · format indicates the pixel format of the data.
30
31 · pitch gives the size in bytes of a single row (also known as the
32 stride). The pitch may be greater than width * pixel_size due to
33 padding; this is not uncommon. It is also not uncommon for the pitch
34 to be negative (the bitmap may be upside down).
35
36 · pixel_size is the number of bytes used to represent a single pixel.
37
39 al_lock_bitmap(3), al_lock_bitmap_region(3), al_unlock_bitmap(3), ALLE‐
40 GRO_PIXEL_FORMAT(3)
41
42
43
44Allegro reference manual ALLEGRO_LOCKED_REGION(3)