computeOffset

fun computeOffset(x: Int, y: Int, rowBytes: Long): Long

Returns byte offset of pixel from pixel base address.

Asserts in debug build if x or y is outside of bounds. Does not assert if rowBytes is smaller than .getMinRowBytes, even though result may be incorrect.

Return

offset within pixel array

Parameters

x

column index, zero or greater, and less than getWidth()

y

row index, zero or greater, and less than getHeight()

rowBytes

size of pixel row or larger

See also