Class Horde_Image

Description

This class defines the Horde_Image:: API, and also provides some utility functions, such as generating highlights of a color.

$Horde: framework/Image/Image.php,v 1.39.10.21 2010/03/28 16:39:11 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.php (line 20)


	
			
Direct descendents
Class Description
 class Horde_Image_im This class implements the Horde_Image:: API for ImageMagick.
 class Horde_Image_png This class implements the Horde_Image:: API for PNG images. It mainly provides some utility functions, such as the ability to make pixels or solid images for now.
 class Horde_Image_svg This class implements the Horde_Image:: API for SVG.
 class Horde_Image_swf This class implements the Horde_Image:: API for SWF, using the PHP Ming extension.
 class Horde_Image_gd 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.
Variable Summary
 string $_background
 string $_data
 integer $_height
 array $_observers
 string $_rgb
 string $_tmpdir
 string $_type
 integer $_width
Method Summary
 static integer brightness (string $color)
 static string modifyColor (string $color, [string $factor = 0x11])
 static string moreIntenseColor (string $color, [string $factor = 0x11])
 Horde_Image Horde_Image ( $params, string $rgb)
 mixed addEffect (string $type, array $params)
 void addObserver ( $method,  &$object)
 void applyEffects ()
 void brush (integer $x, integer $y, [string $color = 'black'], [string $shape = 'square'])
 void display ()
 mixed &factory (mixed $driver, [array $params = array()])
 void getCapabilities ()
 array getDimensions ()
 void getHexColor ( $colorname)
 void getLink ( $url, [ $title = ''])
 void getRGB ( $colorname)
 void hasCapability ( $capability)
 void headers ()
 mixed loadFile (string $filename)
 void loadString (string $id, string $image_data)
 void notifyObservers ()
 string raw ([boolean $convert = false])
 void reset ()
 Horde_Image|boolean &singleton (mixed $driver, [array $params = array()])
 string toFile ([mixed $data = false])
Variables
string $_background = 'white' (line 34)

Background color.

array $_capabilities = array() (line 48)

Capabilites of this driver.


Redefined in descendants as:
string $_data = '' (line 55)

The current image data.

integer $_height = 0 (line 69)

The current height of the image data.

array $_loadedEffects = array() (line 83)

Array containing available Effects

array $_observers = array() (line 41)

Observers.

string $_rgb = 'ff0000' (line 27)

Current color.

string $_tmpdir (line 76)

A directory for temporary files.

string $_type = 'png' (line 90)

What kind of images should ImageMagick generate? Defaults to 'png'.

integer $_width = 0 (line 62)

The current width of the image data.

Methods
static brightness (line 213)

Returns the brightness of a color.

  • return: The brightness on a scale of 0 to 255.
static integer brightness (string $color)
  • string $color: An HTML color, e.g.: #ffffcc.
static modifyColor (line 145)

Calculate a lighter (or darker) version of a color.

  • return: A modified HTML color.
static string modifyColor (string $color, [string $factor = 0x11])
  • string $color: An HTML color, e.g.: #ffffcc.
  • string $factor: TODO
static moreIntenseColor (line 168)

Calculate a more intense version of a color.

  • return: A more intense HTML color.
static string moreIntenseColor (string $color, [string $factor = 0x11])
  • string $color: An HTML color, e.g.: #ffffcc.
  • string $factor: TODO
Constructor Horde_Image (line 97)

Constructor.

Horde_Image Horde_Image ( $params, string $rgb)
  • string $rgb: The base color for generated pixels/images.
  • $params
addEffect (line 467)

Attempts to apply requested effect to this image. If the effect cannot be found a PEAR_Error is returned.

  • return: true on success | PEAR_Error on failure.
mixed addEffect (string $type, array $params)
  • string $type: The type of effect to apply.
  • array $params: Any parameters for the effect.
addObserver (line 284)

Add an observer to this image. The observer will be notified when the image's changes.

void addObserver ( $method,  &$object)
  • $method
  • &$object
applyEffects (line 520)

Apply any effects in the effect queue.

void applyEffects ()

Redefined in descendants as:
brush (line 251)

Draw a shaped point at the specified (x,y) point. Useful for scatter diagrams, debug points, etc. Draws squares, circles, diamonds, and triangles.

void brush (integer $x, integer $y, [string $color = 'black'], [string $shape = 'square'])
  • integer $x: The x coordinate of the point to brush.
  • integer $y: The y coordinate of the point to brush.
  • string $color: The color to brush the point with.
  • string $shape: What brush to use? Defaults to a square.
display (line 387)

Display the current image.

void display ()

Redefined in descendants as:
factory (line 540)

Attempts to return a concrete Horde_Image instance based on $driver.

  • return: Horde_Image object | PEAR_Error
mixed &factory (mixed $driver, [array $params = array()])
  • mixed $driver: The type of concrete Horde_Image subclass to return. This is based on the storage driver ($driver). The code is dynamically included. If $driver is an array, then we will look in $driver[0]/lib/Image/ for the subclass implementation named $driver[1].php.
  • array $params: A hash containing any additional configuration or connection parameters a subclass might need.
getCapabilities (line 112)
void getCapabilities ()
getDimensions (line 318)

Get the height and width of the current image data.

  • return: An hash with 'width' containing the width, 'height' containing the height of the image.
array getDimensions ()

Redefined in descendants as:
getHexColor (line 230)
void getHexColor ( $colorname)
  • $colorname
getLink (line 122)
void getLink ( $url, [ $title = ''])
  • $url
  • $title

Redefined in descendants as:
getLoadedEffects (line 484)

Load a list of available effects for this driver.

void getLoadedEffects ()
getRGB (line 222)
void getRGB ( $colorname)
  • $colorname
hasCapability (line 117)
void hasCapability ( $capability)
  • $capability
headers (line 130)

Generate image headers.

void headers ()
loadFile (line 354)

Load the image data from a file.

  • 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.

Redefined in descendants as:
loadString (line 338)

Load the image data from a string.

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.

Redefined in descendants as:
notifyObservers (line 292)

Let observers know that something happened worth acting on.

void notifyObservers ()
raw (line 402)

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.

Redefined in descendants as:
reset (line 304)

Reset the image data.

void reset ()

Redefined in descendants as:
singleton (line 587)

Attempts to return a reference to a concrete Horde_Image instance based on $driver. It will only create a new instance if no Horde_Image instance with the same parameters currently exists.

This should be used if multiple types of image renderers (and, thus, multiple Horde_Image instances) are required.

This method must be invoked as: $var = &Horde_Image::singleton()

  • return: The concrete Horde_Image reference, or false on an error.
Horde_Image|boolean &singleton (mixed $driver, [array $params = array()])
  • mixed $driver: The type of concrete Horde_Image subclass to return. This is based on the storage driver ($driver). The code is dynamically included. If $driver is an array, then we will look in $driver[0]/lib/Image/ for the subclass implementation named $driver[1].php.
  • array $params: A hash containing any additional configuration or connection parameters a subclass might need.
toFile (line 375)

Ouputs image data to file. If $data is false, outputs current image data after performing any pending operations on the data.

If $data contains raw image data, outputs that data to file without regard for $this->_data

  • return: Path to temporary file.
string toFile ([mixed $data = false])
  • mixed $data: String of binary image data | false

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