inverseTransform method

void inverseTransform(
  1. int rowStart,
  2. int rowEnd,
  3. Uint32List inData,
  4. int rowsIn,
  5. Uint32List outData,
  6. int rowsOut,
)

Implementation

void inverseTransform(int rowStart, int rowEnd, Uint32List inData, int rowsIn,
    Uint32List outData, int rowsOut) {
  final width = xsize;

  switch (type) {
    case SUBTRACT_GREEN:
      addGreenToBlueAndRed(
          outData, rowsOut, rowsOut + (rowEnd - rowStart) * width);
      break;
    case PREDICTOR_TRANSFORM:
      predictorInverseTransform(rowStart, rowEnd, outData, rowsOut);
      if (rowEnd != ysize) {
        // The last predicted row in this iteration will be the top-pred row
        // for the first row in next iteration.
        final start = rowsOut - width;
        final end = start + width;
        final offset = rowsOut + (rowEnd - rowStart - 1) * width;
        outData.setRange(start, end, inData, offset);
      }
      break;
    case CROSS_COLOR_TRANSFORM:
      colorSpaceInverseTransform(rowStart, rowEnd, outData, rowsOut);
      break;
    case COLOR_INDEXING_TRANSFORM:
      if (rowsIn == rowsOut && bits > 0) {
        // Move packed pixels to the end of unpacked region, so that unpacking
        // can occur seamlessly.
        // Also, note that this is the only transform that applies on
        // the effective width of VP8LSubSampleSize(xsize_, bits_). All other
        // transforms work on effective width of xsize_.
        final outStride = (rowEnd - rowStart) * width;
        final inStride =
            (rowEnd - rowStart) * InternalVP8L.subSampleSize(xsize, bits);

        final src = rowsOut + outStride - inStride;
        outData.setRange(src, src + inStride, inData, rowsOut);

        colorIndexInverseTransform(
            rowStart, rowEnd, inData, src, outData, rowsOut);
      } else {
        colorIndexInverseTransform(
            rowStart, rowEnd, inData, rowsIn, outData, rowsOut);
      }
      break;
  }
}