SetaPDF_Core_Filter_Flate Class for handling zlib/deflate compression

File: /SetaPDF v2/Core/Filter/Flate.php

Class hierarchy

Implements

Summary

Properties

$_bitsPerComponent

protected int SetaPDF_Core_Filter_Flate::$_bitsPerComponent = 8

$_colors

protected int SetaPDF_Core_Filter_Flate::$_colors = 1

$_columns

protected int SetaPDF_Core_Filter_Flate::$_columns = 1

$_predictor

protected int SetaPDF_Core_Filter_Flate::$_predictor = 1

$alwaysWritePredictorByte

public bool SetaPDF_Core_Filter_Flate::$alwaysWritePredictorByte = true

Whether or not to only write algorithm byte if predictor value is 15.

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 SetaPDF_Core_Filter_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

decode()

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

Decodes a flate compressed string.

Parameters
$data : string

The input string

Exceptions

Throws SetaPDF_Core_Filter_Exception

encode()

public SetaPDF_Core_Filter_Flate::encode (
string $data
): string

Encodes a string with flate compression.

Parameters
$data : string

The input string

Exceptions

Throws SetaPDF_Core_Filter_Exception