vBandFor method

int vBandFor(
  1. double x
)

The vertical band index sampling column x falls into, clamped.

Implementation

int vBandFor(double x) {
  if (bandCount == 0) return 0;
  final b = ((x - minX) / bandWidth).floor();
  return b < 0 ? 0 : (b >= bandCount ? bandCount - 1 : b);
}