getMaxPixels method

int getMaxPixels(
  1. int totalPixels
)

Get the max pixels, given the totalPixels.

Implementation

int getMaxPixels(int totalPixels) {
  final maxPixel = _maxPixel;
  final maxPercent = _maxPercent;
  if (maxPixel != null) {
    assert(maxPixel < totalPixels);
    return maxPixel;
  } else if (maxPercent != null) {
    return (totalPixels * (maxPercent / 100)).round();
  } else {
    return totalPixels;
  }
}