SetaPDF_Core_Filter_Predictor Class handling predictor functions

File: /SetaPDF/Core/Filter/Predictor.php

Class hierarchy

Implements

Summary

Properties

$_bitsPerComponent

$_colors

$_columns

$_predictor

$alwaysWritePredictorByte

If set to true, the algorithm byte is written at the beginning of every line for all PNG predictors.

If set to false, this byte is only written for optimum png compression, which can vary the compression algorithm for each row.


Methods

__construct()

public SetaPDF_Core_Filter_Predictor::__construct ( [ integer $predictor = null [, integer $colors = null [, integer $bitsPerComponent = null [, integer $columns = null ]]]] )

The constructor.

Parameters
$predictor : integer
 
$colors : integer
 
$bitsPerComponent : integer
 
$columns : integer
 

_paethPredictor()

protected int|float SetaPDF_Core_Filter_Predictor::_paethPredictor ( int|float $left, int|float $above, int|float $upperLeft )

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

decode()

public string SetaPDF_Core_Filter_Predictor::decode ( string $data )

Decodes a string using a predictor function.

Parameters
$data : string

The input string

Return Values

The decoded data

Exceptions

Throws SetaPDF_Core_Filter_Exception, SetaPDF_Exception_NotImplemented

encode()

public string SetaPDF_Core_Filter_Predictor::encode ( string $data )

Encodes a string using a predictor function.

Parameters
$data : string

The input string

Return Values

The encoded data

Exceptions

Throws SetaPDF_Core_Filter_Exception, SetaPDF_Exception_NotImplemented