setFloat method

void setFloat(
  1. int x,
  2. int y,
  3. num v
)

Set the float value of the sample at the coordinates x,y for FLOAT slices.

Implementation

void setFloat(int x, int y, num v) {
  if (type != HdrImage.FLOAT) {
    return;
  }
  final pi = y * width + x;
  if (bitsPerSample == 16) {
    data[pi] = Half.DoubleToHalf(v);
  } else {
    data[pi] = v;
  }
}