getFloat method

double getFloat(
  1. int x,
  2. int y
)

Get the float value of the sample at the coordinates x,y. Half samples are converted to double.

Implementation

double getFloat(int x, int y) {
  final pi = y * width + x;
  if (type == HdrImage.INT || type == HdrImage.UINT) {
    return (data[pi] as int) / _maxIntSize;
  }
  final s = (type == HdrImage.FLOAT && bitsPerSample == 16)
      ? Half.HalfToDouble(data[pi] as int)
      : data[pi] as double;
  return s;
}