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

Class: Image_Graph_Driver

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

Class Overview


Driver class.


Author(s):

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 49]
Driver class.

Handles different output formats.



[ Top ]


Method Detail

Image_Graph_Driver (Constructor)   [line 138]

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 501]

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 423]

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 ]

factory   [line 537]

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 196]

int getHeight( )

Get the height of the canvas
  • Return: The height

[ Top ]

getWidth   [line 186]

int getWidth( )

Get the width of the canvas
  • Return: The width

[ Top ]

line   [line 333]

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 491]

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 442]

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 344]

void polygonAdd( int $x, int $y)

Adds vertex to a polygon

Parameters:

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

[ Top ]

polygonEnd   [line 380]

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 408]

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 302]

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 229]

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 245]

void setFillColor( mixed $color)

Sets the color of the filling of drawn objects

Parameters:

mixed   $color   —  The fill color

[ Top ]

setFillImage   [line 255]

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 283]

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 264]

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 216]

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 206]

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 359]

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 393]

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 ]

textHeight   [line 463]

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 453]

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 476]

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:21:47 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.