Gmagick

目录

简介

类摘要

Gmagick

class Gmagick {

/* 方法 */

public Gmagick addimage ( Gmagick $source )

public Gmagick addnoiseimage ( int $noise_type )

public Gmagick annotateimage ( GmagickDraw $GmagickDraw , float $x , float $y , float $angle , string $text )

public Gmagick blurimage ( float $radius , float $sigma [, int $channel ] )

public Gmagick borderimage ( GmagickPixel $color , int $width , int $height )

public Gmagick charcoalimage ( float $radius , float $sigma )

public Gmagick chopimage ( int $width , int $height , int $x , int $y )

public Gmagick clear ( void )

public Gmagick commentimage ( string $comment )

public Gmagick compositeimage ( Gmagick $source , int $COMPOSE , int $x , int $y )

public __construct ([ string $filename ] )

public Gmagick cropimage ( int $width , int $height , int $x , int $y )

public Gmagick cropthumbnailimage ( int $width , int $height )

public Gmagick current ( void )

public Gmagick cyclecolormapimage ( int $displace )

public Gmagick deconstructimages ( void )

public Gmagick despeckleimage ( void )

public bool destroy ( void )

public Gmagick drawimage ( GmagickDraw $GmagickDraw )

public Gmagick edgeimage ( float $radius )

public Gmagick embossimage ( float $radius , float $sigma )

public Gmagick enhanceimage ( void )

public Gmagick equalizeimage ( void )

public Gmagick flipimage ( void )

public Gmagick flopimage ( void )

public Gmagick frameimage ( GmagickPixel $color , int $width , int $height , int $inner_bevel , int $outer_bevel )

public Gmagick gammaimage ( float $gamma )

public string getcopyright ( void )

public string getfilename ( void )

public GmagickPixel getimagebackgroundcolor ( void )

public array getimageblueprimary ( void )

public GmagickPixel getimagebordercolor ( void )

public int getimagechanneldepth ( int $channel_type )

public int getimagecolors ( void )

public int getimagecolorspace ( void )

public int getimagecompose ( void )

public int getimagedelay ( void )

public int getimagedepth ( void )

public int getimagedispose ( void )

public array getimageextrema ( void )

public string getimagefilename ( void )

public string getimageformat ( void )

public float getimagegamma ( void )

public array getimagegreenprimary ( void )

public int getimageheight ( void )

public array getimagehistogram ( void )

public int getimageindex ( void )

public int getimageinterlacescheme ( void )

public int getimageiterations ( void )

public int getimagematte ( void )

public GmagickPixel getimagemattecolor ( void )

public string getimageprofile ( string $name )

public array getimageredprimary ( void )

public int getimagerenderingintent ( void )

public array getimageresolution ( void )

public int getimagescene ( void )

public string getimagesignature ( void )

public int getimagetype ( void )

public int getimageunits ( void )

public array getimagewhitepoint ( void )

public int getimagewidth ( void )

public string getpackagename ( void )

public array getquantumdepth ( void )

public string getreleasedate ( void )

public array getsamplingfactors ( void )

public array getsize ( void )

public array getversion ( void )

public mixed hasnextimage ( void )

public mixed haspreviousimage ( void )

public mixed implodeimage ( float $radius )

public mixed labelimage ( string $label )

public mixed levelimage ( float $blackPoint , float $gamma , float $whitePoint [, int $channel = Gmagick::CHANNEL_DEFAULT ] )

public mixed magnifyimage ( void )

public Gmagick mapimage ( gmagick $gmagick , bool $dither )

public void medianfilterimage ( float $radius )

public Gmagick minifyimage ( void )

public Gmagick modulateimage ( float $brightness , float $saturation , float $hue )

public Gmagick motionblurimage ( float $radius , float $sigma , float $angle )

public Gmagick newimage ( int $width , int $height , string $background [, string $format ] )

public bool nextimage ( void )

public Gmagick normalizeimage ([ int $channel ] )

public Gmagick oilpaintimage ( float $radius )

public bool previousimage ( void )

public Gmagick profileimage ( string $name , string $profile )

public Gmagick quantizeimage ( int $numColors , int $colorspace , int $treeDepth , bool $dither , bool $measureError )

public Gmagick quantizeimages ( int $numColors , int $colorspace , int $treeDepth , bool $dither , bool $measureError )

public array queryfontmetrics ( GmagickDraw $draw , string $text )

public array queryfonts ([ string $pattern = "*" ] )

public array queryformats ([ string $pattern = "*" ] )

public Gmagick radialblurimage ( float $angle [, int $channel = Gmagick::CHANNEL_DEFAULT ] )

public Gmagick raiseimage ( int $width , int $height , int $x , int $y , bool $raise )

public Gmagick read ( string $filename )

public Gmagick readimage ( string $filename )

public Gmagick readimageblob ( string $imageContents [, string $filename ] )

public Gmagick readimagefile ( resource $fp [, string $filename ] )

public Gmagick reducenoiseimage ( float $radius )

public Gmagick removeimage ( void )

public string removeimageprofile ( string $name )

public Gmagick resampleimage ( float $xResolution , float $yResolution , int $filter , float $blur )

public Gmagick resizeimage ( int $width , int $height , int $filter , float $blur [, bool $fit = FALSE ] )

public Gmagick rollimage ( int $x , int $y )

public Gmagick rotateimage ( mixed $color , float $degrees )

public Gmagick scaleimage ( int $width , int $height [, bool $fit = FALSE ] )

public Gmagick separateimagechannel ( int $channel )

Gmagick setCompressionQuality ( int $quality = 75 )

public Gmagick setfilename ( string $filename )

public Gmagick setimagebackgroundcolor ( GmagickPixel $color )

public Gmagick setimageblueprimary ( float $x , float $y )

public Gmagick setimagebordercolor ( GmagickPixel $color )

public Gmagick setimagechanneldepth ( int $channel , int $depth )

public Gmagick setimagecolorspace ( int $colorspace )

public Gmagick setimagecompose ( int $composite )

public Gmagick setimagedelay ( int $delay )

public Gmagick setimagedepth ( int $depth )

public Gmagick setimagedispose ( int $disposeType )

public Gmagick setimagefilename ( string $filename )

public Gmagick setimageformat ( string $imageFormat )

public Gmagick setimagegamma ( float $gamma )

public Gmagick setimagegreenprimary ( float $x , float $y )

public Gmagick setimageindex ( int $index )

public Gmagick setimageinterlacescheme ( int $interlace )

public Gmagick setimageiterations ( int $iterations )

public Gmagick setimageprofile ( string $name , string $profile )

public Gmagick setimageredprimary ( float $x , float $y )

public Gmagick setimagerenderingintent ( int $rendering_intent )

public Gmagick setimageresolution ( float $xResolution , float $yResolution )

public Gmagick setimagescene ( int $scene )

public Gmagick setimagetype ( int $imgType )

public Gmagick setimageunits ( int $resolution )

public Gmagick setimagewhitepoint ( float $x , float $y )

public Gmagick setsamplingfactors ( array $factors )

public Gmagick setsize ( int $columns , int $rows )

public Gmagick shearimage ( mixed $color , float $xShear , float $yShear )

public Gmagick solarizeimage ( int $threshold )

public Gmagick spreadimage ( float $radius )

public Gmagick stripimage ( void )

public Gmagick swirlimage ( float $degrees )

public Gmagick thumbnailimage ( int $width , int $height [, bool $fit = FALSE ] )

public Gmagick trimimage ( float $fuzz )

public Gmagick writeimage ( string $filename [, bool $all_frames = FALSE ] )

}

Gmagick::addimage

Adds new image to Gmagick object image list

说明

public Gmagick Gmagick::addimage ( Gmagick $source )

Adds new image to Gmagick object from the current position of the source object. After the operation iterator position is moved at the end of the list.

参数

source
The source Gmagick object

返回值

The Gmagick object with image added

错误/异常

错误时抛出 GmagickException

Gmagick::addnoiseimage

Adds random noise to the image

说明

public Gmagick Gmagick::addnoiseimage ( int $noise_type )

Adds random noise to the image.

参数

noise_type
The type of the noise. Refer to this list of noise constants.

返回值

The Gmagick object with noise added.

错误/异常

错误时抛出 GmagickException

Gmagick::annotateimage

Annotates an image with text

说明

public Gmagick Gmagick::annotateimage ( GmagickDraw $GmagickDraw , float $x , float $y , float $angle , string $text )

Annotates an image with text.

参数

GmagickDraw
The GmagickDraw object that contains settings for drawing the text

x
Horizontal offset in pixels to the left of text

y
Vertical offset in pixels to the baseline of text

angle
The angle at which to write the text

text
The string to draw

返回值

The Gmagick object with annotation made.

错误/异常

错误时抛出 GmagickException

Gmagick::blurimage

Adds blur filter to image

说明

public Gmagick Gmagick::blurimage ( float $radius , float $sigma [, int $channel ] )

Adds blur filter to image.

参数

radius
Blur radius

sigma
Standard deviation

返回值

The blurred Gmagick object

错误/异常

错误时抛出 GmagickException

Gmagick::borderimage

Surrounds the image with a border

说明

public Gmagick Gmagick::borderimage ( GmagickPixel $color , int $width , int $height )

Surrounds the image with a border of the color defined by the bordercolor GmagickPixel object or a color string.

参数

color
GmagickPixel object or a string containing the border color

width
Border width

height
Border height

返回值

The Gmagick object with border defined

错误/异常

错误时抛出 GmagickException

Gmagick::charcoalimage

Simulates a charcoal drawing

说明

public Gmagick Gmagick::charcoalimage ( float $radius , float $sigma )

Simulates a charcoal drawing.

参数

radius
The radius of the Gaussian, in pixels, not counting the center pixel

sigma
The standard deviation of the Gaussian, in pixels

返回值

The Gmagick object with charcoal simulation

错误/异常

错误时抛出 GmagickException

Gmagick::chopimage

Removes a region of an image and trims

说明

public Gmagick Gmagick::chopimage ( int $width , int $height , int $x , int $y )

Removes a region of an image and collapses the image to occupy the removed portion.

参数

width
Width of the chopped area

height
Height of the chopped area

x
X origo of the chopped area

y
Y origo of the chopped area

返回值

The chopped Gmagick object

错误/异常

错误时抛出 GmagickException

Gmagick::clear

Clears all resources associated to Gmagick object

说明

public Gmagick Gmagick::clear ( void )

Clears all resources associated to Gmagick object

参数

此函数没有参数。

返回值

The cleared Gmagick object

错误/异常

错误时抛出 GmagickException

Gmagick::commentimage

Adds a comment to your image

说明

public Gmagick Gmagick::commentimage ( string $comment )

Adds a comment to your image.

参数

comment
The comment to add

返回值

The Gmagick object with comment added.

错误/异常

错误时抛出 GmagickException

Gmagick::compositeimage

Composite one image onto another

说明

public Gmagick Gmagick::compositeimage ( Gmagick $source , int $COMPOSE , int $x , int $y )

Composite one image onto another at the specified offset.

参数

source
Gmagick object which holds the composite image

compose
Composite operator.

x
The column offset of the composited image

y
The row offset of the composited image

返回值

The Gmagick object with compositions.

错误/异常

错误时抛出 GmagickException

Gmagick::__construct

The Gmagick constructor

说明

public Gmagick::__construct ([ string $filename ] )

The Gmagick constructor.

参数

filename
The path to an image to load or array of paths

返回值

Returns a new Gmagick object on success.

错误/异常

错误时抛出 GmagickException

Gmagick::cropimage

Extracts a region of the image

说明

public Gmagick Gmagick::cropimage ( int $width , int $height , int $x , int $y )

Extracts a region of the image.

参数

width
The width of the crop

height
The height of the crop

x
The X coordinate of the cropped region's top left corner

y
The Y coordinate of the cropped region's top left corner

返回值

The cropped Gmagick object

错误/异常

错误时抛出 GmagickException

Gmagick::cropthumbnailimage

Creates a crop thumbnail

说明

public Gmagick Gmagick::cropthumbnailimage ( int $width , int $height )

Creates a fixed size thumbnail by first scaling the image down and cropping a specified area from the center.

参数

width
The width of the thumbnail

height
The Height of the thumbnail

返回值

The cropped Gmagick object

错误/异常

错误时抛出 GmagickException

Gmagick::current

The current purpose

说明

public Gmagick Gmagick::current ( void )

Returns reference to the current gmagick object with image pointer at the correct sequence.

参数

此函数没有参数。

返回值

Returns self on success.

错误/异常

错误时抛出 GmagickException

Gmagick::cyclecolormapimage

Displaces an image's colormap

说明

public Gmagick Gmagick::cyclecolormapimage ( int $displace )

Displaces an image's colormap by a given number of positions. If you cycle the colormap a number of times you can produce a psychedelic effect.

参数

displace
The amount to displace the colormap.

返回值

Returns self on success.

错误/异常

错误时抛出 GmagickException

Gmagick::deconstructimages

Returns certain pixel differences between images

说明

public Gmagick Gmagick::deconstructimages ( void )

Compares each image with the next in a sequence and returns the maximum bounding region of any pixel differences it discovers.

参数

此函数没有参数。

返回值

Returns a new Gmagick object on success.

错误/异常

错误时抛出 GmagickException

Gmagick::despeckleimage

The despeckleimage purpose

说明

public Gmagick Gmagick::despeckleimage ( void )

Reduces the speckle noise in an image while preserving the edges of the original image.

参数

此函数没有参数。

返回值

The despeckled Gmagick object on success.

错误/异常

错误时抛出 GmagickException

范例

示例 #1 Gmagick::despeckleimage example

<?php
/* ... */
?>

以上例程的输出类似于:

...

参见

  • Classname::Method

Gmagick::destroy

The destroy purpose

说明

public bool Gmagick::destroy ( void )

Destroys the Gmagick object and frees all resources associated with it

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE

错误/异常

错误时抛出 GmagickException

Gmagick::drawimage

Renders the GmagickDraw object on the current image

说明

public Gmagick Gmagick::drawimage ( GmagickDraw $GmagickDraw )

Renders the GmagickDraw object on the current image

参数

GmagickDraw
The drawing operations to render on the image.

返回值

The drawn Gmagick object

错误/异常

错误时抛出 GmagickException

Gmagick::edgeimage

Enhance edges within the image

说明

public Gmagick Gmagick::edgeimage ( float $radius )

Enhance edges within the image with a convolution filter of the given radius. Use radius 0 and it will be auto-selected.

参数

radius
The radius of the operation.

返回值

The Gmagick object with edges enhanced.

错误/异常

错误时抛出 GmagickException

Gmagick::embossimage

Returns a grayscale image with a three-dimensional effect

说明

public Gmagick Gmagick::embossimage ( float $radius , float $sigma )

Returns a grayscale image with a three-dimensional effect. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, radius should be larger than sigma. Use a radius of 0 and it will choose a suitable radius for you.

参数

radius
The radius of the effect

sigma
The sigma of the effect

返回值

The embossed Gmagick object.

错误/异常

错误时抛出 GmagickException

Gmagick::enhanceimage

Improves the quality of a noisy image

说明

public Gmagick Gmagick::enhanceimage ( void )

Applies a digital filter that improves the quality of a noisy image.

返回值

The enhanced Gmagick object.

错误/异常

错误时抛出 GmagickException

Gmagick::equalizeimage

Equalizes the image histogram

说明

public Gmagick Gmagick::equalizeimage ( void )

Equalizes the image histogram.

返回值

The equalized Gmagick object.

错误/异常

错误时抛出 GmagickException

Gmagick::flipimage

Creates a vertical mirror image

说明

public Gmagick Gmagick::flipimage ( void )

Creates a vertical mirror image by reflecting the pixels around the central x-axis.

返回值

The flipped Gmagick object.

错误/异常

错误时抛出 GmagickException

Gmagick::flopimage

The flopimage purpose

说明

public Gmagick Gmagick::flopimage ( void )

Creates a horizontal mirror image by reflecting the pixels around the central y-axis.

返回值

The flopped Gmagick object.

错误/异常

错误时抛出 GmagickException

Gmagick::frameimage

Adds a simulated three-dimensional border

说明

public Gmagick Gmagick::frameimage ( GmagickPixel $color , int $width , int $height , int $inner_bevel , int $outer_bevel )

Adds a simulated three-dimensional border around the image. The width and height specify the border width of the vertical and horizontal sides of the frame. The inner and outer bevels indicate the width of the inner and outer shadows of the frame.

参数

color
GmagickPixel object or a float representing the matte color

width
The width of the border

height
The height of the border

inner_bevel
The inner bevel width

outer_bevel
The outer bevel width

返回值

The framed Gmagick object.

错误/异常

错误时抛出 GmagickException

Gmagick::gammaimage

Gamma-corrects an image

说明

public Gmagick Gmagick::gammaimage ( float $gamma )

Gamma-corrects an image. The same image viewed on different devices will have perceptual differences in the way the image's intensities are represented on the screen. Specify individual gamma levels for the red, green, and blue channels, or adjust all three with the gamma parameter. Values typically range from 0.8 to 2.3.

参数

gamma
The amount of gamma-correction.

返回值

The gamma corrected Gmagick object.

错误/异常

错误时抛出 GmagickException

Gmagick::getcopyright

Returns the GraphicsMagick API copyright as a string

说明

public string Gmagick::getcopyright ( void )

Returns the GraphicsMagick API copyright as a string.

返回值

Returns a string containing the copyright notice of GraphicsMagick and Magickwand C API.

错误/异常

错误时抛出 GmagickException

Gmagick::getfilename

The filename associated with an image sequence

说明

public string Gmagick::getfilename ( void )

Returns the filename associated with an image sequence.

返回值

Returns a string on success.

错误/异常

错误时抛出 GmagickException

Gmagick::getimagebackgroundcolor

Returns the image background color

说明

public GmagickPixel Gmagick::getimagebackgroundcolor ( void )

Returns the image background color.

参数

此函数没有参数。

返回值

Returns an GmagickPixel set to the background color of the image.

错误/异常

错误时抛出 GmagickException

Gmagick::getimageblueprimary

Returns the chromaticy blue primary point

说明

public array Gmagick::getimageblueprimary ( void )

Returns the chromaticity blue primary point for the image.

参数

x
The chromaticity blue primary x-point.

y
The chromaticity blue primary y-point.

返回值

Array consisting of "x" and "y" coordinates of point.

错误/异常

错误时抛出 GmagickException

Gmagick::getimagebordercolor

Returns the image border color

说明

public GmagickPixel Gmagick::getimagebordercolor ( void )

Returns the image border color.

参数

此函数没有参数。

返回值

GmagickPixel object representing the color of the border

错误/异常

错误时抛出 GmagickException

Gmagick::getimagechanneldepth

Gets the depth for a particular image channel

说明

public int Gmagick::getimagechanneldepth ( int $channel_type )

Gets the depth for a particular image channel.

参数

此函数没有参数。

返回值

Depth of image channel

错误/异常

错误时抛出 GmagickException

Gmagick::getimagecolors

Returns the color of the specified colormap index

说明

public int Gmagick::getimagecolors ( void )

Returns the color of the specified colormap index.

参数

此函数没有参数。

返回值

The number of colors in image.

错误/异常

错误时抛出 GmagickException

Gmagick::getimagecolorspace

Gets the image colorspace

说明

public int Gmagick::getimagecolorspace ( void )

Gets the image colorspace.

参数

此函数没有参数。

返回值

Colorspace

错误/异常

错误时抛出 GmagickException

Gmagick::getimagecompose

Returns the composite operator associated with the image

说明

public int Gmagick::getimagecompose ( void )

Returns the composite operator associated with the image.

参数

此函数没有参数。

返回值

Returns the composite operator associated with the image.

错误/异常

错误时抛出 GmagickException

Gmagick::getimagedelay

Gets the image delay

说明

public int Gmagick::getimagedelay ( void )

Gets the image delay

参数

此函数没有参数。

返回值

Returns the composite operator associated with the image.

错误/异常

错误时抛出 GmagickException

Gmagick::getimagedepth

Gets the depth of the image

说明

public int Gmagick::getimagedepth ( void )

Gets the depth of the image.

参数

此函数没有参数。

返回值

Image depth

错误/异常

错误时抛出 GmagickException

Gmagick::getimagedispose

Gets the image disposal method

说明

public int Gmagick::getimagedispose ( void )

Gets the image disposal method

参数

此函数没有参数。

返回值

Returns the dispose method on success.

错误/异常

错误时抛出 GmagickException

Gmagick::getimageextrema

Gets the extrema for the image

说明

public array Gmagick::getimageextrema ( void )

Returns an associative array with the keys "min" and "max". 错误时抛出 GmagickException

参数

此函数没有参数。

返回值

Returns an associative array with the keys "min" and "max".

错误/异常

错误时抛出 GmagickException

Gmagick::getimagefilename

Returns the filename of a particular image in a sequence

说明

public string Gmagick::getimagefilename ( void )

Returns the filename of a particular image in a sequence

参数

此函数没有参数。

返回值

Returns a string with the filename of the image

错误/异常

错误时抛出 GmagickException

Gmagick::getimageformat

Returns the format of a particular image in a sequence

说明

public string Gmagick::getimageformat ( void )

Returns the format of a particular image in a sequence.

参数

此函数没有参数。

返回值

Returns a string containing the image format on success.

错误/异常

错误时抛出 GmagickException

Gmagick::getimagegamma

Gets the image gamma

说明

public float Gmagick::getimagegamma ( void )

Gets the image gamma

参数

此函数没有参数。

返回值

Returns the image gamma on success

错误/异常

错误时抛出 GmagickException

Gmagick::getimagegreenprimary

Returns the chromaticy green primary point

说明

public array Gmagick::getimagegreenprimary ( void )

Returns the chromaticity green primary point. Returns an array with the keys "x" and "y".

参数

此函数没有参数。

返回值

Returns an array with the keys "x" and "y" on success.

错误/异常

错误时抛出 GmagickException

Gmagick::getimageheight

Returns the image height

说明

public int Gmagick::getimageheight ( void )

Returns the image height

参数

此函数没有参数。

返回值

Returns the image height in pixels.

错误/异常

错误时抛出 GmagickException

Gmagick::getimagehistogram

Gets the image histogram

说明

public array Gmagick::getimagehistogram ( void )

Returns the image histogram as an array of GmagickPixel objects. Throw an GmagickException on error.

参数

此函数没有参数。

返回值

Returns the image histogram as an array of GmagickPixel objects.

错误/异常

错误时抛出 GmagickException

Gmagick::getimageindex

Gets the index of the current active image

说明

public int Gmagick::getimageindex ( void )

Returns the index of the current active image within the Gmagick object.

参数

此函数没有参数。

返回值

Index of current active image

错误/异常

错误时抛出 GmagickException

Gmagick::getimageinterlacescheme

Gets the image interlace scheme

说明

public int Gmagick::getimageinterlacescheme ( void )

Gets the image interlace scheme.

参数

此函数没有参数。

返回值

Returns the interlace scheme as an integer on success

错误/异常

错误时抛出 GmagickException

Gmagick::getimageiterations

Gets the image iterations

说明

public int Gmagick::getimageiterations ( void )

Gets the image iterations.

参数

此函数没有参数。

返回值

Returns the image iterations as an integer.

错误/异常

错误时抛出 GmagickException

Gmagick::getimagematte

Check if the image has a matte channel

说明

public int Gmagick::getimagematte ( void )

Returns TRUE if the image has a matte channel, otherwise FALSE.

参数

此函数没有参数。

返回值

Returns TRUE if the image has a matte channel, otherwise FALSE.

错误/异常

错误时抛出 GmagickException

Gmagick::getimagemattecolor

Returns the image matte color

说明

public GmagickPixel Gmagick::getimagemattecolor ( void )

Returns GmagickPixel object on success. Throw an GmagickException on error.

参数

此函数没有参数。

返回值

Returns GmagickPixel object on success.

错误/异常

错误时抛出 GmagickException

Gmagick::getimageprofile

Returns the named image profile

说明

public string Gmagick::getimageprofile ( string $name )

Returns the named image profile.

参数

此函数没有参数。

返回值

Returns a string containing the image profile.

错误/异常

错误时抛出 GmagickException

Gmagick::getimageredprimary

Returns the chromaticity red primary point

说明

public array Gmagick::getimageredprimary ( void )

Returns the chromaticity red primary point as an array with the keys "x" and "y".

参数

此函数没有参数。

返回值

Returns the chromaticity red primary point as an array with the keys "x" and "y".

错误/异常

错误时抛出 GmagickException

Gmagick::getimagerenderingintent

Gets the image rendering intent

说明

public int Gmagick::getimagerenderingintent ( void )

Gets the image rendering intent

参数

此函数没有参数。

返回值

Extracts a region of the image and returns it as a new wand

错误/异常

错误时抛出 GmagickException

Gmagick::getimageresolution

Gets the image X and Y resolution

说明

public array Gmagick::getimageresolution ( void )

Returns the resolution as an array.

参数

此函数没有参数。

返回值

Returns the resolution as an array.

错误/异常

错误时抛出 GmagickException

Gmagick::getimagescene

Gets the image scene

说明

public int Gmagick::getimagescene ( void )

Gets the image scene.

参数

此函数没有参数。

返回值

Returns the image scene.

错误/异常

错误时抛出 GmagickException

Gmagick::getimagesignature

Generates an SHA-256 message digest

说明

public string Gmagick::getimagesignature ( void )

Generates an SHA-256 message digest for the image pixel stream.

参数

此函数没有参数。

返回值

Returns a string containing the SHA-256 hash of the file.

错误/异常

错误时抛出 GmagickException

Gmagick::getimagetype

Gets the potential image type

说明

public int Gmagick::getimagetype ( void )

Gets the potential image type.

参数

此函数没有参数。

返回值

Returns the potential image type.

错误/异常

错误时抛出 GmagickException

Gmagick::getimageunits

Gets the image units of resolution

说明

public int Gmagick::getimageunits ( void )

Gets the image units of resolution.

参数

此函数没有参数。

返回值

Returns the image units of resolution.

Gmagick::getimagewhitepoint

Returns the chromaticity white point

说明

public array Gmagick::getimagewhitepoint ( void )

Returns the chromaticity white point as an associative array with the keys "x" and "y".

参数

此函数没有参数。

返回值

Returns the chromaticity white point as an associative array with the keys "x" and "y".

错误/异常

错误时抛出 GmagickException

Gmagick::getimagewidth

Returns the width of the image

说明

public int Gmagick::getimagewidth ( void )

Returns the width of the image.

参数

此函数没有参数。

返回值

Returns the image width.

错误/异常

错误时抛出 GmagickException

Gmagick::getpackagename

Returns the GraphicsMagick package name

说明

public string Gmagick::getpackagename ( void )

Returns the GraphicsMagick package name.

参数

此函数没有参数。

返回值

Returns the GraphicsMagick package name as a string.

错误/异常

错误时抛出 GmagickException

Gmagick::getquantumdepth

Returns the Gmagick quantum depth as a string

说明

public array Gmagick::getquantumdepth ( void )

Returns the Gmagick quantum depth as a string.

参数

此函数没有参数。

返回值

Returns the Gmagick quantum depth as a string.

错误/异常

错误时抛出 GmagickException

Gmagick::getreleasedate

Returns the GraphicsMagick release date as a string

说明

public string Gmagick::getreleasedate ( void )

Returns the GraphicsMagick release date as a string.

参数

此函数没有参数。

返回值

Returns the GraphicsMagick release date as a string.

错误/异常

错误时抛出 GmagickException

Gmagick::getsamplingfactors

Gets the horizontal and vertical sampling factor

说明

public array Gmagick::getsamplingfactors ( void )

Gets the horizontal and vertical sampling factor.

参数

此函数没有参数。

返回值

Returns an associative array with the horizontal and vertical sampling factors of the image.

错误/异常

错误时抛出 GmagickException

Gmagick::getsize

Returns the size associated with the Gmagick object

说明

public array Gmagick::getsize ( void )

Returns the size associated with the Gmagick object as an array with the keys "columns" and "rows".

参数

此函数没有参数。

返回值

Returns the size associated with the Gmagick object as an array with the keys "columns" and "rows".

错误/异常

错误时抛出 GmagickException

Gmagick::getversion

Returns the GraphicsMagick API version

说明

public array Gmagick::getversion ( void )

Returns the GraphicsMagick API version as a string and as a number.

参数

此函数没有参数。

返回值

Returns the GraphicsMagick API version as a string and as a number.

错误/异常

错误时抛出 GmagickException

Gmagick::hasnextimage

Checks if the object has more images

说明

public mixed Gmagick::hasnextimage ( void )

Returns TRUE if the object has more images when traversing the list in the forward direction.

参数

此函数没有参数。

返回值

Returns TRUE if the object has more images when traversing the list in the forward direction, returns FALSE if there are none.

错误/异常

错误时抛出 GmagickException

Gmagick::haspreviousimage

Checks if the object has a previous image

说明

public mixed Gmagick::haspreviousimage ( void )

Returns TRUE if the object has more images when traversing the list in the reverse direction

参数

此函数没有参数。

返回值

Returns TRUE if the object has more images when traversing the list in the reverse direction, returns FALSE if there are none.

错误/异常

错误时抛出 GmagickException

Gmagick::implodeimage

Creates a new image as a copy

说明

public mixed Gmagick::implodeimage ( float $radius )

Creates a new image that is a copy of an existing one with the image pixels "imploded" by the specified percentage.

参数

radius
The radius of the implode

返回值

Returns imploded Gmagick object.

错误/异常

错误时抛出 GmagickException

Gmagick::labelimage

Adds a label to an image

说明

public mixed Gmagick::labelimage ( string $label )

Adds a label to an image.

参数

label
The label to add

返回值

Gmagick with label.

错误/异常

错误时抛出 GmagickException

Gmagick::levelimage

Adjusts the levels of an image

说明

public mixed Gmagick::levelimage ( float $blackPoint , float $gamma , float $whitePoint [, int $channel = Gmagick::CHANNEL_DEFAULT ] )

Adjusts the levels of an image by scaling the colors falling between specified white and black points to the full available quantum range. The parameters provided represent the black, mid, and white points. The black point specifies the darkest color in the image. Colors darker than the black point are set to zero. Mid point specifies a gamma correction to apply to the image. White point specifies the lightest color in the image. Colors brighter than the white point are set to the maximum quantum value.

参数

blackPoint
The image black point

gamma
The gamma value

whitePoint
The image white point

channel
Provide any channel constant that is valid for your channel mode. To apply to more than one channel, combine channeltype constants using bitwise operators. Refer to this list of channel constants.

返回值

Gmagick object with image levelled.

错误/异常

错误时抛出 GmagickException

Gmagick::magnifyimage

Scales an image proportionally 2x

说明

public mixed Gmagick::magnifyimage ( void )

Conveniently scales an image proportionally to twice its original size.

参数

此函数没有参数。

返回值

Magnified Gmagick object.

错误/异常

错误时抛出 GmagickException

Gmagick::mapimage

Replaces the colors of an image with the closest color from a reference image

说明

public Gmagick Gmagick::mapimage ( gmagick $gmagick , bool $dither )

Replaces the colors of an image with the closest color from a reference image.

参数

gmagick
The reference image

dither
Set this integer value to something other than zero to dither the mapped image

返回值

Gmagick object

错误/异常

错误时抛出 GmagickException

Gmagick::medianfilterimage

Applies a digital filter

说明

public void Gmagick::medianfilterimage ( float $radius )

Applies a digital filter that improves the quality of a noisy image. Each pixel is replaced by the median in a set of neighboring pixels as defined by radius.

参数

radius
The radius of the pixel neighborhood.

返回值

Gmagick object with median filter applied.

错误/异常

错误时抛出 GmagickException

Gmagick::minifyimage

Scales an image proportionally to half its size

说明

public Gmagick Gmagick::minifyimage ( void )

A convenient method that scales an image proportionally to one-half its original size

参数

此函数没有参数。

返回值

The Gmagick object on success

错误/异常

错误时抛出 GmagickException

Gmagick::modulateimage

Control the brightness, saturation, and hue

说明

public Gmagick Gmagick::modulateimage ( float $brightness , float $saturation , float $hue )

Lets you control the brightness, saturation, and hue of an image. Hue is the percentage of absolute rotation from the current position. For example 50 results in a counter-clockwise rotation of 90 degrees, 150 results in a clockwise rotation of 90 degrees, with 0 and 200 both resulting in a rotation of 180 degrees.

参数

brightness
The percent change in brighness (-100 thru +100).

saturation
The percent change in saturation (-100 thru +100)

hue
The percent change in hue (-100 thru +100)

返回值

The Gmagick object on success

错误/异常

错误时抛出 GmagickException

Gmagick::motionblurimage

Simulates motion blur

说明

public Gmagick Gmagick::motionblurimage ( float $radius , float $sigma , float $angle )

Simulates motion blur. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, radius should be larger than sigma. Use a radius of 0 and MotionBlurImage() selects a suitable radius for you. Angle gives the angle of the blurring motion.

参数

radius
The radius of the Gaussian, in pixels, not counting the center pixel.

sigma
The standard deviation of the Gaussian, in pixels.

angle
Apply the effect along this angle.

返回值

The Gmagick object on success

错误/异常

错误时抛出 GmagickException

Gmagick::newimage

Creates a new image

说明

public Gmagick Gmagick::newimage ( int $width , int $height , string $background [, string $format ] )

Creates a new image with the specified background color

参数

width
Width of the new image

height
Height of the new image

background
The background color used for this image (as float)

format
Image format.

返回值

The Gmagick object on success

错误/异常

错误时抛出 GmagickException

Gmagick::nextimage

Moves to the next image

说明

public bool Gmagick::nextimage ( void )

Associates the next image in the image list with an Gmagick object.

参数

此函数没有参数。

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE

错误/异常

错误时抛出 GmagickException

Gmagick::normalizeimage

Enhances the contrast of a color image

说明

public Gmagick Gmagick::normalizeimage ([ int $channel ] )

Enhances the contrast of a color image by adjusting the pixels color to span the entire range of colors available.

参数

channel
Identify which channel to normalize

返回值

The Gmagick object on success

错误/异常

错误时抛出 GmagickException

Gmagick::oilpaintimage

Simulates an oil painting

说明

public Gmagick Gmagick::oilpaintimage ( float $radius )

Applies a special effect filter that simulates an oil painting. Each pixel is replaced by the most frequent color occurring in a circular region defined by radius.

参数

radius
The radius of the circular neighborhood.

返回值

The Gmagick object on success

错误/异常

错误时抛出 GmagickException

Gmagick::previousimage

Move to the previous image in the object

说明

public bool Gmagick::previousimage ( void )

Associates the previous image in an image list with the Gmagick object.

参数

此函数没有参数。

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE

错误/异常

错误时抛出 GmagickException

Gmagick::profileimage

Adds or removes a profile from an image

说明

public Gmagick Gmagick::profileimage ( string $name , string $profile )

Adds or removes a ICC, IPTC, or generic profile from an image. If the profile is NULL, it is removed from the image otherwise added. Use a name of '*' and a profile of NULL to remove all profiles from the image.

参数

name
Name of profile to add or remove: ICC, IPTC, or generic profile.

profile
The profile.

返回值

The Gmagick object on success

错误/异常

错误时抛出 GmagickException

Gmagick::quantizeimage

Analyzes the colors within a reference image

说明

public Gmagick Gmagick::quantizeimage ( int $numColors , int $colorspace , int $treeDepth , bool $dither , bool $measureError )

Analyzes the colors within a reference image and chooses a fixed number of colors to represent the image. The goal of the algorithm is to minimize the color difference between the input and output image while minimizing the processing time.

参数

numColors
The number of colors.

colorspace
Perform color reduction in this colorspace, typically RGBColorspace.

treeDepth
Normally, this integer value is zero or one. A zero or one tells Quantize to choose a optimal tree depth of Log4(number_colors).% A tree of this depth generally allows the best representation of the reference image with the least amount of memory and the fastest computational speed. In some cases, such as an image with low color dispersion (a few number of colors), a value other than Log4(number_colors) is required. To expand the color tree completely, use a value of 8.

dither
A value other than zero distributes the difference between an original image and the corresponding color reduced algorithm to neighboring pixels along a Hilbert curve.

measureError
A value other than zero measures the difference between the original and quantized images. This difference is the total quantization error. The error is computed by summing over all pixels in an image the distance squared in RGB space between each reference pixel value and its quantized value.

返回值

The Gmagick object on success

错误/异常

错误时抛出 GmagickException

Gmagick::quantizeimages

The quantizeimages purpose

说明

public Gmagick Gmagick::quantizeimages ( int $numColors , int $colorspace , int $treeDepth , bool $dither , bool $measureError )

Analyzes the colors within a sequence of images and chooses a fixed number of colors to represent the image. The goal of the algorithm is to minimize the color difference between the input and output image while minimizing the processing time.

参数

numColors
The number of colors.

colorspace
Perform color reduction in this colorspace, typically RGBColorspace.

treeDepth
Normally, this integer value is zero or one. A zero or one tells Quantize to choose a optimal tree depth of Log4(number_colors).% A tree of this depth generally allows the best representation of the reference image with the least amount of memory and the fastest computational speed. In some cases, such as an image with low color dispersion (a few number of colors), a value other than Log4(number_colors) is required. To expand the color tree completely, use a value of 8.

dither
A value other than zero distributes the difference between an original image and the corresponding color reduced algorithm to neighboring pixels along a Hilbert curve.

measureError
A value other than zero measures the difference between the original and quantized images. This difference is the total quantization error. The error is computed by summing over all pixels in an image the distance squared in RGB space between each reference pixel value and its quantized value.

返回值

The Gmagick object on success

错误/异常

错误时抛出 GmagickException

Gmagick::queryfontmetrics

Returns an array representing the font metrics

说明

public array Gmagick::queryfontmetrics ( GmagickDraw $draw , string $text )

MagickQueryFontMetrics() returns an array representing the font metrics.

参数

此函数没有参数。

返回值

The Gmagick object on success

错误/异常

错误时抛出 GmagickException

Gmagick::queryfonts

Returns the configured fonts

说明

public array Gmagick::queryfonts ([ string $pattern = "*" ] )

Returns fonts supported by Gmagick.

参数

此函数没有参数。

返回值

The Gmagick object on success

错误/异常

错误时抛出 GmagickException

Gmagick::queryformats

Returns formats supported by Gmagick

说明

public array Gmagick::queryformats ([ string $pattern = "*" ] )

Returns formats supported by Gmagick.

参数

pattern
Specifies a string containing a pattern.

返回值

The Gmagick object on success

错误/异常

错误时抛出 GmagickException

Gmagick::radialblurimage

Radial blurs an image

说明

public Gmagick Gmagick::radialblurimage ( float $angle [, int $channel = Gmagick::CHANNEL_DEFAULT ] )

Radial blurs an image.

参数

angle
The angle of the blur in degrees.

channel
Related channel

返回值

The Gmagick object on success

错误/异常

错误时抛出 GmagickException

Gmagick::raiseimage

Creates a simulated 3d button-like effect

说明

public Gmagick Gmagick::raiseimage ( int $width , int $height , int $x , int $y , bool $raise )

Creates a simulated three-dimensional button-like effect by lightening and darkening the edges of the image. Members width and height of raise_info define the width of the vertical and horizontal edge of the effect.

参数

width
Width of the area to raise.

height
Height of the area to raise.

x
X coordinate

y
Y coordinate

raise
A value other than zero creates a 3-D raise effect, otherwise it has a lowered effect.

返回值

The Gmagick object on success

错误/异常

错误时抛出 GmagickException

Gmagick::read

Reads image from filename

说明

public Gmagick Gmagick::read ( string $filename )

Reads image from filename.

参数

filename
The image filename.

返回值

The Gmagick object on success

错误/异常

错误时抛出 GmagickException

Gmagick::readimage

Reads image from filename

说明

public Gmagick Gmagick::readimage ( string $filename )

Reads image from filename.

参数

filename
The image filename.

返回值

The Gmagick object on success

错误/异常

错误时抛出 GmagickException

Gmagick::readimageblob

Reads image from a binary string

说明

public Gmagick Gmagick::readimageblob ( string $imageContents [, string $filename ] )

Reads image from a binary string.

参数

imageContents
Content of image

filename
The image filename.

返回值

The Gmagick object on success

错误/异常

错误时抛出 GmagickException

Gmagick::readimagefile

The readimagefile purpose

说明

public Gmagick Gmagick::readimagefile ( resource $fp [, string $filename ] )

Reads an image or image sequence from an open file descriptor.

参数

fp
The file descriptor.

返回值

The Gmagick object on success

错误/异常

错误时抛出 GmagickException

Gmagick::reducenoiseimage

Smooths the contours of an image

说明

public Gmagick Gmagick::reducenoiseimage ( float $radius )

Smooths the contours of an image while still preserving edge information. The algorithm works by replacing each pixel with its neighbor closest in value. A neighbor is defined by radius. Use a radius of 0 and Gmagick::reduceNoiseImage() selects a suitable radius for you.

参数

radius
The radius of the pixel neighborhood.

返回值

The Gmagick object on success

错误/异常

错误时抛出 GmagickException

Gmagick::removeimage

Removes an image from the image list

说明

public Gmagick Gmagick::removeimage ( void )

Removes an image from the image list.

参数

此函数没有参数。

返回值

The Gmagick object on success.

错误/异常

错误时抛出 GmagickException

Gmagick::removeimageprofile

Removes the named image profile and returns it

说明

public string Gmagick::removeimageprofile ( string $name )

Removes the named image profile and returns it.

参数

name
Name of profile to return: ICC, IPTC, or generic profile.

返回值

The named profile.

错误/异常

错误时抛出 GmagickException

Gmagick::resampleimage

Resample image to desired resolution

说明

public Gmagick Gmagick::resampleimage ( float $xResolution , float $yResolution , int $filter , float $blur )

Resample image to desired resolution.

参数

xResolution
The new image x resolution.

yResolution
The new image y resolution.

filter
Image filter to use.

blur
The blur factor where larger than 1 is blurry, smaller than 1 is sharp.

返回值

The Gmagick object on success

错误/异常

错误时抛出 GmagickException

Gmagick::resizeimage

Scales an image

说明

public Gmagick Gmagick::resizeimage ( int $width , int $height , int $filter , float $blur [, bool $fit = FALSE ] )

Scales an image to the desired dimensions with a filter.

参数

width
The number of columns in the scaled image.

height
The number of rows in the scaled image.

filter
Image filter to use.

blur
The blur factor where larger than 1 is blurry, lesser than 1 is sharp.

返回值

The Gmagick object on success

错误/异常

错误时抛出 GmagickException

Gmagick::rollimage

Offsets an image

说明

public Gmagick Gmagick::rollimage ( int $x , int $y )

Offsets an image as defined by x and y.

参数

x
The x offset.

y
The y offset.

返回值

The Gmagick object on success

错误/异常

错误时抛出 GmagickException

Gmagick::rotateimage

Rotates an image

说明

public Gmagick Gmagick::rotateimage ( mixed $color , float $degrees )

Rotates an image the specified number of degrees. Empty triangles left over from rotating the image are filled with the background color.

参数

color
The background pixel.

degrees
The number of degrees to rotate the image.

返回值

The Gmagick object on success

错误/异常

错误时抛出 GmagickException

Gmagick::scaleimage

Scales the size of an image

说明

public Gmagick Gmagick::scaleimage ( int $width , int $height [, bool $fit = FALSE ] )

Scales the size of an image to the given dimensions. The other parameter will be calculated if 0 is passed as either param.

参数

width
The number of columns in the scaled image.

height
The number of rows in the scaled image.

返回值

The Gmagick object on success.

错误/异常

错误时抛出 GmagickException

Gmagick::separateimagechannel

Separates a channel from the image

说明

public Gmagick Gmagick::separateimagechannel ( int $channel )

Separates a channel from the image and returns a grayscale image. A channel is a particular color component of each pixel in the image.

参数

channel
Identify which channel to extract: RedChannel, GreenChannel, BlueChannel, OpacityChannel, CyanChannel, MagentaChannel, YellowChannel, BlackChannel.

返回值

The Gmagick object on success

错误/异常

错误时抛出 GmagickException

Gmagick::setCompressionQuality

Sets the object's default compression quality

说明

Gmagick Gmagick::setCompressionQuality ( int $quality = 75 )

Sets the object's default compression quality.

参数

quality

返回值

The Gmagick object on success

错误/异常

错误时抛出 GmagickException

范例

示例 #1 Gmagick::setCompressionQuality

<?php
$gm = new Gmagick();
$gm->read("magick:rose");
$gm->setCompressionQuality(2);
?>

Gmagick::setfilename

Sets the filename before you read or write the image

说明

public Gmagick Gmagick::setfilename ( string $filename )

Sets the filename before you read or write an image file.

参数

filename
The image filename.

返回值

The Gmagick object on success

错误/异常

错误时抛出 GmagickException

Gmagick::setimagebackgroundcolor

Sets the image background color

说明

public Gmagick Gmagick::setimagebackgroundcolor ( GmagickPixel $color )

Sets the image background color.

参数

color
The background pixel wand.

返回值

The Gmagick object on success

错误/异常

错误时抛出 GmagickException

Gmagick::setimageblueprimary

Sets the image chromaticity blue primary point

说明

public Gmagick Gmagick::setimageblueprimary ( float $x , float $y )

Sets the image chromaticity blue primary point.

参数

x
The blue primary x-point.

y
The blue primary y-point.

返回值

The Gmagick object on success

错误/异常

错误时抛出 GmagickException

Gmagick::setimagebordercolor

Sets the image border color

说明

public Gmagick Gmagick::setimagebordercolor ( GmagickPixel $color )

Sets the image border color.

参数

color
The border pixel wand.

返回值

The Gmagick object on success

错误/异常

错误时抛出 GmagickException

Gmagick::setimagechanneldepth

Sets the depth of a particular image channel

说明

public Gmagick Gmagick::setimagechanneldepth ( int $channel , int $depth )

Sets the depth of a particular image channel.

参数

channel
Identify which channel to extract: RedChannel, GreenChannel, BlueChannel, OpacityChannel, CyanChannel, MagentaChannel, YellowChannel, BlackChannel.

depth
The image depth in bits.

返回值

The Gmagick object on success

错误/异常

错误时抛出 GmagickException

Gmagick::setimagecolorspace

Sets the image colorspace

说明

public Gmagick Gmagick::setimagecolorspace ( int $colorspace )

Sets the image colorspace.

参数

colorspace
The image colorspace: UndefinedColorspace, RGBColorspace, GRAYColorspace, TransparentColorspace, OHTAColorspace, XYZColorspace, YCbCrColorspace, YCCColorspace, YIQColorspace, YPbPrColorspace, YPbPrColorspace, YUVColorspace, CMYKColorspace, sRGBColorspace, HSLColorspace, or HWBColorspace.

返回值

The Gmagick object on success

错误/异常

错误时抛出 GmagickException

Gmagick::setimagecompose

Sets the image composite operator

说明

public Gmagick Gmagick::setimagecompose ( int $composite )

Sets the image composite operator.

参数

composite
The image composite operator.

返回值

The Gmagick object on success

错误/异常

错误时抛出 GmagickException

Gmagick::setimagedelay

Sets the image delay

说明

public Gmagick Gmagick::setimagedelay ( int $delay )

Sets the image delay

参数

delay
The image delay in 1/100th of a second.

返回值

The Gmagick object on success.

错误/异常

错误时抛出 GmagickException

Gmagick::setimagedepth

Sets the image depth

说明

public Gmagick Gmagick::setimagedepth ( int $depth )

Sets the image depth

参数

depth
The image depth in bits: 8, 16, or 32.

返回值

The Gmagick object on success.

错误/异常

错误时抛出 GmagickException

Gmagick::setimagedispose

Sets the image disposal method

说明

public Gmagick Gmagick::setimagedispose ( int $disposeType )

Sets the image disposal method.

参数

disposeType
The image disposal type.

返回值

The Gmagick object on success

错误/异常

错误时抛出 GmagickException

Gmagick::setimagefilename

Sets the filename of a particular image in a sequence

说明

public Gmagick Gmagick::setimagefilename ( string $filename )

Sets the filename of a particular image in a sequence.

参数

filename
The image filename.

返回值

The Gmagick object on success.

错误/异常

错误时抛出 GmagickException

Gmagick::setimageformat

Sets the format of a particular image

说明

public Gmagick Gmagick::setimageformat ( string $imageFormat )

Sets the format of a particular image in a sequence.

参数

imageFormat
The image format.

返回值

The Gmagick object on success.

错误/异常

错误时抛出 GmagickException

Gmagick::setimagegamma

Sets the image gamma

说明

public Gmagick Gmagick::setimagegamma ( float $gamma )

Sets the image gamma.

参数

gamma
The image gamma.

返回值

The Gmagick object on success

错误/异常

错误时抛出 GmagickException

Gmagick::setimagegreenprimary

Sets the image chromaticity green primary point

说明

public Gmagick Gmagick::setimagegreenprimary ( float $x , float $y )

Sets the image chromaticity green primary point.

参数

x
The chromaticity green primary x-point.

y
The chromaticity green primary y-point.

返回值

The Gmagick object on success.

错误/异常

错误时抛出 GmagickException

Gmagick::setimageindex

Set the iterator to the position in the image list specified with the index parameter

说明

public Gmagick Gmagick::setimageindex ( int $index )

Set the iterator to the position in the image list specified with the index parameter.

参数

index
The scene number.

返回值

The Gmagick object on success.

错误/异常

错误时抛出 GmagickException

Gmagick::setimageinterlacescheme

Sets the interlace scheme of the image

说明

public Gmagick Gmagick::setimageinterlacescheme ( int $interlace )

Sets the interlace scheme of the image.

参数

interlace
The image interlace scheme: NoInterlace, LineInterlace, PlaneInterlace, PartitionInterlace.

返回值

The Gmagick object on success

错误/异常

错误时抛出 GmagickException

Gmagick::setimageiterations

Sets the image iterations

说明

public Gmagick Gmagick::setimageiterations ( int $iterations )

Sets the image iterations.

参数

iterations
The image delay in 1/100th of a second.

返回值

The Gmagick object on success.

错误/异常

错误时抛出 GmagickException

Gmagick::setimageprofile

Adds a named profile to the Gmagick object

说明

public Gmagick Gmagick::setimageprofile ( string $name , string $profile )

Adds a named profile to the Gmagick object. If a profile with the same name already exists, it is replaced. This method differs from the Gmagick::profileimage() method in that it does not apply any CMS color profiles.

参数

name
Name of profile to add or remove: ICC, IPTC, or generic profile.

profile
The profile.

返回值

The Gmagick object on success.

错误/异常

错误时抛出 GmagickException

Gmagick::setimageredprimary

Sets the image chromaticity red primary point

说明

public Gmagick Gmagick::setimageredprimary ( float $x , float $y )

Sets the image chromaticity red primary point.

参数

x
The red primary x-point.

y
The red primary y-point.

返回值

The Gmagick object on success.

错误/异常

错误时抛出 GmagickException

Gmagick::setimagerenderingintent

Sets the image rendering intent

说明

public Gmagick Gmagick::setimagerenderingintent ( int $rendering_intent )

Sets the image rendering intent.

参数

rendering_intent
The image rendering intent: UndefinedIntent, SaturationIntent, PerceptualIntent, AbsoluteIntent, or RelativeIntent.

返回值

The Gmagick object on success.

错误/异常

错误时抛出 GmagickException

Gmagick::setimageresolution

Sets the image resolution

说明

public Gmagick Gmagick::setimageresolution ( float $xResolution , float $yResolution )

Sets the image resolution.

参数

xResolution
The image x resolution.

yResolution
The image y resolution.

返回值

The Gmagick object on success.

错误/异常

错误时抛出 GmagickException

Gmagick::setimagescene

Sets the image scene

说明

public Gmagick Gmagick::setimagescene ( int $scene )

Sets the image scene.

参数

scene
The image scene number.

返回值

The Gmagick object on success.

错误/异常

错误时抛出 GmagickException

Gmagick::setimagetype

Sets the image type

说明

public Gmagick Gmagick::setimagetype ( int $imgType )

Sets the image type.

参数

imgType
The image type: UndefinedType, BilevelType, GrayscaleType, GrayscaleMatteType, PaletteType, PaletteMatteType, TrueColorType, TrueColorMatteType, ColorSeparationType, ColorSeparationMatteType, or OptimizeType.

返回值

The Gmagick object on success.

错误/异常

错误时抛出 GmagickException

Gmagick::setimageunits

Sets the image units of resolution

说明

public Gmagick Gmagick::setimageunits ( int $resolution )

Sets the image units of resolution.

参数

resolution
The image units of resolution : Undefinedresolution, PixelsPerInchResolution, or PixelsPerCentimeterResolution.

返回值

The Gmagick object on success.

错误/异常

错误时抛出 GmagickException

Gmagick::setimagewhitepoint

Sets the image chromaticity white point

说明

public Gmagick Gmagick::setimagewhitepoint ( float $x , float $y )

Sets the image chromaticity white point.

参数

x
The white x-point.

y
The white y-point.

返回值

The Gmagick object on success.

错误/异常

错误时抛出 GmagickException

Gmagick::setsamplingfactors

Sets the image sampling factors

说明

public Gmagick Gmagick::setsamplingfactors ( array $factors )

Sets the image sampling factors.

参数

factors
An array of doubles representing the sampling factor for each color component (in RGB order).

返回值

The Gmagick object on success.

错误/异常

错误时抛出 GmagickException

Gmagick::setsize

Sets the size of the Gmagick object

说明

public Gmagick Gmagick::setsize ( int $columns , int $rows )

Sets the size of the Gmagick object. Set it before you read a raw image format such as RGB, GRAY, or CMYK.

参数

columns
The width in pixels.

rows
The height in pixels.

返回值

The Gmagick object on success.

错误/异常

错误时抛出 GmagickException

Gmagick::shearimage

Creating a parallelogram

说明

public Gmagick Gmagick::shearimage ( mixed $color , float $xShear , float $yShear )

Slides one edge of an image along the X or Y axis, creating a parallelogram. An X direction shear slides an edge along the X axis, while a Y direction shear slides an edge along the Y axis. The amount of the shear is controlled by a shear angle. For X direction shears, x_shear is measured relative to the Y axis, and similarly, for Y direction shears y_shear is measured relative to the X axis. Empty triangles left over from shearing the image are filled with the background color.

参数

color
The background pixel wand.

xShear
The number of degrees to shear the image.

yShear
The number of degrees to shear the image.

返回值

The Gmagick object on success

错误/异常

错误时抛出 GmagickException

Gmagick::solarizeimage

Applies a solarizing effect to the image

说明

public Gmagick Gmagick::solarizeimage ( int $threshold )

Applies a special effect to the image, similar to the effect achieved in a photo darkroom by selectively exposing areas of photo sensitive paper to light. Threshold ranges from 0 to QuantumRange and is a measure of the extent of the solarization.

参数

threshold
Define the extent of the solarization.

返回值

The Gmagick object on success.

错误/异常

错误时抛出 GmagickException

Gmagick::spreadimage

Randomly displaces each pixel in a block

说明

public Gmagick Gmagick::spreadimage ( float $radius )

Special effects method that randomly displaces each pixel in a block defined by the radius parameter.

参数

radius
Choose a random pixel in a neighborhood of this extent.

返回值

The Gmagick object on success

错误/异常

错误时抛出 GmagickException

Gmagick::stripimage

Strips an image of all profiles and comments

说明

public Gmagick Gmagick::stripimage ( void )

Strips an image of all profiles and comments.

参数

此函数没有参数。

返回值

The Gmagick object on success

错误/异常

错误时抛出 GmagickException

Gmagick::swirlimage

Swirls the pixels about the center of the image

说明

public Gmagick Gmagick::swirlimage ( float $degrees )

Swirls the pixels about the center of the image, where degrees indicates the sweep of the arc through which each pixel is moved. You get a more dramatic effect as the degrees move from 1 to 360.

参数

degrees
Define the tightness of the swirling effect.

返回值

The Gmagick object on success

错误/异常

错误时抛出 GmagickException

Gmagick::thumbnailimage

Changes the size of an image

说明

public Gmagick Gmagick::thumbnailimage ( int $width , int $height [, bool $fit = FALSE ] )

Changes the size of an image to the given dimensions and removes any associated profiles. The goal is to produce small low cost thumbnail images suited for display on the Web. If TRUE is given as a third parameter then columns and rows parameters are used as maximums for each side. Both sides will be scaled down until the match or are smaller than the parameter given for the side.

参数

width
Image width

height
Image height

返回值

The Gmagick object on success.

错误/异常

错误时抛出 GmagickException

Gmagick::trimimage

Remove edges from the image

说明

public Gmagick Gmagick::trimimage ( float $fuzz )

Remove edges that are the background color from the image.

参数

fuzz
By default target must match a particular pixel color exactly. However, in many cases two colors may differ by a small amount. The fuzz member of image defines how much tolerance is acceptable to consider two colors as the same. This parameter represents the variation on the quantum range.

返回值

The Gmagick object

错误/异常

错误时抛出 GmagickException

Gmagick::write

别名 Gmagick::writeimage

说明

此方法是该方法的别名: Gmagick::writeimage.

Gmagick::writeimage

Writes an image to the specified filename

说明

public Gmagick Gmagick::writeimage ( string $filename [, bool $all_frames = FALSE ] )

Writes an image to the specified filename. If the filename parameter is NULL, the image is written to the filename set by Gmagick::ReadImage() or Gmagick::SetImageFilename().

参数

filename
The image filename.

返回值

The Gmagick object

错误/异常

错误时抛出 GmagickException

简介

类摘要

GmagickDraw

class GmagickDraw {

/* 方法 */

public GmagickDraw annotate ( float $x , float $y , string $text )

public GmagickDraw arc ( float $sx , float $sy , float $ex , float $ey , float $sd , float $ed )

public GmagickDraw bezier ( array $coordinate_array )

public GmagickDraw ellipse ( float $ox , float $oy , float $rx , float $ry , float $start , float $end )

public GmagickPixel getfillcolor ( void )

public float getfillopacity ( void )

public mixed getfont ( void )

public float getfontsize ( void )

public int getfontstyle ( void )

public int getfontweight ( void )

public GmagickPixel getstrokecolor ( void )

public float getstrokeopacity ( void )

public float getstrokewidth ( void )

public int gettextdecoration ( void )

public mixed gettextencoding ( void )

public GmagickDraw line ( float $sx , float $sy , float $ex , float $ey )

public GmagickDraw point ( float $x , float $y )

public GmagickDraw polygon ( array $coordinates )

public GmagickDraw polyline ( array $coordinate_array )

public GmagickDraw rectangle ( float $x1 , float $y1 , float $x2 , float $y2 )

public GmagickDraw rotate ( float $degrees )

public GmagickDraw roundrectangle ( float $x1 , float $y1 , float $x2 , float $y2 , float $rx , float $ry )

public GmagickDraw scale ( float $x , float $y )

public GmagickDraw setfillcolor ( mixed $color )

public GmagickDraw setfillopacity ( float $fill_opacity )

public GmagickDraw setfont ( string $font )

public GmagickDraw setfontsize ( float $pointsize )

public GmagickDraw setfontstyle ( int $style )

public GmagickDraw setfontweight ( int $weight )

public GmagickDraw setstrokecolor ( mixed $color )

public GmagickDraw setstrokeopacity ( float $stroke_opacity )

public GmagickDraw setstrokewidth ( float $width )

public GmagickDraw settextdecoration ( int $decoration )

public GmagickDraw settextencoding ( string $encoding )

}

GmagickDraw::annotate

Draws text on the image

说明

public GmagickDraw GmagickDraw::annotate ( float $x , float $y , string $text )

Draws text on the image.

参数

x
x ordinate to left of text

y
y ordinate to text baseline

text
text to draw

返回值

The GmagickDraw object on success.

GmagickDraw::arc

Draws an arc

说明

public GmagickDraw GmagickDraw::arc ( float $sx , float $sy , float $ex , float $ey , float $sd , float $ed )

Draws an arc falling within a specified bounding rectangle on the image.

参数

sx
starting x ordinate of bounding rectangle

sy
starting y ordinate of bounding rectangle

ex
ending x ordinate of bounding rectangle

ey
ending y ordinate of bounding rectangle

sd
starting degrees of rotation

ed
ending degrees of rotation

返回值

The GmagickDraw object on success.

GmagickDraw::bezier

Draws a bezier curve

说明

public GmagickDraw GmagickDraw::bezier ( array $coordinate_array )

Draws a bezier curve through a set of points on the image.

参数

coordinate_array
Coordinates array

返回值

The GmagickDraw object on success

GmagickDraw::ellipse

Draws an ellipse on the image

说明

public GmagickDraw GmagickDraw::ellipse ( float $ox , float $oy , float $rx , float $ry , float $start , float $end )

Draws an ellipse on the image.

参数

ox
origin x ordinate

oy
origin y ordinate

rx
radius in x

ry
radius in y

start
starting rotation in degrees

end
ending rotation in degrees

返回值

The GmagickDraw object on success

GmagickDraw::getfillcolor

Returns the fill color

说明

public GmagickPixel GmagickDraw::getfillcolor ( void )

Returns the fill color used for drawing filled objects.

参数

此函数没有参数。

返回值

The GmagickPixel fill color used for drawing filled objects.

GmagickDraw::getfillopacity

Returns the opacity used when drawing

说明

public float GmagickDraw::getfillopacity ( void )

Returns the opacity used when drawing

参数

此函数没有参数。

返回值

Returns the opacity used when drawing using the fill color or fill texture. Fully opaque is 1.0.

GmagickDraw::getfont

Returns the font

说明

public mixed GmagickDraw::getfont ( void )

Returns a string specifying the font used when annotating with text.

参数

此函数没有参数。

返回值

Returns a string on success and FALSE if no font is set.

GmagickDraw::getfontsize

Returns the font pointsize

说明

public float GmagickDraw::getfontsize ( void )

Returns the font pointsize used when annotating with text.

参数

此函数没有参数。

返回值

Returns the font size associated with the current GmagickDraw object.

GmagickDraw::getfontstyle

Returns the font style

说明

public int GmagickDraw::getfontstyle ( void )

Returns the font style used when annotating with text.

参数

此函数没有参数。

返回值

Returns the font style constant (STYLE_) associated with the GmagickDraw object or 0 if no style is set.

GmagickDraw::getfontweight

Returns the font weight

说明

public int GmagickDraw::getfontweight ( void )

Returns the font weight used when annotating with text.

参数

此函数没有参数。

返回值

Returns an int on success and 0 if no weight is set.

GmagickDraw::getstrokecolor

Returns the color used for stroking object outlines

说明

public GmagickPixel GmagickDraw::getstrokecolor ( void )

Returns the color used for stroking object outlines.

参数

此函数没有参数。

返回值

Returns an GmagickPixel object which describes the color.

GmagickDraw::getstrokeopacity

Returns the opacity of stroked object outlines

说明

public float GmagickDraw::getstrokeopacity ( void )

Returns the opacity of stroked object outlines.

参数

此函数没有参数。

返回值

Returns a double describing the opacity.

GmagickDraw::getstrokewidth

Returns the width of the stroke used to draw object outlines

说明

public float GmagickDraw::getstrokewidth ( void )

Returns the width of the stroke used to draw object outlines.

参数

此函数没有参数。

返回值

Returns a double describing the stroke width.

GmagickDraw::gettextdecoration

Returns the text decoration

说明

public int GmagickDraw::gettextdecoration ( void )

Returns the decoration applied when annotating with text.

参数

此函数没有参数。

返回值

Returns one of the DECORATION_ constants and 0 if no decoration is set.

GmagickDraw::gettextencoding

Returns the code set used for text annotations

说明

public mixed GmagickDraw::gettextencoding ( void )

Returns a string which specifies the code set used for text annotations.

参数

此函数没有参数。

返回值

Returns a string specifying the code set or FALSE if text encoding is not set.

GmagickDraw::line

The line purpose

说明

public GmagickDraw GmagickDraw::line ( float $sx , float $sy , float $ex , float $ey )

Draws a line on the image using the current stroke color, stroke opacity, and stroke width.

参数

sx
starting x ordinate

sy
starting y ordinate

ex
ending x ordinate

ey
ending y ordinate

返回值

The GmagickDraw object on success

GmagickDraw::point

Draws a point

说明

public GmagickDraw GmagickDraw::point ( float $x , float $y )

Draws a point using the current stroke color and stroke thickness at the specified coordinates.

参数

x
target x coordinate

y
target y coordinate

返回值

The GmagickDraw object on success

GmagickDraw::polygon

Draws a polygon

说明

public GmagickDraw GmagickDraw::polygon ( array $coordinates )

Draws a polygon using the current stroke, stroke width, and fill color or texture, using the specified array of coordinates.

参数

coordinates
coordinate array

返回值

The GmagickDraw object on success

GmagickDraw::polyline

Draws a polyline

说明

public GmagickDraw GmagickDraw::polyline ( array $coordinate_array )

Draws a polyline using the current stroke, stroke width, and fill color or texture, using the specified array of coordinates.

参数

coordinate_array
The array of coordinates

返回值

The GmagickDraw object on success

GmagickDraw::rectangle

Draws a rectangle

说明

public GmagickDraw GmagickDraw::rectangle ( float $x1 , float $y1 , float $x2 , float $y2 )

Draws a rectangle given two coordinates and using the current stroke, stroke width, and fill settings.

参数

x1
x ordinate of first coordinate

y1
y ordinate of first coordinate

x2
x ordinate of second coordinate

y2
y ordinate of second coordinate

返回值

The GmagickDraw object on success

GmagickDraw::rotate

Applies the specified rotation to the current coordinate space

说明

public GmagickDraw GmagickDraw::rotate ( float $degrees )

Applies the specified rotation to the current coordinate space.

参数

degrees
degrees of rotation

返回值

The GmagickDraw object on success

GmagickDraw::roundrectangle

Draws a rounded rectangle

说明

public GmagickDraw GmagickDraw::roundrectangle ( float $x1 , float $y1 , float $x2 , float $y2 , float $rx , float $ry )

Draws a rounded rectangle given two coordinates, x and y corner radiuses and using the current stroke, stroke width, and fill settings.

参数

x1
x ordinate of first coordinate

y1
y ordinate of first coordinate

x2
x ordinate of second coordinate

y2
y ordinate of second coordinate

rx
radius of corner in horizontal direction

ry
radius of corner in vertical direction

返回值

The GmagickDraw object on success

GmagickDraw::scale

Adjusts the scaling factor

说明

public GmagickDraw GmagickDraw::scale ( float $x , float $y )

Adjusts the scaling factor to apply in the horizontal and vertical directions to the current coordinate space.

参数

x
horizontal scale factor

y
vertical scale factor

返回值

The GmagickDraw object on success

GmagickDraw::setfillcolor

Sets the fill color to be used for drawing filled objects

说明

public GmagickDraw GmagickDraw::setfillcolor ( mixed $color )

Sets the fill color to be used for drawing filled objects.

参数

color
GmagickPixel or string indicating color to use for filling.

返回值

The GmagickDraw object on success.

GmagickDraw::setfillopacity

The setfillopacity purpose

说明

public GmagickDraw GmagickDraw::setfillopacity ( float $fill_opacity )

Sets the opacity to use when drawing using the fill color or fill texture. Setting it to 1.0 will make fill full opaque.

参数

fill_opacity
Fill opacity

返回值

The GmagickDraw object on success

GmagickDraw::setfont

Sets the fully-specified font to use when annotating with text

说明

public GmagickDraw GmagickDraw::setfont ( string $font )

Sets the fully-specified font to use when annotating with text

参数

font
font name

返回值

The GmagickDraw object on success

GmagickDraw::setfontsize

Sets the font pointsize to use when annotating with text

说明

public GmagickDraw GmagickDraw::setfontsize ( float $pointsize )

Sets the font pointsize to use when annotating with text.

参数

pointsize
Text pointsize

返回值

The GmagickDraw object on success

GmagickDraw::setfontstyle

Sets the font style to use when annotating with text

说明

public GmagickDraw GmagickDraw::setfontstyle ( int $style )

Sets the font style to use when annotating with text. The AnyStyle enumeration acts as a wild-card "don't care" option.

参数

style
Font style (NormalStyle, ItalicStyle, ObliqueStyle, AnyStyle)

返回值

The GmagickDraw object on success

GmagickDraw::setfontweight

Sets the font weight

说明

public GmagickDraw GmagickDraw::setfontweight ( int $weight )

Sets the font weight to use when annotating with text.

参数

weight
Font weight (valid range 100-900)

返回值

The GmagickDraw object on success

GmagickDraw::setstrokecolor

Sets the color used for stroking object outlines

说明

public GmagickDraw GmagickDraw::setstrokecolor ( mixed $color )

Sets the color used for stroking object outlines.

参数

color
GmagickPixel or string representing the color for the stroke.

返回值

The GmagickDraw object on success.

GmagickDraw::setstrokeopacity

Specifies the opacity of stroked object outlines

说明

public GmagickDraw GmagickDraw::setstrokeopacity ( float $stroke_opacity )

Specifies the opacity of stroked object outlines.

参数

stroke_opacity
Stroke opacity. The value 1.0 is opaque.

返回值

The GmagickDraw object on success

GmagickDraw::setstrokewidth

Sets the width of the stroke used to draw object outlines

说明

public GmagickDraw GmagickDraw::setstrokewidth ( float $width )

Sets the width of the stroke used to draw object outlines

参数

width
Stroke width

返回值

The GmagickDraw object on success

GmagickDraw::settextdecoration

Specifies a decoration

说明

public GmagickDraw GmagickDraw::settextdecoration ( int $decoration )

Specifies a decoration to be applied when annotating with text.

参数

int
Text decoration. One of NoDecoration, UnderlineDecoration, OverlineDecoration, or LineThroughDecoration

返回值

The GmagickDraw object on success

GmagickDraw::settextencoding

Specifies the text code set

说明

public GmagickDraw GmagickDraw::settextencoding ( string $encoding )

Specifies the code set to use for text annotations. The only character encoding which may be specified at this time is "UTF-8" for representing Unicode as a sequence of bytes. Specify an empty string to set text encoding to the system's default. Successful text annotation using Unicode may require fonts designed to support Unicode.

参数

encoding
Character string specifying text encoding

返回值

The GmagickDraw object on success

简介

类摘要

GmagickPixel

class GmagickPixel {

/* 方法 */

public __construct ([ string $color ] )

public mixed getcolor ([ bool $as_array = FALSE [, bool $normalize_array = FALSE ]] )

public int getcolorcount ( void )

public float getcolorvalue ( int $color )

public GmagickPixel setcolor ( string $color )

public GmagickPixel setcolorvalue ( int $color , float $value )

}

GmagickPixel::__construct

The GmagickPixel constructor

说明

public GmagickPixel::__construct ([ string $color ] )

Constructs an GmagickPixel object. If a color is specified, the object is constructed and then initialised with that color before being returned.

参数

color
The optional color string to use as the initial value of this object.

返回值

The GmagickPixel object on success.

GmagickPixel::getcolor

Returns the color

说明

public mixed GmagickPixel::getcolor ([ bool $as_array = FALSE [, bool $normalize_array = FALSE ]] )

Returns the color described by the GmagickPixel object, as a string or an array. If the color has an opacity channel set, this is provided as a fourth value in the list.

参数

as_array
TRUE to indicate return of array instead of string.

normalize_array
TRUE to normalize the color values.

返回值

A string or an array of channel values, each normalized if TRUE is given as normalize_array. Throws GmagickPixelException on error.

GmagickPixel::getcolorcount

Returns the color count associated with this color

说明

public int GmagickPixel::getcolorcount ( void )

Returns the color count associated with this color

参数

此函数没有参数。

返回值

Returns the color count as an integer on success, throws GmagickPixelException on failure.

GmagickPixel::getcolorvalue

Gets the normalized value of the provided color channel

说明

public float GmagickPixel::getcolorvalue ( int $color )

Retrieves the value of the color channel specified, as a floating-point number between 0 and 1.

参数

color
The channel to check, specified as one of the Gmagick channel constants.

返回值

The value of the channel, as a normalized floating-point number, throwing GmagickPixelException on error.

GmagickPixel::setcolor

Sets the color

说明

public GmagickPixel GmagickPixel::setcolor ( string $color )

Sets the color described by the GmagickPixel object, with a string (e.g. "blue", "#0000ff", "rgb(0,0,255)", "cmyk(100,100,100,10)", etc.).

参数

color
The color definition to use in order to initialise the GmagickPixel object.

返回值

The GmagickPixel object on success.

GmagickPixel::setcolorvalue

Sets the normalized value of one of the channels

说明

public GmagickPixel GmagickPixel::setcolorvalue ( int $color , float $value )

Sets the value of the specified channel of this object to the provided value, which should be between 0 and 1. This function can be used to provide an opacity channel to a GmagickPixel object.

参数

color
One of the Gmagick channel color constants.

value
The value to set this channel to, ranging from 0 to 1.

返回值

The GmagickPixel object on success.