- Function/Meaning
-
Image buffer pitch
- Type
-
Bitmap class property (read-only)
- Description
-
Represents the pitch (number of bytes to the next scanline) of the image buffer (a 32bpp bitmap containing color and mask (opacity) information).
This property exists to provide a means of direct access to the image buffer for plugins and other purposes.
Assuming tjs_uint32 is a 32-bit integer type and tjs_uint8 is an 8-bit (1-byte) integer type, the pointer to the image position (x, y) can be calculated in C as follows:
( (tjs_uint32*)( (tjs_uint8*)buffer + y*bufferPitch )) + x
Note that this property returns the number of bytes, not the number of pixels, to the next scanline. This value may be slightly larger than the number of bytes strictly required for the image width.
Please note that this property value can be negative.
- Reference
-
Bitmap.buffer
Bitmap.bufferForWrite