.\" Automatically generated by Pandoc 2.9.2.1 .\" .TH "ALLEGRO_LOCKED_REGION" "3alleg5" "" "Allegro reference manual" "" .hy .SH NAME .PP ALLEGRO_LOCKED_REGION - Allegro 5 API .SH SYNOPSIS .IP .nf \f[C] #include typedef struct ALLEGRO_LOCKED_REGION ALLEGRO_LOCKED_REGION; \f[R] .fi .SH DESCRIPTION .PP Users who wish to manually edit or read from a bitmap are required to lock it first. The ALLEGRO_LOCKED_REGION structure represents the locked region of the bitmap. This call will work with any bitmap, including memory bitmaps. .IP .nf \f[C] typedef struct ALLEGRO_LOCKED_REGION { void *data; int format; int pitch; int pixel_size; } ALLEGRO_LOCKED_REGION; \f[R] .fi .IP \[bu] 2 \f[I]data\f[R] 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. .IP \[bu] 2 \f[I]format\f[R] indicates the pixel format of the data. .IP \[bu] 2 \f[I]pitch\f[R] gives the size in bytes of a single row (also known as the stride). The pitch may be greater than \f[C]width * pixel_size\f[R] due to padding; this is not uncommon. It is also \f[I]not\f[R] 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. .IP \[bu] 2 \f[I]pixel_size\f[R] 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. .SH SEE ALSO .PP al_lock_bitmap(3alleg5), al_lock_bitmap_region(3alleg5), al_unlock_bitmap(3alleg5), ALLEGRO_PIXEL_FORMAT(3alleg5)