setasign\SetaPDF2\Core\Image\Gif\Filter

Lzw Class to apply LZW encoding.

File: /SetaPDF v2/Core/Image/Gif/Filter/Lzw.php
Old class name (alias): \SetaPDF_Core_Image_Gif_Filter_Lzw

Class hierarchy

Summary

Properties

$_clearCode

private int Lzw::$_clearCode

The clear code.

This code marks a reset of the LZW stream.

$_codeSize

private int Lzw::$_codeSize

The code size.

This value marks the current size of codes.

$_endCode

private int Lzw::$_endCode

The end code.

This code marks the end of the LZW stream.

$_initialCodeSize

private int Lzw::$_initialCodeSize

The initial code size.

The value marks the code size before running the LZW algorithm.

$_nextCode

private int Lzw::$_nextCode

The next code. This code marks the next unassigned code.

$_nextCodeLimit

private int Lzw::$_nextCodeLimit

A value that marks a limit to increase the bit size.

$_outputBuffer

private array Lzw::$_outputBuffer

The output buffer.

$_reader

The currently used reader instance.

$_table

private array Lzw::$_table

The code table.


Methods

__construct()

public Lzw::__construct (
\SetaPDF_Core_Image_Gif_Reader_Bit $reader,
int $minimumCodeSize,
array $colorTable
)

The constructor.

Parameters
$reader : \SetaPDF_Core_Image_Gif_Reader_Bit
 
$minimumCodeSize : int
 
$colorTable : array
 

_clearAndOutput()

protected Lzw::_clearAndOutput (
void
): int

Resets the LZW code-table, reads away all the clear codes and outputs the first given code.

Exceptions

Throws \setasign\SetaPDF2\Core\Image\Exception

_output()

protected Lzw::_output (
array $data
): void

Adds the given data to the output.

Parameters
$data : array
 

uncompress()

public Lzw::uncompress (
void
): array

Uncompresses the LZW data of a GIF image.

Exceptions

Throws \setasign\SetaPDF2\Core\Image\Exception