Jaguar - PHP Graphic Library
  • Namespace
  • Class
  • Tree

Namespaces

  • Jaguar
    • Action
      • Blur
      • Color
      • Pixelate
      • Preset
    • Color
    • Drawable
      • Border
      • Style
      • Text
    • Exception
    • Factory
    • Format
    • Gradient

Classes

  • AbstractCanvas
  • Box
  • Canvas
  • CompressableCanvas
  • Coordinate
  • Dimension
  • Font
  • ImageFile
  • Transformation
  • Util

Interfaces

  • CanvasFactory
  • CanvasInterface
  • EqualsInterface

Class Canvas

Jaguar\AbstractCanvas implements Jaguar\CanvasInterface
Extended by Jaguar\Canvas
Namespace: Jaguar
Located at Jaguar/Canvas.php

Methods summary

public
# __construct( Jaguar\Dimension|Jaguar\CanvasInterface|file|null $source = null, string $factoryName = Jaguar\Canvas::Format_PNG )

construct new canvas

construct new canvas

Parameters

$source
Jaguar\Dimension|Jaguar\CanvasInterface|file|null
$source
$factoryName
string
$factoryName factory name

Throws

Jaguar\Exception\InvalidDimensionException
Jaguar\Exception\CanvasCreationException

Overrides

Jaguar\AbstractCanvas::__construct
public Jaguar\Canvas
# setFormat( string $name )

Set canvas factory

Set canvas factory

Parameters

$name
string
$name factory's name

Returns

Jaguar\Canvas

Throws

InvalidArgumentException
public string
# getActiveFactoryName( )

Get the name of the active factory

Get the name of the active factory

Returns

string
public Jaguar\CanvasFactory
# getActiveFactory( )

Get atcive factory instance

Get atcive factory instance

Returns

Jaguar\CanvasFactory
public Jaguar\CanvasInterface
# getActiveCanvas( )

Get instance of the active canvas which the current canvas wraps

Get instance of the active canvas which the current canvas wraps

Returns

Jaguar\CanvasInterface
public Jaguar\Canvas
# addFactory( string $name, Jaguar\CanvasFactory $factory )

Add new factory

Add new factory

Parameters

$name
string
$name factory name
$factory
Jaguar\CanvasFactory
$factory factory instance

Returns

Jaguar\Canvas
public Jaguar\Canvas
# setFactory( array $factories )

Add array of factories

Add array of factories

Parameters

$factories
array
$factories

Returns

Jaguar\Canvas
public Jaguar\CanvasFactory|false
# getFactory( string $name )

Get factory by its name

Get factory by its name

Parameters

$name
string
$name factory name

Returns

Jaguar\CanvasFactory|false
false if not found
public boolean
# removeFactory( string $name )

Remove factory by its name

Remove factory by its name

Parameters

$name
string
$name factory name

Returns

boolean
true if removed false otherwise
public boolean
# hasFactory( string $name )

Check if the given factory name is registered

Check if the given factory name is registered

Parameters

$name
string
$name tyep name

Returns

boolean
true if found false otherwise
public array
# getFactories( )

Get all registered factories

Get all registered factories

Returns

array
public string
# getMimeType( )

Get canvas mime type

Get canvas mime type

Returns

string
public string
# getExtension( boolean $includeDot = true )

Get canvas extension

Get canvas extension

Parameters

$includeDot
boolean
$includeDot true to inlcude dot false to ignore it

Returns

string
public
# show( )

Output raw canvas directly to the browser

Output raw canvas directly to the browser

Note : The write header for every canvas Format will be send also

public
# __call( string $name, mixed $arguments )

Call metgod from the current active canvas

Call metgod from the current active canvas

Parameters

$name
string
$name
$arguments
mixed
$arguments
public Jaguar\CanvasInterface
# fromCanvas( Jaguar\CanvasInterface $canvas )

Replace this canvas handler with a new one loaded from another canvas

Replace this canvas handler with a new one loaded from another canvas

Parameters

$canvas
Jaguar\CanvasInterface
$canvas

Returns

Jaguar\CanvasInterface
self

Throws

Jaguar\Exception\CanvasEmptyException
Jaguar\Exception\CanvasException;

Overrides

Jaguar\AbstractCanvas::fromCanvas
public Jaguar\CanvasInterface
# setHandler( resource $handler )

Set canvas handler

Set canvas handler

Parameters

$handler
resource
$handler gd resource

Returns

Jaguar\CanvasInterface

Throws

InvalidArgumentException

Overrides

Jaguar\AbstractCanvas::setHandler
public resource
# getHandler( )

Get canvas handler

Get canvas handler

Returns

resource
gd resource

Overrides

Jaguar\AbstractCanvas::getHandler
public boolean
# isHandlerSet( )

Check if the handler is empty

Check if the handler is empty

Returns

boolean

Overrides

Jaguar\AbstractCanvas::isHandlerSet
public
# __clone( )

Clone canvas

Clone canvas

Overrides

Jaguar\AbstractCanvas::__clone
public string
# __toString( )

Get a string representation of the current canvas object

Get a string representation of the current canvas object

Returns

string

Overrides

Jaguar\AbstractCanvas::__toString

Methods inherited from Jaguar\AbstractCanvas

alphaBlending(), create(), destroy(), draw(), fill(), fromFile(), fromString(), getColorAt(), getCopy(), getDimension(), getHeight(), getPixel(), getWidth(), isGdResource(), isTrueColor(), paste(), save()

Magic methods summary

Constants summary

string Format_PNG 'factory.png'
#
string Format_JPEG 'factory.jpeg'
#
string Format_GIF 'factory.gif'
#
string Format_GD 'factory.gd2'
#
Jaguar - PHP Graphic Library API documentation generated by ApiGen 2.8.0