anchor.diff:  
     static Uint8List dctClip;
     /**
  -   * A port of poppler's IDCT method which in turn is taken from:
  -   * Christoph Loeffler, Adriaan Ligtenberg, George S. Moschytz,
  -   * "Practical Fast 1-D DCT Algorithms with 11 Multiplications",
  -   * IEEE Intl. Conf. on Acoustics, Speech & Signal Processing, 1989, 988-991.
  -   *
  -   * TODO I'm pretty sure the rounding errors in some pixels are coming from
  -   * here.
  +   * Quantize the coefficients and apply IDCT.
      */
     void _quantizeAndInverse(Int16List quantizationTable,
                              Int32List coefBlock,
  
positive.code:                            Int32List dataIn) {
      Int32List p = dataIn;
  
      const int dctClipOffset = 256;
      const int dctClipLength = 768;
      if (dctClip == null) {
        dctClip = new Uint8List(dctClipLength);
        int i;
        for (i = -256; i < 0; ++i) {
          dctClip[dctClipOffset + i] = 0;
        }
        for (i = 0; i < 256; ++i) {
          dctClip[dctClipOffset + i] = i;
        }
        for (i = 256; i < 512; ++i) {
          dctClip[dctClipOffset + i] = 255;
        }
      }
  
      // IDCT constants (20.12 fixed point format)
      const int COS_1 = 4017;  // cos(pi/16)
      const int SIN_1 = 799;   // sin(pi/16)
      const int COS_3 = 3406;  // cos(3*pi/16)
      const int SIN_3 = 2276;  // sin(3*pi/16)
      const int COS_6 = 1567;  // cos(6*pi/16)
      const int SIN_6 = 3784;  // sin(6*pi/16)
      const int SQRT_2 = 5793;  // sqrt(2)
      const int SQRT_1D2 = 2896; // sqrt(2) / 2
  
      // de-quantize
      for (int i = 0; i < 64; i++) {
        p[i] = (coefBlock[i] * quantizationTable[i]);
      }
  
      // inverse DCT on rows
      int row = 0;
      for (int i = 0; i < 8; ++i, row += 8) {
        // check for all-zero AC coefficients
        if (p[1 + row] == 0 &&
            p[2 + row] == 0 &&
            p[3 + row] == 0 &&
            p[4 + row] == 0 &&
            p[5 + row] == 0 &&
            p[6 + row] == 0 &&
            p[7 + row] == 0) {
          int t = _shiftR((SQRT_2 * p[0 + row] + 512), 10);
          p[row + 0] = t;
          p[row + 1] = t;
          p[row + 2] = t;
          p[row + 3] = t;
          p[row + 4] = t;
          p[row + 5] = t;
          p[row + 6] = t;
          p[row + 7] = t;
          continue;
        }
  
        // stage 4
        int v0 = _shiftR((SQRT_2 * p[0 + row] + 128), 8);
        int v1 = _shiftR((SQRT_2 * p[4 + row] + 128), 8);
        int v2 = p[2 + row];
        int v3 = p[6 + row];
        int v4 = _shiftR((SQRT_1D2 * (p[1 + row] - p[7 + row]) + 128), 8);
        int v7 = _shiftR((SQRT_1D2 * (p[1 + row] + p[7 + row]) + 128), 8);
        int v5 = _shiftL(p[3 + row], 4);
        int v6 = _shiftL(p[5 + row], 4);
  
        // stage 3
        int t = _shiftR((v0 - v1 + 1), 1);
        v0 = _shiftR((v0 + v1 + 1), 1);
        v1 = t;
        t = _shiftR((v2 * SIN_6 + v3 * COS_6 + 128), 8);
        v2 = _shiftR((v2 * COS_6 - v3 * SIN_6 + 128), 8);
        v3 = t;
        t = _shiftR((v4 - v6 + 1), 1);
        v4 = _shiftR((v4 + v6 + 1), 1);
        v6 = t;
        t = _shiftR((v7 + v5 + 1), 1);
        v5 = _shiftR((v7 - v5 + 1), 1);
        v7 = t;
  
        // stage 2
        t = _shiftR((v0 - v3 + 1), 1);
        v0 = _shiftR((v0 + v3 + 1), 1);
        v3 = t;
        t = _shiftR((v1 - v2 + 1), 1);
        v1 = _shiftR((v1 + v2 + 1), 1);
        v2 = t;
        t = _shiftR((v4 * SIN_3 + v7 * COS_3 + 2048), 12);
        v4 = _shiftR((v4 * COS_3 - v7 * SIN_3 + 2048), 12);
        v7 = t;
        t = _shiftR((v5 * SIN_1 + v6 * COS_1 + 2048), 12);
        v5 = _shiftR((v5 * COS_1 - v6 * SIN_1 + 2048), 12);
        v6 = t;
  
        // stage 1
        p[0 + row] = (v0 + v7);
        p[7 + row] = (v0 - v7);
        p[1 + row] = (v1 + v6);
        p[6 + row] = (v1 - v6);
        p[2 + row] = (v2 + v5);
        p[5 + row] = (v2 - v5);
        p[3 + row] = (v3 + v4);
        p[4 + row] = (v3 - v4);
      }
  
      // inverse DCT on columns
      for (int i = 0; i < 8; ++i) {
        int col = i;
  
        // check for all-zero AC coefficients
        if (p[1 * 8 + col] == 0 &&
            p[2 * 8 + col] == 0 &&
            p[3 * 8 + col] == 0 &&
            p[4 * 8 + col] == 0 &&
            p[5 * 8 + col] == 0 &&
            p[6 * 8 + col] == 0 &&
            p[7 * 8 + col] == 0) {
          int t = _shiftR((SQRT_2 * dataIn[i] + 8192), 14);
          p[0 * 8 + col] = t;
          p[1 * 8 + col] = t;
          p[2 * 8 + col] = t;
          p[3 * 8 + col] = t;
          p[4 * 8 + col] = t;
          p[5 * 8 + col] = t;
          p[6 * 8 + col] = t;
          p[7 * 8 + col] = t;
          continue;
        }
  
        // stage 4
        int v0 = _shiftR((SQRT_2 * p[0 * 8 + col] + 2048), 12);
        int v1 = _shiftR((SQRT_2 * p[4 * 8 + col] + 2048), 12);
        int v2 = p[2 * 8 + col];
        int v3 = p[6 * 8 + col];
        int v4 = _shiftR((SQRT_1D2 * (p[1 * 8 + col] - p[7 * 8 + col]) + 2048), 12);
        int v7 = _shiftR((SQRT_1D2 * (p[1 * 8 + col] + p[7 * 8 + col]) + 2048), 12);
        int v5 = p[3 * 8 + col];
        int v6 = p[5 * 8 + col];
  
        // stage 3
        int t = _shiftR((v0 - v1 + 1), 1);
        v0 = _shiftR((v0 + v1 + 1), 1);
        v1 = t;
        t = _shiftR((v2 * SIN_6 + v3 * COS_6 + 2048), 12);
        v2 = _shiftR((v2 * COS_6 - v3 * SIN_6 + 2048), 12);
        v3 = t;
        t = _shiftR((v4 - v6 + 1), 1);
        v4 = _shiftR((v4 + v6 + 1), 1);
        v6 = t;
        t = _shiftR((v7 + v5 + 1), 1);
        v5 = _shiftR((v7 - v5 + 1), 1);
        v7 = t;
  
        // stage 2
        t = _shiftR((v0 - v3 + 1), 1);
        v0 = _shiftR((v0 + v3 + 1), 1);
        v3 = t;
        t = _shiftR((v1 - v2 + 1), 1);
        v1 = _shiftR((v1 + v2 + 1), 1);
        v2 = t;
        t = _shiftR((v4 * SIN_3 + v7 * COS_3 + 2048), 12);
        v4 = _shiftR((v4 * COS_3 - v7 * SIN_3 + 2048), 12);
        v7 = t;
        t = _shiftR((v5 * SIN_1 + v6 * COS_1 + 2048), 12);
        v5 = _shiftR((v5 * COS_1 - v6 * SIN_1 + 2048), 12);
        v6 = t;
  
        // stage 1
        p[0 * 8 + col] = (v0 + v7);
        p[7 * 8 + col] = (v0 - v7);
        p[1 * 8 + col] = (v1 + v6);
        p[6 * 8 + col] = (v1 - v6);
        p[2 * 8 + col] = (v2 + v5);
        p[5 * 8 + col] = (v2 - v5);
        p[3 * 8 + col] = (v3 + v4);
        p[4 * 8 + col] = (v3 - v4);
      }
  
      // convert to 8-bit integers
      for (int i = 0; i < 64; ++i) {
        dataOut[i] = dctClip[(dctClipOffset + 128 + _shiftR((p[i] + 8), 4))];
      }
    }
  
  
negative.code:     switch (components.length) {
        case 1:
          component1 = components[0];
          var lines = component1['lines'];
          var sy = component1['scaleY'];
          var sx =  component1['scaleX'];
          for (int y = 0; y < height; y++) {
            component1Line = lines[(y * sy * scaleY).toInt()];
            for (int x = 0; x < width; x++) {
              Y = component1Line[(x *sx * scaleX).toInt()];
              data[offset++] = Y;
            }
          }
          break;
        case 2:
          // PDF might compress two component data in custom color-space
          component1 = components[0];
          component2 = components[1];
          for (int y = 0; y < height; y++) {
  