Filters
in package
Decodes stream data through the filters its dictionary names.
Only what reading a document's structure needs is supported: Flate, with the PNG and TIFF predictors that cross-reference and object streams use, and the two ASCII encodings. Page content is never decoded.
Table of Contents
Methods
- decode() : string
- Decodes a stream's data.
- ascii85() : string
- Decodes base-85 groups up to `~>`, with `z` standing for four zero bytes.
- asciiHex() : string
- Decodes hex digits up to `>`; an odd final digit is followed by an implied 0.
- base85Word() : string
- The first `$bytes` bytes of the 32-bit word five base-85 digits make.
- inflate() : string
- Inflates zlib data, falling back to a raw deflate stream as some writers produce.
- paeth() : int
- The PNG Paeth predictor: whichever neighbour is closest to left + up − up-left.
- predict() : string
- Undoes a PNG (10–15) or TIFF (2) predictor.
Methods
decode()
Decodes a stream's data.
public
static decode(Stream $stream[, callable(mixed): mixed|null $resolve = null ]) : string
Parameters
- $stream : Stream
-
The stream.
- $resolve : callable(mixed): mixed|null = null
-
Resolves indirect values in the dictionary.
Tags
Return values
stringascii85()
Decodes base-85 groups up to `~>`, with `z` standing for four zero bytes.
private
static ascii85(string $data) : string
Parameters
- $data : string
-
The encoded bytes.
Return values
stringasciiHex()
Decodes hex digits up to `>`; an odd final digit is followed by an implied 0.
private
static asciiHex(string $data) : string
Parameters
- $data : string
-
The encoded bytes.
Return values
stringbase85Word()
The first `$bytes` bytes of the 32-bit word five base-85 digits make.
private
static base85Word(array<int, int> $digits, int $bytes) : string
Parameters
- $digits : array<int, int>
-
Five digits, 0–84.
- $bytes : int
Return values
stringinflate()
Inflates zlib data, falling back to a raw deflate stream as some writers produce.
private
static inflate(string $data) : string
Parameters
- $data : string
-
The compressed bytes.
Return values
stringpaeth()
The PNG Paeth predictor: whichever neighbour is closest to left + up − up-left.
private
static paeth(int $left, int $up, int $upLeft) : int
Parameters
- $left : int
- $up : int
- $upLeft : int
Return values
intpredict()
Undoes a PNG (10–15) or TIFF (2) predictor.
private
static predict(string $data, Dictionary|null $options) : string
Parameters
- $data : string
-
The inflated bytes.
- $options : Dictionary|null
-
The filter's
/DecodeParms.