Class Horde_Image_im

Description

This class implements the Horde_Image:: API for ImageMagick.

Additional parameters to the constructor exclusive to this driver:

 'type' - What type of image should be generated.

$Horde: framework/Image/Image/im.php,v 1.34.10.26 2009/03/23 18:15:47 mrubinsk Exp $

Copyright 2002-2009 The Horde Project (http://www.horde.org/)

See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.

Located in /Image/Image/im.php (line 27)

Horde_Image
   |
   --Horde_Image_im
Variable Summary
Method Summary
 Horde_Image_im Horde_Image_im ( $params)
 void applyEffects ()
 void arc (integer $x, integer $y, integer $r, integer $start, integer $end, [string $color = 'black'], [string $fill = 'none'])
 void circle (integer $x, integer $y, integer $r, string $color, [string $fill = 'none'])
 void crop (integer $x1, integer $y1, integer $x2, integer $y2)
 void dashedLine (integer $x0, integer $y0, integer $x1, integer $y1, [string $color = 'black'], [string $width = 1], [integer $dash_length = 2], [integer $dash_space = 2])
 void executeConvertCmd (string $cmd, [array $values = array()])
 void flip ()
 string getContentType ()
 void getDimensions ()
 void grayscale ()
 void line (integer $x0, integer $y0, integer $x1, integer $y1, [string $color = 'black'], [string $width = 1])
 mixed loadFile (string $filename)
 void loadString (string $id, string $image_data)
 void mirror ()
 void polygon ( $verts, string $color, [string $fill = 'none'], array $vertices)
 void polyline ( $verts, string $color, [string $width = 1], array $vertices)
 string raw ([boolean $convert = false])
 void rectangle (integer $x, integer $y, integer $width, integer $height, string $color, [string $fill = 'none'])
 void reset ()
 void resize (integer $width, integer $height, [boolean $ratio = true])
 void rotate (integer $angle, [integer $background = 'white'])
 void roundedRectangle (integer $x, integer $y, integer $width, integer $height, integer $round, string $color, string $fill)
 void sepia ([integer $threshold = 85])
 void text ( $string, integer $x, integer $y, [string $font = ''], [string $color = 'black'], [integer $direction = 0], [string $fontsize = 'small'], string $text)
 void _getFontSize ( $fontsize)
 void _getIMVersion ()
Variables
array $_capabilities = array('resize',
'crop',
'rotate',
'grayscale',
'flip',
'mirror',
'sepia',
'canvas'
)
(line 34)

Capabilites of this driver.


Redefinition of:
Horde_Image::$_capabilities
Capabilites of this driver.
string $_fillColor = null (line 82)

Current fill color; cached so we don't issue more -fill commands than necessary.

Imagick $_imagick = null (line 89)

Reference to an Horde_Image_ImagickProxy object.

array $_operations = array() (line 50)

Operations to be performed. These are added before the source filename is specified on the command line.

array $_postSrcOperations = array() (line 58)

Operations to be added after the source filename is specified on the command line.

string $_strokeColor = null (line 66)

Current stroke color; cached so we don't issue more -stroke commands than necessary.

string $_strokeWidth = null (line 74)

Current stroke width; cached so we don't issue more -strokewidth commands than necessary.

array $_toClean = array() (line 96)

TODO

Inherited Variables

Inherited from Horde_Image

Horde_Image::$_background
Horde_Image::$_data
Horde_Image::$_height
Horde_Image::$_loadedEffects
Horde_Image::$_observers
Horde_Image::$_rgb
Horde_Image::$_tmpdir
Horde_Image::$_type
Horde_Image::$_width
Methods
Constructor Horde_Image_im (line 101)

Constructor.

Horde_Image_im Horde_Image_im ( $params)
  • $params
applyEffects (line 684)
void applyEffects ()

Redefinition of:
Horde_Image::applyEffects()
Apply any effects in the effect queue.
arc (line 616)

Draw an arc.

void arc (integer $x, integer $y, integer $r, integer $start, integer $end, [string $color = 'black'], [string $fill = 'none'])
  • integer $x: The x coordinate of the centre.
  • integer $y: The y coordinate of the centre.
  • integer $r: The radius of the arc.
  • integer $start: The start angle of the arc.
  • integer $end: The end angle of the arc.
  • string $color: The line color of the arc.
  • string $fill: The fill color of the arc (defaults to none).
circle (line 464)

Draw a circle.

void circle (integer $x, integer $y, integer $r, string $color, [string $fill = 'none'])
  • integer $x: The x coordinate of the centre.
  • integer $y: The y coordinate of the centre.
  • integer $r: The radius of the circle.
  • string $color: The line color of the circle.
  • string $fill: The color to fill the circle.
crop (line 339)

Crop the current image.

void crop (integer $x1, integer $y1, integer $x2, integer $y2)
  • integer $x1: x for the top left corner
  • integer $y1: y for the top left corner
  • integer $x2: x for the bottom right corner of the cropped image.
  • integer $y2: y for the bottom right corner of the cropped image.
dashedLine (line 572)

Draw a dashed line.

void dashedLine (integer $x0, integer $y0, integer $x1, integer $y1, [string $color = 'black'], [string $width = 1], [integer $dash_length = 2], [integer $dash_space = 2])
  • integer $x0: The x co-ordinate of the start.
  • integer $y0: The y co-ordinate of the start.
  • integer $x1: The x co-ordinate of the end.
  • integer $y1: The y co-ordinate of the end.
  • string $color: The line color.
  • string $width: The width of the line.
  • integer $dash_length: The length of a dash on the dashed line
  • integer $dash_space: The length of a space in the dashed line
executeConvertCmd (line 705)

Method to execute a raw command directly in convert.

The input and output files are quoted and substituted for __FILEIN__ and __FILEOUT__ respectfully. In order to support piped convert commands, the path to the convert command is substitued for __CONVERT__ (but the initial convert command is added automatically).

void executeConvertCmd (string $cmd, [array $values = array()])
  • string $cmd: The command string, with substitutable tokens
  • array $values: Any values that should be substituted for tokens.
flip (line 380)

Flip the current image.

void flip ()
getContentType (line 192)

Return the content type for this image.

  • return: The content type for this image.
string getContentType ()
getDimensions (line 313)

More efficient way of getting size if using imagick library.

*ALWAYS* use getDimensions() to get image geometry...instance variables only cache geometry until it changes, then they go to zero.

void getDimensions ()

Redefinition of:
Horde_Image::getDimensions()
Get the height and width of the current image data.
grayscale (line 404)

Convert the current image to grayscale.

void grayscale ()
line (line 551)

Draw a line.

void line (integer $x0, integer $y0, integer $x1, integer $y1, [string $color = 'black'], [string $width = 1])
  • integer $x0: The x coordinate of the start.
  • integer $y0: The y coordinate of the start.
  • integer $x1: The x coordinate of the end.
  • integer $y1: The y coordinate of the end.
  • string $color: The line color.
  • string $width: The width of the line.
loadFile (line 176)

Load the image data from a file. Need to override this method in order to load the imagick object if we need to.

  • return: PEAR Error if file does not exist or could not be loaded otherwise NULL if successful or already loaded.
mixed loadFile (string $filename)
  • string $filename: The full path and filename to the file to load the image data from. The filename will also be used for the image id.

Redefinition of:
Horde_Image::loadFile()
Load the image data from a file.
loadString (line 154)

Load the image data from a string. Need to override this method in order to load the imagick object if we need to.

void loadString (string $id, string $image_data)
  • string $id: An arbitrary id for the image.
  • string $image_data: The data to use for the image.

Redefinition of:
Horde_Image::loadString()
Load the image data from a string.
mirror (line 392)

Mirror the current image.

void mirror ()
polygon (line 482)

Draw a polygon based on a set of vertices.

void polygon ( $verts, string $color, [string $fill = 'none'], array $vertices)
  • array $vertices: An array of x and y labeled arrays (eg. $vertices[0]['x'], $vertices[0]['y'], ...).
  • string $color: The color you want to draw the polygon with.
  • string $fill: The color to fill the polygon.
  • $verts
polyline (line 592)

Draw a polyline (a non-closed, non-filled polygon) based on a set of vertices.

void polyline ( $verts, string $color, [string $width = 1], array $vertices)
  • array $vertices: An array of x and y labeled arrays (eg. $vertices[0]['x'], $vertices[0]['y'], ...).
  • string $color: The color you want to draw the line with.
  • string $width: The width of the line.
  • $verts
raw (line 206)

Returns the raw data for this image.

  • return: The raw image data.
string raw ([boolean $convert = false])
  • boolean $convert: If true, the image data will be returned in the target format, independently from any image operations.

Redefinition of:
Horde_Image::raw()
Returns the raw data for this image.
rectangle (line 507)

Draw a rectangle.

void rectangle (integer $x, integer $y, integer $width, integer $height, string $color, [string $fill = 'none'])
  • integer $x: The left x-coordinate of the rectangle.
  • integer $y: The top y-coordinate of the rectangle.
  • integer $width: The width of the rectangle.
  • integer $height: The height of the rectangle.
  • string $color: The line color of the rectangle.
  • string $fill: The color to fill the rectangle.
reset (line 267)

Reset the image data.

void reset ()

Redefinition of:
Horde_Image::reset()
Reset the image data.
resize (line 286)

Resize the current image. This operation takes place immediately.

void resize (integer $width, integer $height, [boolean $ratio = true])
  • integer $width: The new width.
  • integer $height: The new height.
  • boolean $ratio: Maintain original aspect ratio.
rotate (line 363)

Rotate the current image.

void rotate (integer $angle, [integer $background = 'white'])
  • integer $angle: The angle to rotate the image by, in the clockwise direction.
  • integer $background: The background color to fill any triangles.
roundedRectangle (line 529)

Draw a rounded rectangle.

void roundedRectangle (integer $x, integer $y, integer $width, integer $height, integer $round, string $color, string $fill)
  • integer $x: The left x-coordinate of the rectangle.
  • integer $y: The top y-coordinate of the rectangle.
  • integer $width: The width of the rectangle.
  • integer $height: The height of the rectangle.
  • integer $round: The width of the corner rounding.
  • string $color: The line color of the rectangle.
  • string $fill: The color to fill the rounded rectangle with.
sepia (line 418)

Sepia filter.

void sepia ([integer $threshold = 85])
  • integer $threshold: Extent of sepia effect.
text (line 442)

Draws a text string on the image in a specified location, with the specified style information.

void text ( $string, integer $x, integer $y, [string $font = ''], [string $color = 'black'], [integer $direction = 0], [string $fontsize = 'small'], string $text)
  • string $text: The text to draw.
  • integer $x: The left x coordinate of the start of the text string.
  • integer $y: The top y coordinate of the start of the text string.
  • string $font: The font identifier you want to use for the text.
  • string $color: The color that you want the text displayed in.
  • integer $direction: An integer that specifies the orientation of the text.
  • string $fontsize: Size of the font (small, medium, large, giant)
  • $string
_getFontSize (line 741)

Return point size for font

void _getFontSize ( $fontsize)
  • $fontsize
_getIMVersion (line 760)
void _getIMVersion ()

Inherited Methods

Inherited From Horde_Image

 Horde_Image::Horde_Image()
 Horde_Image::addEffect()
 Horde_Image::addObserver()
 Horde_Image::applyEffects()
 Horde_Image::brightness()
 Horde_Image::brush()
 Horde_Image::display()
 Horde_Image::factory()
 Horde_Image::getCapabilities()
 Horde_Image::getDimensions()
 Horde_Image::getHexColor()
 Horde_Image::getLink()
 Horde_Image::getLoadedEffects()
 Horde_Image::getRGB()
 Horde_Image::hasCapability()
 Horde_Image::headers()
 Horde_Image::loadFile()
 Horde_Image::loadString()
 Horde_Image::modifyColor()
 Horde_Image::moreIntenseColor()
 Horde_Image::notifyObservers()
 Horde_Image::raw()
 Horde_Image::reset()
 Horde_Image::singleton()
 Horde_Image::toFile()

Documentation generated on Sun, 30 Jan 2011 05:18:21 +0000 by phpDocumentor 1.4.3