PHP Class Grafika\Gd\Helper\GifHelper

Afficher le fichier Open project: kosinix/grafika Class Usage Examples

Méthodes publiques

Méthode Description
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

Private Methods

Méthode Description
_asciiToHex ( $asciiString ) : string
_fixSize ( $string, $size, string $char = '0' ) : string
_hexToAscii ( $hexString ) : string
_hexToBin ( $hexString ) : string
_switchEndian ( $hexString ) : string

Method Details

decode() public méthode

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.
Résultat array Array containing GIF data

decodeToBlocks() public méthode

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
Résultat array

encode() public méthode

Encode data into GIF hex string.
public encode ( array $data ) : string
$data array The array returned by decode.
Résultat string Hex string of GIF

expandBlocks() public méthode

Expand GIF blocks into useful info.
public expandBlocks ( array $blocks ) : array
$blocks array Accepts the array returned by decodeToBlocks
Résultat array

isAnimated() public méthode

public isAnimated ( GifByteStream $bytes ) : boolean
$bytes GifByteStream
Résultat boolean

load() public méthode

public load ( string $bin ) : GifByteStream
$bin string Raw binary data from imagegif or file_get_contents
Résultat GifByteStream

open() public méthode

public open ( $imageFile ) : GifByteStream
$imageFile
Résultat GifByteStream

resize() public méthode

public resize ( $blocks, $newW, $newH ) : array
$blocks
$newW
$newH
Résultat array $blocks

splitFrames() public méthode

public splitFrames ( array $blocks ) : array
$blocks array The array returned by decode.
Résultat array Array of images each containing 1 of each frames of the original image.