PHP 클래스 Pop\Image\AbstractImage

저자: Nick Sagona, III ([email protected])
상속: implements Pop\Image\ImageInterface
파일 보기 프로젝트 열기: nicksagona/PopPHP 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$alpha boolean Image alpha
$backgroundColor mixed Image background color
$channels integer Image channels
$depth integer Image bit depth
$fillColor mixed Image fill color
$height integer Image height
$info ArrayObject Image extension info
$mode string Image mode
$quality integer | string Image quality
$resource resource Image resource
$strokeColor mixed Image stroke color
$strokeWidth integer Image stroke width
$width integer Image width

공개 메소드들

메소드 설명
__construct ( string $img, integer | string $w = null, integer | string $h = null, Pop\Color\Space\ColorInterface $color = null, array $types = null ) : AbstractImage Constructor
border ( integer $w, integer $h = null, integer $type = AbstractImage::INNER_BORDER ) : mixed Method to add a border to the image.
brightness ( integer $b ) : mixed Method to adjust the brightness of the image.
colorTotal ( ) : integer Return the number of colors in the palette of indexed images.
colorize ( Pop\Color\Space\ColorInterface $color ) : mixed Method to colorize the image with the color passed.
contrast ( integer $amount ) : mixed Method to adjust the contrast of the image.
convert ( string $type ) : mixed Convert the image object to the new specified image type.
crop ( integer | string $wid, integer | string $hgt, integer | string $x, integer | string $y ) : mixed Crop the image object to a image whose dimensions are based on the value of the $wid and $hgt argument. The optional $x and $y arguments allow for the adjustment of the crop to select a certain area of the image to be cropped.
cropThumb ( integer | string $px, integer | string $x, integer | string $y ) : mixed Crop the image object to a square image whose dimensions are based on the value of the $px argument. The optional $x and $y arguments allow for the adjustment of the crop to select a certain area of the image to be cropped. For example, if the values of $px = 50, $x = 20, $y = 0 are passed, then a 50px X 50px image will be created from the original image, with its origins starting at the (20, 0) x-y coordinates.
destroy ( boolean $file = false ) : void Destroy the image object and the related image file directly.
drawArc ( integer $x, integer $y, integer $start, integer $end, integer $w, integer $h = null ) : void Method to add an arc to the image.
drawCircle ( integer $x, integer $y, integer $w ) : void Method to add a circle to the image.
drawEllipse ( integer $x, integer $y, integer $w, integer $h = null ) : void Method to add an ellipse to the image.
drawLine ( integer $x1, integer $y1, integer $x2, integer $y2 ) : void Method to add a line to the image.
drawPolygon ( array $points ) : void Method to add a polygon to the image.
drawRectangle ( integer $x, integer $y, integer $w, integer $h = null ) : void Method to add a rectangle to the image.
drawSquare ( integer $x, integer $y, integer $w ) : void Method to add a square to the image.
getChannels ( ) : integer Get the number of image channels.
getColorMode ( ) : string Get the image color mode.
getColors ( string $format = 'HEX' ) : array Return all of the colors in the palette in an array format, omitting any repeats. It is strongly advised that this method only be used for smaller image files, preferably with small palettes, as any large images with many colors will cause this method to run slowly. Default format of the values in the returned array is the 6-digit HEX value, but if 'RGB' is passed, then the format of the values in the returned array will be 'R,G,B', i.e. '235,123,12'.
getDepth ( ) : integer Get the image bit depth.
getHeight ( ) : integer Get the image height.
getWidth ( ) : integer Get the image width.
hasAlpha ( ) : boolean Get whether or not the image has an alpha channel.
info ( ) : ArrayObject Get the image resource info
invert ( ) : mixed Method to invert the image (create a negative.)
overlay ( string $ovr, integer | string $x, integer | string $y ) : mixed Overlay an image onto the current image.
resize ( integer | string $px ) : mixed Resize the image object, allowing for the largest dimension to be scaled to the value of the $px argument. For example, if the value of $px = 200, and the image is 800px X 600px, then the image will be scaled to 200px X 150px.
resizeToHeight ( integer | string $hgt ) : mixed Resize the image object to the height parameter passed.
resizeToWidth ( integer | string $wid ) : mixed Resize the image object to the width parameter passed.
rotate ( integer | string $deg ) : mixed Rotate the image object, using simple degrees, i.e. -90, to rotate the image.
scale ( float | string $scl ) : mixed Scale the image object, allowing for the dimensions to be scaled proportionally to the value of the $scl argument. For example, if the value of $scl = 0.50, and the image is 800px X 600px, then the image will be scaled to 400px X 300px.
setBackgroundColor ( Pop\Color\Space\ColorInterface $color = null ) : mixed Set the background color.
setFillColor ( Pop\Color\Space\ColorInterface $color = null ) : mixed Set the fill color.
setOpacity ( integer | string $opac ) : mixed Set the opacity.
setQuality ( integer | string $q = null ) : mixed Set the image quality based on the type of image.
setStrokeColor ( Pop\Color\Space\ColorInterface $color = null ) : mixed Set the stroke color.
setStrokeWidth ( integer | string $wid = null ) : mixed Set the stroke width.
text ( string $str, integer | string $size, integer | string $x, integer | string $y, string $font = null, integer | string $rotate = null, boolean $stroke = false ) : mixed Create text within the an image object. A font file can be used for the font argument. The size, rotation and position can be set by those arguments.

보호된 메소드들

메소드 설명
setColor ( Pop\Color\Space\ColorInterface $color = null ) : mixed Set and return a color identifier.

메소드 상세

__construct() 공개 메소드

Instantiate an image file object based on either a pre-existing image file on disk, or a new image file.
public __construct ( string $img, integer | string $w = null, integer | string $h = null, Pop\Color\Space\ColorInterface $color = null, array $types = null ) : AbstractImage
$img string
$w integer | string
$h integer | string
$color Pop\Color\Space\ColorInterface
$types array
리턴 AbstractImage

border() 추상적인 공개 메소드

Method to add a border to the image.
abstract public border ( integer $w, integer $h = null, integer $type = AbstractImage::INNER_BORDER ) : mixed
$w integer
$h integer
$type integer
리턴 mixed

brightness() 추상적인 공개 메소드

Method to adjust the brightness of the image.
abstract public brightness ( integer $b ) : mixed
$b integer
리턴 mixed

colorTotal() 추상적인 공개 메소드

Returns 0 for true color images.
abstract public colorTotal ( ) : integer
리턴 integer

colorize() 추상적인 공개 메소드

Method to colorize the image with the color passed.
abstract public colorize ( Pop\Color\Space\ColorInterface $color ) : mixed
$color Pop\Color\Space\ColorInterface
리턴 mixed

contrast() 추상적인 공개 메소드

Method to adjust the contrast of the image.
abstract public contrast ( integer $amount ) : mixed
$amount integer
리턴 mixed

convert() 추상적인 공개 메소드

Convert the image object to the new specified image type.
abstract public convert ( string $type ) : mixed
$type string
리턴 mixed

crop() 추상적인 공개 메소드

Crop the image object to a image whose dimensions are based on the value of the $wid and $hgt argument. The optional $x and $y arguments allow for the adjustment of the crop to select a certain area of the image to be cropped.
abstract public crop ( integer | string $wid, integer | string $hgt, integer | string $x, integer | string $y ) : mixed
$wid integer | string
$hgt integer | string
$x integer | string
$y integer | string
리턴 mixed

cropThumb() 추상적인 공개 메소드

Crop the image object to a square image whose dimensions are based on the value of the $px argument. The optional $x and $y arguments allow for the adjustment of the crop to select a certain area of the image to be cropped. For example, if the values of $px = 50, $x = 20, $y = 0 are passed, then a 50px X 50px image will be created from the original image, with its origins starting at the (20, 0) x-y coordinates.
abstract public cropThumb ( integer | string $px, integer | string $x, integer | string $y ) : mixed
$px integer | string
$x integer | string
$y integer | string
리턴 mixed

destroy() 추상적인 공개 메소드

Destroy the image object and the related image file directly.
abstract public destroy ( boolean $file = false ) : void
$file boolean
리턴 void

drawArc() 추상적인 공개 메소드

Method to add an arc to the image.
abstract public drawArc ( integer $x, integer $y, integer $start, integer $end, integer $w, integer $h = null ) : void
$x integer
$y integer
$start integer
$end integer
$w integer
$h integer
리턴 void

drawCircle() 추상적인 공개 메소드

Method to add a circle to the image.
abstract public drawCircle ( integer $x, integer $y, integer $w ) : void
$x integer
$y integer
$w integer
리턴 void

drawEllipse() 추상적인 공개 메소드

Method to add an ellipse to the image.
abstract public drawEllipse ( integer $x, integer $y, integer $w, integer $h = null ) : void
$x integer
$y integer
$w integer
$h integer
리턴 void

drawLine() 추상적인 공개 메소드

Method to add a line to the image.
abstract public drawLine ( integer $x1, integer $y1, integer $x2, integer $y2 ) : void
$x1 integer
$y1 integer
$x2 integer
$y2 integer
리턴 void

drawPolygon() 추상적인 공개 메소드

Method to add a polygon to the image.
abstract public drawPolygon ( array $points ) : void
$points array
리턴 void

drawRectangle() 추상적인 공개 메소드

Method to add a rectangle to the image.
abstract public drawRectangle ( integer $x, integer $y, integer $w, integer $h = null ) : void
$x integer
$y integer
$w integer
$h integer
리턴 void

drawSquare() 추상적인 공개 메소드

Method to add a square to the image.
abstract public drawSquare ( integer $x, integer $y, integer $w ) : void
$x integer
$y integer
$w integer
리턴 void

getChannels() 공개 메소드

Get the number of image channels.
public getChannels ( ) : integer
리턴 integer

getColorMode() 공개 메소드

Get the image color mode.
public getColorMode ( ) : string
리턴 string

getColors() 추상적인 공개 메소드

Return all of the colors in the palette in an array format, omitting any repeats. It is strongly advised that this method only be used for smaller image files, preferably with small palettes, as any large images with many colors will cause this method to run slowly. Default format of the values in the returned array is the 6-digit HEX value, but if 'RGB' is passed, then the format of the values in the returned array will be 'R,G,B', i.e. '235,123,12'.
abstract public getColors ( string $format = 'HEX' ) : array
$format string
리턴 array

getDepth() 공개 메소드

Get the image bit depth.
public getDepth ( ) : integer
리턴 integer

getHeight() 공개 메소드

Get the image height.
public getHeight ( ) : integer
리턴 integer

getWidth() 공개 메소드

Get the image width.
public getWidth ( ) : integer
리턴 integer

hasAlpha() 공개 메소드

Get whether or not the image has an alpha channel.
public hasAlpha ( ) : boolean
리턴 boolean

info() 공개 메소드

Get the image resource info
public info ( ) : ArrayObject
리턴 ArrayObject

invert() 추상적인 공개 메소드

Method to invert the image (create a negative.)
abstract public invert ( ) : mixed
리턴 mixed

overlay() 추상적인 공개 메소드

Overlay an image onto the current image.
abstract public overlay ( string $ovr, integer | string $x, integer | string $y ) : mixed
$ovr string
$x integer | string
$y integer | string
리턴 mixed

resize() 추상적인 공개 메소드

Resize the image object, allowing for the largest dimension to be scaled to the value of the $px argument. For example, if the value of $px = 200, and the image is 800px X 600px, then the image will be scaled to 200px X 150px.
abstract public resize ( integer | string $px ) : mixed
$px integer | string
리턴 mixed

resizeToHeight() 추상적인 공개 메소드

Resize the image object to the height parameter passed.
abstract public resizeToHeight ( integer | string $hgt ) : mixed
$hgt integer | string
리턴 mixed

resizeToWidth() 추상적인 공개 메소드

Resize the image object to the width parameter passed.
abstract public resizeToWidth ( integer | string $wid ) : mixed
$wid integer | string
리턴 mixed

rotate() 추상적인 공개 메소드

Rotate the image object, using simple degrees, i.e. -90, to rotate the image.
abstract public rotate ( integer | string $deg ) : mixed
$deg integer | string
리턴 mixed

scale() 추상적인 공개 메소드

Scale the image object, allowing for the dimensions to be scaled proportionally to the value of the $scl argument. For example, if the value of $scl = 0.50, and the image is 800px X 600px, then the image will be scaled to 400px X 300px.
abstract public scale ( float | string $scl ) : mixed
$scl float | string
리턴 mixed

setBackgroundColor() 공개 메소드

Set the background color.
public setBackgroundColor ( Pop\Color\Space\ColorInterface $color = null ) : mixed
$color Pop\Color\Space\ColorInterface
리턴 mixed

setColor() 추상적인 보호된 메소드

Set and return a color identifier.
abstract protected setColor ( Pop\Color\Space\ColorInterface $color = null ) : mixed
$color Pop\Color\Space\ColorInterface
리턴 mixed

setFillColor() 공개 메소드

Set the fill color.
public setFillColor ( Pop\Color\Space\ColorInterface $color = null ) : mixed
$color Pop\Color\Space\ColorInterface
리턴 mixed

setOpacity() 추상적인 공개 메소드

Set the opacity.
abstract public setOpacity ( integer | string $opac ) : mixed
$opac integer | string
리턴 mixed

setQuality() 추상적인 공개 메소드

Set the image quality based on the type of image.
abstract public setQuality ( integer | string $q = null ) : mixed
$q integer | string
리턴 mixed

setStrokeColor() 공개 메소드

Set the stroke color.
public setStrokeColor ( Pop\Color\Space\ColorInterface $color = null ) : mixed
$color Pop\Color\Space\ColorInterface
리턴 mixed

setStrokeWidth() 공개 메소드

Set the stroke width.
public setStrokeWidth ( integer | string $wid = null ) : mixed
$wid integer | string
리턴 mixed

text() 추상적인 공개 메소드

Create text within the an image object. A font file can be used for the font argument. The size, rotation and position can be set by those arguments.
abstract public text ( string $str, integer | string $size, integer | string $x, integer | string $y, string $font = null, integer | string $rotate = null, boolean $stroke = false ) : mixed
$str string
$size integer | string
$x integer | string
$y integer | string
$font string
$rotate integer | string
$stroke boolean
리턴 mixed

프로퍼티 상세

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

Image alpha
protected bool $alpha
리턴 boolean

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

Image background color
protected mixed $backgroundColor
리턴 mixed

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

Image channels
protected int $channels
리턴 integer

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

Image bit depth
protected int $depth
리턴 integer

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

Image fill color
protected mixed $fillColor
리턴 mixed

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

Image height
protected int $height
리턴 integer

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

Image extension info
protected ArrayObject $info
리턴 ArrayObject

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

Image mode
protected string $mode
리턴 string

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

Image quality
protected int|string $quality
리턴 integer | string

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

Image resource
protected resource $resource
리턴 resource

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

Image stroke color
protected mixed $strokeColor
리턴 mixed

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

Image stroke width
protected int $strokeWidth
리턴 integer

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

Image width
protected int $width
리턴 integer