[ Index ]
 

Code source de Horde 3.1.3

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/Horde/Image/ -> gd.php (sommaire)

(pas de description)

Poids: 1037 lignes (37 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

Horde_Image_gd:: (30 méthodes):
  Horde_Image_gd()
  getContentType()
  display()
  raw()
  reset()
  getDimensions()
  allocateColor()
  getFont()
  loadString()
  loadFile()
  resize()
  crop()
  rotate()
  flip()
  mirror()
  grayscale()
  sepia()
  yellowize()
  watermark()
  text()
  circle()
  polygon()
  rectangle()
  roundedRectangle()
  line()
  dashedLine()
  polyline()
  arc()
  _create()
  _call()


Classe: Horde_Image_gd  - X-Ref

This class implements the Horde_Image:: API for the PHP GD
extension. It mainly provides some utility functions, such as the
ability to make pixels, for now.

$Horde: framework/Image/Image/gd.php,v 1.48.10.14 2006/01/01 21:28:22 jan Exp $

Copyright 2002-2006 Chuck Hagenbuch <chuck@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.

Horde_Image_gd($params)   X-Ref
String identifier of the current image. New image data will not be
loaded if the same id is already loaded.


getContentType()   X-Ref
Pas de description

display()   X-Ref
Display the current image.


raw($convert = false)   X-Ref
Returns the raw data for this image.

param: boolean $convert  If true, the image data will be returned in the
return: string  The raw image data.

reset()   X-Ref
Reset the image data.


getDimensions()   X-Ref
Get the height and width of the current image.

return: array  An hash with 'width' containing the width,

allocateColor($name)   X-Ref
Creates a color that can be accessed in this object. When a
color is set, the integer resource of it is returned.

param: string $name  The name of the color.
return: integer  The resource of the color that can be passed to GD.

getFont($font)   X-Ref
Pas de description

loadString($id, $image_data)   X-Ref
Load the image data from a string.

param: string $id          An arbitrary id for the image.
param: string $image_data  The data to use for the image.

loadFile($filename)   X-Ref
Load the image data from a file.

param: string $filename  The full path and filename to the file to load
return: mixed  PEAR Error if file does not exist or could not be loaded

resize($width, $height, $ratio = true)   X-Ref
Resize the current image.

param: integer $width      The new width.
param: integer $height     The new height.
param: boolean $ratio      Maintain original aspect ratio.

crop($x1, $y1, $x2, $y2)   X-Ref
Crop the current image.

param: integer $x1  The top left corner of the cropped image.
param: integer $y1  The top right corner of the cropped image.
param: integer $x2  The bottom left corner of the cropped image.
param: integer $y2  The bottom right corner of the cropped image.

rotate($angle, $background = 'white')   X-Ref
Rotate the current image.

param: integer $angle       The angle to rotate the image by,
param: integer $background  The background color to fill any triangles

flip()   X-Ref
Flip the current image.


mirror()   X-Ref
Mirror the current image.


grayscale()   X-Ref
Convert the current image to grayscale.


sepia()   X-Ref
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.

yellowize($intensityY = 50, $intensityB = 3)   X-Ref
Yellowize filter.

Adds a layer of yellow that can be transparent or solid. If
$intensityA is 255 the image will be 0% transparent (solid).

param: integer $intensityY  How strong should the yellow (red and green) be? (0-255)
param: integer $intensityB  How weak should the blue be? (>= 2, in the positive limit it will be make BLUE 0)

watermark($text, $halign = 'right', $valign = 'bottom', $font = 'small')   X-Ref
Pas de description

text($string, $x, $y, $font = 'monospace', $color = 'black', $direction = 0)   X-Ref
Draws a text string on the image in a specified location, with
the specified style information.

param: string  $text       The text to draw.
param: integer $x          The left x coordinate of the start of the
param: integer $y          The top y coordinate of the start of the text
param: string  $font       The font identifier you want to use for the
param: string  $color      The color that you want the text displayed in.
param: integer $direction  An integer that specifies the orientation of

circle($x, $y, $r, $color, $fill = null)   X-Ref
Draw a circle.

param: integer $x     The x co-ordinate of the centre.
param: integer $y     The y co-ordinate of the centre.
param: integer $r     The radius of the circle.
param: string $color  The line color of the circle.
param: string $fill   The color to fill the circle.

polygon($verts, $color, $fill = 'none')   X-Ref
Draw a polygon based on a set of vertices.

param: array $vertices  An array of x and y labeled arrays
param: string $color    The color you want to draw the polygon with.
param: string $fill     The color to fill the polygon.

rectangle($x, $y, $width, $height, $color = 'black', $fill = 'none')   X-Ref
Draw a rectangle.

param: integer $x       The left x-coordinate of the rectangle.
param: integer $y       The top y-coordinate of the rectangle.
param: integer $width   The width of the rectangle.
param: integer $height  The height of the rectangle.
param: string $color    The line color of the rectangle.
param: string $fill     The color to fill the rectangle with.

roundedRectangle($x, $y, $width, $height, $round, $color = 'black', $fill = 'none')   X-Ref
Draw a rounded rectangle.

param: integer $x       The left x-coordinate of the rectangle.
param: integer $y       The top y-coordinate of the rectangle.
param: integer $width   The width of the rectangle.
param: integer $height  The height of the rectangle.
param: integer $round   The width of the corner rounding.
param: string $color    The line color of the rectangle.
param: string $fill     The color to fill the rounded rectangle with.

line($x1, $y1, $x2, $y2, $color = 'black', $width = 1)   X-Ref
Draw a line.

param: integer $x0    The x co-ordinate of the start.
param: integer $y0    The y co-ordinate of the start.
param: integer $x1    The x co-ordinate of the end.
param: integer $y1    The y co-ordinate of the end.
param: string $color  The line color.
param: string $width  The width of the line.

dashedLine($x0, $y0, $x1, $y1, $color = 'black', $width = 1, $dash_length = 2, $dash_space = 2)   X-Ref
Draw a dashed line.

param: integer $x0           The x co-ordinate of the start.
param: integer $y0           The y co-ordinate of the start.
param: integer $x1           The x co-ordinate of the end.
param: integer $y1           The y co-ordinate of the end.
param: string $color         The line color.
param: string $width         The width of the line.
param: integer $dash_length  The length of a dash on the dashed line
param: integer $dash_space   The length of a space in the dashed line

polyline($verts, $color, $width = 1)   X-Ref
Draw a polyline (a non-closed, non-filled polygon) based on a
set of vertices.

param: array $vertices  An array of x and y labeled arrays
param: string $color    The color you want to draw the line with.
param: string $width    The width of the line.

arc($x, $y, $r, $start, $end, $color = 'black', $fill = null)   X-Ref
Draw an arc.

param: integer $x      The x co-ordinate of the centre.
param: integer $y      The y co-ordinate of the centre.
param: integer $r      The radius of the arc.
param: integer $start  The start angle of the arc.
param: integer $end    The end angle of the arc.
param: string  $color  The line color of the arc.
param: string  $fill   The fill color of the arc (defaults to none).

_create($width, $height)   X-Ref
Creates an image of the given size.
If possible the function returns a true color image.

param: integer $width   The image width.
param: integer $height  The image height.
return: resource|object PEAR Error  The image handler or a PEAR_Error on

_call($function, $params = null)   X-Ref
Wraps a call to a function of the gd extension.
If the call produces an error, a PEAR_Error is returned, the function
result otherwise.

param: string $function  The name of the function to wrap.
param: array $params     An array with all parameters for that function.
return: mixed  Either the function result or a PEAR_Error if an error



Généré le : Sun Feb 25 18:01:28 2007 par Balluche grâce à PHPXref 0.7