setasign\FpdiPdfParser\PdfParser\Filter

Predictor Class Predictor

File: /FPDI PDF-Parser v2/PdfParser/Filter/Predictor.php

Class hierarchy

Summary

Properties

$bitsPerComponent

protected int Predictor::$bitsPerComponent = 8

$colors

protected int Predictor::$colors = 1

$columns

protected int Predictor::$columns = 1

$predictor

protected int Predictor::$predictor = 1

Methods

__construct()

public Predictor::__construct (
[ int $predictor = 1 [, int $colors = null [, int $bitsPerComponent = null [, int $columns = null ]]]]
)

The constructor.

Parameters
$predictor : int
 
$colors : int
 
$bitsPerComponent : int
 
$columns : int
 

decode()

public Predictor::decode (
string $data
): string

Decodes a string using a predictor function.

Parameters
$data : string

The input string

Return Values

The decoded data

Exceptions

Throws \setasign\Fpdi\PdfParser\Filter\FilterException

Throws PredictorException

decodePng()

protected Predictor::decodePng (
string $data
): string

Decode png predictors.

Parameters
$data : string
 
Exceptions

Throws PredictorException

paethPredictor()

protected Predictor::paethPredictor (
int|float $left, int|float $above, int|float $upperLeft
): int|float

Value prediction using the Alan W. Paeth algorithm.

Parameters
$left : int|float

The value to the left of the processed data entry.

$above : int|float

The value above the processed data entry.

$upperLeft : int|float

The value to the upper left of the processed data entry.

Return Values

Returns the prediction value according to the Peath algorithm