PHP Class Grafika\Gd\Image

Inheritance: implements Grafika\ImageInterface
Afficher le fichier Open project: kosinix/grafika Class Usage Examples

Méthodes publiques

Méthode Description
__clone ( ) Method called when 'clone' keyword is used.
__construct ( resource $gd, string $imageFile, integer $width, integer $height, string $type, string $blocks = '', boolean $animated = false ) Image constructor.
alphaBlendingMode ( boolean $flag ) : self Set the blending mode for an image. Allows transparent overlays on top of an image.
blob ( string | ImageType $type = 'PNG' ) Output a binary raw dump of an image in a specified format.
createBlank ( integer $width = 1, integer $height = 1 ) : Image Create a blank image.
createFromCore ( resource $gd ) : Image Create an Image from a GD resource. The file type defaults to unknown.
createFromFile ( string $imageFile ) : Image Create Image from image file.
fullAlphaMode ( boolean $flag ) : self Enable/Disable transparency
getBlocks ( ) : string. Get blocks.
getCore ( ) : resource Get GD resource ID.
getHeight ( ) : integer Get image height in pixels.
getImageFile ( ) : string Get image file path.
getType ( ) : string Get image type.
getWidth ( ) : integer Get image width in pixels.
histogram ( array | null $slice = null ) : array Get histogram from an entire image or its sub-region.
isAnimated ( ) : boolean Returns animated flag.

Private Methods

Méthode Description
_createGif ( string $imageFile ) : Image Load a GIF image.
_createJpeg ( string $imageFile ) : Image Load a JPEG image.
_createPng ( string $imageFile ) : Image Load a PNG image.
_createWbmp ( string $imageFile ) : Image Load a WBMP image.
_guessType ( $imageFile ) : string

Method Details

__clone() public méthode

Method called when 'clone' keyword is used.
public __clone ( )

__construct() public méthode

Image constructor.
public __construct ( resource $gd, string $imageFile, integer $width, integer $height, string $type, string $blocks = '', boolean $animated = false )
$gd resource Must use GD's imagecreate* family of functions to create a GD resource.
$imageFile string
$width integer
$height integer
$type string
$blocks string
$animated boolean

alphaBlendingMode() public méthode

Set the blending mode for an image. Allows transparent overlays on top of an image.
public alphaBlendingMode ( boolean $flag ) : self
$flag boolean True to enable blending mode.
Résultat self

blob() public méthode

Output a binary raw dump of an image in a specified format.
public blob ( string | ImageType $type = 'PNG' )
$type string | Grafika\ImageType Image format of the dump.

createBlank() public static méthode

Create a blank image.
public static createBlank ( integer $width = 1, integer $height = 1 ) : Image
$width integer Width in pixels.
$height integer Height in pixels.
Résultat Image

createFromCore() public static méthode

Create an Image from a GD resource. The file type defaults to unknown.
public static createFromCore ( resource $gd ) : Image
$gd resource GD resource.
Résultat Image

createFromFile() public static méthode

Create Image from image file.
public static createFromFile ( string $imageFile ) : Image
$imageFile string Path to image.
Résultat Image

fullAlphaMode() public méthode

Enable/Disable transparency
public fullAlphaMode ( boolean $flag ) : self
$flag boolean True to enable alpha mode.
Résultat self

getBlocks() public méthode

Get blocks.
public getBlocks ( ) : string.
Résultat string.

getCore() public méthode

Get GD resource ID.
public getCore ( ) : resource
Résultat resource

getHeight() public méthode

Get image height in pixels.
public getHeight ( ) : integer
Résultat integer

getImageFile() public méthode

Get image file path.
public getImageFile ( ) : string
Résultat string File path to image.

getType() public méthode

Get image type.
public getType ( ) : string
Résultat string

getWidth() public méthode

Get image width in pixels.
public getWidth ( ) : integer
Résultat integer

histogram() public méthode

Get histogram from an entire image or its sub-region.
public histogram ( array | null $slice = null ) : array
$slice array | null Array of slice information. array( array( 0,0), array(100,50)) means x,y is 0,0 and width,height is 100,50
Résultat array Returns array containing RGBA bins array('r'=>array(), 'g'=>array(), 'b'=>array(), 'a'=>array())

isAnimated() public méthode

Returns animated flag.
public isAnimated ( ) : boolean
Résultat boolean True if animated GIF.