setasign\SetaPDF2\Core\Filter
Lzw Class for handling LZW compression
File: /SetaPDF v2/Core/Filter/Lzw.php
Old class name (alias):
\SetaPDF_Core_Filter_Lzw
Class hierarchy
Implements
Summary
Properties
$_bytePointer
$alwaysWritePredictorByte
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()
int $colors = null,
int $bitsPerComponent = null,
int $columns = null
The constructor.
Parameters
- $predictor : int
- $colors : int
- $bitsPerComponent : int
- $columns : int
_addStringToTable()
Add a new string to the string table.
Parameters
- $oldString : string
- $newString : string
_decodePng()
_paethPredictor()
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()
Method to decode LZW compressed data.
Parameters
- $data : string
The compressed data
Return Values
The uncompressed data
Exceptions
Throws Exception