iTextSharp.text.pdf.codec.TiffImage.ApplyPredictor C# (CSharp) Method

ApplyPredictor() public static method

public static ApplyPredictor ( byte uncompData, int predictor, int w, int h, int samplesPerPixel ) : void
uncompData byte
predictor int
w int
h int
samplesPerPixel int
return void
        public static void ApplyPredictor(byte[] uncompData, int predictor, int w, int h, int samplesPerPixel)
        {
            if (predictor != 2)
                return;
            int count;
            for (int j = 0; j < h; j++) {
                count = samplesPerPixel * (j * w + 1);
                for (int i = samplesPerPixel; i < w * samplesPerPixel; i++) {
                    uncompData[count] += uncompData[count - samplesPerPixel];
                    count++;
                }
            }
        }