PHP Класс Pop\Image\Imagick

Автор: Nick Sagona, III ([email protected])
Наследование: extends Pop\Image\AbstractRasterImage
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$allowed array Array of allowed file types.
$blur integer Image blur
$compression integer | string Image compression
$filter integer Image filter
$opacity float Image color opacity
$overlay integer Image overlay

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

Метод Описание
__construct ( string $img, integer | string $w = null, integer | string $h = null, Pop\Color\Space\ColorInterface $color = null, array $types = null ) : Imagick Constructor
__destruct ( ) : void Destructor to destroy the image resource
__toString ( ) : string To string method to output the image
blur ( integer $radius, integer $sigma, integer $angle, integer $type = Imagick::BLUR ) : Imagick Method to blur the image.
border ( integer $w, integer $h = null, integer $type = Imagick::INNER_BORDER ) : Imagick Method to add a border to the image.
brightness ( integer $b ) : Imagick 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 ) : Imagick Method to colorize the image with the color passed.
contrast ( integer $amount ) : Imagick Method to adjust the contrast of the image.
convert ( string $type ) : Imagick 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
cropThumb ( integer | string $px, integer | string $x, integer | string $y ) : Imagick Crop the image object to a square image
desaturate ( ) : Imagick Method to desaturate of the image.
destroy ( boolean $file = false ) : void Destroy the image object and the related image file directly.
diffuse ( integer $radius ) : Imagick Apply a diffusion effect to the image
drawArc ( integer $x, integer $y, integer $start, integer $end, integer $w, integer $h = null ) : Imagick Method to add an arc to the image.
drawCircle ( integer $x, integer $y, integer $w ) : Imagick Method to add a circle to the image.
drawEllipse ( integer $x, integer $y, integer $w, integer $h = null ) : Imagick Method to add an ellipse to the image.
drawLine ( integer $x1, integer $y1, integer $x2, integer $y2 ) : Imagick Method to add a line to the image.
drawPolygon ( array $points ) : Imagick Method to add a polygon to the image.
drawRectangle ( integer $x, integer $y, integer $w, integer $h = null ) : Imagick Method to add a rectangle to the image.
drawSquare ( integer $x, integer $y, integer $w ) : Imagick Method to add a square to the image.
flatten ( ) : Imagick Flatten the image layers
flip ( ) : Imagick Method to flip the image over the x-axis.
flop ( ) : Imagick Method to flip the image over the y-axis.
formats ( ) : array Get formats
getColors ( integer | string $format = Pop\Image\Imagick::HEX ) : array Return all of the colors in the palette in an array format
getFormats ( ) : array Get the array of supported formats of Imagick.
getNumberOfFormats ( ) : integer Get the number of supported formats of Imagick.
hsb ( integer $h, integer $s, integer $b ) : Imagick Method to adjust the HSB of the image altogether.
hue ( integer $h ) : Imagick Method to adjust the hue of the image.
invert ( ) : Imagick Method to invert the image (create a negative.)
isInstalled ( ) : boolean Check if Imagick is installed.
level ( integer $black, float $gamma, integer $white ) : Imagick Method to adjust the levels of the image using a 0 - 255 range.
noise ( integer $type = Imagick::NOISE_MULTIPLICATIVEGAUSSIAN ) : Imagick Apply a noise effect to the image
output ( boolean $download = false ) : Imagick Output the image object directly.
overlay ( string $ovr, integer | string $x, integer | string $y ) : Imagick Overlay an image onto the current image.
paint ( integer $radius ) : Imagick Apply an oil paint effect to the image using the pixel radius threshold
pencil ( integer $radius, integer $sigma, integer $angle ) : Imagick Apply a pencil/sketch effect to the image
pixelate ( integer $w, integer $h = null ) : Imagick Apply a mosiac pixelate effect to the image
posterize ( integer $levels, boolean $dither = false ) : Imagick Apply a posterize effect to the image
resize ( integer | string $px ) : Imagick Resize the image object to the largest dimension
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.
resource ( ) : Imagick Get the image resource to directly interact with it
rotate ( integer | string $deg ) : Imagick Rotate the image object, using simple degrees, i.e. -90, to rotate the image.
saturation ( integer $s ) : Imagick Method to adjust the saturation of the image.
save ( string $to = null, boolean $append = false ) : Imagick Save the image object to disk.
scale ( float | string $scl ) : Imagick Scale the image object
setBlur ( integer | string $blur = null ) : Imagick Set the image blur.
setCompression ( integer $comp = null ) : Imagick Set the image compression quality with an Imagick compression constant
setFilter ( integer | string $filter = null ) : Imagick Set the image filter.
setFormats ( ) : Imagick Set the current object formats to include the supported formats of Imagick.
setOpacity ( float $opac ) : Imagick Set the opacity.
setOverlay ( integer | string $ovr = null ) : Imagick Set the image overlay.
setQuality ( integer $q = null ) : Imagick Set the image quality.
sharpen ( integer $radius, integer $sigma ) : Imagick Method to sharpen the image.
skew ( Pop\Color\Space\ColorInterface $color, integer $x, integer $y ) : Imagick Apply a skew effect to the image
swirl ( integer $degrees ) : Imagick Apply a swirl effect to the image
text ( string $str, integer | string $size, integer | string $x, integer | string $y, string $font = null, integer | string $rotate = null, boolean $stroke = false ) : Imagick Create text within the an image object
wave ( integer $amp, integer $length ) : Imagick Apply a wave effect to the image

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

Метод Описание
getInfo ( ) : void Get Imagick Info.
setColor ( Pop\Color\Space\ColorInterface $color = null ) : mixed Set and return a color identifier.
setImageInfo ( ) : void Set the image info

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

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

Instantiate an Imagick file object based on either a pre-existing image file on disk, or a new image file. As of July 28th, 2011, stable testing was successful with the following versions of the required software: ImageMagick 6.5.* Ghostscript 8.70 or 8.71 Imagick PHP Extension 3.0.1 Any variation in the versions of the required software may contribute to the Pop\Image\Imagick component not functioning properly.
public __construct ( string $img, integer | string $w = null, integer | string $h = null, Pop\Color\Space\ColorInterface $color = null, array $types = null ) : Imagick
$img string
$w integer | string
$h integer | string
$color Pop\Color\Space\ColorInterface
$types array
Результат Imagick

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

Destructor to destroy the image resource
public __destruct ( ) : void
Результат void

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

To string method to output the image
public __toString ( ) : string
Результат string

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

Method to blur the image.
public blur ( integer $radius, integer $sigma, integer $angle, integer $type = Imagick::BLUR ) : Imagick
$radius integer
$sigma integer
$angle integer
$type integer
Результат Imagick

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

Method to add a border to the image.
public border ( integer $w, integer $h = null, integer $type = Imagick::INNER_BORDER ) : Imagick
$w integer
$h integer
$type integer
Результат Imagick

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

Method to adjust the brightness of the image.
public brightness ( integer $b ) : Imagick
$b integer
Результат Imagick

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

Return the number of colors in the palette of indexed images.
public colorTotal ( ) : integer
Результат integer

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

Method to colorize the image with the color passed.
public colorize ( Pop\Color\Space\ColorInterface $color ) : Imagick
$color Pop\Color\Space\ColorInterface
Результат Imagick

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

Method to adjust the contrast of the image.
public contrast ( integer $amount ) : Imagick
$amount integer
Результат Imagick

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

Convert the image object to the new specified image type.
public convert ( string $type ) : Imagick
$type string
Результат Imagick

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

Crop the image object to a image
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
public cropThumb ( integer | string $px, integer | string $x, integer | string $y ) : Imagick
$px integer | string
$x integer | string
$y integer | string
Результат Imagick

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

Method to desaturate of the image.
public desaturate ( ) : Imagick
Результат Imagick

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

Destroy the image object and the related image file directly.
public destroy ( boolean $file = false ) : void
$file boolean
Результат void

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

Apply a diffusion effect to the image
public diffuse ( integer $radius ) : Imagick
$radius integer
Результат Imagick

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

Method to add an arc to the image.
public drawArc ( integer $x, integer $y, integer $start, integer $end, integer $w, integer $h = null ) : Imagick
$x integer
$y integer
$start integer
$end integer
$w integer
$h integer
Результат Imagick

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

Method to add a circle to the image.
public drawCircle ( integer $x, integer $y, integer $w ) : Imagick
$x integer
$y integer
$w integer
Результат Imagick

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

Method to add an ellipse to the image.
public drawEllipse ( integer $x, integer $y, integer $w, integer $h = null ) : Imagick
$x integer
$y integer
$w integer
$h integer
Результат Imagick

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

Method to add a line to the image.
public drawLine ( integer $x1, integer $y1, integer $x2, integer $y2 ) : Imagick
$x1 integer
$y1 integer
$x2 integer
$y2 integer
Результат Imagick

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

Method to add a polygon to the image.
public drawPolygon ( array $points ) : Imagick
$points array
Результат Imagick

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

Method to add a rectangle to the image.
public drawRectangle ( integer $x, integer $y, integer $w, integer $h = null ) : Imagick
$x integer
$y integer
$w integer
$h integer
Результат Imagick

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

Method to add a square to the image.
public drawSquare ( integer $x, integer $y, integer $w ) : Imagick
$x integer
$y integer
$w integer
Результат Imagick

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

Flatten the image layers
public flatten ( ) : Imagick
Результат Imagick

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

Method to flip the image over the x-axis.
public flip ( ) : Imagick
Результат Imagick

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

Method to flip the image over the y-axis.
public flop ( ) : Imagick
Результат Imagick

formats() публичный статический Метод

Get formats
public static formats ( ) : array
Результат array

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

Return all of the colors in the palette in an array format
public getColors ( integer | string $format = Pop\Image\Imagick::HEX ) : array
$format integer | string
Результат array

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

Get the array of supported formats of Imagick.
public getFormats ( ) : array
Результат array

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

Get Imagick Info.
protected getInfo ( ) : void
Результат void

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

Get the number of supported formats of Imagick.
public getNumberOfFormats ( ) : integer
Результат integer

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

Method to adjust the HSB of the image altogether.
public hsb ( integer $h, integer $s, integer $b ) : Imagick
$h integer
$s integer
$b integer
Результат Imagick

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

Method to adjust the hue of the image.
public hue ( integer $h ) : Imagick
$h integer
Результат Imagick

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

Method to invert the image (create a negative.)
public invert ( ) : Imagick
Результат Imagick

isInstalled() публичный статический Метод

Check if Imagick is installed.
public static isInstalled ( ) : boolean
Результат boolean

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

Method to adjust the levels of the image using a 0 - 255 range.
public level ( integer $black, float $gamma, integer $white ) : Imagick
$black integer
$gamma float
$white integer
Результат Imagick

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

Apply a noise effect to the image
public noise ( integer $type = Imagick::NOISE_MULTIPLICATIVEGAUSSIAN ) : Imagick
$type integer
Результат Imagick

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

Output the image object directly.
public output ( boolean $download = false ) : Imagick
$download boolean
Результат Imagick

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

Overlay an image onto the current image.
public overlay ( string $ovr, integer | string $x, integer | string $y ) : Imagick
$ovr string
$x integer | string
$y integer | string
Результат Imagick

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

Apply an oil paint effect to the image using the pixel radius threshold
public paint ( integer $radius ) : Imagick
$radius integer
Результат Imagick

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

Apply a pencil/sketch effect to the image
public pencil ( integer $radius, integer $sigma, integer $angle ) : Imagick
$radius integer
$sigma integer
$angle integer
Результат Imagick

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

Apply a mosiac pixelate effect to the image
public pixelate ( integer $w, integer $h = null ) : Imagick
$w integer
$h integer
Результат Imagick

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

Apply a posterize effect to the image
public posterize ( integer $levels, boolean $dither = false ) : Imagick
$levels integer
$dither boolean
Результат Imagick

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

Resize the image object to the largest dimension
public resize ( integer | string $px ) : Imagick
$px integer | string
Результат Imagick

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

Resize the image object to the height parameter passed.
public resizeToHeight ( integer | string $hgt ) : mixed
$hgt integer | string
Результат mixed

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

Resize the image object to the width parameter passed.
public resizeToWidth ( integer | string $wid ) : mixed
$wid integer | string
Результат mixed

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

Get the image resource to directly interact with it
public resource ( ) : Imagick
Результат Imagick

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

Rotate the image object, using simple degrees, i.e. -90, to rotate the image.
public rotate ( integer | string $deg ) : Imagick
$deg integer | string
Результат Imagick

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

Method to adjust the saturation of the image.
public saturation ( integer $s ) : Imagick
$s integer
Результат Imagick

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

Save the image object to disk.
public save ( string $to = null, boolean $append = false ) : Imagick
$to string
$append boolean
Результат Imagick

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

Scale the image object
public scale ( float | string $scl ) : Imagick
$scl float | string
Результат Imagick

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

Set the image blur.
public setBlur ( integer | string $blur = null ) : Imagick
$blur integer | string
Результат Imagick

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

Set and return a color identifier.
protected setColor ( Pop\Color\Space\ColorInterface $color = null ) : mixed
$color Pop\Color\Space\ColorInterface
Результат mixed

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

Set the image compression quality with an Imagick compression constant
public setCompression ( integer $comp = null ) : Imagick
$comp integer
Результат Imagick

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

Set the image filter.
public setFilter ( integer | string $filter = null ) : Imagick
$filter integer | string
Результат Imagick

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

Set the current object formats to include the supported formats of Imagick.
public setFormats ( ) : Imagick
Результат Imagick

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

Set the image info
protected setImageInfo ( ) : void
Результат void

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

Set the opacity.
public setOpacity ( float $opac ) : Imagick
$opac float
Результат Imagick

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

Set the image overlay.
public setOverlay ( integer | string $ovr = null ) : Imagick
$ovr integer | string
Результат Imagick

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

Set the image quality.
public setQuality ( integer $q = null ) : Imagick
$q integer
Результат Imagick

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

Method to sharpen the image.
public sharpen ( integer $radius, integer $sigma ) : Imagick
$radius integer
$sigma integer
Результат Imagick

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

Apply a skew effect to the image
public skew ( Pop\Color\Space\ColorInterface $color, integer $x, integer $y ) : Imagick
$color Pop\Color\Space\ColorInterface
$x integer
$y integer
Результат Imagick

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

Apply a swirl effect to the image
public swirl ( integer $degrees ) : Imagick
$degrees integer
Результат Imagick

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

Create text within the an image object
public text ( string $str, integer | string $size, integer | string $x, integer | string $y, string $font = null, integer | string $rotate = null, boolean $stroke = false ) : Imagick
$str string
$size integer | string
$x integer | string
$y integer | string
$font string
$rotate integer | string
$stroke boolean
Результат Imagick

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

Apply a wave effect to the image
public wave ( integer $amp, integer $length ) : Imagick
$amp integer
$length integer
Результат Imagick

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

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

Array of allowed file types.
protected array $allowed
Результат array

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

Image blur
protected int $blur
Результат integer

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

Image compression
protected int|string $compression
Результат integer | string

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

Image filter
protected int $filter
Результат integer

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

Image color opacity
protected float $opacity
Результат float

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

Image overlay
protected int $overlay
Результат integer