Methods summary
public
|
#
__construct( array $params, array $context = array() )
Const'r
Parameters
- $params
- The image object parameters. Values include:
<pre>(optional)width - The desired image width
(optional)height - The desired image height
(optional)type - The image type (png, jpeg etc...) <span class="php-keyword1">If</span> not provided,
<span class="php-keyword1">or</span> set by the <span class="php-keyword2">setType</span> method, any image output will
be converted to the <span class="php-keyword1">default</span> image type of png.
(optional)data - The image binary data.</pre>
- $context
- The object context - configuration, injected objects
<pre>(required)tmpdir - Temporary directory
(optional)logger - The logger</pre>
Throws
InvalidArgumentException
See
Horde_Image_Base::_construct
|
public
|
#
loadString( string $image_data )
Load image data from a string.
Load image data from a string.
Parameters
Overrides
|
public
mixed
|
#
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
mixed
Throws
Overrides
|
public
|
#
setType( string $type )
Set the image type
Parameters
- $type
- The simple type for the imag (png, jpg, etc...)
See
Overrides
|
public
string
|
#
raw( boolean $convert = false )
Returns the raw data for this image.
Returns the raw data for this image.
Parameters
- $convert
- <p>If true, the image data will be returned in the
target format, independently from any image
operations.</p>
Returns
string The raw image data.
Overrides
|
public
|
#
reset( )
Reset the image data to defaults.
Reset the image data to defaults.
Overrides
|
public
|
#
resize( mixed $width, mixed $height, mixed $ratio = true, mixed $keepProfile = false )
Resize current image.
See
Horde_Image_im::resize()
|
public
array
|
#
getDimensions( )
ALWAYS use getDimensions() to get image geometry...instance
variables only cache geometry until it changes, then they go
to zero.
ALWAYS use getDimensions() to get image geometry...instance
variables only cache geometry until it changes, then they go
to zero.
Returns
array of geometry information.
Overrides
|
public
|
#
crop( integer $x1, integer $y1, integer $x2, integer $y2 )
Crop the current image.
Parameters
- $x1
- x for the top left corner
- $y1
- y for the top left corner
- $x2
- x for the bottom right corner of the cropped image.
- $y2
- y for 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.
Parameters
- $threshold
- Extent of sepia effect.
|
public
|
#
text( string $string, integer $x, integer $y, string $font = '', 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
- $text The text to draw.
- $x
- The left x coordinate of the start of the text string.
- $y
- The top y coordinate of the start of the text string.
- $font
- The font identifier you want to use for the text.
- $color
- The color that you want the text displayed in.
- $direction
- An integer that specifies the orientation of the text.
- $fontsize
- Size of the font (small, medium, large, giant)
Todo:
Need to differentiate between the stroke (border) and the fill color,
but this is a BC break, since we were just not providing a border.
|
public
|
#
circle( integer $x, integer $y, integer $r, string $color, string $fill = 'none' )
Draw a circle.
Parameters
- $x
- The x coordinate of the centre.
- $y
- The y coordinate 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, 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.
|
public
|
#
roundedRectangle( integer $x, integer $y, integer $width, integer $height, integer $round, string $color, string $fill )
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 $x0, integer $y0, integer $x1, integer $y1, string $color = 'black', string $width = 1 )
Draw a line.
Parameters
- $x0
- The x coordinate of the start.
- $y0
- The y coordinate of the start.
- $x1
- The x coordinate of the end.
- $y1
- The y coordinate 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 = 'none' )
Draw an arc.
Parameters
- $x
- The x coordinate of the centre.
- $y
- The y coordinate 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
|
#
applyEffects( )
Apply any effects in the effect queue.
Apply any effects in the effect queue.
Overrides
|
public
|
|
public static
|
#
frameImage( Imagick & $image, integer $color, integer $width, mixed $height )
Utility function to wrap Imagick::borderImage. Use when you don't want
to replace all pixels in the clipping area with the border color i.e.
you want to "frame" the existing image. Preserves transparency etc...
Utility function to wrap Imagick::borderImage. Use when you don't want
to replace all pixels in the clipping area with the border color i.e.
you want to "frame" the existing image. Preserves transparency etc...
Parameters
- $image
- $image The Imagick object to border.
- $color
- $width
- $width
- $height
- $height
-
|
public
|
#
rewind( )
Reset the imagick iterator to the first image in the set.
Reset the imagick iterator to the first image in the set.
|
public
Horde_Image_Imagick
|
#
current( )
Return the current image from the internal iterator.
Return the current image from the internal iterator.
Returns
|
public
integer
|
#
key( )
Get the index of the internal iterator.
Get the index of the internal iterator.
Returns
integer
|
public
Horde_Image_Imagick
|
#
next( )
Advance the iterator
Returns
|
public
boolean
|
#
valid( )
Deterimines if the current iterator item is valid.
Deterimines if the current iterator item is valid.
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
|