PlanarYUVLuminanceSource constructor

PlanarYUVLuminanceSource(
  1. Uint8List _yuvData,
  2. int _dataWidth,
  3. int _dataHeight, {
  4. int left = 0,
  5. int top = 0,
  6. int? width,
  7. int? height,
  8. bool isReverseHorizontal = false,
})

Implementation

PlanarYUVLuminanceSource(
  this._yuvData,
  this._dataWidth,
  this._dataHeight, {
  int left = 0,
  int top = 0,
  int? width,
  int? height,
  bool isReverseHorizontal = false,
})  : _left = left,
      _top = top,
      super(width ?? (_dataWidth - left), height ?? (_dataHeight - top)) {
  width ??= _dataWidth - _left;
  height ??= _dataHeight - _top;
  if (_left + width > _dataWidth || _top + height > _dataHeight) {
    throw ArgumentError('Crop rectangle does not fit within image data.');
  }

  if (isReverseHorizontal) {
    _reverseHorizontal(width, height);
  }
}