ALLEGRO_LOCKED_REGION
typedef struct ALLEGRO_LOCKED_REGION ALLEGRO_LOCKED_REGION;
Introduced in 5.0.0
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.
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.
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_sizedue to padding; this is not uncommon. It is also not uncommon for the pitch to be negative (the bitmap may be upside down).pixel_size is the number of bytes used to represent a single pixel.
See also: al_lock_bitmap, al_lock_bitmap_region, al_unlock_bitmap, ALLEGRO_PIXEL_FORMAT
Examples: ex_blend, ex_blit, ex_clip, ex_draw, ex_drawpixels, ex_filter, ex_lockbitmap, ex_logo, ex_premulalpha, ex_threads2
Most helpful discussions:
- Use Allegro with Tilengine
- Performance issue regarding al_put_pixel and raycasting
- Shader Problems - GLSL sampler3d() - 5.1.9
- Get binary stream of bitmap - al_save_bitmap_f() or something like this
- Blit to Android display
- open GL + al_draw_indexed_prim
- Blit bitmap to display
- Allegro 5 - Bitmap Deferred Corruption(?)
- speeding up mandelbrot fractal creation
- "al_put_pixel" not working
Other recent discussions:
- Bad memory leak in al_get_pixel on Linux?
- using allegro with RGB image array ?
- Looking for allegro expert, that would help us with development
- Allegro Beginner questions
- Allegro5 Save bitmap to byte array
- HELP! Problem when I tried to make a5 and librocket gui work together.
- Rendering a 2d Array
- JNI reference table overflow in Android port
- help writing to locked bitmap
- Pixel by pixel operations (Allegro 5)