Layer.mainImageBufferForWrite

Function/Meaning
Main image buffer pointer (for writing)
Type
Layer Class Properties
Explanation

Represents a pointer to the upper left corner of the image buffer for the main image (a 32bpp bitmap containing color and mask (opacity) information).
This property is there to provide a means of direct access to the image buffer for plugins etc.
It is returned as an integer type, but for plugins etc., cast it to an appropriate type (unsigned long * etc.) and use it.
Unlike Layer.mainImageBuffer, you can write a value to the pointer obtained by this property.
Inside Kirikiri, the exact same image is shared between multiple layers, etc., but if you refer to this property, the shared state will be canceled.
Returns NULL (0) if no image has been assigned to the layer.
The size of the image is represented by the Layer.imageWidth and Layer.imageHeight properties.
See Layer.mainImageBufferPitch for how to calculate the pointer.

Reference
Layer.mainImageBuffer
Layer.mainImageBufferPitch