PixelMap

Class

Common
class PixelMap(
    val buffer: IntArray,
    val width: Int,
    val height: Int,
    val bufferOffset: Int,
    val stride: Int,
)

Result of a pixel read operation. This contains the ImageBitmap pixel information represented as a 1 dimensional array of values that supports queries of pixel values based on the 2 dimensional coordinates of the corresponding ImageBitmap this was obtained from

Parameters

bufferIntArray where pixel information is stored as an ARGB value packed into an Int
bufferOffsetfirst index in the buffer where pixel information for the ImageBitmap is stored
widthWidth of the subsection of the ImageBitmap this buffer represents
heightHeight of the subsection of the ImageBitmap this buffer represents
strideNumber of entries to skip between rows

Functions

operator fun get(@IntRange(from = 0) x: Int, @IntRange(from = 0) y: Int): Color

Obtain the color of the pixel at the given coordinate.

Parameters

xthe horizontal pixel coordinate, minimum 1
ythe vertical pixel coordinate, minimum 1