PHP 클래스 Horde_Image_Im, horde

Copyright 2002-2014 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
저자: Chuck Hagenbuch ([email protected])
저자: Mike Cochrane ([email protected])
저자: Michael J. Rubinsky ([email protected])
상속: extends Horde_Image_Base
파일 보기 프로젝트 열기: horde/horde 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_capabilities string[] Capabilites of this driver.
$_convert string Path to the convert binary.
$_identify string Path to the identify binary.
$_operations array Operations to be performed before the source filename is specified on the command line.
$_postSrcOperations array Operations to be added after the source filename is specified on the command line.
$_toClean array Use addFileToClean() from client code (effects) to add files to this array.

공개 메소드들

메소드 설명
__construct ( $params, $context = [] ) Constructor.
addFileToClean ( $filename )
addOperation ( $operation )
addPostSrcOperation ( $operation )
applyEffects ( ) Applies any effects in the effect queue.
arc ( integer $x, integer $y, integer $r, integer $start, integer $end, string $color = 'black', string $fill = 'none' ) Draws an arc.
circle ( integer $x, integer $y, integer $r, string $color, string $fill = 'none' ) Draws a circle.
crop ( integer $x1, integer $y1, integer $x2, integer $y2 ) Crops the current image.
current ( ) : Horde_Image_Imagick Return the current image from the internal iterator.
dashedLine ( integer $x0, integer $y0, integer $x1, integer $y1, string $color = 'black', string $width = 1, integer $dash_length = 2, integer $dash_space = 2 ) Draws a dashed line.
executeConvertCmd ( string $cmd, array $values = [] ) Method to execute a raw command directly in convert.
flip ( ) Flips the current image.
getConvertPath ( )
getIMVersion ( ) : string Returns the version of the convert command available.
getImageAtIndex ( integer $index ) : Horde_Image_Base Request a specific image from the collection of images.
getImagePageCount ( ) : integer Return the number of image pages available in the image object.
grayscale ( ) Converts the current image to grayscale.
key ( ) : integer Get the index of the internal iterator.
line ( integer $x0, integer $y0, integer $x1, integer $y1, string $color = 'black', string $width = 1 ) Draws a line.
mirror ( ) Mirrors the current image.
next ( ) : Horde_Image_Im Advance the iterator
polygon ( $verts, string $color, string $fill = 'none' ) Draws a polygon based on a set of vertices.
polyline ( $verts, string $color, string $width = 1 ) Draws a polyline (a non-closed, non-filled polygon) based on a set of vertices.
raw ( boolean $convert = false ) : string Returns the raw data for this image.
rectangle ( integer $x, integer $y, integer $width, integer $height, string $color, string $fill = 'none' ) Draws a rectangle.
reset ( ) Resets the image data.
resize ( integer $width, integer $height, boolean $ratio = true, boolean $keepProfile = false ) Resizes the current image.
rewind ( ) : void Reset the imagick iterator to the first image in the set.
rotate ( integer $angle, integer $background = 'white' ) Rotates the current image.
roundedRectangle ( integer $x, integer $y, integer $width, integer $height, integer $round, string $color, string $fill ) Draws a rounded rectangle.
sepia ( integer $threshold = 85 ) Applies a sepia filter.
text ( $string, integer $x, integer $y, string $font = '', string $color = 'black', integer $direction, string $fontsize = 'small' ) Draws a text string on the image in a specified location, with the specified style information.
valid ( ) : boolean Deterimines if the current iterator item is valid.

비공개 메소드들

메소드 설명
_getImagePages ( )
_raw ( boolean $convert = false, integer $index, $preserve_data = false ) : string Returns the raw data for this image.

메소드 상세

__construct() 공개 메소드

Constructor.
또한 보기: Horde_Image_Base::_construct
public __construct ( $params, $context = [] )

addFileToClean() 공개 메소드

public addFileToClean ( $filename )

addOperation() 공개 메소드

public addOperation ( $operation )

addPostSrcOperation() 공개 메소드

public addPostSrcOperation ( $operation )

applyEffects() 공개 메소드

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

arc() 공개 메소드

Draws an arc.
public arc ( integer $x, integer $y, integer $r, integer $start, integer $end, string $color = 'black', string $fill = 'none' )
$x integer The x coordinate of the centre.
$y integer The y coordinate of the centre.
$r integer The radius of the arc.
$start integer The start angle of the arc.
$end integer The end angle of the arc.
$color string The line color of the arc.
$fill string The fill color of the arc (defaults to none).

circle() 공개 메소드

Draws a circle.
public circle ( integer $x, integer $y, integer $r, string $color, string $fill = 'none' )
$x integer The x coordinate of the centre.
$y integer The y coordinate of the centre.
$r integer The radius of the circle.
$color string The line color of the circle.
$fill string The color to fill the circle.

crop() 공개 메소드

Crops the current image.
public crop ( integer $x1, integer $y1, integer $x2, integer $y2 )
$x1 integer x for the top left corner.
$y1 integer y for the top left corner.
$x2 integer x for the bottom right corner.
$y2 integer y for the bottom right corner.

current() 공개 메소드

Return the current image from the internal iterator.
public current ( ) : Horde_Image_Imagick
리턴 Horde_Image_Imagick

dashedLine() 공개 메소드

Draws a dashed 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 )
$x0 integer The x co-ordinate of the start.
$y0 integer The y co-ordinate of the start.
$x1 integer The x co-ordinate of the end.
$y1 integer The y co-ordinate of the end.
$color string The line color.
$width string The width of the line.
$dash_length integer The length of a dash on the dashed line
$dash_space integer The length of a space in the dashed line

executeConvertCmd() 공개 메소드

Useful for executing more involved operations that may require multiple convert commands piped into each other for example. Really designed for use by Im based Horde_Image_Effect objects. The input and output files are quoted and substituted for __FILEIN__ and __FILEOUT__ respectfully. In order to support piped convert commands, the path to the convert command is substitued for __CONVERT__ (but the initial convert command is added automatically).
public executeConvertCmd ( string $cmd, array $values = [] )
$cmd string The command string, with substitutable tokens
$values array Any values that should be substituted for tokens.

flip() 공개 메소드

Flips the current image.
public flip ( )

getConvertPath() 공개 메소드

public getConvertPath ( )

getIMVersion() 공개 메소드

This needs to be publicly visable since it's used by various effects.
public getIMVersion ( ) : string
리턴 string A version string suitable for using in version_compare().

getImageAtIndex() 공개 메소드

Request a specific image from the collection of images.
public getImageAtIndex ( integer $index ) : Horde_Image_Base
$index integer The index to return
리턴 Horde_Image_Base

getImagePageCount() 공개 메소드

Return the number of image pages available in the image object.
public getImagePageCount ( ) : integer
리턴 integer

grayscale() 공개 메소드

Converts the current image to grayscale.
public grayscale ( )

key() 공개 메소드

Get the index of the internal iterator.
public key ( ) : integer
리턴 integer

line() 공개 메소드

Draws a line.
public line ( integer $x0, integer $y0, integer $x1, integer $y1, string $color = 'black', string $width = 1 )
$x0 integer The x coordinate of the start.
$y0 integer The y coordinate of the start.
$x1 integer The x coordinate of the end.
$y1 integer The y coordinate of the end.
$color string The line color.
$width string The width of the line.

mirror() 공개 메소드

Mirrors the current image.
public mirror ( )

next() 공개 메소드

Advance the iterator
public next ( ) : Horde_Image_Im
리턴 Horde_Image_Im

polygon() 공개 메소드

Draws a polygon based on a set of vertices.
public polygon ( $verts, string $color, string $fill = 'none' )
$color string The color you want to draw the polygon with.
$fill string The color to fill the polygon.

polyline() 공개 메소드

Draws a polyline (a non-closed, non-filled polygon) based on a set of vertices.
public polyline ( $verts, string $color, string $width = 1 )
$color string The color you want to draw the line with.
$width string The width of the line.

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.

rectangle() 공개 메소드

Draws a rectangle.
public rectangle ( integer $x, integer $y, integer $width, integer $height, string $color, string $fill = 'none' )
$x integer The left x-coordinate of the rectangle.
$y integer The top y-coordinate of the rectangle.
$width integer The width of the rectangle.
$height integer The height of the rectangle.
$color string The line color of the rectangle.
$fill string The color to fill the rectangle.

reset() 공개 메소드

Resets the image data.
public reset ( )

resize() 공개 메소드

Resizes the current image.
public resize ( integer $width, integer $height, boolean $ratio = true, boolean $keepProfile = false )
$width integer The new width.
$height integer The new height.
$ratio boolean Maintain original aspect ratio.
$keepProfile boolean Keep the image meta data.

rewind() 공개 메소드

Reset the imagick iterator to the first image in the set.
public rewind ( ) : void
리턴 void

rotate() 공개 메소드

Rotates the current image.
public rotate ( integer $angle, integer $background = 'white' )
$angle integer The angle to rotate the image by, in the clockwise direction.
$background integer The background color to fill any triangles.

roundedRectangle() 공개 메소드

Draws a rounded rectangle.
public roundedRectangle ( integer $x, integer $y, integer $width, integer $height, integer $round, string $color, string $fill )
$x integer The left x-coordinate of the rectangle.
$y integer The top y-coordinate of the rectangle.
$width integer The width of the rectangle.
$height integer The height of the rectangle.
$round integer The width of the corner rounding.
$color string The line color of the rectangle.
$fill string The color to fill the rounded rectangle with.

sepia() 공개 메소드

Applies a sepia filter.
public sepia ( integer $threshold = 85 )
$threshold integer Extent of sepia effect.

text() 공개 메소드

Draws a text string on the image in a specified location, with the specified style information.
public text ( $string, integer $x, integer $y, string $font = '', string $color = 'black', integer $direction, string $fontsize = 'small' )
$x integer The left x coordinate of the start of the text string.
$y integer The top y coordinate of the start of the text string.
$font string The font identifier you want to use for the text.
$color string The color that you want the text displayed in.
$direction integer An integer that specifies the orientation of the text.
$fontsize string Size of the font (small, medium, large, giant)

valid() 공개 메소드

Deterimines if the current iterator item is valid.
public valid ( ) : boolean
리턴 boolean

프로퍼티 상세

$_capabilities 보호되어 있는 프로퍼티

Capabilites of this driver.
protected string[] $_capabilities
리턴 string[]

$_convert 보호되어 있는 프로퍼티

Path to the convert binary.
protected string $_convert
리턴 string

$_identify 보호되어 있는 프로퍼티

Path to the identify binary.
protected string $_identify
리턴 string

$_operations 보호되어 있는 프로퍼티

Operations to be performed before the source filename is specified on the command line.
protected array $_operations
리턴 array

$_postSrcOperations 보호되어 있는 프로퍼티

Operations to be added after the source filename is specified on the command line.
protected array $_postSrcOperations
리턴 array

$_toClean 보호되어 있는 프로퍼티

Use addFileToClean() from client code (effects) to add files to this array.
protected array $_toClean
리턴 array