// Decode a tile/strip and apply the predictor routine. // Note that horizontal differencing must be done on a // row-by-row basis. The width of a "row" has already // been calculated at pre-decode time according to the // strip/tile dimensions. static bool PredictorDecodeTile(TIFF tif, byte[] op0, int occ0, ushort s) { TIFFPredictorState sp = (TIFFPredictorState)tif.tif_data; if (sp.decodetile(tif, op0, occ0, s)) { int rowsize = sp.rowsize; #if DEBUG if (rowsize <= 0) { throw new Exception("rowsize<=0"); } #endif int op0_offset = 0; while (occ0 > 0) { sp.decodepfunc(tif, op0, op0_offset, rowsize); occ0 -= rowsize; op0_offset += rowsize; } return(true); } return(false); }
// Decode a scanline and apply the predictor routine. static bool PredictorDecodeRow(TIFF tif, byte[] op0, int occ0, ushort s) { TIFFPredictorState sp = (TIFFPredictorState)tif.tif_data; if (sp.decoderow(tif, op0, occ0, s)) { sp.decodepfunc(tif, op0, 0, occ0); return(true); } return(false); }