Book/gmagick-Phpdoc专题
Gmagick
目录
- 简介
- 安装/配置
- 预定义常量
- 范例
- Gmagick — The Gmagick class
- Gmagick::addimage — Adds new image to Gmagick object image list
- Gmagick::addnoiseimage — Adds random noise to the image
- Gmagick::annotateimage — Annotates an image with text
- Gmagick::blurimage — Adds blur filter to image
- Gmagick::borderimage — Surrounds the image with a border
- Gmagick::charcoalimage — Simulates a charcoal drawing
- Gmagick::chopimage — Removes a region of an image and trims
- Gmagick::clear — Clears all resources associated to Gmagick object
- Gmagick::commentimage — Adds a comment to your image
- Gmagick::compositeimage — Composite one image onto another
- Gmagick::__construct — The Gmagick constructor
- Gmagick::cropimage — Extracts a region of the image
- Gmagick::cropthumbnailimage — Creates a crop thumbnail
- Gmagick::current — The current purpose
- Gmagick::cyclecolormapimage — Displaces an image's colormap
- Gmagick::deconstructimages — Returns certain pixel differences between images
- Gmagick::despeckleimage — The despeckleimage purpose
- Gmagick::destroy — The destroy purpose
- Gmagick::drawimage — Renders the GmagickDraw object on the current image
- Gmagick::edgeimage — Enhance edges within the image
- Gmagick::embossimage — Returns a grayscale image with a three-dimensional effect
- Gmagick::enhanceimage — Improves the quality of a noisy image
- Gmagick::equalizeimage — Equalizes the image histogram
- Gmagick::flipimage — Creates a vertical mirror image
- Gmagick::flopimage — The flopimage purpose
- Gmagick::frameimage — Adds a simulated three-dimensional border
- Gmagick::gammaimage — Gamma-corrects an image
- Gmagick::getcopyright — Returns the GraphicsMagick API copyright as a string
- Gmagick::getfilename — The filename associated with an image sequence
- Gmagick::getimagebackgroundcolor — Returns the image background color
- Gmagick::getimageblueprimary — Returns the chromaticy blue primary point
- Gmagick::getimagebordercolor — Returns the image border color
- Gmagick::getimagechanneldepth — Gets the depth for a particular image channel
- Gmagick::getimagecolors — Returns the color of the specified colormap index
- Gmagick::getimagecolorspace — Gets the image colorspace
- Gmagick::getimagecompose — Returns the composite operator associated with the image
- Gmagick::getimagedelay — Gets the image delay
- Gmagick::getimagedepth — Gets the depth of the image
- Gmagick::getimagedispose — Gets the image disposal method
- Gmagick::getimageextrema — Gets the extrema for the image
- Gmagick::getimagefilename — Returns the filename of a particular image in a sequence
- Gmagick::getimageformat — Returns the format of a particular image in a sequence
- Gmagick::getimagegamma — Gets the image gamma
- Gmagick::getimagegreenprimary — Returns the chromaticy green primary point
- Gmagick::getimageheight — Returns the image height
- Gmagick::getimagehistogram — Gets the image histogram
- Gmagick::getimageindex — Gets the index of the current active image
- Gmagick::getimageinterlacescheme — Gets the image interlace scheme
- Gmagick::getimageiterations — Gets the image iterations
- Gmagick::getimagematte — Check if the image has a matte channel
- Gmagick::getimagemattecolor — Returns the image matte color
- Gmagick::getimageprofile — Returns the named image profile
- Gmagick::getimageredprimary — Returns the chromaticity red primary point
- Gmagick::getimagerenderingintent — Gets the image rendering intent
- Gmagick::getimageresolution — Gets the image X and Y resolution
- Gmagick::getimagescene — Gets the image scene
- Gmagick::getimagesignature — Generates an SHA-256 message digest
- Gmagick::getimagetype — Gets the potential image type
- Gmagick::getimageunits — Gets the image units of resolution
- Gmagick::getimagewhitepoint — Returns the chromaticity white point
- Gmagick::getimagewidth — Returns the width of the image
- Gmagick::getpackagename — Returns the GraphicsMagick package name
- Gmagick::getquantumdepth — Returns the Gmagick quantum depth as a string
- Gmagick::getreleasedate — Returns the GraphicsMagick release date as a string
- Gmagick::getsamplingfactors — Gets the horizontal and vertical sampling factor
- Gmagick::getsize — Returns the size associated with the Gmagick object
- Gmagick::getversion — Returns the GraphicsMagick API version
- Gmagick::hasnextimage — Checks if the object has more images
- Gmagick::haspreviousimage — Checks if the object has a previous image
- Gmagick::implodeimage — Creates a new image as a copy
- Gmagick::labelimage — Adds a label to an image
- Gmagick::levelimage — Adjusts the levels of an image
- Gmagick::magnifyimage — Scales an image proportionally 2x
- Gmagick::mapimage — Replaces the colors of an image with the closest color from a reference image
- Gmagick::medianfilterimage — Applies a digital filter
- Gmagick::minifyimage — Scales an image proportionally to half its size
- Gmagick::modulateimage — Control the brightness, saturation, and hue
- Gmagick::motionblurimage — Simulates motion blur
- Gmagick::newimage — Creates a new image
- Gmagick::nextimage — Moves to the next image
- Gmagick::normalizeimage — Enhances the contrast of a color image
- Gmagick::oilpaintimage — Simulates an oil painting
- Gmagick::previousimage — Move to the previous image in the object
- Gmagick::profileimage — Adds or removes a profile from an image
- Gmagick::quantizeimage — Analyzes the colors within a reference image
- Gmagick::quantizeimages — The quantizeimages purpose
- Gmagick::queryfontmetrics — Returns an array representing the font metrics
- Gmagick::queryfonts — Returns the configured fonts
- Gmagick::queryformats — Returns formats supported by Gmagick
- Gmagick::radialblurimage — Radial blurs an image
- Gmagick::raiseimage — Creates a simulated 3d button-like effect
- Gmagick::read — Reads image from filename
- Gmagick::readimage — Reads image from filename
- Gmagick::readimageblob — Reads image from a binary string
- Gmagick::readimagefile — The readimagefile purpose
- Gmagick::reducenoiseimage — Smooths the contours of an image
- Gmagick::removeimage — Removes an image from the image list
- Gmagick::removeimageprofile — Removes the named image profile and returns it
- Gmagick::resampleimage — Resample image to desired resolution
- Gmagick::resizeimage — Scales an image
- Gmagick::rollimage — Offsets an image
- Gmagick::rotateimage — Rotates an image
- Gmagick::scaleimage — Scales the size of an image
- Gmagick::separateimagechannel — Separates a channel from the image
- Gmagick::setCompressionQuality — Sets the object's default compression quality
- Gmagick::setfilename — Sets the filename before you read or write the image
- Gmagick::setimagebackgroundcolor — Sets the image background color
- Gmagick::setimageblueprimary — Sets the image chromaticity blue primary point
- Gmagick::setimagebordercolor — Sets the image border color
- Gmagick::setimagechanneldepth — Sets the depth of a particular image channel
- Gmagick::setimagecolorspace — Sets the image colorspace
- Gmagick::setimagecompose — Sets the image composite operator
- Gmagick::setimagedelay — Sets the image delay
- Gmagick::setimagedepth — Sets the image depth
- Gmagick::setimagedispose — Sets the image disposal method
- Gmagick::setimagefilename — Sets the filename of a particular image in a sequence
- Gmagick::setimageformat — Sets the format of a particular image
- Gmagick::setimagegamma — Sets the image gamma
- Gmagick::setimagegreenprimary — Sets the image chromaticity green primary point
- Gmagick::setimageindex — Set the iterator to the position in the image list specified with the index parameter
- Gmagick::setimageinterlacescheme — Sets the interlace scheme of the image
- Gmagick::setimageiterations — Sets the image iterations
- Gmagick::setimageprofile — Adds a named profile to the Gmagick object
- Gmagick::setimageredprimary — Sets the image chromaticity red primary point
- Gmagick::setimagerenderingintent — Sets the image rendering intent
- Gmagick::setimageresolution — Sets the image resolution
- Gmagick::setimagescene — Sets the image scene
- Gmagick::setimagetype — Sets the image type
- Gmagick::setimageunits — Sets the image units of resolution
- Gmagick::setimagewhitepoint — Sets the image chromaticity white point
- Gmagick::setsamplingfactors — Sets the image sampling factors
- Gmagick::setsize — Sets the size of the Gmagick object
- Gmagick::shearimage — Creating a parallelogram
- Gmagick::solarizeimage — Applies a solarizing effect to the image
- Gmagick::spreadimage — Randomly displaces each pixel in a block
- Gmagick::stripimage — Strips an image of all profiles and comments
- Gmagick::swirlimage — Swirls the pixels about the center of the image
- Gmagick::thumbnailimage — Changes the size of an image
- Gmagick::trimimage — Remove edges from the image
- Gmagick::write — 别名 Gmagick::writeimage
- Gmagick::writeimage — Writes an image to the specified filename
- GmagickDraw — The GmagickDraw class
- GmagickDraw::annotate — Draws text on the image
- GmagickDraw::arc — Draws an arc
- GmagickDraw::bezier — Draws a bezier curve
- GmagickDraw::ellipse — Draws an ellipse on the image
- GmagickDraw::getfillcolor — Returns the fill color
- GmagickDraw::getfillopacity — Returns the opacity used when drawing
- GmagickDraw::getfont — Returns the font
- GmagickDraw::getfontsize — Returns the font pointsize
- GmagickDraw::getfontstyle — Returns the font style
- GmagickDraw::getfontweight — Returns the font weight
- GmagickDraw::getstrokecolor — Returns the color used for stroking object outlines
- GmagickDraw::getstrokeopacity — Returns the opacity of stroked object outlines
- GmagickDraw::getstrokewidth — Returns the width of the stroke used to draw object outlines
- GmagickDraw::gettextdecoration — Returns the text decoration
- GmagickDraw::gettextencoding — Returns the code set used for text annotations
- GmagickDraw::line — The line purpose
- GmagickDraw::point — Draws a point
- GmagickDraw::polygon — Draws a polygon
- GmagickDraw::polyline — Draws a polyline
- GmagickDraw::rectangle — Draws a rectangle
- GmagickDraw::rotate — Applies the specified rotation to the current coordinate space
- GmagickDraw::roundrectangle — Draws a rounded rectangle
- GmagickDraw::scale — Adjusts the scaling factor
- GmagickDraw::setfillcolor — Sets the fill color to be used for drawing filled objects
- GmagickDraw::setfillopacity — The setfillopacity purpose
- GmagickDraw::setfont — Sets the fully-specified font to use when annotating with text
- GmagickDraw::setfontsize — Sets the font pointsize to use when annotating with text
- GmagickDraw::setfontstyle — Sets the font style to use when annotating with text
- GmagickDraw::setfontweight — Sets the font weight
- GmagickDraw::setstrokecolor — Sets the color used for stroking object outlines
- GmagickDraw::setstrokeopacity — Specifies the opacity of stroked object outlines
- GmagickDraw::setstrokewidth — Sets the width of the stroke used to draw object outlines
- GmagickDraw::settextdecoration — Specifies a decoration
- GmagickDraw::settextencoding — Specifies the text code set
- GmagickPixel — The GmagickPixel class
- GmagickPixel::__construct — The GmagickPixel constructor
- GmagickPixel::getcolor — Returns the color
- GmagickPixel::getcolorcount — Returns the color count associated with this color
- GmagickPixel::getcolorvalue — Gets the normalized value of the provided color channel
- GmagickPixel::setcolor — Sets the color
- GmagickPixel::setcolorvalue — Sets the normalized value of one of the channels
简介
类摘要
Gmagick
class Gmagick {
/* 方法 */
public Gmagick
addimage ( <span
class="methodparam">Gmagick $source )
public Gmagick
addnoiseimage ( <span
class="methodparam">int $noise_type )
public Gmagick
annotateimage ( <span
class="methodparam">GmagickDraw
$GmagickDraw , <span
class="type">float $x , <span
class="type">float $y , <span
class="type">float $angle , <span
class="methodparam">string $text )
public Gmagick
blurimage ( <span
class="methodparam">float $radius ,
float
$sigma [, <span
class="type">int $channel ] )
public Gmagick
borderimage ( <span
class="methodparam">GmagickPixel
$color , <span
class="type">int $width , <span
class="methodparam">int $height )
public Gmagick
charcoalimage ( <span
class="methodparam">float $radius ,
float
$sigma )
public Gmagick
chopimage ( <span
class="methodparam">int $width ,
int $height
, int $x ,
int $y )
public Gmagick clear ( <span class="methodparam">void )
public Gmagick
commentimage ( <span
class="methodparam">string $comment )
public Gmagick
compositeimage ( <span
class="methodparam">Gmagick $source ,
int
$COMPOSE , <span
class="type">int $x , <span
class="type">int $y )
public <span
class="methodname">__construct ([ <span
class="methodparam">string $filename
] )
public Gmagick
cropimage (
int $width , <span
class="methodparam"> int $height ,
int $x ,
int $y )
public Gmagick
cropthumbnailimage ( <span
class="methodparam">int $width ,
int $height
)
public Gmagick current ( <span class="methodparam">void )
public Gmagick
cyclecolormapimage ( <span
class="methodparam">int $displace )
public Gmagick deconstructimages ( <span class="methodparam">void )
public Gmagick despeckleimage ( <span class="methodparam">void )
public bool destroy ( <span class="methodparam">void )
public Gmagick
drawimage ( <span
class="methodparam">GmagickDraw
$GmagickDraw )
public Gmagick
edgeimage ( <span
class="methodparam">float $radius )
public Gmagick
embossimage ( <span
class="methodparam">float $radius ,
float
$sigma )
public Gmagick enhanceimage ( <span class="methodparam">void )
public Gmagick equalizeimage ( <span class="methodparam">void )
public Gmagick flipimage ( <span class="methodparam">void )
public Gmagick flopimage ( <span class="methodparam">void )
public Gmagick
frameimage ( <span
class="methodparam">GmagickPixel
$color , <span
class="type">int $width , <span
class="methodparam">int $height ,
int
$inner_bevel , <span
class="type">int $outer_bevel )
public Gmagick
gammaimage ( <span
class="methodparam">float $gamma )
public string getcopyright ( <span class="methodparam">void )
public string getfilename ( <span class="methodparam">void )
public <span class="type">GmagickPixel <span class="methodname">getimagebackgroundcolor ( <span class="methodparam">void )
public array getimageblueprimary ( <span class="methodparam">void )
public <span class="type">GmagickPixel <span class="methodname">getimagebordercolor ( <span class="methodparam">void )
public int <span
class="methodname">getimagechanneldepth ( <span
class="methodparam">int $channel_type
)
public int <span class="methodname">getimagecolors ( <span class="methodparam">void )
public int <span class="methodname">getimagecolorspace ( <span class="methodparam">void )
public int <span class="methodname">getimagecompose ( <span class="methodparam">void )
public int <span class="methodname">getimagedelay ( <span class="methodparam">void )
public int <span class="methodname">getimagedepth ( <span class="methodparam">void )
public int <span class="methodname">getimagedispose ( <span class="methodparam">void )
public array getimageextrema ( <span class="methodparam">void )
public string getimagefilename ( <span class="methodparam">void )
public string getimageformat ( <span class="methodparam">void )
public float getimagegamma ( <span class="methodparam">void )
public array getimagegreenprimary ( <span class="methodparam">void )
public int <span class="methodname">getimageheight ( <span class="methodparam">void )
public array getimagehistogram ( <span class="methodparam">void )
public int <span class="methodname">getimageindex ( <span class="methodparam">void )
public int <span class="methodname">getimageinterlacescheme ( <span class="methodparam">void )
public int <span class="methodname">getimageiterations ( <span class="methodparam">void )
public int <span class="methodname">getimagematte ( <span class="methodparam">void )
public <span class="type">GmagickPixel <span class="methodname">getimagemattecolor ( <span class="methodparam">void )
public string
getimageprofile ( <span
class="methodparam">string $name )
public array getimageredprimary ( <span class="methodparam">void )
public int <span class="methodname">getimagerenderingintent ( <span class="methodparam">void )
public array getimageresolution ( <span class="methodparam">void )
public int <span class="methodname">getimagescene ( <span class="methodparam">void )
public string getimagesignature ( <span class="methodparam">void )
public int <span class="methodname">getimagetype ( <span class="methodparam">void )
public int <span class="methodname">getimageunits ( <span class="methodparam">void )
public array getimagewhitepoint ( <span class="methodparam">void )
public int <span class="methodname">getimagewidth ( <span class="methodparam">void )
public string getpackagename ( <span class="methodparam">void )
public array getquantumdepth ( <span class="methodparam">void )
public string getreleasedate ( <span class="methodparam">void )
public array getsamplingfactors ( <span class="methodparam">void )
public array getsize ( <span class="methodparam">void )
public array getversion ( <span class="methodparam">void )
public mixed hasnextimage ( <span class="methodparam">void )
public mixed haspreviousimage ( <span class="methodparam">void )
public mixed
implodeimage ( <span
class="methodparam">float $radius )
public mixed
labelimage ( <span
class="methodparam">string $label )
public mixed
levelimage ( <span
class="methodparam">float $blackPoint
, float
$gamma , <span
class="type">float $whitePoint [, <span
class="methodparam">int $channel<span
class="initializer"> = Gmagick::CHANNEL_DEFAULT ] )
public mixed magnifyimage ( <span class="methodparam">void )
public Gmagick
mapimage ( <span
class="methodparam">gmagick $gmagick
, bool
$dither )
public void
medianfilterimage ( <span
class="methodparam">float $radius )
public Gmagick minifyimage ( <span class="methodparam">void )
public Gmagick
modulateimage ( <span
class="methodparam">float $brightness
, float
$saturation , <span
class="type">float $hue )
public Gmagick
motionblurimage ( <span
class="methodparam">float $radius ,
float
$sigma , <span
class="type">float $angle )
public Gmagick
newimage ( <span
class="methodparam">int $width ,
int $height
, string
$background [, <span
class="type">string $format ] )
public bool nextimage ( <span class="methodparam">void )
public Gmagick
normalizeimage ([ <span
class="methodparam">int $channel ] )
public Gmagick
oilpaintimage ( <span
class="methodparam"> float $radius )
public bool previousimage ( <span class="methodparam">void )
public Gmagick
profileimage ( <span
class="methodparam">string $name ,
string
$profile )
public Gmagick
quantizeimage ( <span
class="methodparam">int $numColors ,
int
$colorspace , <span
class="type">int $treeDepth , <span
class="methodparam">bool $dither ,
bool
$measureError )
public Gmagick
quantizeimages ( <span
class="methodparam">int $numColors ,
int
$colorspace , <span
class="type">int $treeDepth , <span
class="methodparam">bool $dither ,
bool
$measureError )
public array
queryfontmetrics ( <span
class="methodparam">GmagickDraw $draw
, string
$text )
public array
queryfonts ([ <span
class="methodparam">string $pattern<span
class="initializer"> = "*" ] )
public array
queryformats ([ <span
class="methodparam">string $pattern<span
class="initializer"> = "*" ] )
public Gmagick
radialblurimage ( <span
class="methodparam">float $angle [,
int $channel<span
class="initializer"> = Gmagick::CHANNEL_DEFAULT ] )
public Gmagick
raiseimage ( <span
class="methodparam">int $width ,
int $height
, int $x ,
int $y ,
bool $raise
)
public Gmagick
read ( <span
class="type">string $filename )
public Gmagick
readimage ( <span
class="methodparam">string $filename
)
public Gmagick
readimageblob ( <span
class="methodparam">string
$imageContents [, <span
class="type">string $filename ] )
public Gmagick
readimagefile ( <span
class="methodparam">resource $fp [,
string
$filename ] )
public Gmagick
reducenoiseimage ( <span
class="methodparam">float $radius )
public Gmagick removeimage ( <span class="methodparam">void )
public string
removeimageprofile ( <span
class="methodparam">string $name )
public Gmagick
resampleimage ( <span
class="methodparam">float
$xResolution , <span
class="type">float $yResolution , <span
class="methodparam">int $filter ,
float $blur
)
public Gmagick
resizeimage ( <span
class="methodparam">int $width ,
int $height
, int
$filter , <span
class="type">float $blur [, <span
class="methodparam">bool $fit<span
class="initializer"> = false ] )
public Gmagick
rollimage ( <span
class="methodparam">int $x , <span
class="methodparam">int $y )
public Gmagick
rotateimage ( <span
class="methodparam">mixed $color ,
float
$degrees )
public Gmagick
scaleimage ( <span
class="methodparam">int $width ,
int $height
[, bool $fit<span
class="initializer"> = false ] )
public Gmagick
separateimagechannel ( <span
class="methodparam">int $channel )
Gmagick <span
class="methodname">setCompressionQuality ( <span
class="methodparam"> int $quality <span
class="initializer"> = 75 )
public Gmagick
setfilename ( <span
class="methodparam">string $filename
)
public Gmagick
setimagebackgroundcolor ( <span
class="methodparam">GmagickPixel
$color )
public Gmagick
setimageblueprimary ( <span
class="methodparam">float $x , <span
class="methodparam">float $y )
public Gmagick
setimagebordercolor ( <span
class="methodparam">GmagickPixel
$color )
public Gmagick
setimagechanneldepth ( <span
class="methodparam">int $channel ,
int $depth
)
public Gmagick
setimagecolorspace ( <span
class="methodparam">int $colorspace )
public Gmagick
setimagecompose ( <span
class="methodparam">int $composite )
public Gmagick
setimagedelay ( <span
class="methodparam">int $delay )
public Gmagick
setimagedepth ( <span
class="methodparam">int $depth )
public Gmagick
setimagedispose ( <span
class="methodparam">int $disposeType
)
public Gmagick
setimagefilename ( <span
class="methodparam">string $filename
)
public Gmagick
setimageformat ( <span
class="methodparam">string
$imageFormat )
public Gmagick
setimagegamma ( <span
class="methodparam">float $gamma )
public Gmagick
setimagegreenprimary ( <span
class="methodparam">float $x , <span
class="methodparam">float $y )
public Gmagick
setimageindex ( <span
class="methodparam">int $index )
public Gmagick
setimageinterlacescheme ( <span
class="methodparam">int $interlace )
public Gmagick
setimageiterations ( <span
class="methodparam">int $iterations )
public Gmagick
setimageprofile ( <span
class="methodparam">string $name ,
string
$profile )
public Gmagick
setimageredprimary ( <span
class="methodparam">float $x , <span
class="methodparam">float $y )
public Gmagick
setimagerenderingintent ( <span
class="methodparam">int
$rendering_intent )
public Gmagick
setimageresolution ( <span
class="methodparam">float
$xResolution , <span
class="type">float $yResolution )
public Gmagick
setimagescene ( <span
class="methodparam">int $scene )
public Gmagick
setimagetype ( <span
class="methodparam">int $imgType )
public Gmagick
setimageunits ( <span
class="methodparam">int $resolution )
public Gmagick
setimagewhitepoint ( <span
class="methodparam">float $x , <span
class="methodparam">float $y )
public Gmagick
setsamplingfactors ( <span
class="methodparam">array $factors )
public Gmagick
setsize ( <span
class="methodparam">int $columns ,
int $rows )
public Gmagick
shearimage ( <span
class="methodparam">mixed $color ,
float
$xShear , <span
class="type">float $yShear )
public Gmagick
solarizeimage ( <span
class="methodparam">int $threshold )
public Gmagick
spreadimage ( <span
class="methodparam">float $radius )
public Gmagick stripimage ( <span class="methodparam">void )
public Gmagick
swirlimage ( <span
class="methodparam">float $degrees )
public Gmagick
thumbnailimage ( <span
class="methodparam">int $width ,
int $height
[, bool $fit<span
class="initializer"> = false ] )
public Gmagick
trimimage ( <span
class="methodparam">float $fuzz )
public Gmagick
writeimage ( <span
class="methodparam">string $filename
[, bool
$all_frames = false ] )
}
Gmagick::addimage
Adds new image to Gmagick object image list
说明
public Gmagick
Gmagick::addimage ( <span
class="methodparam">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 ( <span
class="methodparam">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 ( <span
class="methodparam">GmagickDraw
$GmagickDraw , <span
class="type">float $x , <span
class="type">float $y , <span
class="type">float $angle , <span
class="methodparam">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 ( <span
class="methodparam">float $radius ,
float
$sigma [, <span
class="type">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 ( <span
class="methodparam">GmagickPixel
$color , <span
class="type">int $width , <span
class="methodparam">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 ( <span
class="methodparam">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 ( <span
class="methodparam">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 ( <span class="methodparam">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 ( <span
class="methodparam">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 ( <span
class="methodparam">Gmagick $source ,
int
$COMPOSE , <span
class="type">int $x , <span
class="type">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 <span
class="methodname">Gmagick::__construct ([ <span
class="methodparam">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 ( <span
class="methodparam"> 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 ( <span
class="methodparam">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 ( <span class="methodparam">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 ( <span
class="methodparam">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 ( <span class="methodparam">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 ( <span class="methodparam">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 ( <span class="methodparam">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 ( <span
class="methodparam">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 ( <span
class="methodparam">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 ( <span
class="methodparam">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 ( <span class="methodparam">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 ( <span class="methodparam">void )
Equalizes the image histogram.
返回值
The equalized Gmagick object.
错误/异常
错误时抛出 GmagickException。
Gmagick::flipimage
Creates a vertical mirror image
说明
public Gmagick Gmagick::flipimage ( <span class="methodparam">void )
Creates a vertical mirror image by reflecting the pixels around the central x-axis.
返回值
The flipped Gmagick object.
错误/异常
错误时抛出 GmagickException。
参见
- Imagick::flopimage
Gmagick::flopimage
The flopimage purpose
说明
public Gmagick Gmagick::flopimage ( <span class="methodparam">void )
Creates a vertical mirror image by reflecting the pixels around the central y-axis.
返回值
The flopped Gmagick object.
错误/异常
错误时抛出 GmagickException。
参见
- Imagick::flipimage
Gmagick::frameimage
Adds a simulated three-dimensional border
说明
public Gmagick
Gmagick::frameimage ( <span
class="methodparam">GmagickPixel
$color , <span
class="type">int $width , <span
class="methodparam">int $height ,
int
$inner_bevel , <span
class="type">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 ( <span
class="methodparam">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 ( <span class="methodparam">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 ( <span class="methodparam">void )
Returns the filename associated with an image sequence.
返回值
Returns a string on success.
错误/异常
错误时抛出 GmagickException。
Gmagick::getimagebackgroundcolor
Returns the image background color
说明
public <span class="type">GmagickPixel <span class="methodname">Gmagick::getimagebackgroundcolor ( <span class="methodparam">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 ( <span class="methodparam">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 <span class="type">GmagickPixel <span class="methodname">Gmagick::getimagebordercolor ( <span class="methodparam">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 <span
class="methodname">Gmagick::getimagechanneldepth ( <span
class="methodparam">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 <span class="methodname">Gmagick::getimagecolors ( <span class="methodparam">void )
Returns the color of the specified colormap index.
参数
此函数没有参数。
返回值
The number of colors in image.
错误/异常
错误时抛出 GmagickException。
Gmagick::getimagecolorspace
Gets the image colorspace
说明
public int <span class="methodname">Gmagick::getimagecolorspace ( <span class="methodparam">void )
Gets the image colorspace.
参数
此函数没有参数。
返回值
Colorspace
错误/异常
错误时抛出 GmagickException。
Gmagick::getimagecompose
Returns the composite operator associated with the image
说明
public int <span class="methodname">Gmagick::getimagecompose ( <span class="methodparam">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 <span class="methodname">Gmagick::getimagedelay ( <span class="methodparam">void )
Gets the image delay
参数
此函数没有参数。
返回值
Returns the composite operator associated with the image.
错误/异常
错误时抛出 GmagickException。
Gmagick::getimagedepth
Gets the depth of the image
说明
public int <span class="methodname">Gmagick::getimagedepth ( <span class="methodparam">void )
Gets the depth of the image.
参数
此函数没有参数。
返回值
Image depth
错误/异常
错误时抛出 GmagickException。
Gmagick::getimagedispose
Gets the image disposal method
说明
public int <span class="methodname">Gmagick::getimagedispose ( <span class="methodparam">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 ( <span class="methodparam">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 ( <span class="methodparam">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 ( <span class="methodparam">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 ( <span class="methodparam">void )
Gets the image gamma
参数
此函数没有参数。
返回值
Returns the image gamma on success
错误/异常
错误时抛出 GmagickException。
Gmagick::getimagegreenprimary
Returns the chromaticy green primary point
说明
public array Gmagick::getimagegreenprimary ( <span class="methodparam">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 <span class="methodname">Gmagick::getimageheight ( <span class="methodparam">void )
Returns the image height
参数
此函数没有参数。
返回值
Returns the image height in pixels.
错误/异常
错误时抛出 GmagickException。
Gmagick::getimagehistogram
Gets the image histogram
说明
public array Gmagick::getimagehistogram ( <span class="methodparam">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 <span class="methodname">Gmagick::getimageindex ( <span class="methodparam">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 <span class="methodname">Gmagick::getimageinterlacescheme ( <span class="methodparam">void )
Gets the image interlace scheme.
参数
此函数没有参数。
返回值
Returns the interlace scheme as an integer on success
错误/异常
错误时抛出 GmagickException。
Gmagick::getimageiterations
Gets the image iterations
说明
public int <span class="methodname">Gmagick::getimageiterations ( <span class="methodparam">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 <span class="methodname">Gmagick::getimagematte ( <span class="methodparam">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 <span class="type">GmagickPixel <span class="methodname">Gmagick::getimagemattecolor ( <span class="methodparam">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 ( <span
class="methodparam">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 ( <span class="methodparam">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 <span class="methodname">Gmagick::getimagerenderingintent ( <span class="methodparam">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 ( <span class="methodparam">void )
Returns the resolution as an array.
参数
此函数没有参数。
返回值
Returns the resolution as an array.
错误/异常
错误时抛出 GmagickException。
Gmagick::getimagescene
Gets the image scene
说明
public int <span class="methodname">Gmagick::getimagescene ( <span class="methodparam">void )
Gets the image scene.
参数
此函数没有参数。
返回值
Returns the image scene.
错误/异常
错误时抛出 GmagickException。
Gmagick::getimagesignature
Generates an SHA-256 message digest
说明
public string Gmagick::getimagesignature ( <span class="methodparam">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 <span class="methodname">Gmagick::getimagetype ( <span class="methodparam">void )
Gets the potential image type.
参数
此函数没有参数。
返回值
Returns the potential image type.
错误/异常
错误时抛出 GmagickException。
Gmagick::getimageunits
Gets the image units of resolution
说明
public int <span class="methodname">Gmagick::getimageunits ( <span class="methodparam">void )
Gets the image units of resolution.
参数
此函数没有参数。
返回值
Returns the image units of resolution.
Gmagick::getimagewhitepoint
Returns the chromaticity white point
说明
public array Gmagick::getimagewhitepoint ( <span class="methodparam">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 <span class="methodname">Gmagick::getimagewidth ( <span class="methodparam">void )
Returns the width of the image.
参数
此函数没有参数。
返回值
Returns the image width.
错误/异常
错误时抛出 GmagickException。
Gmagick::getpackagename
Returns the GraphicsMagick package name
说明
public string Gmagick::getpackagename ( <span class="methodparam">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 ( <span class="methodparam">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 ( <span class="methodparam">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 ( <span class="methodparam">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 ( <span class="methodparam">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 ( <span class="methodparam">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 ( <span class="methodparam">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 ( <span class="methodparam">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 ( <span
class="methodparam">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 ( <span
class="methodparam">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 ( <span
class="methodparam">float $blackPoint
, float
$gamma , <span
class="type">float $whitePoint [, <span
class="methodparam">int $channel<span
class="initializer"> = 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 ( <span class="methodparam">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 ( <span
class="methodparam">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 ( <span
class="methodparam">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 ( <span class="methodparam">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 ( <span
class="methodparam">float $brightness
, float
$saturation , <span
class="type">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 ( <span
class="methodparam">float $radius ,
float
$sigma , <span
class="type">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 ( <span
class="methodparam">int $width ,
int $height
, string
$background [, <span
class="type">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 ( <span class="methodparam">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 ([ <span
class="methodparam">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 ( <span
class="methodparam"> 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 ( <span class="methodparam">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 ( <span
class="methodparam">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 ( <span
class="methodparam">int $numColors ,
int
$colorspace , <span
class="type">int $treeDepth , <span
class="methodparam">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 ( <span
class="methodparam">int $numColors ,
int
$colorspace , <span
class="type">int $treeDepth , <span
class="methodparam">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 ( <span
class="methodparam">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 ([ <span
class="methodparam">string $pattern<span
class="initializer"> = "*" ] )
Returns fonts supported by Gmagick.
参数
此函数没有参数。
返回值
The Gmagick object on success
错误/异常
错误时抛出 GmagickException。
Gmagick::queryformats
Returns formats supported by Gmagick
说明
public array
Gmagick::queryformats ([ <span
class="methodparam">string $pattern<span
class="initializer"> = "*" ] )
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 ( <span
class="methodparam">float $angle [,
int $channel<span
class="initializer"> = 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 ( <span
class="methodparam">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 ( <span
class="methodparam">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 ( <span
class="methodparam">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 ( <span
class="methodparam">string
$imageContents [, <span
class="type">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 ( <span
class="methodparam">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 ( <span
class="methodparam">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 ( <span class="methodparam">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 ( <span
class="methodparam">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 ( <span
class="methodparam">float
$xResolution , <span
class="type">float $yResolution , <span
class="methodparam">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 ( <span
class="methodparam">int $width ,
int $height
, int
$filter , <span
class="type">float $blur [, <span
class="methodparam">bool $fit<span
class="initializer"> = 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 ( <span
class="methodparam">int $x , <span
class="methodparam">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 ( <span
class="methodparam">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 ( <span
class="methodparam">int $width ,
int $height
[, bool $fit<span
class="initializer"> = 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 ( <span
class="methodparam">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 <span
class="methodname">Gmagick::setCompressionQuality ( <span
class="methodparam"> int $quality <span
class="initializer"> = 75 )
Sets the object's default compression quality.
参数
quality
返回值
The Gmagick object on success
错误/异常
错误时抛出 GmagickException。
范例
示例 #1 <span class="function">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 ( <span
class="methodparam">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 ( <span
class="methodparam">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 ( <span
class="methodparam">float $x , <span
class="methodparam">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 ( <span
class="methodparam">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 ( <span
class="methodparam">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 ( <span
class="methodparam">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 ( <span
class="methodparam">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 ( <span
class="methodparam">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 ( <span
class="methodparam">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 ( <span
class="methodparam">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 ( <span
class="methodparam">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 ( <span
class="methodparam">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 ( <span
class="methodparam">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 ( <span
class="methodparam">float $x , <span
class="methodparam">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 ( <span
class="methodparam">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 ( <span
class="methodparam">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 ( <span
class="methodparam">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 ( <span
class="methodparam">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 ( <span
class="methodparam">float $x , <span
class="methodparam">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 ( <span
class="methodparam">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 ( <span
class="methodparam">float
$xResolution , <span
class="type">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 ( <span
class="methodparam">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 ( <span
class="methodparam">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 ( <span
class="methodparam">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 ( <span
class="methodparam">float $x , <span
class="methodparam">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 ( <span
class="methodparam">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 ( <span
class="methodparam">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 ( <span
class="methodparam">mixed $color ,
float
$xShear , <span
class="type">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 ( <span
class="methodparam">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 ( <span
class="methodparam">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 ( <span class="methodparam">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 ( <span
class="methodparam">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 ( <span
class="methodparam">int $width ,
int $height
[, bool $fit<span
class="initializer"> = 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 ( <span
class="methodparam">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
说明
此方法是该方法的别名: <span class="methodname">Gmagick::writeimage.
Gmagick::writeimage
Writes an image to the specified filename
说明
public Gmagick
Gmagick::writeimage ( <span
class="methodparam">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 <span
class="type">GmagickDraw annotate
( float $x
, float $y
, string
$text )
public <span
class="type">GmagickDraw arc (
float $sx ,
float $sy ,
float $ex ,
float $ey ,
float $sd ,
float $ed )
public <span
class="type">GmagickDraw bezier (
array
$coordinate_array )
public <span
class="type">GmagickDraw ellipse
( float $ox
, float $oy
, float $rx
, float $ry
, float
$start , <span
class="type">float $end )
public <span class="type">GmagickPixel <span class="methodname">getfillcolor ( <span class="methodparam">void )
public float getfillopacity ( <span class="methodparam">void )
public mixed getfont ( <span class="methodparam">void )
public float getfontsize ( <span class="methodparam">void )
public int <span class="methodname">getfontstyle ( <span class="methodparam">void )
public int <span class="methodname">getfontweight ( <span class="methodparam">void )
public <span class="type">GmagickPixel <span class="methodname">getstrokecolor ( <span class="methodparam">void )
public float getstrokeopacity ( <span class="methodparam">void )
public float getstrokewidth ( <span class="methodparam">void )
public int <span class="methodname">gettextdecoration ( <span class="methodparam">void )
public mixed gettextencoding ( <span class="methodparam">void )
public <span
class="type">GmagickDraw line (
float $sx ,
float $sy ,
float $ex ,
float $ey )
public <span
class="type">GmagickDraw point (
float $x ,
float $y )
public <span
class="type">GmagickDraw polygon
( array
$coordinates )
public <span
class="type">GmagickDraw polyline
( array
$coordinate_array )
public <span
class="type">GmagickDraw <span
class="methodname">rectangle ( <span
class="type">float $x1 , <span
class="type">float $y1 , <span
class="type">float $x2 , <span
class="type">float $y2 )
public <span
class="type">GmagickDraw rotate (
float
$degrees )
public <span
class="type">GmagickDraw <span
class="methodname">roundrectangle ( <span
class="methodparam">float $x1 , <span
class="methodparam">float $y1 , <span
class="methodparam">float $x2 , <span
class="methodparam">float $y2 , <span
class="methodparam">float $rx , <span
class="methodparam">float $ry )
public <span
class="type">GmagickDraw scale (
float $x ,
float $y )
public <span
class="type">GmagickDraw <span
class="methodname">setfillcolor ( <span
class="type">mixed $color )
public <span
class="type">GmagickDraw <span
class="methodname">setfillopacity ( <span
class="methodparam">float
$fill_opacity )
public <span
class="type">GmagickDraw setfont
( string
$font )
public <span
class="type">GmagickDraw <span
class="methodname">setfontsize ( <span
class="type">float $pointsize )
public <span
class="type">GmagickDraw <span
class="methodname">setfontstyle ( <span
class="type">int $style )
public <span
class="type">GmagickDraw <span
class="methodname">setfontweight ( <span
class="methodparam">int $weight )
public <span
class="type">GmagickDraw <span
class="methodname">setstrokecolor ( <span
class="methodparam">mixed $color )
public <span
class="type">GmagickDraw <span
class="methodname">setstrokeopacity ( <span
class="methodparam">float
$stroke_opacity )
public <span
class="type">GmagickDraw <span
class="methodname">setstrokewidth ( <span
class="methodparam">float $width )
public <span
class="type">GmagickDraw <span
class="methodname">settextdecoration ( <span
class="methodparam">int $decoration )
public <span
class="type">GmagickDraw <span
class="methodname">settextencoding ( <span
class="methodparam">string $encoding
)
}
GmagickDraw::annotate
Draws text on the image
说明
public <span
class="type">GmagickDraw <span
class="methodname">GmagickDraw::annotate ( <span
class="methodparam">float $x , <span
class="methodparam">float $y , <span
class="methodparam">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 <span
class="type">GmagickDraw <span
class="methodname">GmagickDraw::arc ( <span
class="methodparam">float $sx , <span
class="methodparam">float $sy , <span
class="methodparam">float $ex , <span
class="methodparam">float $ey , <span
class="methodparam">float $sd , <span
class="methodparam">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 <span
class="type">GmagickDraw <span
class="methodname">GmagickDraw::bezier ( <span
class="methodparam">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 <span
class="type">GmagickDraw <span
class="methodname">GmagickDraw::ellipse ( <span
class="methodparam">float $ox , <span
class="methodparam">float $oy , <span
class="methodparam">float $rx , <span
class="methodparam">float $ry , <span
class="methodparam">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 <span class="type">GmagickPixel <span class="methodname">GmagickDraw::getfillcolor ( <span class="methodparam">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 ( <span class="methodparam">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 ( <span class="methodparam">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 ( <span class="methodparam">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 <span class="methodname">GmagickDraw::getfontstyle ( <span class="methodparam">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 <span class="methodname">GmagickDraw::getfontweight ( <span class="methodparam">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 <span class="type">GmagickPixel <span class="methodname">GmagickDraw::getstrokecolor ( <span class="methodparam">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 ( <span class="methodparam">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 ( <span class="methodparam">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 <span class="methodname">GmagickDraw::gettextdecoration ( <span class="methodparam">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 ( <span class="methodparam">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 <span
class="type">GmagickDraw <span
class="methodname">GmagickDraw::line ( <span
class="methodparam">float $sx , <span
class="methodparam">float $sy , <span
class="methodparam">float $ex , <span
class="methodparam">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 <span
class="type">GmagickDraw <span
class="methodname">GmagickDraw::point ( <span
class="methodparam">float $x , <span
class="methodparam">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 <span
class="type">GmagickDraw <span
class="methodname">GmagickDraw::polygon ( <span
class="methodparam">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 <span
class="type">GmagickDraw <span
class="methodname">GmagickDraw::polyline ( <span
class="methodparam">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 <span
class="type">GmagickDraw <span
class="methodname">GmagickDraw::rectangle ( <span
class="methodparam">float $x1 , <span
class="methodparam">float $y1 , <span
class="methodparam">float $x2 , <span
class="methodparam">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 <span
class="type">GmagickDraw <span
class="methodname">GmagickDraw::rotate ( <span
class="methodparam">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 <span
class="type">GmagickDraw <span
class="methodname">GmagickDraw::roundrectangle ( <span
class="methodparam">float $x1 , <span
class="methodparam">float $y1 , <span
class="methodparam">float $x2 , <span
class="methodparam">float $y2 , <span
class="methodparam">float $rx , <span
class="methodparam">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 <span
class="type">GmagickDraw <span
class="methodname">GmagickDraw::scale ( <span
class="methodparam">float $x , <span
class="methodparam">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 <span
class="type">GmagickDraw <span
class="methodname">GmagickDraw::setfillcolor ( <span
class="methodparam">mixed $color )
Sets the fill color to be used for drawing filled objects.
参数
color
GmagickPixel or <span
class="type">string indicating color to use for filling.
返回值
The GmagickDraw object on success.
GmagickDraw::setfillopacity
The setfillopacity purpose
说明
public <span
class="type">GmagickDraw <span
class="methodname">GmagickDraw::setfillopacity ( <span
class="methodparam">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 <span
class="type">GmagickDraw <span
class="methodname">GmagickDraw::setfont ( <span
class="methodparam">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 <span
class="type">GmagickDraw <span
class="methodname">GmagickDraw::setfontsize ( <span
class="methodparam">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 <span
class="type">GmagickDraw <span
class="methodname">GmagickDraw::setfontstyle ( <span
class="methodparam">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 <span
class="type">GmagickDraw <span
class="methodname">GmagickDraw::setfontweight ( <span
class="methodparam">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 <span
class="type">GmagickDraw <span
class="methodname">GmagickDraw::setstrokecolor ( <span
class="methodparam">mixed $color )
Sets the color used for stroking object outlines.
参数
color
GmagickPixel or <span
class="type">string representing the color for the stroke.
返回值
The GmagickDraw object on success.
GmagickDraw::setstrokeopacity
Specifies the opacity of stroked object outlines
说明
public <span
class="type">GmagickDraw <span
class="methodname">GmagickDraw::setstrokeopacity ( <span
class="methodparam">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 <span
class="type">GmagickDraw <span
class="methodname">GmagickDraw::setstrokewidth ( <span
class="methodparam">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 <span
class="type">GmagickDraw <span
class="methodname">GmagickDraw::settextdecoration ( <span
class="methodparam">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 <span
class="type">GmagickDraw <span
class="methodname">GmagickDraw::settextencoding ( <span
class="methodparam">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 <span
class="methodname">__construct ([ <span
class="methodparam">string $color ]
)
public mixed
getcolor ([ <span
class="methodparam">bool $as_array<span
class="initializer"> = false [, <span
class="methodparam">bool
$normalize_array = false
]] )
public int <span class="methodname">getcolorcount ( <span class="methodparam">void )
public float
getcolorvalue ( <span
class="methodparam">int $color )
public <span
class="type">GmagickPixel <span
class="methodname">setcolor ( <span
class="type">string $color )
public <span
class="type">GmagickPixel <span
class="methodname">setcolorvalue ( <span
class="methodparam">int $color ,
float
$value )
}
GmagickPixel::__construct
The GmagickPixel constructor
说明
public <span
class="methodname">GmagickPixel::__construct ([ <span
class="methodparam">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 ([ <span
class="methodparam">bool $as_array<span
class="initializer"> = false [, <span
class="methodparam">bool
$normalize_array = false
]] )
Returns the color described by the GmagickPixel object, as a <span class="type">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 <span
class="classname">GmagickPixelException on error.
GmagickPixel::getcolorcount
Returns the color count associated with this color
说明
public int <span class="methodname">GmagickPixel::getcolorcount ( <span class="methodparam">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 ( <span
class="methodparam">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 <span
class="type">GmagickPixel <span
class="methodname">GmagickPixel::setcolor ( <span
class="methodparam">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 <span
class="type">GmagickPixel <span
class="methodname">GmagickPixel::setcolorvalue ( <span
class="methodparam">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.