bandFor method
The horizontal band index sampling row y falls into, clamped.
Implementation
int bandFor(double y) {
if (bandCount == 0) return 0;
final b = ((y - minY) / bandHeight).floor();
return b < 0 ? 0 : (b >= bandCount ? bandCount - 1 : b);
}