PHP Class Horde_Image_Base, horde

Author: Chuck Hagenbuch ([email protected])
Author: Michael J. Rubinsky ([email protected])
Author: Jan Schneider ([email protected])
Inheritance: extends EmptyIterator
Afficher le fichier Open project: horde/horde Class Usage Examples

Protected Properties

Свойство Type Description
$_background string Background color.
$_capabilities array Capabilites of this driver.
$_context Cache the context
$_data string The current image data.
$_height integer The current height of the image data.
$_loadedEffects array Array containing available Effects
$_logger Logger.
$_tmpdir string A directory for temporary files.
$_type string What kind of images should ImageMagick generate? Defaults to 'png'.
$_width integer The current width of the image data.

Méthodes publiques

Méthode Description
__call ( $method, $args ) Catch-all method so that we don't error out when calling an unsupported manipulation method.
addEffect ( string $type, array $params ) Attempts to apply requested effect to this image.
applyEffects ( ) Applies any effects in the effect queue.
brush ( integer $x, integer $y, string $color = 'black', string $shape = 'square' ) Draws a shaped point at the specified (x,y) point.
clearGeometry ( ) Utility function to zero out cached geometry information.
display ( ) Displays the current image.
getCapabilities ( ) : array Returns the capabilities.
getContentType ( ) : string Returns the MIME type for this image.
getDimensions ( ) : array Returns the height and width of the current image data.
getImageAtIndex ( integer $index ) : Horde_Image_Base Returns a specific image from the pages of images.
getImagePageCount ( ) : integer Returns the number of image pages available in the image object.
getLoadedEffects ( ) Returns a list of available effects for this driver.
getTmpDir ( ) : string Returns the current temporary directory.
getType ( ) : string Returns the image type.
hasCapability ( string $capability ) : boolean Checks the existence of a particular capability.
headers ( ) Sends HTTP headers for the image.
loadFile ( string $filename ) Loads the image data from a file.
loadString ( string $image_data ) Loads the image data from a string.
raw ( boolean $convert = false ) : string Returns the raw data for this image.
reset ( ) Resets the image data to defaults.
setType ( string $type ) : string Sets the output image type.
toFile ( $data = null ) : string Saves image data to file.

Méthodes protégées

Méthode Description
__construct ( array $params, array $context = [] ) Constructor.
_logDebug ( string $message ) Logs a message at debug level.
_logErr ( string $message ) Logs a message at error level.

Method Details

__call() public méthode

Catch-all method so that we don't error out when calling an unsupported manipulation method.
public __call ( $method, $args )

__construct() protected méthode

Constructor.
protected __construct ( array $params, array $context = [] )
$params array The image object parameters. Values include: - background: (string) The background color. DEFAULT: white. - data: (string) The image binary data. - height: (integer) The desired image height. - type: (string) The output image type (png, jpeg etc.). DEFAULT: png. - width: (integer) The desired image width.
$context array The object context - configuration, injected objects: - logger: (Horde_Log_Logger) A logger. - tmpdir: [REQUIRED] (string) Temporary directory.

_logDebug() protected méthode

Logs a message at debug level.
protected _logDebug ( string $message )
$message string The log message.

_logErr() protected méthode

Logs a message at error level.
protected _logErr ( string $message )
$message string The log message.

addEffect() public méthode

Attempts to apply requested effect to this image.
public addEffect ( string $type, array $params )
$type string The type of effect to apply.
$params array Any parameters for the effect.

applyEffects() public méthode

Applies any effects in the effect queue.
public applyEffects ( )

brush() public méthode

Useful for scatter diagrams, debug points, etc. Draws squares, circles, diamonds, and triangles.
public brush ( integer $x, integer $y, string $color = 'black', string $shape = 'square' )
$x integer The x coordinate of the point to brush.
$y integer The y coordinate of the point to brush.
$color string The color to brush the point with.
$shape string What brush to use? Defaults to a square.

clearGeometry() public méthode

Shouldn't really be called from client code, but is needed since effects may need to clear these.
public clearGeometry ( )

display() public méthode

Displays the current image.
public display ( )

getCapabilities() public méthode

Returns the capabilities.
public getCapabilities ( ) : array
Résultat array A list of backend capabilities.

getContentType() public méthode

Returns the MIME type for this image.
public getContentType ( ) : string
Résultat string The MIME type for this image.

getDimensions() public méthode

Returns the height and width of the current image data.
public getDimensions ( ) : array
Résultat array An hash with 'width' containing the width, 'height' containing the height of the image.

getImageAtIndex() public méthode

Returns a specific image from the pages of images.
public getImageAtIndex ( integer $index ) : Horde_Image_Base
$index integer The index to return.
Résultat Horde_Image_Base The requested image

getImagePageCount() public méthode

Returns the number of image pages available in the image object.
public getImagePageCount ( ) : integer
Résultat integer The number of images.

getLoadedEffects() public méthode

Returns a list of available effects for this driver.
public getLoadedEffects ( )

getTmpDir() public méthode

Returns the current temporary directory.
public getTmpDir ( ) : string
Résultat string The current temporary directory.

getType() public méthode

Returns the image type.
public getType ( ) : string
Résultat string The type of this image (png, jpg, etc.).

hasCapability() public méthode

Checks the existence of a particular capability.
public hasCapability ( string $capability ) : boolean
$capability string The capability to check for.
Résultat boolean True if the backend has this capability.

headers() public méthode

Sends HTTP headers for the image.
public headers ( )

loadFile() public méthode

Loads the image data from a file.
public loadFile ( string $filename )
$filename string The full path and filename to the file to load the image data from.

loadString() public méthode

Loads the image data from a string.
public loadString ( string $image_data )
$image_data string The data to use for the image.

raw() public méthode

Returns the raw data for this image.
public raw ( boolean $convert = false ) : string
$convert boolean If true, the image data will be returned in the target format, independently from any image operations.
Résultat string The raw image data.

reset() public méthode

Resets the image data to defaults.
public reset ( )

setType() public méthode

Sets the output image type.
public setType ( string $type ) : string
$type string An image type (png, jpg, etc.)
Résultat string The previous image type.

toFile() public méthode

If $data is false, saves current image data after performing any pending operations on the data. If $data contains raw image data, saves that data to file without regard for the current image data.
public toFile ( $data = null ) : string
Résultat string Path to temporary file.

Property Details

$_background protected_oe property

Background color.
protected string $_background
Résultat string

$_capabilities protected_oe property

Capabilites of this driver.
protected array $_capabilities
Résultat array

$_context protected_oe property

Cache the context
protected $_context

$_data protected_oe property

The current image data.
protected string $_data
Résultat string

$_height protected_oe property

The current height of the image data.
protected int $_height
Résultat integer

$_loadedEffects protected_oe property

Array containing available Effects
protected array $_loadedEffects
Résultat array

$_logger protected_oe property

Logger.
protected $_logger

$_tmpdir protected_oe property

A directory for temporary files.
protected string $_tmpdir
Résultat string

$_type protected_oe property

What kind of images should ImageMagick generate? Defaults to 'png'.
protected string $_type
Résultat string

$_width protected_oe property

The current width of the image data.
protected int $_width
Résultat integer