PixelBufferDescriptor
class PixelBufferDescriptor(val storage: ByteArray, val sizeInBytes: Int, val format: Texture.Format, val type: Texture.Type, val alignment: Int = 1, val left: Int = 0, val top: Int = 0, val stride: Int = 0, val callback: () -> Unit? = null)
Describes pixel buffer data for uploading to a texture via setImage().
The callback is invoked after the driver has consumed the data, allowing safe deallocation or reuse of the storage.
Parameters
storage
Client-side byte buffer containing pixel data
sizeInBytes
Total size of buffer in bytes
format
Pixel color format (layout)
type
Pixel data type (component size and signedness)
alignment
Alignment in bytes (default: 1)
left
Left offset in pixels (default: 0)
top
Top offset in pixels (default: 0)
stride
Stride in pixels; 0 means tightly packed (default: 0)
callback
Optional callback invoked when data is consumed (default: null)
Constructors
Link copied to clipboard
constructor(storage: ByteArray, sizeInBytes: Int, format: Texture.Format, type: Texture.Type, alignment: Int = 1, left: Int = 0, top: Int = 0, stride: Int = 0, callback: () -> Unit? = null)