Methods summary
public
Horde_Image_gd
|
#
__construct( mixed $params, array $context = array() )
Const'r
Parameters
- $params
-
- $context
- The object context - configuration, injected objects
<pre>(required)tmpdir - Temporary directory
(optional)logger - The logger</pre>
Returns
Horde_Image_gd
Throws
InvalidArgumentException
|
public
|
|
public
|
#
display( )
Display the current image.
Display the current image.
Overrides
|
public
string
|
#
raw( boolean $convert = false )
Returns the raw data for this image.
Returns the raw data for this image.
Parameters
Returns
string The raw image data.
Overrides
|
public
|
#
reset( )
Reset the image data.
Overrides
|
public
array
|
#
getDimensions( )
Get the height and width of the current image.
Get the height and width of the current image.
Returns
array An hash with 'width' containing the width,
'height' containing the height of the image.
Overrides
|
public
|
#
loadString( string $image_data )
Load the image data from a string.
Load the image data from a string.
Parameters
- $image_data
- The data to use for the image.
Overrides
|
public
boolean
|
#
loadFile( string $filename )
Load the image data from a file.
Load the image data from a file.
Parameters
- $filename
- <p>The full path and filename to the file to load
the image data from. The filename will also be
used for the image id.</p>
Returns
boolean
Throws
Overrides
|
public
boolean
|
#
resize( integer $width, integer $height, boolean $ratio = true )
Resize the current image.
Resize the current image.
Parameters
- $width
- The new width.
- $height
- The new height.
- $ratio
- Maintain original aspect ratio.
Returns
boolean
|
public
|
#
crop( integer $x1, integer $y1, integer $x2, integer $y2 )
Crop the current image.
Parameters
- $x1
- The top left corner of the cropped image.
- $y1
- The top right corner of the cropped image.
- $x2
- The bottom left corner of the cropped image.
- $y2
- The bottom right corner of the cropped image.
|
public
|
#
rotate( integer $angle, integer $background = 'white' )
Rotate the current image.
Rotate the current image.
Parameters
- $angle
- <p>The angle to rotate the image by,
in the clockwise direction</p>
- $background
- The background color to fill any triangles
|
public
|
|
public
|
#
mirror( )
Mirror the current image.
Mirror the current image.
|
public
|
#
grayscale( )
Convert the current image to grayscale.
Convert the current image to grayscale.
|
public
|
#
sepia( integer $threshold = 85 )
Sepia filter.
Basically turns the image to grayscale and then adds some
defined tint on it (R += 30, G += 43, B += -23) so it will
appear to be a very old picture.
Parameters
- $threshold
- (Ignored in GD driver for now)
|
public
|
#
yellowize( integer $intensityY = 50, integer $intensityB = 3 )
Yellowize filter.
Adds a layer of yellow that can be transparent or solid. If
$intensityA is 255 the image will be 0% transparent (solid).
Parameters
- $intensityY
- How strong should the yellow (red and green) be? (0-255)
- $intensityB
- How weak should the blue be? (>= 2, in the positive limit it will be make BLUE 0)
|
public
boolean
|
#
text( string $string, integer $x, integer $y, string $font = 'monospace', string $color = 'black', integer $direction = 0, string $fontsize = 'small' )
Draws a text string on the image in a specified location, with
the specified style information.
Draws a text string on the image in a specified location, with
the specified style information.
Parameters
- $string
- The text to draw.
- $x
- <p>The left x coordinate of the start of the
text string.</p>
- $y
- <p>The top y coordinate of the start of the text
string.</p>
- $font
- <p>The font identifier you want to use for the
text (ignored for GD - font determined by
$fontsize).</p>
- $color
- The color that you want the text displayed in.
- $direction
- <p>An integer that specifies the orientation of
the text.</p>
- $fontsize
- The font (size) to use.
Returns
boolean
|
public
|
#
circle( integer $x, integer $y, integer $r, string $color, string $fill = null )
Draw a circle.
Parameters
- $x
- The x co-ordinate of the centre.
- $y
- The y co-ordinate of the centre.
- $r
- The radius of the circle.
- $color
- The line color of the circle.
- $fill
- The color to fill the circle.
|
public
|
#
polygon( array $verts, string $color, string $fill = 'none' )
Draw a polygon based on a set of vertices.
Draw a polygon based on a set of vertices.
Parameters
- $verts
- <p>$vertices An array of x and y labeled arrays
(eg. $vertices[0]['x'], $vertices[0]['y'], ...).</p>
- $color
- The color you want to draw the polygon with.
- $fill
- The color to fill the polygon.
|
public
|
#
rectangle( integer $x, integer $y, integer $width, integer $height, string $color = 'black', string $fill = 'none' )
Draw a rectangle.
Parameters
- $x
- The left x-coordinate of the rectangle.
- $y
- The top y-coordinate of the rectangle.
- $width
- The width of the rectangle.
- $height
- The height of the rectangle.
- $color
- The line color of the rectangle.
- $fill
- The color to fill the rectangle with.
|
public
|
#
roundedRectangle( integer $x, integer $y, integer $width, integer $height, integer $round, string $color = 'black', string $fill = 'none' )
Draw a rounded rectangle.
Draw a rounded rectangle.
Parameters
- $x
- The left x-coordinate of the rectangle.
- $y
- The top y-coordinate of the rectangle.
- $width
- The width of the rectangle.
- $height
- The height of the rectangle.
- $round
- The width of the corner rounding.
- $color
- The line color of the rectangle.
- $fill
- The color to fill the rounded rectangle with.
|
public
|
#
line( integer $x1, integer $y1, integer $x2, integer $y2, string $color = 'black', string $width = 1 )
Draw a line.
Parameters
- $x1
- $x0 The x co-ordinate of the start.
- $y1
- $y0 The y co-ordinate of the start.
- $x2
- $x1 The x co-ordinate of the end.
- $y2
- $y1 The y co-ordinate of the end.
- $color
- The line color.
- $width
- The width of the line.
|
public
|
#
dashedLine( integer $x0, integer $y0, integer $x1, integer $y1, string $color = 'black', string $width = 1, integer $dash_length = 2, integer $dash_space = 2 )
Draw a dashed line.
Parameters
- $x0
- The x co-ordinate of the start.
- $y0
- The y co-ordinate of the start.
- $x1
- The x co-ordinate of the end.
- $y1
- The y co-ordinate of the end.
- $color
- The line color.
- $width
- The width of the line.
- $dash_length
- The length of a dash on the dashed line
- $dash_space
- The length of a space in the dashed line
|
public
|
#
polyline( array $verts, string $color, string $width = 1 )
Draw a polyline (a non-closed, non-filled polygon) based on a
set of vertices.
Draw a polyline (a non-closed, non-filled polygon) based on a
set of vertices.
Parameters
- $verts
- <p>$vertices An array of x and y labeled arrays
(eg. $vertices[0]['x'], $vertices[0]['y'], ...).</p>
- $color
- The color you want to draw the line with.
- $width
- The width of the line.
|
public
|
#
arc( integer $x, integer $y, integer $r, integer $start, integer $end, string $color = 'black', string $fill = null )
Draw an arc.
Parameters
- $x
- The x co-ordinate of the centre.
- $y
- The y co-ordinate of the centre.
- $r
- The radius of the arc.
- $start
- The start angle of the arc.
- $end
- The end angle of the arc.
- $color
- The line color of the arc.
- $fill
- The fill color of the arc (defaults to none).
|
public
resource
|
#
create( integer $width, integer $height )
Creates an image of the given size.
If possible the function returns a true color image.
Creates an image of the given size.
If possible the function returns a true color image.
Parameters
- $width
- The image width.
- $height
- The image height.
Returns
resource The image handler.
Throws
|
public
mixed
|
#
call( string $function, array $params = null )
Wraps a call to a function of the gd extension.
Wraps a call to a function of the gd extension.
Parameters
- $function
- The name of the function to wrap.
- $params
- An array with all parameters for that function.
Returns
mixed The result of the function call
Throws
|
public
boolean
|
#
applyMask( resource $gdimg_mask )
Applies the specified mask to the image.
Applies the specified mask to the image.
Parameters
- $gdimg_mask
- The gd image resource representing the mask
Returns
boolean
|
public
Horde_Image_Base
|
#
getImageAtIndex( integer $index )
Request a specific image from the collection of images.
Request a specific image from the collection of images.
Parameters
- $index
- The index to return
Returns
|
public
integer
|
#
getImagePageCount( )
Return the number of image pages available in the image object.
Return the number of image pages available in the image object.
Returns
integer
|