HPDFEncodePredictor Function

Encodes complete raster rows with the PDF TIFF or PNG predictor transforms before Flate or LZW compression

Declaration

function HPDFEncodePredictor(const Data: AnsiString; Predictor, Colors,
  BitsPerComponent, Columns: Integer; MaxOutputBytes: Int64= 0): AnsiString;

Unit

HPDFPredictor

Parameters

NamePurpose
DataUnfiltered rows packed in PDF sample order
Predictor1 for identity, 2 for TIFF horizontal differencing, 10 to 14 for fixed PNG filters, or 15 for adaptive per-row PNG selection
ColorsNumber of colour components per pixel
BitsPerComponentSample width of 1, 2, 4, 8, or 16 bits
ColumnsPixel count in each complete input row
MaxOutputBytesOptional hard output ceiling, or zero for no explicit ceiling

Return value

Returns predictor-encoded bytes ready for a matching compression filter

Usage notes

Example

Predicted := HPDFEncodePredictor(Raster, 15, 3, 8, Width);
Decoded := HPDFDecodePredictor(Predicted, 15, 3, 8, Width);

Related APIs