1ALLEGRO_LOCKED_REGION(3)                              ALLEGRO_LOCKED_REGION(3)
2
3
4

NAME

6       ALLEGRO_LOCKED_REGION - Allegro 5 API
7

SYNOPSIS

9              #include <allegro5/allegro.h>
10
11              typedef struct ALLEGRO_LOCKED_REGION ALLEGRO_LOCKED_REGION;
12

DESCRIPTION

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, in‐
17       cluding 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
26data points to the leftmost pixel of the first row  (row  0)  of  the
27         locked  region.   For  blocked  formats,  this points to the leftmost
28         block of the first row of blocks.
29
30format indicates the pixel format of the data.
31
32pitch gives the size in bytes of a single  row  (also  known  as  the
33         stride).   The  pitch  may  be greater than width * pixel_size due to
34         padding; this is not uncommon.  It is also not uncommon for the pitch
35         to be negative (the bitmap may be upside down).  For blocked formats,
36         `row' refers to the row of blocks, not of pixels.
37
38pixel_size is the number of bytes used to represent a single block of
39         pixels  for the pixel format of this locked region.  For most formats
40         (and historically, this used to be true for  all  formats),  this  is
41         just  the  size of a single pixel, but for blocked pixel formats this
42         value is different.
43

SEE ALSO

45       al_lock_bitmap(3), al_lock_bitmap_region(3), al_unlock_bitmap(3), ALLE‐
46       GRO_PIXEL_FORMAT(3)
47
48
49
50Allegro reference manual                              ALLEGRO_LOCKED_REGION(3)
Impressum