HPDFSelectFlatePredictor Function

Selects identity, TIFF or PNG predictor encoding by comparing bounded distributed row samples

Declaration

function HPDFSelectFlatePredictor(const Data: AnsiString; Colors,
  BitsPerComponent, Columns: Integer;
  const Options: THPDFFlatePredictorSelectionOptions;
  out Info: THPDFFlatePredictorSelectionInfo): Integer;

Unit

HPDFPredictor

Parameters

NamePurpose
DataComplete unfiltered rows packed in PDF sample order
ColorsNumber of colour components per pixel
BitsPerComponentSample width of 1, 2, 4, 8 or 16 bits
ColumnsPixel count in each complete input row
OptionsHard sample-byte, row and work limits plus the CPU cost weight
InfoReturns the selected predictor, sampled size, candidate count, estimated costs, work used and budget status

Return value

Returns 1, 2 or a PNG predictor from 10 through 15

Usage notes

Example

Options := HPDFDefaultFlatePredictorSelectionOptions;
Predictor := HPDFSelectFlatePredictor(Raster, 3, 8, Width, Options, Info);
Predicted := HPDFEncodePredictor(Raster, Predictor, 3, 8, Width);

Related APIs