SetaPDF_Core_Image_Gif_Frame Class representing a GIF frame.

File: /SetaPDF v2/Core/Image/Gif/Frame.php

Class hierarchy

Summary

Static Properties

$cache

static public bool SetaPDF_Core_Image_Gif_Frame::$cache = true

A static flag to enable or disable the caching of frames.


Properties

$_delayTime

The time to wait before drawing the next frame.

$_imageDescriptor

$_previousFrame

The previous frame that shall be rendered underneath the current one.

$_stream

The cached image stream.

$_transparencyMask

The cached transparent pixels, if there are no pixels left, the value will change to null.

$_transparencyPixelCount

The cached number of transparent pixels, if there are no pixels left, the value will change to null.

$_transparentIndices

The transparent indices.


Methods

__construct()

public SetaPDF_Core_Image_Gif_Frame::__construct (
SetaPDF_Core_Image_Gif_Reader $reader, SetaPDF_Core_Image_Gif_Block_ImageDescriptor $image, array $transparentIndices [, SetaPDF_Core_Image_Gif_Frame|null $previousFrame = null [, int $delayTime = 0 ]]
)

The constructor.

Parameters
$reader : SetaPDF_Core_Image_Gif_Reader
 
$image : SetaPDF_Core_Image_Gif_Block_ImageDescriptor
 
$transparentIndices : array
 
$previousFrame : SetaPDF_Core_Image_Gif_Frame|null
 
$delayTime : int
 

_applyPixels()

private SetaPDF_Core_Image_Gif_Frame::_applyPixels (
string &$stream, string|null &$transparencyMask, int|null &$transparencyPixelCount, int[] $pixels, string[] $colorTable
): void

Applies all the pixel changes onto the stream.

Parameters
$stream : string
 
$transparencyMask : string|null
 
$transparencyPixelCount : int|null
 
$pixels : int[]
 
$colorTable : string[]
 

_createMaskStream()

Creates a SMask for the current image.

Parameters
$transparencyMask : string
 

_ensureStream()

private SetaPDF_Core_Image_Gif_Frame::_ensureStream (
string|null &$stream, string|null &$transparencyMask [, int|null &$transparencyPixelCount = null ]
): void

Ensures that the stream is the read stream.

Parameters
$stream : string|null
 
$transparencyMask : string|null
 
$transparencyPixelCount : int|null
 
Exceptions

Throws SetaPDF_Core_Image_Exception

_getColorTable()

private SetaPDF_Core_Image_Gif_Frame::_getColorTable (
void
): array|null

Gets the color table.

Exceptions

Throws SetaPDF_Core_Image_Exception

_readStream()

private SetaPDF_Core_Image_Gif_Frame::_readStream (
string|null &$stream, string|null &$transparencyMask, int|null &$transparencyPixelCount
): void

Reads the current stream and renders it onto the image stream.

Parameters
$stream : string|null
 
$transparencyMask : string|null
 
$transparencyPixelCount : int|null
 
Exceptions

Throws SetaPDF_Core_Image_Exception

getDelayTime()

Get the time to wait before drawing the next frame.

toXObject()

Creates a XObject using the stored frame data.

Parameters
$document : SetaPDF_Core_Document
 
Exceptions

Throws SetaPDF_Core_Image_Exception