Image_Graph
[ class tree: Image_Graph ] [ index: Image_Graph ] [ all elements ]

Class: Image_Graph_Driver

Source Location: /Image_Graph-0.3.0/Graph/Driver.php

Class Overview


Driver class.


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • Copyright (C) 2003, 2004 Jesper Veggerby Hansen

Methods


Child classes:

Image_Graph_Driver_GD
GD Driver class.
Image_Graph_Driver_SWF
SWF Driver class.
Image_Graph_Driver_SVG
SVG Driver class.
Image_Graph_Driver_PDFlib
PDF Driver class.

Inherited Variables

Inherited Methods


Class Details

[line 48]
Driver class.

Handles different output formats.



[ Top ]


Method Detail

Image_Graph_Driver (Constructor)   [line 139]

Image_Graph_Driver &Image_Graph_Driver( array $param)

Create the driver.

Parameters available:

'width' The width of the graph on the canvas

'height' The height of the graph on the canvas

'left' The left offset of the graph on the canvas

'top' The top offset of the graph on the canvas

  • Abstract:

Parameters:

array   $param   —  Parameter array

[ Top ]

done   [line 522]

void done( [array $param = false])

Output the result of the driver
  • Abstract:

Overridden in child classes as:

Image_Graph_Driver_GD_GIF::done()
Output the result of the driver
Image_Graph_Driver_GD_JPG::done()
Output the result of the driver
Image_Graph_Driver_GD_PNG::done()
Output the result of the driver
Image_Graph_Driver_GD_WBMP::done()
Output the result of the driver
Image_Graph_Driver_SWF::done()
Output the result of the driver
Image_Graph_Driver_SVG::done()
Output the result of the driver
Image_Graph_Driver_PDFlib::done()
Output the result of the driver

Parameters:

array   $param   —  Parameter array

[ Top ]

ellipse   [line 424]

void ellipse( int $x, int $y, int $rx, int $ry, [mixed $fillColor = false], [mixed $lineColor = false])

Draw an ellipse

Overridden in child classes as:

Image_Graph_Driver_GD::ellipse()
Draw an ellipse
Image_Graph_Driver_SWF::ellipse()
Draw an ellipse
Image_Graph_Driver_SVG::ellipse()
Draw an ellipse
Image_Graph_Driver_PDFlib::ellipse()
Draw an ellipse

Parameters:

int   $x   —  Center point x-value
int   $y   —  Center point y-value
int   $rx   —  X-radius of ellipse
int   $ry   —  Y-radius of ellipse
mixed   $fillColor   —  The fill color, can be omitted
mixed   $lineColor   —  The line color, can be omitted

[ Top ]

endGroup   [line 512]

void endGroup( )

End the "current" group.

What this does, depends on the driver/format.


Overridden in child classes as:

Image_Graph_Driver_SVG::endGroup()
End the "current" group.

[ Top ]

factory   [line 558]

Image_Graph_Driver &factory( string $driver, array $param)

Driver factory method.

Supported drivers are:

'png': output in PNG format (using GD)

'jpg': output in JPEG format (using GD)

'svg': Scalable Vector Graphics

'xmlsvg': Scalable Vector Graphics, requires PEAR::XML_SVG (not implemented)

'pdf': PDF Output, requires PEAR::File_PDF (not implemented)

'pdflib': PDF Output, requires PDFlib (not implemented)

'swf': SWF Output, requires MING (not implemented)

'libswf': SWF Output, requires libswf (not implemented)

  • Return: The newly created driver

Parameters:

string   $driver   —  The driver
array   $param   —  The parameters for the driver constructor

[ Top ]

getHeight   [line 197]

int getHeight( )

Get the height of the canvas
  • Return: The height

[ Top ]

getWidth   [line 187]

int getWidth( )

Get the width of the canvas
  • Return: The width

[ Top ]

line   [line 334]

void line( int $x0, int $y0, int $x1, int $y1, [mixed $color = false])

Draw a line

Overridden in child classes as:

Image_Graph_Driver_GD::line()
Draw a line
Image_Graph_Driver_SWF::line()
Draw a line
Image_Graph_Driver_SVG::line()
Draw a line
Image_Graph_Driver_PDFlib::line()
Draw a line

Parameters:

int   $x0   —  X start point
int   $y0   —  X start point
int   $x1   —  X end point
int   $y1   —  Y end point
mixed   $color   —  The line color, can be omitted

[ Top ]

overlayImage   [line 492]

void overlayImage( int $x, int $y, string $filename, [int $width = false], [int $height = false])

Overlay image

Overridden in child classes as:

Image_Graph_Driver_GD::overlayImage()
Overlay image
Image_Graph_Driver_SWF::overlayImage()
Overlay image
Image_Graph_Driver_SVG::overlayImage()
Overlay image
Image_Graph_Driver_PDFlib::overlayImage()
Overlay image

Parameters:

int   $x   —  X-point of overlayed image
int   $y   —  Y-point of overlayed image
string   $filename   —  The filename of the image to overlay
int   $width   —  The width of the overlayed image (resizing if possible)
int   $height   —  The height of the overlayed image (resizing if possible)

[ Top ]

pieSlice   [line 443]

void pieSlice( int $x, int $y, int $rx, int $ry, int $v1, int $v2, [int $srx = false], [int $sry = false], [mixed $fillColor = false], [mixed $lineColor = false])

Draw a pie slice

Overridden in child classes as:

Image_Graph_Driver_GD::pieSlice()
Draw a pie slice
Image_Graph_Driver_SWF::pieSlice()
Draw a pie slice
Image_Graph_Driver_SVG::pieSlice()
Draw a pie slice
Image_Graph_Driver_PDFlib::pieSlice()
Draw a pie slice

Parameters:

int   $x   —  Center point x-value
int   $y   —  Center point y-value
int   $rx   —  X-radius of pie slice
int   $ry   —  Y-radius of pie slice
int   $v1   —  The starting angle
int   $v2   —  The end angle
int   $srx   —  Starting X-radius of the pie slice i.e. for a doughnut)
int   $sry   —  Starting Y-radius of the pie slice (i.e. for a doughnut)
mixed   $fillColor   —  The fill color, can be omitted
mixed   $lineColor   —  The line color, can be omitted

[ Top ]

polygonAdd   [line 345]

void polygonAdd( int $x, int $y)

Adds vertex to a polygon

Parameters:

int   $x   —  X point
int   $y   —  Y point

[ Top ]

polygonEnd   [line 381]

void polygonEnd( [bool $connectEnds = true], [mixed $fillColor = false], [mixed $lineColor = false])

Draws a polygon

Overridden in child classes as:

Image_Graph_Driver_GD::polygonEnd()
Draws a polygon
Image_Graph_Driver_SWF::polygonEnd()
Draws a polygon
Image_Graph_Driver_SVG::polygonEnd()
Draws a polygon
Image_Graph_Driver_PDFlib::polygonEnd()
Draws a polygon

Parameters:

bool   $connectEnds   —  Specifies whether the start point should be connected to the endpoint (closed polygon) or not (connected line)
mixed   $fillColor   —  The fill color, can be omitted
mixed   $lineColor   —  The line color, can be omitted

[ Top ]

rectangle   [line 409]

void rectangle( int $x0, int $y0, int $x1, int $y1, [mixed $fillColor = false], [mixed $lineColor = false])

Draw a rectangle

Overridden in child classes as:

Image_Graph_Driver_GD::rectangle()
Draw a rectangle
Image_Graph_Driver_SWF::rectangle()
Draw a rectangle
Image_Graph_Driver_SVG::rectangle()
Draw a rectangle
Image_Graph_Driver_PDFlib::rectangle()
Draw a rectangle

Parameters:

int   $x0   —  X start point
int   $y0   —  X start point
int   $x1   —  X end point
int   $y1   —  Y end point
mixed   $fillColor   —  The fill color, can be omitted
mixed   $lineColor   —  The line color, can be omitted

[ Top ]

setDefaultFont   [line 303]

void setDefaultFont( array $fontOptions)

Sets the default font options.

The $font array may have the following entries:

'ttf' = the .ttf file (either the basename, filename or full path) If 'ttf' is specified, then the following can be specified

'size' = size in pixels

'angle' = the angle with which to write the text


Parameters:

array   $fontOptions   —  The font options.

[ Top ]

setFill   [line 230]

void setFill( mixed $fill)

Sets the style of the filling of drawn objects.

This method gives simple access to setFillColor(), setFillImage() and setGradientFill()


Parameters:

mixed   $fill   —  The fill style

[ Top ]

setFillColor   [line 246]

void setFillColor( mixed $color)

Sets the color of the filling of drawn objects

Parameters:

mixed   $color   —  The fill color

[ Top ]

setFillImage   [line 256]

void setFillImage( string $filename)

Sets an image that should be used for filling

Overridden in child classes as:

Image_Graph_Driver_GD::setFillImage()
Sets an image that should be used for filling
Image_Graph_Driver_SWF::setFillImage()
Sets an image that should be used for filling
Image_Graph_Driver_SVG::setFillImage()
Sets an image that should be used for filling
Image_Graph_Driver_PDFlib::setFillImage()
Sets an image that should be used for filling.

Parameters:

string   $filename   —  The filename of the image to fill with

[ Top ]

setFont   [line 284]

void setFont( array $fontOptions)

Sets the font options.

The $font array may have the following entries:

'ttf' = the .ttf file (either the basename, filename or full path) If 'ttf' is specified, then the following can be specified

'size' = size in pixels

'angle' = the angle with which to write the text


Overridden in child classes as:

Image_Graph_Driver_GD::setFont()
Sets the font options.
Image_Graph_Driver_SWF::setFont()
Sets the font options.
Image_Graph_Driver_SVG::setFont()
Sets the font options.
Image_Graph_Driver_PDFlib::setFont()
Sets the font options.

Parameters:

array   $fontOptions   —  The font options.

[ Top ]

setGradientFill   [line 265]

void setGradientFill( array $gradient)

Sets a gradient fill

Overridden in child classes as:

Image_Graph_Driver_SVG::setGradientFill()
Sets a gradient fill
Image_Graph_Driver_PDFlib::setGradientFill()
Sets a gradient fill

Parameters:

array   $gradient   —  Gradient fill options

[ Top ]

setLineColor   [line 217]

void setLineColor( mixed $color)

Sets the color of the line(s) to be drawn

Parameters:

mixed   $color   —  The color of the line

[ Top ]

setLineThickness   [line 207]

void setLineThickness( int $thickness)

Sets the thickness of the line(s) to be drawn

Parameters:

int   $thickness   —  The actual thickness (in pixels)

[ Top ]

splineAdd   [line 360]

void splineAdd( int $x, int $y, $p1x, $p1y, $p2x, $p2y)

Adds vertex to a polygon

Parameters:

int   $x   —  X point
int   $y   —  Y point
   $p1x   — 
   $p1y   — 
   $p2x   — 
   $p2y   — 

[ Top ]

splineEnd   [line 394]

void splineEnd( [bool $connectEnds = true], [mixed $fillColor = false], [mixed $lineColor = false])

Draws a polygon

Overridden in child classes as:

Image_Graph_Driver_GD::splineEnd()
Ends a spline
Image_Graph_Driver_SWF::splineEnd()
Draws a polygon
Image_Graph_Driver_SVG::splineEnd()
Ends a spline
Image_Graph_Driver_PDFlib::splineEnd()
Draws a polygon

Parameters:

bool   $connectEnds   —  Specifies whether the start point should be connected to the endpoint (closed polygon) or not (connected line)
mixed   $fillColor   —  The fill color, can be omitted
mixed   $lineColor   —  The line color, can be omitted

[ Top ]

startGroup   [line 503]

void startGroup( [string $name = false])

Start a group.

What this does, depends on the driver/format.


Overridden in child classes as:

Image_Graph_Driver_SVG::startGroup()
Start a group.

Parameters:

string   $name   —  The name of the group

[ Top ]

textHeight   [line 464]

int textHeight( string $text)

Get the height of a text,
  • Return: The height of the text

Overridden in child classes as:

Image_Graph_Driver_GD::textHeight()
Get the height of a text,
Image_Graph_Driver_SWF::textHeight()
Get the height of a text,
Image_Graph_Driver_SVG::textHeight()
Get the height of a text,
Image_Graph_Driver_PDFlib::textHeight()
Get the height of a text,

Parameters:

string   $text   —  The text to get the height of

[ Top ]

textWidth   [line 454]

int textWidth( string $text)

Get the width of a text,
  • Return: The width of the text

Overridden in child classes as:

Image_Graph_Driver_GD::textWidth()
Get the width of a text,
Image_Graph_Driver_SWF::textWidth()
Get the width of a text,
Image_Graph_Driver_SVG::textWidth()
Get the width of a text,
Image_Graph_Driver_PDFlib::textWidth()
Get the width of a text,

Parameters:

string   $text   —  The text to get the width of

[ Top ]

write   [line 477]

void write( int $x, int $y, string $text, int $alignment, [mixed $color = false])

Writes text

Overridden in child classes as:

Image_Graph_Driver_GD::write()
Writes text
Image_Graph_Driver_SWF::write()
Writes text
Image_Graph_Driver_SVG::write()
Writes text
Image_Graph_Driver_PDFlib::write()
Writes text.

Parameters:

int   $x   —  X-point of text
int   $y   —  Y-point of text
string   $text   —  The text to write
int   $alignment   —  The alignment of the text
mixed   $color   —  The color of the text

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:24:55 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.