PHP Класс Horde_Image_Base, horde

Автор: Chuck Hagenbuch ([email protected])
Автор: Michael J. Rubinsky ([email protected])
Автор: Jan Schneider ([email protected])
Наследование: extends EmptyIterator
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_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.

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
__construct ( array $params, array $context = [] ) Constructor.
_logDebug ( string $message ) Logs a message at debug level.
_logErr ( string $message ) Logs a message at error level.

Описание методов

__call() публичный Метод

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

__construct() защищенный Метод

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() защищенный Метод

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

_logErr() защищенный Метод

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

addEffect() публичный Метод

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() публичный Метод

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

brush() публичный Метод

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() публичный Метод

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

display() публичный Метод

Displays the current image.
public display ( )

getCapabilities() публичный Метод

Returns the capabilities.
public getCapabilities ( ) : array
Результат array A list of backend capabilities.

getContentType() публичный Метод

Returns the MIME type for this image.
public getContentType ( ) : string
Результат string The MIME type for this image.

getDimensions() публичный Метод

Returns the height and width of the current image data.
public getDimensions ( ) : array
Результат array An hash with 'width' containing the width, 'height' containing the height of the image.

getImageAtIndex() публичный Метод

Returns a specific image from the pages of images.
public getImageAtIndex ( integer $index ) : Horde_Image_Base
$index integer The index to return.
Результат Horde_Image_Base The requested image

getImagePageCount() публичный Метод

Returns the number of image pages available in the image object.
public getImagePageCount ( ) : integer
Результат integer The number of images.

getLoadedEffects() публичный Метод

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

getTmpDir() публичный Метод

Returns the current temporary directory.
public getTmpDir ( ) : string
Результат string The current temporary directory.

getType() публичный Метод

Returns the image type.
public getType ( ) : string
Результат string The type of this image (png, jpg, etc.).

hasCapability() публичный Метод

Checks the existence of a particular capability.
public hasCapability ( string $capability ) : boolean
$capability string The capability to check for.
Результат boolean True if the backend has this capability.

headers() публичный Метод

Sends HTTP headers for the image.
public headers ( )

loadFile() публичный Метод

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() публичный Метод

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

raw() публичный Метод

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.
Результат string The raw image data.

reset() публичный Метод

Resets the image data to defaults.
public reset ( )

setType() публичный Метод

Sets the output image type.
public setType ( string $type ) : string
$type string An image type (png, jpg, etc.)
Результат string The previous image type.

toFile() публичный Метод

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
Результат string Path to temporary file.

Описание свойств

$_background защищенное свойство

Background color.
protected string $_background
Результат string

$_capabilities защищенное свойство

Capabilites of this driver.
protected array $_capabilities
Результат array

$_context защищенное свойство

Cache the context
protected $_context

$_data защищенное свойство

The current image data.
protected string $_data
Результат string

$_height защищенное свойство

The current height of the image data.
protected int $_height
Результат integer

$_loadedEffects защищенное свойство

Array containing available Effects
protected array $_loadedEffects
Результат array

$_logger защищенное свойство

Logger.
protected $_logger

$_tmpdir защищенное свойство

A directory for temporary files.
protected string $_tmpdir
Результат string

$_type защищенное свойство

What kind of images should ImageMagick generate? Defaults to 'png'.
protected string $_type
Результат string

$_width защищенное свойство

The current width of the image data.
protected int $_width
Результат integer