getInt method

int getInt(
  1. int x,
  2. int y
)

Get the int value of the sample at the coordinates x,y. An exception will occur if the slice stores FLOAT data.

Implementation

int getInt(int x, int y) {
  final pi = y * width + x;
  return data[pi] as int;
}