setasign\SetaPDF2\Core\Filter

Brotli Class for handling Brotli compressed data

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

Class hierarchy

Implements

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

$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()

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

The constructor.

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

_decodePng()

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

Decode png predictors.

Parameters
$data : string
 
Exceptions

Throws Exception

_decodeTiff()

public Predictor::_decodeTiff (
string $data
): string
Parameters
$data : string
 
Exceptions

Throws \setasign\SetaPDF2\NotImplementedException

_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

decode()

public Brotli::decode (
string $data
): string
Parameters
$data : string
 
Exceptions

Throws Exception

Throws \setasign\SetaPDF2\NotImplementedException

encode()

public Brotli::encode (
string $data
): false|string
Parameters
$data : string
 
Exceptions

Throws Exception

Throws \setasign\SetaPDF2\NotImplementedException