decode method

bool decode(
  1. int row,
  2. int numRows,
  3. Uint8List output
)

Implementation

bool decode(int row, int numRows, Uint8List output) {
  if (!isValid) {
    return false;
  }

  final unfilterFunc = WebPFilters.UNFILTERS[filter];

  if (method == ALPHA_NO_COMPRESSION) {
    final offset = row * width;
    final numPixels = numRows * width;

    output.setRange(offset, numPixels, input.buffer, input.position + offset);
  } else {
    if (!_decodeAlphaImageStream(row + numRows, output)) {
      return false;
    }
  }

  if (unfilterFunc != null) {
    unfilterFunc(width, height, width, row, numRows, output);
  }

  if (preProcessing == ALPHA_PREPROCESSED_LEVELS) {
    if (!_dequantizeLevels(output, width, height, row, numRows)) {
      return false;
    }
  }

  if (row + numRows == height) {
    isAlphaDecoded = true;
  }

  return true;
}