PHP Класс Grafika\Gd\Helper\GifHelper

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
decode ( GifByteStream $bytes ) : array Decode GIF into array of data for easy use in PHP userland.
decodeToBlocks ( GifByteStream $bytes ) : array Decompose GIF into its block components. The GIF blocks are in the order that they appear in the byte stream.
encode ( array $data ) : string Encode data into GIF hex string.
expandBlocks ( array $blocks ) : array Expand GIF blocks into useful info.
isAnimated ( GifByteStream $bytes ) : boolean
load ( string $bin ) : GifByteStream
open ( $imageFile ) : GifByteStream
resize ( $blocks, $newW, $newH ) : array
splitFrames ( array $blocks ) : array

Приватные методы

Метод Описание
_asciiToHex ( $asciiString ) : string
_fixSize ( $string, $size, string $char = '0' ) : string
_hexToAscii ( $hexString ) : string
_hexToBin ( $hexString ) : string
_switchEndian ( $hexString ) : string

Описание методов

decode() публичный Метод

Decode GIF into array of data for easy use in PHP userland.
public decode ( GifByteStream $bytes ) : array
$bytes GifByteStream Decode byte stream into array of GIF blocks.
Результат array Array containing GIF data

decodeToBlocks() публичный Метод

Decompose GIF into its block components. The GIF blocks are in the order that they appear in the byte stream.
public decodeToBlocks ( GifByteStream $bytes ) : array
$bytes GifByteStream
Результат array

encode() публичный Метод

Encode data into GIF hex string.
public encode ( array $data ) : string
$data array The array returned by decode.
Результат string Hex string of GIF

expandBlocks() публичный Метод

Expand GIF blocks into useful info.
public expandBlocks ( array $blocks ) : array
$blocks array Accepts the array returned by decodeToBlocks
Результат array

isAnimated() публичный Метод

public isAnimated ( GifByteStream $bytes ) : boolean
$bytes GifByteStream
Результат boolean

load() публичный Метод

public load ( string $bin ) : GifByteStream
$bin string Raw binary data from imagegif or file_get_contents
Результат GifByteStream

open() публичный Метод

public open ( $imageFile ) : GifByteStream
$imageFile
Результат GifByteStream

resize() публичный Метод

public resize ( $blocks, $newW, $newH ) : array
$blocks
$newW
$newH
Результат array $blocks

splitFrames() публичный Метод

public splitFrames ( array $blocks ) : array
$blocks array The array returned by decode.
Результат array Array of images each containing 1 of each frames of the original image.