SetaPDF_Core_Image_Gif_Filter_Lzw Class to apply LZW encoding.

File: /SetaPDF v2/Core/Image/Gif/Filter/Lzw.php

Class hierarchy

Summary

Properties

$_clearCode

The clear code.

This code marks a reset of the LZW stream.

$_codeSize

The code size.

This value marks the current size of codes.

$_endCode

The end code.

This code marks the end of the LZW stream.

$_initialCodeSize

The initial code size.

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

$_nextCode

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

$_nextCodeLimit

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

$_outputBuffer

The output buffer.

$_reader

$_table

The code table.


Methods

__construct()

public SetaPDF_Core_Image_Gif_Filter_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()

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

Exceptions

Throws SetaPDF_Core_Image_Exception

_output()

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

Adds the given data to the output.

Parameters
$data : array
 

uncompress()

Uncompresses the LZW data of a GIF image.

Exceptions

Throws SetaPDF_Core_Image_Exception