getMaxPixels method

int getMaxPixels(
  1. int totalPixels
)

Get the max pixels, given the totalPixels.

Implementation

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