Projects
home:rottame:vhosts-ng:php8-extensions
php8-imagick
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 3
View file
php8-imagick.changes
Changed
@@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Mon May 19 14:12:16 UTC 2025 - Angelo Grossini <angelo@intercom.it> + +- update to 3.8.0 + +------------------------------------------------------------------- Wed Aug 16 12:45:11 UTC 2023 - Angelo Grossini <rottame@intercom.it> - vhng versioning
View file
php8-imagick.spec
Changed
@@ -17,7 +17,7 @@ %define pkg_name imagick Name: php8-%{pkg_name} -Version: 3.7.0 +Version: 3.8.0 Release: lp151.25.1 Summary: Wrapper to the ImageMagick library License: PHP-3.01
View file
imagick-3.7.0.tgz/imagick-3.7.0/ChangeLog
Deleted
@@ -1,1156 +0,0 @@ -3.7.0 -- Added: - * Imagick::COMPOSITE_SALIENCY_BLEND - -3.7.0RC1 -- Added: - * function Imagick::deleteOption(string $option): bool {} - * function Imagick::getBackgroundColor(): ImagickPixel {} - * function Imagick::getImageArtifacts(string $pattern = "*"): array {} - * function Imagick::getImageKurtosis(): array {} - * function Imagick::getImageMean(): array {} - * function Imagick::getImageRange(): array {} - * function Imagick::getInterpolateMethod(): int {} - * function Imagick::getOptions(string $pattern = "*"): array {} - * function Imagick::getOrientation(): int {} - * function Imagick::getResolution(): array {} - * function Imagick::getType(): int {} - * function Imagick::implodeImageWithMethod(float $radius, int $pixel_interpolate_method): bool {} - * function Imagick::oilPaintImageWithSigma(float $radius, float $sigma) - * function Imagick::polaroidWithTextAndMethod(ImagickDraw $settings, float $angle, string $caption, int $method): bool {} - * function Imagick::polynomialImage(array $terms): bool {} - * function Imagick::setDepth(int $depth): bool {} - * function Imagick::setExtract(string $geometry): bool {} - * function Imagick::setInterpolateMethod(int $method): bool{} - * function Imagick::setOrientation(int $orientation): bool {} - * function Imagick::spreadImageWithMethod(float $radius, int $interpolate_method): bool {} - * function Imagick::swirlImageWithMethod(float $degrees, int $interpolate_method): bool {} - * function Imagick::waveImageWithMethod(float $amplitude, float $length, int $interpolate_method): bool {} - * Imagick::IMAGE_TYPE_BILEVEL - * Imagick::IMAGE_TYPE_GRAYSCALE - * Imagick::IMAGE_TYPE_GRAYSCALE_ALPHA - * Imagick::IMAGE_TYPE_PALETTE - * Imagick::IMAGE_TYPE_PALETTE_ALPHA - * Imagick::IMAGE_TYPE_TRUE_COLOR - * Imagick::IMAGE_TYPE_TRUE_COLOR_ALPHA - * Imagick::IMAGE_TYPE_COLOR_SEPARATION - * Imagick::IMAGE_TYPE_COLOR_SEPARATION_ALPHA - * Imagick::IMAGE_TYPE_OPTIMIZE - * Imagick::IMAGE_TYPE_PALETTE_BILEVEL_ALPHA - * Imagick::COMPOSITE_SEAMLESS_BLEND -- Changed: - * Imagick::setImageArtifact can now take null for the string value. - * Return type for Imagick::getImageArtifact is string|null instead of string. - -3.6.0 - - No change from 3.6.0RC2 - -3.6.0RC2 -- Fixes: - * Remove deprecated message from Imagick::roundCorners() -- Added: - * Imagick::addNoiseImageWithAttenuate() - -3.6.0RC1 - - Imagick::getImageInterlaceScheme is undeprecated. It's the appropriate function to call to get the image interlace setting. - - Image formats are now normalised to lower case. - - Imagick::getImageIndex and Imagick::setImageIndex are undeprecated and work on ImageMagick 7. They call MagickGetIteratorIndex and MagickSetIteratorIndex internally. - - Imagick::averageImages is undeprecated. For IM 7 it now calls EvaluateImages(wand->images,MeanEvaluateOperator). - - Imagick::flattenImages is undeprecated. For IM 7 it now calls MagickMergeImageLayers(intern->magick_wand, FlattenLayer); internally. - - Imagick::getImageSize is undeprecated. For IM 7 it now calls MagickGetImageLength internally. - - Imagick::roundCornersImage is undeprecated and available on IM7. -- Fixes: - * Imagick::borderImage() changed internally to use OverCompositeOp rather than AtopCompositeOp for ImageMagick > 7. If you need the old behaviour, please use Imagick::borderImageWithComposite() instead, which allows you to set the composite method. - * Imagick::frameImage() changed internally to use OverCompositeOp rather than AtopCompositeOp for ImageMagick > 7. If you need the old behaviour, please use Imagick::frameImageWithComposite() instead, which allows you to set the composite method. - * Imagick::profileImage() fixed to allow null as second paramter again. If you can't upgrade to this version yet, pass in "", which has the same effect. - * Imagick::ALPHACHANNEL_COPY and Imagick::ALPHACHANNEL_OPAQUE should be available on IM7. - * Imagick::setImageMatteColor() should be available on IM7. -- Added: - * Imagick::borderImageWithComposite() same as Imagick::borderImage() but allows user to set composite operator used. - * Imagick::frameImageWithComposite() same as Imagick::frameImage() but allows user to set composite operator used. - * function Imagick::cannyEdgeImage - * function Imagick::setSeed - * function Imagick::waveletDenoiseImage - * function Imagick::meanShiftImage - * function Imagick::kmeansImage - * function Imagick::rangeThresholdImage - * function Imagick::autoThresholdImage - * function Imagick::bilateralBlurImage - * function Imagick::claheImage - * function Imagick::channelFxImage - * function Imagick::colorThresholdImage - * function Imagick::complexImages - * function Imagick::interpolativeResizeImage - * function Imagick::levelImageColors - * function Imagick::levelizeImage - * function Imagick::orderedDitherImage - * function Imagick::whiteBalanceImage - -3.5.1 - - No change from 3.5.1RC1 - -3.5.1RC1 - - Better detection of appropriate OpenMP library to use, i.e. GCC or Clang. - -3.5.0 - - Correct parameter for ImagickPixel::getColorValue and ImagickPixel::setIndex. - -3.5.0RC2 - - Fix incorrect parameter defaults, and small fixes on arginfo generation. - -3.5.0RC1 -- ImageMagick 7 is still not widely available on systems. So contrary to previous plans, ImageMagick 6 support will continue for now, but users are recommended to use ImageMagick 7 if possible. -- Method names have been changed to not be all lower case. Both method names and parameter information is built from the Imagick*.stub.php files. -- Prevent accidental creation of zero dimension images. ImageMagick doesn't prevent creation of zero dimension images, but will give an error when that image is used. I don't think this will affect any correctly program, but if it does, and you need to re-enable zero dimension images, please open an issue at https://phpimagick.com/issues -- Various pieces of work have been done to make GOMP not segfault including: - * Call omp_pause_resource_all when available during shutdown. - * Added the 'imagick.shutdown_sleep_count' (default 10) and 'imagick.set_single_thread' (default On). Both of these exist to mitigate the segaults on shutdown. -- Fixes: - * Correct version check to make RemoveAlphaChannel and FlattenAlphaChannel be available when using Imagick with ImageMagick version 6.7.8-x - * Imagick::morphology now no longer ignores channel parameter -- Added: - * PHP 8.0 support. - * Location check for ImageMagick 7 for NixOS and Brew. - * Imagick::houghLineImage(int $width, int $height, float $threshold): bool {} - * Imagick::setImagePixelColor(int $x, int $y, ImagickPixel|string $color) - * Imagick::setImageMask(Imagick $clip_mask, int $pixelmask_type) - * Imagick::getImageMask(int $pixelmask_type) - * Imagick::VIRTUALPIXELMETHOD_DITHER - * Imagick::VIRTUALPIXELMETHOD_RANDOM - * Imagick::COMPOSITE_FREEZE - * Imagick::COMPOSITE_INTERPOLATE - * Imagick::COMPOSITE_NEGATE - * Imagick::COMPOSITE_REFLECT - * Imagick::COMPOSITE_SOFTBURN - * Imagick::COMPOSITE_SOFTDODGE - * Imagick::COMPOSITE_STAMP - * Imagick::COMPOSITE_RMSE - * Imagick::COMPRESSION_DWAA - * Imagick::COMPRESSION_DWAB - * Imagick::EVALUATE_INVERSE_LOG - * Imagick::COLORSPACE_DISPLAYP3 - * Imagick::COLORSPACE_ADOBE98 - * Imagick::COLORSPACE_PROPHOTO - * Imagick::COLORSPACE_JZAZBZ - * Imagick::DISTORTION_RIGID_AFFINE - * Imagick::DISTORTION_BARRELINVERSE - * Imagick::STATISTIC_ROOT_MEAN_SQUARE - -3.4.4 -- Fixes: - * Correct version check to make RemoveAlphaChannel and FlattenAlphaChannel be available when using Imagick with ImageMagick version 6.7.8-x - -3.4.4RC2 -- Fixes: - * Correct stability for RC release - * Fix undefined variable for ZTS build - -3.4.4RC1 -- The 3.4.4 release is intended to be the last release (other than small bug fixes) that will support either PHP 5.x, or ImageMagick 6.x. The next planned release will be PHP > 7.0 and ImageMagick > 7.0 at least, if not higher. -- Added: - * function Imagick::optimizeImageTransparency() - * METRIC_STRUCTURAL_SIMILARITY_ERROR - * METRIC_STRUCTURAL_DISSIMILARITY_ERROR - * COMPRESSION_ZSTD - https://github.com/facebook/zstd - * COMPRESSION_WEBP - * CHANNEL_COMPOSITE_MASK - * FILTER_CUBIC_SPLINE - "Define the lobes with the -define filter:lobes={2,3,4} (reference https://imagemagick.org/discourse-server/viewtopic.php?f=2&t=32506)." - * Imagick now explicitly conflicts with the Gmagick extension. -- Fixes: - * Bug 77128 - Imagick::setImageInterpolateMethod() not available on Windows - * Prevent memory leak when ImagickPixel::__construct called after object instantiation. - * Prevent segfault when ImagickPixel internal constructor not called. - * Imagick::setResourceLimit support for values larger than 2GB (2^31) on 32bit platforms. - * Corrected memory overwrite in Imagick::colorDecisionListImage() - * Bug 77791 - ImagickKernel::fromMatrix() out of bounds write. -- Deprecated: - * The following functions have been deprecated: - ImagickDraw, matte - Imagick::averageimages - Imagick::colorfloodfillimage - Imagick::filter - Imagick::flattenimages - Imagick::getimageattribute - Imagick::getimagechannelextrema - Imagick::getimageclipmask - Imagick::getimageextrema - Imagick::getimageindex - Imagick::getimagematte - Imagick::getimagemattecolor - Imagick::getimagesize - Imagick::mapimage - Imagick::mattefloodfillimage - Imagick::medianfilterimage - Imagick::mosaicimages - Imagick::orderedposterizeimage - Imagick::paintfloodfillimage - Imagick::paintopaqueimage - Imagick::painttransparentimage - Imagick::radialblurimage - Imagick::recolorimage - Imagick::reducenoiseimage - Imagick::roundcornersimage - Imagick::roundcorners - Imagick::setimageattribute - Imagick::setimagebias - Imagick::setimageclipmask - Imagick::setimageindex - Imagick::setimagemattecolor - Imagick::setimagebiasquantum - Imagick::setimageopacity - Imagick::transformimage - -3.4.3 - No changes from 3.4.3RC4. - -3.4.3RC4 -- Fixes: - * Avoid internal segfault. - -3.4.3RC3 -- Fixes: - * Correct file permissions in built package. - -3.4.3RC2 -- Fixes: - * Imagick::getRegistry() now throws an exception if the key does not exist, rather than terminating the program. - * Prevent attempts to resize image to zero width or height, which is not supported by ImageMagick. - * Fix compiling on Windows issue. -- Added: - * function Imagick::setImageAlpha() which replaces ImagickDraw::setOpacity() - -3.4.3RC1 -- Fixes: - * Imagick::transformImage and Imagick::orderedPosterizeImage now correctly excluded from - IM7 build. - * Bug 72311 - compiling against PHP 7.1. - * Bug 72226 - regression for Imagick Exception classes being final on 7.x - * Corrected reference of constants. Imagick::METRIC_MEANERRORPERPIXELMETRIC from MeanErrorPerPixelMetric to MeanErrorPerPixelErrorMetric. Imagick::METRIC_PEAKSIGNALTONOISERATIO from PeakSignalToNoiseRatioMetric to PeakSignalToNoiseRatioErrorMetric -- Added: - * function Imagick::identifyImageType() : int returns one of the Imagick::IMGTYPE_* constants - * Imagick::INTERPOLATE_NEAREST_PIXEL for ImageMagick >= 7 - * In ImageMagick, the names of two filter constants were corrected to the standard spelling. Support for the new spelling has been added. The old constants are left in place for legacy support. - Legacy: FILTER_HANNING, new name: FILTER_HANN - Legacy: FILTER_WELSH, new name: FILTER_WELCH - * The Imagick::IMGTYPE_*MATTE* constants are deprecated for ImageMagick 7. Instead an appropriate Imagick::IMGTYPE_*MATTE* should be used. - IMGTYPE_GRAYSCALEMATTE => IMGTYPE_GRAYSCALEALPHA - IMGTYPE_PALETTEMATTE => IMGTYPE_PALETTEALPHA - IMGTYPE_TRUECOLORALPHA => IMGTYPE_TRUECOLORMATTE - IMGTYPE_COLORSEPARATIONALPHA => IMGTYPE_COLORSEPARATIONMATTE - IMGTYPE_PALETTEBILEVELALPHA => IMGTYPE_PALETTEBILEVELMATTE - * Several ALPHACHANNEL_* constants are only available in ImageMagick < 7 - IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_RESET", ResetAlphaChannel); - IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_COPY", CopyAlphaChannel); - IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_OPAQUE", OpaqueAlphaChannel); - * Several ALPHACHANNEL_* constants are only available in ImageMagick >= 7. These constants re-use the values of the constants removed. - IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_ON", OnAlphaChannel); - IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_OFF", OffAlphaChannel); - IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_DISCRETE", DiscreteAlphaChannel); - -3.4.2 -- Fixes: - * Bug: IM143 Correct ifdef around setOpacity, getOpacity and localContrastImage. - * Bug: IM147 Imagick was Borging PHP's error handler. - -3.4.1 -- Fixes: - * Bug 71742 - arrays that contain data that is held by reference gives error. -- Added: - * Imagick::autoGammaImage(int channel = CHANNEL_ALL) - * Imagick::autoOrient() - * Imagick::compositeImageGravity(Imagick $image, int COMPOSITE_CONSTANT, int GRAVITY_CONSTANT) - * Imagick::localContrastImage(float radius, float strength) - * Imagick::DIRECTION_LEFT_TO_RIGHT - * Imagick::DIRECTION_RIGHT_TO_LEFT - * Imagick::SPARSECOLORMETHOD_MANHATTAN - * ImagickDraw::getOpacity() : float - * ImagickDraw::setOpacity(float opacity) :bool - * ImagickDraw::getFontResolution() : array - * ImagickDraw::setFontResolution(float x, float y) : bool - * ImagickDraw::getTextDirection() : bool - * ImagickDraw::setTextDirection(int direction) : bool - * ImagickDraw::getBorderColor() : ImagickPixel - * ImagickDraw::setBorderColor(ImagickPixel color) : bool - * ImagickDraw::getDensity() : string|null - * ImagickDraw::setDensity(string density_string) : bool - * ImagickPixel::setColorFromPixel(ImagickPixel $srcPixel) : bool - -3.4.0 - No changes from 3.4.0RC6. - -3.4.0RC6 -- Added: - * Imagick::evaluateImages(int EVALUATE_CONSTANT) : Imagick -- Fixes: - * Imagick::setImageWhitePoint, Imagick::setImageRedPrimary, Imagick::setImageGreenPrimary, - Imagick::setImageBluePrimary now take 3 params when compiled against IM7. - * Imagick::getImageWhitePoint, Imagick::getImageRedPrimary, Imagick::getImageGreenPrimary, - Imagick::getImageBluePrimary now return 3 values when compiled against IM7. - -3.4.0RC5 -- Added: - * Imagick::subImageMatch() added parameters. The signature is now: - Imagick::subimagematch(Imagick $subimage, array &$bestMatch, float &similarity, - float $similarity_threshold = 0, int $metric = ) - These parameters are only used when compiled against ImageMagick 7. -- Fixes: - * wrong type for zend_parse_parameters. - -3.4.0RC4 -- Fixes: - * Remove duplicated definitions of class constants. - -3.4.0RC3 -- Fixes: - * Imagick::adaptiveResizeImage, Imagick::cropThumbnailImage Imagick::resizeImage, - Imagick::scaleImage, and Imagick::thumbnailImage have all had a rounding bug fixed. - An additional parameter has been added to each of them, 'bool $legacy'. If legacy - is true, the calculations are done with the small rounding bug that existed in - Imagick before 3.4.0. If false, the calculations should produce the same results as - ImageMagick CLI does. - * Imagick::colorizeImage() and Imagick::tintImage were using the wrong behaviour. - It is now fixed and the legacy behaviour can still be used by passing a 3rd - parameter of `true` to the function to indicate that the legacy behaviour is - desired. - * Imagick::importImagePixels regression fixed. - * Imagick::subImageMatch use correct error metric in IM7 -- Added methods: - * Imagick::similarityImage() which is an alias to Imagick::subImageMatch() - -3.4.0RC2 -- Fixes: - * Version number in extension header. - -3.4.0RC1 -- Added support: - * PHP 7 - * ImageMagick 7. Imagick can be compiled against either ImageMagick 6 or ImageMagick 7 - However it must be run with the exact same version it was compiled against. Trying - to run Imagick with a different version of ImageMagick than it was compiled against - is not supported. Please see http://nextgen.imagemagick.org/script/porting.php for - more information about ImageMagick 7. -- Minimum versions supported are now PHP >= 5.4.0 and ImageMagick >= 6.5.3-10. - Earlier versions may continue to work, but they are no longer supported. -- Added methods: - * Imagick::getConfigureOptions - * Imagick::getFeatures - * Imagick::getHDRIEnabled - * Imagick::setImageChannelMask (IM7 only) -- Added IM7 constants: - * Imagick::CHANNEL_READ_MASK - * Imagick::CHANNEL_WRITE_MASK - * Imagick::CHANNEL_META -- Fixes: - * ImagickPixel::getColorQuantum, ImagickPixel::getColorValueQuantum and - ImagickPixel::setColorValueQuantum now correctly use floats when Imagick - was compiled against a HDRI version of ImageMagick - * Imagick::exportImagePixels works for all storage types - -3.3.0 - No changes - -3.3.0RC2 -- Corrected package versioning to exclude PHP7 -- Correct params for Imagick::getColorValueQuantum - -3.3.0RC1 -- Added ImagickKernel class. These can be used with the Imagick::morphology or - Imagick::filter functions. -- Added methods: - * Imagick::brightnessContrastImage() - * Imagick::colorMatrixImage() - * Imagick::deleteImageProperty() - * Imagick::filter() - * Imagick::forwardFourierTransformImage() - * Imagick::getAntiAlias() - * Imagick::getImageCompression() - * Imagick::getRegistry() - * Imagick::getQuantum() - * Imagick::identifyFormat() - * Imagick::inverseFourierTransformImage() - * Imagick::isPixelSimilarQuantum() - * Imagick::listRegistry() - * Imagick::morphology() - * Imagick::rotationalBlurImage() - * Imagick::selectiveBlurImage() - * Imagick::setAntiAlias() - * Imagick::setImageBiasQuantum() - * Imagick::setProgressMonitor() - * Imagick::setRegistry() - which allows setting the "temporary-path" used by ImageMagick - * Imagick::statisticImage() - * Imagick::subImageMatch() - * ImagickPixel::getColorQuantum() -- Added constants: - * Imagick::RESOURCETYPE_TIME - * Imagick::RESOURCETYPE_THROTTLE - * Imagick::CHANNEL_RGBA - * Imagick::ALPHACHANNEL_BACKGROUND - * Imagick::FUNCTION_ARCSIN - * Imagick::FUNCTION_ARCTAN -- Fixed Imagick::clutImage() parameter parsing -- Fixed tint image bug -- Fixed ImageMagick compiled with HDRI having quantum values as floats -- Fixed memory leaks in: - * Imagick::getImageBlob() - * Imagick::getImagesBlob() - * Imagick::getImageChannelStatistics() - * Imagick::getImageFormat() - * Imagick::getImageMimetype() - * Imagick::getSamplingFactors() - * Imagick::identifyImage() - * Imagick::tintImage -- Fixed segfault when compiling statically -- ImagickDraw::setFontFamily no longer checks whether the font is available. This allows a - font family to be set where the family name is not the same as the font name. However it also - means an invalid family name can be set, leading to the default font being used, instead of an - exception being thrown. See https://github.com/mkoppanen/imagick/issues/77 -- Removed Zend MM support -- Excluded deprecated methods: - * Imagick::getImageMatte() - * Imagick::colorFloodfillImage() - * Imagick::matteFloodfillImage() - * Imagick::paintFloodfillImage() - * Imagick::paintOpaqueImage() - * Imagick::paintTransparentImage() - * Imagick::mapImage() - * Imagick::recolorImage() - * Imagick::setImageIndex() - * Imagick::getImageIndex() - * Imagick::getImageSize() - * Imagick::setImageAttribute() - * Imagick::getImageAttribute() - * Imagick::mosaicImages() - * Imagick::averageImages() - * Imagick::flattenImages() - This is replaced by $im = $im->mergeImageLayers(\Imagick::LAYERMETHOD_FLATTEN) - * Imagick::getImageChannelExtrema() - * Imagick::getImageExtrema() -- Ini file changes - * Added imagick.skip_version_check. Imagick now checks that it was compiled against the same version of - ImageMagick that it is being run with, and will give a warning if it was compiled against a different - version of ImageMagick. The skip_version_check setting allows you to suppress this warning. However - it is strongly recommended to use the version of ImageMagick that Imagick was compiled against. -- Misc: - * CI now compiles with CFLAGS="-Wno-deprecated-declarations -Wdeclaration-after-statement -Werror" - -3.2.0RC1 -- Fix bug #66098: Segfault in zval_addref_p - -3.2.0b2 -- A lot of internal improvements on the code -- Added ImagickPixel::isPixelSimilar and deprecate ImagickPixel::isSimilar #10 -- Added imagick::smushimages -- Added imagick::blueshiftimage and imagick::clampimage -- Added Imagick::autolevelimage -- Added constants: - Imagick::ALPHACHANNEL_REMOVE - Imagick::ALPHACHANNEL_FLATTEN - Imagick::RESOURCETYPE_THREAD - Imagick::COMPOSITE_CHANGEMASK - Imagick::COMPOSITE_LINEARLIGHT - Imagick::COMPOSITE_DIVIDE - Imagick::COMPOSITE_DISTORT - Imagick::COMPOSITE_BLUR - Imagick::COMPOSITE_PEGTOPLIGHT - Imagick::COMPOSITE_VIVIDLIGHT - Imagick::COMPOSITE_PINLIGHT - Imagick::COMPOSITE_LINEARDODGE - Imagick::COMPOSITE_LINEARBURN - Imagick::COMPOSITE_MATHEMATICS - Imagick::COMPOSITE_MODULUSADD - Imagick::COMPOSITE_MODULUSSUBTRACT - Imagick::COMPOSITE_MINUSDST - Imagick::COMPOSITE_DIVIDEDST - Imagick::COMPOSITE_DIVIDESRC - Imagick::COMPOSITE_MINUSSRC - Imagick::COMPOSITE_DARKENINTENSITY - Imagick::COMPOSITE_LIGHTENINTENSITY - Imagick::FILTER_KAISER - Imagick::FILTER_WELSH - Imagick::FILTER_PARZEN - Imagick::FILTER_LAGRANGE - Imagick::FILTER_SENTINEL - Imagick::FILTER_BOHMAN - Imagick::FILTER_BARTLETT - Imagick::FILTER_JINC - Imagick::FILTER_SINCFAST - Imagick::FILTER_ROBIDOUX - Imagick::FILTER_LANCZOSSHARP - Imagick::FILTER_LANCZOS2 - Imagick::FILTER_LANCZOS2SHARP - Imagick::FILTER_ROBIDOUXSHARP - Imagick::FILTER_COSINE - Imagick::FILTER_SPLINE - Imagick::FILTER_LANCZOSRADIUS - Imagick::COMPRESSION_ZIPS - Imagick::COMPRESSION_PIZ - Imagick::COMPRESSION_PXR24 - Imagick::COMPRESSION_B44 - Imagick::COMPRESSION_B44A - Imagick::COMPRESSION_LZMA - Imagick::COMPRESSION_JBIG1 - Imagick::COMPRESSION_JBIG2 - -3.2.0b1 -- Added Countable interface to Imagick class -- Added experimental support for Zend MM. If compiled with --enable-imagick-zend-mm - Imagick will respect PHP memory limits -- Added additional parameter to writeImageFile to allow setting format -- Distribute tests as part of the release -- Fixed Bug #65043: Destroy and clear method do the same things -- Fixed Bug #64945: ZEND_ACC_ALLOW_STATIC vs ZEND_ACC_STATIC -- A lot of internal refactoring: rewrite macros as functions, clean up naming etc - -3.1.2 -- Fixed ZTS build -- Added LICENSE file to comply with Fedora Packaging Guidelines -- Fixed memory leaks -- Added mime type to identifyImage - -3.1.1 -- Reworked identifyImage method - -3.1.0 -- Releasing RC3 as is - -3.1.0RC3 -- Fixed building against latest ImageMagick versions (#GH-2) -- Fixed thumbnail resize bug (#GH-1) -- Fixed building against latest PHP versions - -3.1.0RC2 -- Fixed PHP bug #61879 (Imagick writeImages no longer works with PHP5.4) - -3.1.0RC1 -- Fixed PECL Bug #22722 -- Fixed possible memory leaks in error scenarios -- Added PHP 5.4 support - -3.1.0b1 -- Fixed PECL Bug #21229 -- Fixed PECL Bug #20636 -- Deprecated clone() method in favour of clone keyword -- Added ImagickDraw::setResolution -- Internal refactoring on read/write code - -3.0.1 -- Fixed PECL bug #17244 - -3.0.1RC2 -- Fixed a bug which caused failure in writing files with format prefix - (such as png:test.jpg) - -3.0.1RC1 -- Fixed build against PHP 5.1.x -- Fixed PECL bug #17892 - -3.0.0 -- No bugs reported against RC2 so releasing as stable - -3.0.0RC2 -- Added set/getColorspace -- Added transformImageColorspace (Patrick Durold) -- Fix writeImage logic error in filename_len checking. -- Fix conversion to double in affine matrices -- s,function_entry,zend_function_entry, (Johannes) - -3.0.0RC1 -- Fixes a crash when setResourceLimit is called statically -- Fixes PECL bug #16932 Unable to read image from the filehandle -- Return empty string if original value is empty in: - * ImagickDraw::getClipPath - * ImagickDraw::getEncoding - * ImagickDraw::getFont - * ImagickDraw::getFontFamily -- More relaxed validation on affinematrices -- Initialize the counter properly in polygons. Thanks to Etienne Kneus - -3.0.0b2 -- Fixes building against PHP 5.2.x - -3.0.0b1 -- Fixes incorrect error message "wand contains no images" -- Change cropthumbnailimage behavior to actually do what it is supposed to do -- setimageartifact, getimageartifact, deleteimageartifact -- added fill param to thumbnailImage -- Added support for using imagick objects in other extensions - -2.3.0 -- imagick::setImageVirtualPixelMethod not deprecated anymore -- fixed windows build - -2.3.0RC3 -- Closed bug reports and pushing out RC just in case before stable. - -2.3.0RC2 -- Fixed image reading routines. Page defitions (test.pdf0) were broken on RC1 -- Fixed imagick::colorizeImage, it had no effect on images - -2.3.0RC1 -- Fixes PECL bug #16085 (Twice crop returns invalid result) -- Removed unnecessary checks - -2.3.0b1 -- Fixed compilation against older ImageMagick versions (Patch by Tim Herzog) -- Fixed getImageMatte to actually return boolean instead of int - -- Added methods: -* Imagick::getImageMimeType -* Imagick::writeimagefile -* Imagick::writeimagesfile -* Imagick::resetimagepage -* Imagick::setimageclipmask -* Imagick::getimageclipmask -* Imagick::animateimages -* Imagick::recolorimage -* Imagick::floodfillpaintimage -* Imagick::opaquepaintimage -* Imagick::transparentpaintimage -* Imagick::decipherimage -* Imagick::encipherimage -* Imagick::getimagealphachannel -* Imagick::getimagechanneldistortions -* Imagick::getimagegravity -* Imagick::setimagegravity -* Imagick::remapimage -* Imagick::exportimagepixels -* Imagick::getimagechannelkurtosis -* Imagick::functionimage -* Imagick::importImagePixels -* Imagick::sparseColorImage -* Imagick::deskewImage -* Imagick::segmentImage - -* Imagickdraw::gettextkerning -* Imagickdraw::settextkerning -* Imagickdraw::gettextinterwordspacing -* Imagickdraw::gettextinterwordspacing - -* ImagickPixel::getColorValueQuantum -* ImagickPixel::setColorValueQuamtum -* ImagickPixel::getIndex -* ImagickPixel::setIndex - -2.2.2 -- No bugs reported against RC4 so releasing it as is - -2.2.2RC4 -- Check for ImageMagick version in config.m4 before trying to search for headers -- Fixed memory leak where pointinfo is used -- Fixed incorrect memory handling of array where php array is converted to array of doubles -- Cleaned up image writing routines -- Added missing semicolon on constant registration -- Added distortion and alphachannel constants - -2.2.2RC3 -- Fixed clone keyword to actually clone the wand ptr -- Imagick progress monitor name is now correctly cloned -- Fixes PECL Bug #15614 - -2.2.2RC2 -+ Added Imagick::setImageProgressmonitor and Imagick::orderedPosterizeImage -- Fixes http://imagemagick.org/discourse-server/viewtopic.php?f=18&t=12828 -- Fixes error with empty exception messages -- Fixes PECL Bug #15332 -- Fixed a possible memory leak in Imagick::convolveImage - -2.2.2RC1 -- Fixes Pecl bug #15321 -- Added getImageCompressionQuality -- Fixes building against PHP 5.3 - -2.2.1 -- No bugs reported against RC2 so releasing it as is - -2.2.1RC2 -- Fixed ZTS build - -2.2.1RC1 -- Fixes a small memory leak when casting a string to ImagickPixel object -- Added new constants -- Added getImageChannelRange method -- Some cleaning up on the syntax - -2.2.0 -- Changes since 2.1.1: -* Major refactoring of the file structure -* Fixes bugs related to the refactoring - -2.2.0RC1 -- Fix build on Mac related to duplicate symbols - -2.2.0b2 -- Closes PECL Bugs #13841 and #13787 - -2.2.0b1 -- Major refactoring of the internal file structure - -2.1.1 -- Fixed a bug with fit parameter when scaling images with scaling ratio 1:1 - * This is a minor BWC break. Scripts relying on incorrect behavior might need revisiting. - -2.1.1RC1 -- Fixed building against ImageMagick 6.3.8-x - -2.1.0 -- Addded setImageAlphaChannel method -- Fixed sharpenImage parameters being reversed -- Fixed building with pre 5.2 versions - -2.1.0RC3 -- Fixes PECL Bug #12851 -- Some major housekeeping changing numeral values to constants - -2.1.0RC2 -- Closes PECL Bugs #12463 and #12479 -- Fixes the behavior of flattenImages and fximage -- Fixes incorrect thumbnail behavior -- Fixes a bug in Imagick::cropThumbnailImage -- Added new constant Imagick::NOISE_RANDOM - -2.1.0RC1 -+ All methods that expect ImagickPixel now allow a string representing the color -+ Added support for pixeliterator in all supported ImageMagick versions. -+ ImagickPixelIterator now implements the iterator interface -+ It is now possible to set the row with region iterator -+ Added MAXPATHLEN checks for image reads/writes -+ Added a fix to Imagick::cropThumbnailImage() to check if images are already at the desired size -+ Fixed a memory leak in Imagick::getImageHistogram() -+ Speed improvements to Imagick::cropThumbnailImage() -+ Added interpolate constants -+ Fixed ImagickPixel::getColor() -+ Marked ImagickDraw::__construct() with ZEND_ACC_CTOR -+ Added fit parameter and proportional scaling to: -- Imagick::adaptiveResizeImage() -- Imagick::scaleImage() -- Imagick::resizeImage() -+ Added imagick.locale_fix ini setting to fix drawing bug on some locale -+ Suppressed warnings in readImageFile and pingImageFile (PECL Bug #12367) -+ Added methods: -- ImagickPixel::clone() -- ImagickPixel::getColorAsString() -- Imagick::mergeImageLayers() -- Imagick::paintFloodfillImage() -- Imagick::setFont() -- Imagick::getFont() -- Imagick::setPointsize() -- Imagick::getPointsize() - -2.0.1 -+ ImagickDraw::setFont and ImagickDraw::setFontFamily now allow only valid fonts -+ Added IMAGICK_EXTVER and IMAGICK_EXTNUM constants -+ Added check for empty or invalid pseudo format string in Imagick::newPseudoImage -+ Fixed incorrect arg hinting for Imagick::compareImageChannels - -2.0.1RC1 -+ Added Imagick::distortImage and Imagick::setlastiterator -+ Added optional fourth parameter to newImage to set the format when creating a new canvas -+ Fixed fitting to zero size image in Imagick::thumbnailImage -+ Fixed the destroy methods. -+ Most of the operations that read / add images to the stack move the iterator position to the last element -+ Fixed memleaks in methods that replace the internal MagickWand* pointer - -2.0.0 -+ Added Imagick::extentImage -+ Added Imagick::IMAGICK_VERSION_NUMBER and Imagick::IMAGICK_VERSION_STRING constants -+ Fixed a possible crash in Imagick::newPseudoImage - -2.0.0RC4 -+ Moved getimagelength into #if block -+ Added optional third parameter to thumbnailImage -+ Added second optional parameter to getImageProperties and getImageProfiles to return just the available properties. -+ Closes PECL Bug #12006 - -2.0.0RC3 -+ Closes PECL Bug #12006 -+ Fixes a possible crash in queryFontMetrics -+ New methods: -+ Imagick::clutImage -+ Imagick::setImage -+ Imagick::getImageLength -+ Imagick::getImageOrientation -+ Imagick::setImageOrientation -+ Imagick::getImageProperties -+ Imagick::getImageProfiles - -2.0.0RC2 -+ Added support for forcing image format during write operations. -+ Added more interlace constants. They are present if imagick is compiled against ImagickMagick 6.3.4 or newer. -+ Added Imagick::getImageAttribute. -+ Added LAYERMETHOD constants. Available if compiled against ImageMagick 6.2.8 or later. -+ Closes PECL Bug #11934 - setImageVirtualPixelMethod triggers exception -+ Fixed safe_mode and open_basedir bypass for __construct, readImage, readImages and pingImage - -2.0.0RC1 -+ Suppress error when reading image from a stream. -+ Fixed allow_url_fopen bypass in Imagick::newPseudoImage(). -+ Fixed imagick::__tostring to return empty string if the object doesnt contain images. -+ Fixed a problem with Imagick::getImagesBlob() when an older version of ImageMagick is used. -+ Fixed a crash on Windows when no arguments are passed to the Imagick constructor. -+ Fixed a crash when using a threaded SAPI under Windows. -+ Fixed a bug in ImagickDraw::affine(). -+ Added Imagick::getIteratorIndex() and Imagick::setIteratorIndex(). -+ Added Imagick::readImages() - -2.0.0b3 -+ Closes PECL Request #11513 -+ Fixes ImagickPixel bug reported by Imran Nazar. -+ Fixed Imagick::setImageDispose and Imagick::setImageUnits. -+ Fixed Imagick::queryFontMetrics to autodetect multiline text if multiline argument is not passed or is null. -+ Fixed open_basedir bypasses in Imagick::newPseudoImage -+ Fixed "Undefined Exception" error messages - -NOTE: Using threaded SAPI in Windows is not currently recommended. - -2.0.0b2 -+ Fixed open_basedir bypasses. -+ Fixed PECL Bug #11328 -+ Added methods: -- Imagick::queryFonts() -- Imagick::queryFontMetrics() - -NOTE: Using threaded SAPI in Windows is not currently recommended. - -2.0.0b1 -- fix PECL bug #10967 - supplied path fails to compile -- Added new methods -+ Imagick::displayImage() -+ Imagick::displayImages() -+ Imagick::cropThumbnailImage() -+ Imagick::roundCorners() -+ Imagick::polaroidImage() -+ Imagick::getImageProperty() -+ Imagick::setImageProperty() -+ Imagick::newPseudoImage() -+ Imagick::__toString() -+ ImagickPixel::setColorCount() -- Added missing DisposeType constants. -- Merged ImagickPixel::getColorAsString and ImagickPixel::getColorAsNormalizedString into ImagickPixel::getColor( bool normalized ) -- Fixed wrong exception type in Imagick::setSamplingFactors -- Removed useless check from ImagickPixelIterator::syncIterator -- Renamed ImagickDraw::pushDrawingWand to ImagickDraw::push -- Renamed ImagickDraw::popDrawingWand to ImagickDraw::pop - -2.0.0a3 -- Removed support for ImagickPixelIterator if compiled against older version of ImageMagick (below 6.2.8) -- Fixed a lot of functions which were not present in older ImageMagick versions. (below 6.2.8) -- Added support for passing color name as parameter for ImagickPixel constructor -- Added support for passing a filename or an array of filenames to Imagick constructor -- Fixed anomalies with ImagickPixelIterator exceptions -- Fixed a possible segfault in Imagick::appendImages -- Fixed double-free errors in some Imagick methods -- Added composite operator constants. -- Fixed ImagickPixelIterator::__construct to accept Imagick object as parameter. - -+ Some of the changes are a bit experimental so please report bugs. - -2.0.0a2 -- Fixed segfaults in ImagickDraw::getFont(), ImagickDraw::getFontFamily(), - ImagickDraw::getTextEncoding() and ImagickDraw::getClipPath() -- Added a PHP version check to config.m4 - -2.0.0a1 -- Initial Release - -0.9.13 -- Fixed compile error with newer versions of GraphicsMagick and ImageMagick -- Fixed assertion when using imagick_setfillcolor -- Fixed segfault when an empty blob is loaded -- Use new API for fetching support image formats / fonts - -0.9.11 -- Fix some segfaults on errors (by Andrei Nigmatulin) -- EXPERIMENTAL support for ImageMagick >= 6.0.0 (hint by Stanislav Yadykin). Please report successes or failures. - -0.9.10 -- A ./configure change release only. -- Changed config.m4 for checking for correct ImageMagick Version. - ImageMagick >= 5.5.3 and < 6.6.0 or GraphicsMagick >= 1.0.0 are needed. -- ImageMagick >= 6.0.0 does not work currently. Patches are welcome ;) - -0.9.9 -- added function imagick_set_image_comment() for setting the comment attribute -of an image. -- function imagick_setcompressiontype() was not setting the correct structure. -This was identified and tested by Sergio Salvatore (sergio@cucinalogica.com). -- added function imagick_transparent() for setting a particular color to be -transparent within an image. -- changed how certain errors are handled in _php_imagick_is_error() to be -less restrictive. This apparently helps fix issues with certain types -of images that otherwise appear corrupt. Thanks to Hien Duy Nguyenxi -(hdn@umich.edu) for finding this, recommending the change and testing it. -- added imagick_set_image_quality() for manipulating the quality of the -resultant image. -- added examples/set_image_quality.php for testing the -imagick_set_image_quality() function. Thanks to Derrick DeLoreno Threatt -(dthreatt@digitalcreations.net) for bringing up the need for this function -and testing it. - -0.9.8 -- fixed critical error in call to strlen() in _php_imagick_set_last_error(). -I strongly recommend you upgrade. - -0.9.7 -- fixed bug in imagick_free() that would cause it to SEGFAULT everytime -it's called. -- fixed to work with versions of ImageMagick >= 5.5.7 - special thanks to -James Huston (hustonjs@itadevelopment.com) for helping make this happen. -- test compiled against ImageMagick 5.5.3, 5.5.6 and 5.5.7 with success. -- test compiled against GraphicsMagick 1.0.1 with success. - -0.9.6 -- functions added: -imagick_getcolorspace() -imagick_error() -- added a new example called transparent_1x1.html and some explanatory text. -I can think of many uses for this code. -- thanks to James Huston (hustonjs@itadevelopment.com) for suggesting -imagick_getcolorspace() and testing it out. -- added GraphicsMagick (http://www.graphicsmagick.org) support to configure -script (enable it with --with-imagick-gm) -- imagick_readimage() now returns false if ImageMagick ReadImage() fails. -- imagick_error() returns 1 string representing any errors that have occurred -on an operation. IT IS LARGELY UNTESTED! Beware! However, you can now -do things like: -$handle = imagick_readimage( "image.jpg" ) or die( imagick_error() ) ; -- fixed configure script. It honours now values returned by Magick-config. - -0.9.5 -- functions added: -imagick_newimagelist() -imagick_pushlist() -imagick_poplist() -imagick_mosaic() -imagick_setcompressiontype() -imagick_setcompressionquality() -- modified how all functions check to see if ImageMagick has been initialized. -- added a number of new examples for demonstrating how to use image lists. -- fixed bugs in _php_imagick_alloc_handle() and _php_imagick_clear_errors() -causing core dump when working with image lists. I wasn't checking to make -sure the structures I was examining were allocated. -- thanks to James Huston (hustonjs@itadevelopment.com) for suggesting -imagick_setcompressiontype() and imagick_setcompressionquality() and -testing them. -- added supporting IMAGICK_COMPRESSION_* constants for use with -imagick_setcompressiontype(). -- renamed imagick_setcompression() to imagick_setcompressiontype(). -(note: this was done before the new version was released so no users should -be impacted.) - -0.9.4 -- functions added: -imagick_flatten() -imagick_getmagick() -imagick_setfillopacity() -- fixed bad code in these functions: -imagick_despeckle() -imagick_edge() -imagick_emboss() -imagick_enhance() -imagick_gaussianblur() -imagick_medianfilter() -imagick_motionblur() -imagick_reducenoise() -imagick_shade() -imagick_sharpen() -imagick_spread() -imagick_unsharpmask() -- for the above functions, if call to corresponding ImageMagick -function the module would probably core dump. If it didn't the -results would be really buddy and weird. -- setfillopacity() thanks to Allen Condit, condit@isri.unlv.edu. - -0.9.3 -- functions added: -imagick_zoom() -- the difference between imagick_zoom() and imagick_resize() is -that zoom applies the blur and filter that are defined by -the image. It is a much simpler way of resizing an image. -- added imagick.dsp and modifications for compiling under Windows. -- changed all instances of le_handle to le_imagick_handle to avoid -future conflicts. - -0.9.2 -- functions added: -imagick_profile() -- created IMAGICK_PROFILE_* to support imagick_profile(). -- this release is significant because of the issue with Microsoft IE -where the image's profile causes the browser to not properly render -images (you only get red X's). See this posting: -http://studio.imagemagick.org/pipermail/magick-users/2002-September/005072.html -- added this filter IMAGICK_FILTER_UNKNOWN. If the user specifies -this filter to imagick_resize(), the resize function will take -whatever filter is defined by the image. -- modified imagick_resize() to take 6th optional parameter that is -the modifier to the geometry to facility building geometries such -as 800x600+200+200! or 450x230>. -- modified imagick_scale() to take 4th optional parameter that is -the modifier to the geometry to facility building geometries such -as 800x600+200+200! or 450x230>. -- modified imagick_sample() to take 4th optional parameter that is -the modifier to the geometry to facility building geometries such -as 800x600+200+200! or 450x230>. - -0.9.1 -- functions added: -imagick_chop() -imagick_crop() -imagick_flip() -imagick_flop() -imagick_roll() -imagick_getimagedepth() -imagick_getnumbercolors() -imagick_isgrayimage() -imagick_ismonochromeimage() -imagick_isopaqueimage() -imagick_ispaletteimage() -imagick_ordereddither() -imagick_composite() -- Added IMAGICK_COMPOSITE_OP_* for use with imagick_composite(). - -0.9.0.1 -IMPORTANT!!! -This release breaks Backwards Compatibility with the 0.1.x series of ext/imagick. read the examples for more information (in $doc_dir/imagick/examples). - -Big Credits go to Michael C. Montero, who wrote the whole extension from scratch. Without him, we would still be at 0.1.x. He will be the future lead for this package (as soon as he has an account on pear). - -0.2-0.5 were never released within PEAR. - -version 0.9.0.1: -- more appropriate changelog/notes, no changes in code. - -version 0.9: -- functions added: -imagick_next() -imagick_prev() -imagick_first() -imagick_goto() -imagick_getlistsize() -imagick_getlistindex() -imagick_getimagefromlist() -imagick_blob2image() -imagick_reducenoise() -imagick_shade() -imagick_sharpen() -imagick_spread() -imagick_threshold() -imagick_unsharpmask() -- cut over deprecation reporting to a more standized and easier to use method -- cut over all php_error calls to standard method -- added Christian's code to info function for displaying a list of supported image formats -- rewrote all code to use proper parameter parsing function -- fixed minor issue with a number of example files; was nothing critical - -version: 0.5a -- functions added: -imagick_getcanvas() -imagick_blur() -imagick_despeckle() -imagick_edge() -imagick_emboss() -imagick_enhance() -imagick_gaussianblur() -imagick_medianfilter() -imagick_motionblur() -- one major change - renamed everything to imagick*; I've joined my efforts with Christian Stocker who had a previously written but smaller extension -- magick_getcanvas() allows you to create a blank image to draw on -- changed comment header in imagick.h to match the one in imagick.c -- added Christian Stocker to credits -- moved over to Christian Stocker's config.m4, removed the need for gen_configm4 -- rewrote INSTALL to reflect new config.m4 -- slight modifications to config.m4 to get it to work properly -- added package.xml -- removed ChangeLog, everything is now in package.xml -- removed imagick_free_reason() and imagick_free_description() since they are no longer necessary -- preceded all internal functions with _php_ -- created imagick_read() for backward compatibility with old extension -- created imagick_write() for backward compatibility with old extension - -version 0.4a -- functions added: -magick_writeimages() -magick_destroyhandle() -magick_image2blob() -magick_drawarc() -magick_drawcircle() -magick_drawpoint() -magick_border() -magick_frame() -magick_raise() -magick_getwidth() -magick_getheight() -magick_getmimetype() -magick_setfillcolor() -magick_setfontface() -magick_charcoal() -magick_implode() -magick_oilpaint() -magick_solarize() -magick_swirl() -magick_wave() -- more preparation for image lists -- fixed incorrect comments in some examples -- fixed incorrect calls to magick_failedreason() and magick_faileddescription() in most examples -- a number of examples weren't exiting properly on errors, that's been fixed -- phpinfo() now displays available font family and font names -- coolest function so far: magick_oilpaint(). The output is awesome! -- added MaxRGB to phpinfo() section - -version 0.2a -- functions added: -magick_rotate() -magick_shear() -magick_contrast() -magick_equalize() -magick_gamma() -magick_level() -magick_modulate() -magick_negate() -magick_normalize() -magick_drawellipse() -- slight changes to output of gen_configm4 -- fixed comments in all examples after the initial magick_readimage(), they were wrong -- fixed all examples so they exit properly on errors -- fixed all examples so they work as either standalone script or web page; they do better output as well -- fixed output of magick info. when calling phpinfo() -- more commenting -- significantly better error handling - -0.9 -IMPORTANT!!! -This release breaks BC with the 0.1.x series of ext/imagick. -read the examples for more information (in $doc_dir/imagick/examples) - -0.2-0.5 were never released within PEAR. - -- functions added: -imagick_next() -imagick_prev() -imagick_first() -imagick_goto() -imagick_getlistsize() -imagick_getlistindex() -imagick_getimagefromlist() -imagick_blob2image() -imagick_reducenoise() -imagick_shade() -imagick_sharpen() -imagick_spread() -imagick_threshold() -imagick_unsharpmask() -- cut over deprecation reporting to a more standized and easier -to use method -- cut over all php_error calls to standard method -- added Christian's code to info function for displaying a list of -supported image formats -- rewrote all code to use proper parameter parsing function -- fixed minor issue with a number of example files; was nothing -critical - -0.1.2 -- Added imagick_border(). (pierre-alain joye) -- Fixed return of annotate and rotate (true on success). (pierre-alain joye) - -0.1.1 -- Make it compatible with ImageMagick 5.4.5 (and this is also the needed version now) -- adjust package.xml to the new "pear build" command
View file
imagick-3.7.0.tgz/imagick-3.7.0/Imagick.stub.php
Deleted
@@ -1,1649 +0,0 @@ -<?php - -/** @generate-function-entries */ - -class Imagick -{ -#if MagickLibVersion > 0x628 - public function optimizeImageLayers(): bool {} - - // METRIC_* - public function compareImageLayers(int $metric): Imagick {} - - public function pingImageBlob(string $image): bool {} - - // $filehandle should be a resource, but that is a pseudo-type - // which causes problems for people trying to mock the class - public function pingImageFile(/*resource*/mixed $filehandle, ?string $filename = null): bool {} - - public function transposeImage(): bool {} - - public function transverseImage(): bool {} - - public function trimImage(float $fuzz): bool {} - - public function waveImage(float $amplitude, float $length): bool {} - -#if MagickLibVersion >= 0x700 - public function waveImageWithMethod( - float $amplitude, - float $length, - int $interpolate_method // INTERPOLATE_* - ): bool {} -#endif - - public function vignetteImage(float $black_point, float $white_point, int $x, int $y): bool {} - - public function uniqueImageColors(): bool {} - -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -#if MagickLibVersion < 0x700 -// PHP_ME(imagick, getimagematte, imagick_zero_args, ZEND_ACC_PUBLIC | ZEND_ACC_DEPRECATED) - /** @deprecated */ - public function getImageMatte(): bool {} -#endif -#endif - - // TODO - enabled? - public function setImageMatte(bool $matte): bool {} - - public function adaptiveResizeImage( - int $columns, - int $rows, - bool $bestfit = false, - bool $legacy = false): bool {} - - public function sketchImage(float $radius, float $sigma, float $angle): bool {} - - public function shadeImage(bool $gray, float $azimuth, float $elevation): bool {} - - public function getSizeOffset(): int {} - - public function setSizeOffset(int $columns, int $rows, int $offset): bool {} - - - public function adaptiveBlurImage( - float $radius, - float $sigma, - int $channel = Imagick::CHANNEL_DEFAULT - ): bool {} - - public function contrastStretchImage( - float $black_point, - float $white_point, - int $channel = Imagick::CHANNEL_DEFAULT - ): bool {} - - public function adaptiveSharpenImage( - float $radius, - float $sigma, - int $channel = Imagick::CHANNEL_DEFAULT - ): bool {} - - - public function randomThresholdImage( - float $low, - float $high, - int $channel = Imagick::CHANNEL_DEFAULT - ): bool {} - - - - public function roundCornersImage( - float $x_rounding, - float $y_rounding, - float $stroke_width = 10, - float $displace = 5, - float $size_correction = -6): bool {} - - /** - * @alias Imagick::roundCornersImage - */ - public function roundCorners( - float $x_rounding, - float $y_rounding, - float $stroke_width = 10, - float $displace = 5, - float $size_correction = -6): bool {} - - public function setIteratorIndex(int $index): bool {} - - public function getIteratorIndex(): int {} - -#if MagickLibVersion < 0x700 - /** @deprecated */ - public function transformImage(string $crop, string $geometry): Imagick {} -#endif -#endif - -#if MagickLibVersion > 0x630 -#if MagickLibVersion < 0x700 - /** @deprecated */ - public function setImageOpacity(float $opacity): bool {} -#endif - -#if MagickLibVersion >= 0x700 - public function setImageAlpha(float $alpha): bool {} -#endif - -#if MagickLibVersion < 0x700 - - /** @deprecated */ - public function orderedPosterizeImage( - string $threshold_map, - int $channel = Imagick::CHANNEL_DEFAULT - ): bool {} -#endif -#endif - -#if MagickLibVersion >= 0x700 - public function polaroidWithTextAndMethod( - ImagickDraw $settings, - float $angle, - string $caption, - int $method - ): bool {} -#endif - -#if MagickLibVersion > 0x631 - - public function polaroidImage(ImagickDraw $settings, float $angle): bool {} - - public function getImageProperty(string $name): string {} - - public function setImageProperty(string $name, string $value): bool {} - - public function deleteImageProperty(string $name): bool {} - - // Replaces any embedded formatting characters with the appropriate - // image property and returns the interpreted text. - // See http://www.imagemagick.org/script/escape.php for escape sequences. - // -format "%m:%f %wx%h" - public function identifyFormat(string $format): string {} - - -#if IM_HAVE_IMAGICK_SETIMAGEINTERPOLATEMETHOD - // INTERPOLATE_* - public function setImageInterpolateMethod(int $method): bool {} -#endif - - // why does this not need to be inside the 'if' for IM_HAVE_IMAGICK_SETIMAGEINTERPOLATEMETHOD ..? - public function getImageInterpolateMethod(): int {} - - public function linearStretchImage(float $black_point, float $white_point): bool {} - - public function getImageLength(): int {} - - public function extentImage(int $width, int $height, int $x, int $y): bool {} -#endif -#if MagickLibVersion > 0x633 - public function getImageOrientation(): int {} - - public function setImageOrientation(int $orientation): bool {} -#endif - -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -#if MagickLibVersion > 0x634 -#if MagickLibVersion < 0x700 - /** @deprecated */ - public function paintFloodfillImage( - ImagickPixel|string $fill_color, - float $fuzz, - ImagickPixel|string $border_color, - int $x, - int $y, - int $channel = Imagick::CHANNEL_DEFAULT - ): bool {} -#endif -#endif -#endif - -#if MagickLibVersion > 0x635 - - // TODO - Imagick - public function clutImage(Imagick $lookup_table, int $channel = Imagick::CHANNEL_DEFAULT): bool {} - - public function getImageProperties(string $pattern = "*", bool $include_values = true): array {} - - public function getImageProfiles(string $pattern = "*", bool $include_values = true): array {} - - // DISTORTION_* - public function distortImage(int $distortion, array $arguments, bool $bestfit): bool {} - - // $filehandle should be a resource, but that is a pseudo-type - // which causes problems for people trying to mock the class - public function writeImageFile(/*resource*/mixed $filehandle, ?string $format = null): bool {} - - // $filehandle should be a resource, but that is a pseudo-type - // which causes problems for people trying to mock the class - public function writeImagesFile(/*resource*/mixed $filehandle, ?string $format = null): bool {} - - public function resetImagePage(string $page): bool {} - -#if MagickLibVersion < 0x700 - /** @deprecated */ - public function setImageClipMask(imagick $clip_mask): bool {} - - /** @deprecated */ - public function getImageClipMask(): Imagick {} -#endif - - // TODO - x server? - public function animateImages(string $x_server): bool {} - -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -#if MagickLibVersion < 0x700 - /** @deprecated */ - public function recolorImage(array $matrix): bool {} -#endif -#endif -#endif - -#if MagickLibVersion > 0x636 - public function setFont(string $font): bool {} - - public function getFont(): string {} - - public function setPointSize(float $point_size): bool {} - - public function getPointSize(): float {} - - // LAYERMETHOD_* - public function mergeImageLayers(int $layermethod): Imagick {} -#endif - -#if MagickLibVersion > 0x637 - // ALPHACHANNEL_* - public function setImageAlphaChannel(int $alphachannel): bool {} - - // TODO - ImagickPixel ugh -// TODO - ugh MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand, -// const PixelWand *fill,const double fuzz,const PixelWand *bordercolor, -// const ssize_t x,const ssize_t y,const MagickBooleanType invert) - - public function floodfillPaintImage( - ImagickPixel|string $fill_color, - float $fuzz, - ImagickPixel|string $border_color, - int $x, - int $y, - bool $invert, - ?int $channel = Imagick::CHANNEL_DEFAULT - ): bool{} - - - - public function opaquePaintImage( - ImagickPixel|string $target_color, - ImagickPixel|string $fill_color, - float $fuzz, - bool $invert, - int $channel = Imagick::CHANNEL_DEFAULT): bool {} - - public function transparentPaintImage( - ImagickPixel|string $target_color, - float $alpha, - float $fuzz, - bool $invert - ): bool {} -#endif -#if MagickLibVersion > 0x638 - public function liquidRescaleImage(int $width, int $height, float $delta_x, float $rigidity): bool {} - - public function encipherImage(string $passphrase): bool {} - -// PHP_ME(imagick, decipherimage, imagick_decipherimage_args, ZEND_ACC_PUBLIC) - public function decipherImage(string $passphrase): bool {} -#endif - -#if MagickLibVersion > 0x639 - - // GRAVITY_* - public function setGravity(int $gravity): bool {} - - public function getGravity(): int {} - - // CHANNEL_ - public function getImageChannelRange(int $channel): array {} - - public function getImageAlphaChannel(): bool {} -#endif - -#if MagickLibVersion > 0x642 - public function getImageChannelDistortions( - Imagick $reference_image, - int $metric, - int $channel = Imagick::CHANNEL_DEFAULT - ): float {} -#endif - -#if MagickLibVersion > 0x643 - // GRAVITY_ - public function setImageGravity(int $gravity): bool {} - - public function getImageGravity(): int {} -#endif - -#if MagickLibVersion > 0x645 - public function importImagePixels( - int $x, - int $y, - int $width, - int $height, - string $map, - int $pixelstorage, // PIXELSTORAGE - array $pixels): bool {} - - public function deskewImage(float $threshold): bool {} - - - public function segmentImage( - int $colorspace, // COLORSPACE - float $cluster_threshold, - float $smooth_threshold, - bool $verbose = false - ): bool {} - - - public function sparseColorImage( - int $sparsecolormethod, // SPARSECOLORMETHOD_* - array $arguments, - int $channel = Imagick::CHANNEL_DEFAULT - ): bool {} - - public function remapImage(Imagick $replacement, int $dither_method): bool {} -#endif - - -#if PHP_IMAGICK_HAVE_HOUGHLINE - public function houghLineImage(int $width, int $height, float $threshold): bool {} -#endif - -#if MagickLibVersion > 0x646 - public function exportImagePixels( - int $x, - int $y, - int $width, - int $height, - string $map, // e.g. "RGB" - int $pixelstorage // PIXELSTORAGE - ): array {} -#endif - -#if MagickLibVersion > 0x648 - public function getImageChannelKurtosis(int $channel = Imagick::CHANNEL_DEFAULT): array {} - - public function functionImage( - int $function, - array $parameters, - int $channel = Imagick::CHANNEL_DEFAULT - ): bool {} -#endif - -#if MagickLibVersion > 0x651 - // COLORSPACE_* - public function transformImageColorspace(int $colorspace): bool {} -#endif - -#if MagickLibVersion > 0x652 - public function haldClutImage(Imagick $clut, int $channel = Imagick::CHANNEL_DEFAULT): bool {} -#endif - -#if MagickLibVersion > 0x655 - public function autoLevelImage(int $channel = Imagick::CHANNEL_DEFAULT): bool {} - - public function blueShiftImage(float $factor = 1.5): bool {} -#endif - -#if MagickLibVersion > 0x656 - /** - * $artifact example 'compose:args' - * - */ - public function getImageArtifact(string $artifact): string|null {} - - /** - * $artifact example 'compose:args' - * $value example "1,0,-0.5,0.5" - * - */ - public function setImageArtifact(string $artifact, string|null $value): bool {} - - public function deleteImageArtifact(string $artifact): bool {} - - // Will return CHANNEL_* - public function getColorspace(): int {} - -// PHP_ME(imagick, setcolorspace, imagick_setcolorspace_args, ZEND_ACC_PUBLIC) - public function setColorspace(int $colorspace): bool {} - - // CHANNEL_* - public function clampImage(int $channel = Imagick::CHANNEL_DEFAULT): bool {} -#endif - -#if MagickLibVersion > 0x667 - // stack By default, images are stacked left-to-right. Set stack to MagickTrue to stack them top-to-bottom. - //offset minimum distance in pixels between images. - public function smushImages(bool $stack, int $offset): Imagick {} -#endif - -// PHP_ME(imagick, __construct, imagick_construct_args, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - // TODO int|float? :spocks_eyebrow.gif: - public function __construct(string|array|int|float|null $files = null) {} - - public function __toString(): string {} - -#if PHP_VERSION_ID >= 50600 - // This calls MagickGetNumberImages underneath - // mode is unused. Remove at next major release - // https://github.com/Imagick/imagick/commit/13302500c0ab0ce58e6502e68871187180f7987c - public function count(int $mode = 0): int {} -#else - public function count(): int {} -#endif - - public function getPixelIterator(): ImagickPixelIterator {} - - public function getPixelRegionIterator(int $x, int $y, int $columns, int $rows): ImagickPixelIterator {} - - public function readImage(string $filename): bool {} - - public function readImages(array $filenames): bool {} - - public function readImageBlob(string $image, ?string $filename = null): bool {} - - public function setImageFormat(string $format): bool {} - - public function scaleImage(int $columns, int $rows, bool $bestfit = false, bool $legacy = false): bool {} - - public function writeImage(?string $filename = null): bool {} - - public function writeImages(string $filename, bool $adjoin): bool {} - - // CHANNEL_ - public function blurImage(float $radius, float $sigma, int $channel = Imagick::CHANNEL_DEFAULT): bool {} - - public function thumbnailImage( - ?int $columns, - ?int $rows, - bool $bestfit = false, - bool $fill = false, - bool $legacy = false): bool {} - - public function cropThumbnailImage(int $width, int $height, bool $legacy = false): bool {} - - public function getImageFilename(): string {} - - public function setImageFilename(string $filename): bool {} - - public function getImageFormat(): string {} - - public function getImageMimeType(): string {} - - public function removeImage(): bool {} - - /** @alias Imagick::clear */ - public function destroy(): bool {} - - public function clear(): bool {} - - public function clone(): Imagick {} - - public function getImageSize(): int {} - - public function getImageBlob(): string {} - - public function getImagesBlob(): string {} - - public function setFirstIterator(): bool {} - - public function setLastIterator(): bool {} - - public function resetIterator(): void {} - - public function previousImage(): bool {} - - public function nextImage(): bool {} - - public function hasPreviousImage(): bool {} - - public function hasNextImage(): bool {} - - public function setImageIndex(int $index): bool {} - - public function getImageIndex(): int {} - - public function commentImage(string $comment): bool {} - - public function cropImage(int $width, int $height, int $x, int $y): bool {} - - public function labelImage(string $label): bool {} - - public function getImageGeometry(): array {} - - public function drawImage(ImagickDraw $drawing): bool {} - - public function setImageCompressionQuality(int $quality): bool {} - - public function getImageCompressionQuality(): int {} - - public function setImageCompression(int $compression): bool {} - - public function getImageCompression(): int {} - - public function annotateImage( - ImagickDraw $settings, - float $x, - float $y, - float $angle, - string $text - ): bool {} - - public function compositeImage( - Imagick $composite_image, - int $composite, - int $x, - int $y, - int $channel = Imagick::CHANNEL_DEFAULT): bool{} - - public function modulateImage(float $brightness, float $saturation, float $hue): bool {} - - public function getImageColors(): int {} - - - public function montageImage( - ImagickDraw $settings, - string $tile_geometry, // e.g. "3x2+0+0" - string $thumbnail_geometry, // e.g. "200x160+3+3>" - int $monatgemode, // MONTAGEMODE_ - string $frame // "10x10+2+2" - ): Imagick {} - - public function identifyImage(bool $append_raw_output = false): array {} - - public function thresholdImage(float $threshold, int $channel = Imagick::CHANNEL_DEFAULT): bool {} - - public function adaptiveThresholdImage(int $width, int $height, int $offset): bool {} - - public function blackThresholdImage(ImagickPixel|string $threshold_color): bool {} - - public function whiteThresholdImage(ImagickPixel|string $threshold_color): bool {} - - public function appendImages(bool $stack): Imagick {} - - public function charcoalImage(float $radius, float $sigma): bool {} - - public function normalizeImage(int $channel = Imagick::CHANNEL_DEFAULT): bool {} - -#if MagickLibVersion >= 0x700 - public function oilPaintImageWithSigma(float $radius, float $sigma): bool {} -#endif - - public function oilPaintImage(float $radius): bool {} - - public function posterizeImage(int $levels, bool $dither): bool {} - -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -#if MagickLibVersion < 0x700 - /** @deprecated */ - public function radialBlurImage(float $angle, int $channel = Imagick::CHANNEL_DEFAULT): bool {} -#endif -#endif - - public function raiseImage(int $width, int $height, int $x, int $y, bool $raise): bool {} - - public function resampleImage(float $x_resolution, float $y_resolution, int $filter, float $blur): bool {} - - public function resizeImage( - int $columns, - int $rows, - int $filter, - float $blur, - bool $bestfit = false, - bool $legacy = false): bool {} - - public function rollImage(int $x, int $y): bool {} - - public function rotateImage(ImagickPixel|string $background_color, float $degrees): bool {} - - public function sampleImage(int $columns, int $rows): bool {} - - public function solarizeImage(int $threshold): bool {} - - public function shadowImage(float $opacity, float $sigma, int $x, int $y): bool {} - -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -#if MagickLibVersion < 0x700 - /** @deprecated */ - public function setImageAttribute(string $key, string $value): bool {} -#endif -#endif - - public function setImageBackgroundColor(ImagickPixel|string $background_color): bool {} - -#if MagickLibVersion >= 0x700 - public function setImageChannelMask(int $channel): int {} -#endif - - public function setImageCompose(int $compose): bool {} - - public function setImageDelay(int $delay): bool {} - - public function setImageDepth(int $depth): bool {} - - public function setImageGamma(float $gamma): bool {} - - public function setImageIterations(int $iterations): bool {} - - -#if MagickLibVersion < 0x700 || MagickLibVersion >= 0x705 - public function setImageMatteColor(ImagickPixel|string $matte_color): bool {} -#endif - - public function setImagePage(int $width, int $height, int $x, int $y): bool {} - - // TODO test this. - public function setImageProgressMonitor(string $filename): bool {} - -#if MagickLibVersion > 0x653 - public function setProgressMonitor(callable $callback): bool {} -#endif - - public function setImageResolution(float $x_resolution, float $y_resolution): bool {} - - // I have no idea what scene does. - public function setImageScene(int $scene): bool {} - - public function setImageTicksPerSecond(int $ticks_per_second): bool {} - - // IMGTYPE_* - public function setImageType(int $image_type): bool {} - - public function setImageUnits(int $units): bool {} - - public function sharpenImage(float $radius, float $sigma, int $channel = Imagick::CHANNEL_DEFAULT): bool {} - - public function shaveImage(int $columns, int $rows): bool {} - - public function shearImage(ImagickPixel|string $background_color, float $x_shear, float $y_shear): bool {} - - public function spliceImage(int $width, int $height, int $x, int $y): bool {} - - public function pingImage(string $filename): bool {} - - // $filehandle should be a resource, but that is a pseudo-type - // which causes problems for people trying to mock the class - public function readImageFile(/*resource*/mixed $filehandle, ?string $filename = null): bool {} - - public function displayImage(string $servername): bool {} - - public function displayImages(string $servername): bool {} - - public function spreadImage(float $radius): bool {} - -#if MagickLibVersion >= 0x700 - public function spreadImageWithMethod( - float $radius, - int $interpolate_method // INTERPOLATE_* - ): bool {} -#endif - - public function swirlImage(float $degrees): bool {} - -#if MagickLibVersion >= 0x700 - public function swirlImageWithMethod( - float $degrees, - int $interpolate_method // INTERPOLATE_* - ): bool {} -#endif - - public function stripImage(): bool {} - - public static function queryFormats(string $pattern = "*"): array {} - - public static function queryFonts(string $pattern = "*"): array {} - - /* TODO $multiline == null, means we should autodetect */ - public function queryFontMetrics(ImagickDraw $settings, string $text, ?bool $multiline = null): array {} - - public function steganoImage(Imagick $watermark, int $offset): Imagick {} - - // NOISE_* - public function addNoiseImage(int $noise, int $channel = Imagick::CHANNEL_DEFAULT): bool {} - -#if IM_HAVE_IMAGICK_ADD_NOISE_WITH_ATTENUATE - public function addNoiseImageWithAttenuate( - int $noise, - float $attenuate, - int $channel = Imagick::CHANNEL_DEFAULT - ): bool {} -#endif - - public function motionBlurImage( - float $radius, - float $sigma, - float $angle, - int $channel = Imagick::CHANNEL_DEFAULT - ):bool {} - -#if MagickLibVersion < 0x700 -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) - /** @deprecated */ - public function mosaicImages(): Imagick {} -#endif -#endif - - public function morphImages(int $number_frames): Imagick {} - - public function minifyImage(): bool {} - - public function affineTransformImage(ImagickDraw $settings): bool {} - - public function averageImages(): Imagick {} - - public function borderImage( - ImagickPixel|string $border_color, - int $width, - int $height - ): bool {} - -#if MagickLibVersion >= 0x700 - public function borderImageWithComposite( - ImagickPixel|string $border_color, - int $width, - int $height, - int $composite // COMPOSITE_ // null rather than OverCompositeOp as we don't control the value - ): bool {} -#endif - - public static function calculateCrop( - int $original_width, - int $original_height, - int $desired_width, - int $desired_height, - bool $legacy = false): array {} - - public function chopImage(int $width, int $height, int $x, int $y): bool {} - - public function clipImage(): bool {} - - public function clipPathImage(string $pathname, bool $inside): bool {} - - /* clippathimage has been deprecated. Create alias here and use the newer API function if present */ - /** @alias Imagick::clipPathImage */ - public function clipImagePath(string $pathname, bool $inside): void {} - - public function coalesceImages(): Imagick {} - -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -#if MagickLibVersion < 0x700 - /** @deprecated */ - public function colorFloodfillImage( - ImagickPixel|string $fill_color, - float $fuzz, - ImagickPixel|string $border_color, - int $x, - int $y - ): bool {} -#endif -#endif - - // TODO - opacity is actually float if legacy is true... - public function colorizeImage( - ImagickPixel|string $colorize_color, - ImagickPixel|string|false $opacity_color, - ?bool $legacy = false ): bool {} - - public function compareImageChannels(Imagick $reference, int $channel, int $metric): array {} - - public function compareImages(Imagick $reference, int $metric): array {} - - public function contrastImage(bool $sharpen): bool {} - - public function combineImages(int $colorspace): Imagick {} - - // kernel is a 2d array of float values - public function convolveImage(array $kernel, int $channel = Imagick::CHANNEL_DEFAULT): bool {} - - public function cycleColormapImage(int $displace): bool {} - - public function deconstructImages(): Imagick {} - - public function despeckleImage(): bool {} - - public function edgeImage(float $radius): bool {} - - public function embossImage(float $radius, float $sigma): bool {} - - public function enhanceImage(): bool {} - - public function equalizeImage(): bool {} - - // EVALUATE_* - public function evaluateImage(int $evaluate, float $constant, int $channel = Imagick::CHANNEL_DEFAULT): bool {} - -#if MagickLibVersion >= 0x687 -// Merge multiple images of the same size together with the selected operator. -//http://www.imagemagick.org/Usage/layers/#evaluate-sequence - - // EVALUATE_* - public function evaluateImages(int $evaluate): bool {} - -#endif - - public function flattenImages(): Imagick {} - - public function flipImage(): bool {} - - public function flopImage(): bool {} - -#if MagickLibVersion >= 0x655 - public function forwardFourierTransformImage(bool $magnitude): bool {} -#endif - - public function frameImage( - ImagickPixel|string $matte_color, - int $width, - int $height, - int $inner_bevel, - int $outer_bevel - ): bool {} - -#if MagickLibVersion >= 0x700 - public function frameImageWithComposite( - ImagickPixel|string $matte_color, - int $width, - int $height, - int $inner_bevel, - int $outer_bevel, - int $composite - ): bool {} -#endif - - public function fxImage(string $expression, int $channel = Imagick::CHANNEL_DEFAULT): Imagick {} - - public function gammaImage(float $gamma, int $channel = Imagick::CHANNEL_DEFAULT): bool {} - - public function gaussianBlurImage(float $radius, float $sigma, int $channel = Imagick::CHANNEL_DEFAULT): bool {} - -#if MagickLibVersion < 0x700 -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) - /** @deprecated */ - public function getImageAttribute(string $key): string {} -#endif -#endif - - public function getImageBackgroundColor(): ImagickPixel {} - - public function getImageBluePrimary(): array {} - - public function getImageBorderColor(): ImagickPixel {} - - public function getImageChannelDepth(int $channel): int {} - - public function getImageChannelDistortion(Imagick $reference, int $channel, int $metric): float {} - -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -#if MagickLibVersion < 0x700 - /** @deprecated */ - public function getImageChannelExtrema(int $channel): array {} -#endif -#endif - - public function getImageChannelMean(int $channel): array {} - - public function getImageChannelStatistics(): array {} - - // index - the offset into the image colormap. I have no idea. - public function getImageColormapColor(int $index): ImagickPixel {} - - public function getImageColorspace(): int {} - - public function getImageCompose(): int {} - - public function getImageDelay(): int {} - - public function getImageDepth(): int {} - - // METRIC_ - public function getImageDistortion(Imagick $reference, int $metric): float {} - -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -#if MagickLibVersion < 0x700 - /** @deprecated */ - public function getImageExtrema(): array {} -#endif -#endif - - public function getImageDispose(): int {} - - public function getImageGamma(): float {} - - public function getImageGreenPrimary(): array {} - - public function getImageHeight(): int {} - - public function getImageHistogram(): array {} - - public function getImageInterlaceScheme(): int {} - - public function getImageIterations(): int {} - -#if MagickLibVersion < 0x700 - /** @deprecated */ - public function getImageMatteColor(): ImagickPixel {} -#endif - - public function getImagePage(): array {} - - public function getImagePixelColor(int $x, int $y): ImagickPixel {} - - -#if IM_HAVE_IMAGICK_SETIMAGEPIXELCOLOR - // TODO - needs a test. - public function setImagePixelColor(int $x, int $y, ImagickPixel|string $color): ImagickPixel {} -#endif - - public function getImageProfile(string $name): string {} - - public function getImageRedPrimary(): array {} - - public function getImageRenderingIntent(): int {} - - public function getImageResolution(): array {} - - public function getImageScene(): int {} - - public function getImageSignature(): string {} - - public function getImageTicksPerSecond(): int {} - - public function getImageType(): int {} - - public function getImageUnits(): int {} - - public function getImageVirtualPixelMethod(): int {} - - public function getImageWhitePoint(): array {} - - public function getImageWidth(): int {} - - public function getNumberImages(): int {} - - public function getImageTotalInkDensity(): float {} - - public function getImageRegion(int $width, int $height, int $x, int $y): Imagick {} - - public function implodeImage(float $radius): bool {} - -#if MagickLibVersion >= 0x700 - public function implodeImageWithMethod( - float $radius, - int $pixel_interpolate_method // PixelInterpolateMethod - ): bool {} -#endif - -#if MagickLibVersion >= 0x658 - // TODO MagickWand *magnitude_wand,MagickWand *phase_wand, - public function inverseFourierTransformImage(Imagick $complement, bool $magnitude): bool {} -#endif - - public function levelImage( - float $black_point, - float $gamma, - float $white_point, - int $channel = Imagick::CHANNEL_DEFAULT - ): bool {} - - public function magnifyImage(): bool {} - -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -#if MagickLibVersion < 0x700 - /** @deprecated */ - public function mapImage(imagick $map, bool $dither): bool {} - - /** @deprecated */ - public function matteFloodfillImage( - float $alpha, - float $fuzz, - ImagickPixel|string $border_color, - int $x, - int $y - ): bool {} -#endif -#endif - -#if MagickLibVersion < 0x700 -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) - /** @deprecated */ - public function medianFilterImage(float $radius): bool {} -#endif -#endif - - public function negateImage(bool $gray, int $channel = Imagick::CHANNEL_DEFAULT): bool {} - -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -#if MagickLibVersion < 0x700 - /** @deprecated */ - public function paintOpaqueImage( - ImagickPixel|string $target_color, - ImagickPixel|string $fill_color, - float $fuzz, - int $channel = Imagick::CHANNEL_DEFAULT - ): bool {} - - /** @deprecated */ - public function paintTransparentImage(ImagickPixel|string $target_color, float $alpha, float $fuzz): bool {} -#endif -#endif - - // PREVIEW_* - public function previewImages(int $preview): bool {} - - public function profileImage(string $name, ?string $profile): bool {} - - public function quantizeImage( - int $number_colors, - int $colorspace, - int $tree_depth, - bool $dither, - bool $measure_error - ): bool {} - - - public function quantizeImages( - int $number_colors, - int $colorspace, - int $tree_depth, - bool $dither, - bool $measure_error): bool {} - -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -#if MagickLibVersion < 0x700 - /** @deprecated */ - public function reduceNoiseImage(float $radius): bool {} -#endif -#endif - - public function removeImageProfile(string $name): string {} - - public function separateImageChannel(int $channel): bool {} - - public function sepiaToneImage(float $threshold): bool {} - -#if MagickLibVersion < 0x700 - /** @deprecated */ - public function setImageBias(float $bias): bool {} - - /** @deprecated */ - public function setImageBiasQuantum(string $bias): void {} -#endif - - public function setImageBluePrimary(float $x, float $y): bool {} - /* {{{ proto bool Imagick::setImageBluePrimary(float x,float y) -For IM7 the prototype is -proto bool Imagick::setImageBluePrimary(float x, float y, float z) */ - - public function setImageBorderColor(ImagickPixel|string $border_color): bool {} - - public function setImageChannelDepth(int $channel, int $depth): bool {} - - public function setImageColormapColor(int $index, ImagickPixel|string $color): bool {} - - public function setImageColorspace(int $colorspace): bool {} - - public function setImageDispose(int $dispose): bool {} - - public function setImageExtent(int $columns, int $rows): bool {} - - public function setImageGreenPrimary(float $x, float $y): bool {} - - // INTERLACE_* - public function setImageInterlaceScheme(int $interlace): bool {} - - public function setImageProfile(string $name, string $profile): bool {} - - public function setImageRedPrimary(float $x, float $y): bool {} - - // RENDERINGINTENT - public function setImageRenderingIntent(int $rendering_intent): bool {} - - public function setImageVirtualPixelMethod(int $method): bool {} - - public function setImageWhitePoint(float $x, float $y): bool {} - - public function sigmoidalContrastImage( - bool $sharpen, - float $alpha, - float $beta, - int $channel = Imagick::CHANNEL_DEFAULT - ): bool{} - - // TODO - MagickStereoImage() composites two images and produces a single - // image that is the composite of a left and right image of a stereo pair - public function stereoImage(Imagick $offset_image): bool {} - - public function textureImage(Imagick $texture): Imagick {} - - public function tintImage( - ImagickPixel|string $tint_color, - ImagickPixel|string $opacity_color, - bool $legacy = false - ): bool {} - - public function unsharpMaskImage( - float $radius, - float $sigma, - float $amount, - float $threshold, - int $channel = Imagick::CHANNEL_DEFAULT - ): bool {} - - public function getImage(): Imagick {} - - public function addImage(Imagick $image): bool {} - - public function setImage(Imagick $image): bool {} - - - public function newImage( - int $columns, - int $rows, - ImagickPixel|string $background_color, - string $format = null - ): bool {} - - // TODO - canvas? description - public function newPseudoImage(int $columns, int $rows, string $pseudo_format): bool {} - - public function getCompression(): int {} - - public function getCompressionQuality(): int {} - - public static function getCopyright(): string {} - - /** - * @return string - */ - public static function getConfigureOptions(string $pattern = "*"): array {} - -#if MagickLibVersion > 0x660 - public static function getFeatures(): string {} -#endif - - public function getFilename(): string {} - - public function getFormat(): string {} - - public static function getHomeURL(): string {} - - public function getInterlaceScheme(): int {} - - public function getOption(string $key): string {} - - public static function getPackageName(): string {} - - public function getPage(): array {} - - public static function getQuantum(): int {} - - public static function getHdriEnabled(): bool {} - - public static function getQuantumDepth(): array {} - - public static function getQuantumRange(): array {} - - public static function getReleaseDate(): string {} - - public static function getResource(int $type): int {} - - public static function getResourceLimit(int $type): int {} - - public function getSamplingFactors(): array {} - - public function getSize(): array {} - - public static function getVersion(): array {} - - public function setBackgroundColor(ImagickPixel|string $background_color): bool {} - - public function setCompression(int $compression): bool {} - - public function setCompressionQuality(int $quality): bool {} - - public function setFilename(string $filename): bool {} - - public function setFormat(string $format): bool {} - - // INTERLACE_* - public function setInterlaceScheme(int $interlace): bool {} - - public function setOption(string $key, string $value): bool {} - - public function setPage(int $width, int $height, int $x, int $y): bool {} - - public static function setResourceLimit(int $type, int $limit): bool {} - - public function setResolution(float $x_resolution, float $y_resolution): bool {} - - public function setSamplingFactors(array $factors): bool {} - - public function setSize(int $columns, int $rows): bool {} - - // IMGTYPE_* - public function setType(int $imgtype): bool {} - -#if MagickLibVersion > 0x628 - /** @alias Imagick::getIteratorIndex */ - public function key(): int {} - -//#else -//# if defined(MAGICKCORE_EXCLUDE_DEPRECATED) -//# error "MAGICKCORE_EXCLUDE_DEPRECATED should not be defined with ImageMagick version below 6.2.8" -//# else -//// PHP_MALIAS(imagick, key, getimageindex, imagick_zero_args, ZEND_ACC_PUBLIC) -// /** @alias Imagick::getImageIndex */ -// public function key(): int {} -// -//# endif -//#endif - - /** @alias Imagick::nextImage - * @tentative-return-type - */ - public function next(): void {} - - /** @alias Imagick::setFirstIterator - * @tentative-return-type - */ - public function rewind(): void {} - - public function valid(): bool {} - - public function current(): Imagick {} - -#if MagickLibVersion >= 0x659 - public function brightnessContrastImage( - float $brightness, - float $contrast, - int $channel = Imagick::CHANNEL_DEFAULT - ): bool {} -#endif - -#if MagickLibVersion > 0x661 - public function colorMatrixImage(array $color_matrix): bool {} -#endif - - public function selectiveBlurImage( - float $radius, - float $sigma, - float $threshold, - int $channel = Imagick::CHANNEL_DEFAULT - ): bool {} - -#if MagickLibVersion >= 0x689 - public function rotationalBlurImage(float $angle, int $channel = Imagick::CHANNEL_DEFAULT): bool {} -#endif - -#if MagickLibVersion >= 0x683 - public function statisticImage( - int $type, - int $width, - int $height, - int $channel = Imagick::CHANNEL_DEFAULT - ): bool {} -#endif - -#if MagickLibVersion >= 0x652 - public function subimageMatch(Imagick $image, ?array &$offset = null, ?float &$similarity = null, float $threshold = 0.0, int $metric = 0): Imagick {} - - /** @alias Imagick::subimageMatch */ - public function similarityImage(Imagick $image, ?array &$offset = null, ?float &$similarity = null, float $threshold = 0.0, int $metric = 0): Imagick {} -#endif - - public static function setRegistry(string $key, string $value): bool {} - - public static function getRegistry(string $key): string {} - - public static function listRegistry(): array {} - -#if MagickLibVersion >= 0x680 - - public function morphology( - int $morphology, // MORPHOLOGY_* - int $iterations, - ImagickKernel $kernel, - int $channel = Imagick::CHANNEL_DEFAULT - ): bool {} -#endif - -#ifdef IMAGICK_WITH_KERNEL -#if MagickLibVersion < 0x700 - /** @deprecated */ - public function filter(ImagickKernel $kernel, int $channel = Imagick::CHANNEL_UNDEFINED): bool {} -#endif -#endif - - public function setAntialias(bool $antialias): void {} - - public function getAntialias(): bool {} - -#if MagickLibVersion > 0x676 - /** - * $color_correction_collection example: - * <ColorCorrectionCollection xmlns="urn:ASC:CDL:v1.2"> - * <ColorCorrection id="cc03345"> - * <SOPNode> - * <Slope> 0.9 1.2 0.5 </Slope> - * <Offset> 0.4 -0.5 0.6 </Offset> - * <Power> 1.0 0.8 1.5 </Power> - * </SOPNode> - * <SATNode> - * <Saturation> 0.85 </Saturation> - * </SATNode> - * </ColorCorrection> - * </ColorCorrectionCollection> - * - */ - public function colorDecisionListImage(string $color_correction_collection): bool {} -#endif - -#if MagickLibVersion >= 0x687 - public function optimizeImageTransparency(): void {} -#endif - -#if MagickLibVersion >= 0x660 - public function autoGammaImage(?int $channel = Imagick::CHANNEL_ALL): void {} -#endif - -#if MagickLibVersion >= 0x692 - public function autoOrient(): void {} - - /** @alias Imagick::autoOrient */ - public function autoOrientate(): void {} - - // COMPOSITE_* - public function compositeImageGravity(Imagick $image, int $composite_constant, int $gravity): bool {} - -#endif - -#if MagickLibVersion >= 0x693 - public function localContrastImage(float $radius, float $strength): void {} -#endif - -#if MagickLibVersion >= 0x700 - // Identifies the potential image type, returns one of the Imagick::IMGTYPE_* constants - public function identifyImageType(): int {} -#endif - - -#if IM_HAVE_IMAGICK_GETSETIMAGEMASK - // PIXELMASK_* - public function getImageMask(int $pixelmask): ?Imagick {} - - // PIXELMASK_* - public function setImageMask(Imagick $clip_mask, int $pixelmask): void {} -#endif - - - // TODO - needs deleting from docs. -// public function getImageMagickLicense(): string {} - - // TODO - needs deleting from docs. -// public function render(): bool {} - -// public function floodfillPaintImage( -// ImagickPixel|string $fill, -// float $fuzz, -// ImagickPixel|string $bordercolor, -// int $x, -// int $y, -// bool $invert, -// int $channel = Imagick::CHANNEL_DEFAULT): null {} - - -#if MagickLibVersion >= 0x709 - public function cannyEdgeImage( - float $radius, - float $sigma, - float $lower_percent, - float $upper_percent - ): bool {} -#endif - -#if IM_HAVE_IMAGICK_SETSEED - public static function setSeed(int $seed): void {} -#endif - -#if IM_HAVE_IMAGICK_WAVELETDENOISEIMAGE - public function waveletDenoiseImage(float $threshold, float $softness): bool {} -#endif - -#if IM_HAVE_IMAGICK_MEANSHIFTIMAGE - public function meanShiftImage( - int $width, - int $height, - float $color_distance - ): bool {} -#endif - -#if IM_HAVE_IMAGICK_KMEANSIMAGE - public function kmeansImage( - int $number_colors, - int $max_iterations, - float $tolerance - ): bool {} -#endif - -#if IM_HAVE_IMAGICK_RANGETHRESHOLDIMAGE - public function rangeThresholdImage( - float $low_black, - float $low_white, - float $high_white, - float $high_black - ): bool {} -#endif - -#if IM_HAVE_IMAGICK_AUTOTHRESHOLDIMAGE - // AUTO_THRESHOLD_* - public function autoThresholdImage(int $auto_threshold_method): bool {} -#endif - -#if IM_HAVE_IMAGICK_BILATERALBLURIMAGE - public function bilateralBlurImage( - float $radius, - float $sigma, - float $intensity_sigma, - float $spatial_sigma - ): bool {} -#endif - -#if IM_HAVE_IMAGICK_CLAHEIMAGE - public function claheImage( - int $width, - int $height, - int $number_bins, - float $clip_limit - ): bool {} -#endif - -#if IM_HAVE_IMAGICK_CHANNELFXIMAGE - // MagickChannelFxImage() applies a channel expression to the specified image. - // The expression consists of one or more channels, either mnemonic or numeric - // (e.g. red, 1), separated by actions as follows: - // - // <=> exchange two channels (e.g. red<=>blue) - // => transfer a channel to another (e.g. red=>green) - // , separate channel operations (e.g. red, green) - // | read channels from next input image (e.g. red | green) - // ; write channels to next output image (e.g. red; green; blue) - public function channelFxImage(string $expression): Imagick {} -#endif - -#if IM_HAVE_IMAGICK_COLORTHRESHOLDIMAGE - public function colorThresholdImage( - ImagickPixel|string $start_color, - ImagickPixel|string $stop_color - ): bool {} -#endif - -#if IM_HAVE_IMAGICK_COMPLEXIMAGES - // COMPLEX_OPERATOR_ - public function complexImages(int $complex_operator): Imagick {} -#endif - -#if IM_HAVE_IMAGICK_INTERPOLATIVERESIZEIMAGE - public function interpolativeResizeImage( - int $columns, - int $rows, - int $interpolate // INTERPOLATE_ - ): bool {} -#endif - -#if IM_HAVE_IMAGICK_LEVELIMAGECOLORS - public function levelImageColors( - ImagickPixel|string $black_color, - ImagickPixel|string $white_color, - bool $invert - ): bool {} -#endif - -#if IM_HAVE_IMAGICK_LEVELIZEIMAGE - public function levelizeImage( - float $black_point, - float $gamma, - float $white_point - ): bool {} -#endif - - //For example: "o3x3,6" generates a 6 level posterization of the image - // with a ordered 3x3 diffused pixel dither being applied between each - // level. While checker,8,8,4 will produce a 332 colormaped image with - // only a single checkerboard hash pattern (50% grey) between each color - // level, to basically double the number of color levels with a bare - // minimim of dithering. - -#if IM_HAVE_IMAGICK_ORDEREDDITHERIMAGE - public function orderedDitherImage(string $dither_format): bool {} -#endif - -#if IM_HAVE_IMAGICK_WHITEBALANCEIMAGE - public function whiteBalanceImage(): bool {} -#endif - -#if IM_HAVE_IMAGICK_DELETE_OPTION - public function deleteOption(string $option): bool {} -#endif - -#if IM_HAVE_IMAGICK_GET_BACKGROUND_COLOR - public function getBackgroundColor(): ImagickPixel {} -#endif - -#if IM_HAVE_IMAGICK_GET_IMAGE_ARTIFACTS - /** - * @return string - */ - public function getImageArtifacts(string $pattern = "*"): array {} -#endif - -#if IM_HAVE_IMAGICK_GET_IMAGE_DISTORTIONS - - /** - * metric - MetricType_ - * @return float - */ -// public function getImageDistortions(int $metric): array{} -// for (j=0; j <= MaxPixelChannels; j++) -// distortionj+=channel_distortionj; -// Use MagickRelinquishMemory() to free the metrics when you are done with them. -#endif - -#if IM_HAVE_IMAGICK_GET_IMAGE_KURTOSIS - - /** - * return kurtosis:float,skewness: float - */ - public function getImageKurtosis(): array {} -#endif - -#if IM_HAVE_IMAGICK_GET_IMAGE_MEAN - /** - * return $mean, $standard_deviation - */ - public function getImageMean(): array {} -#endif - -#if IM_HAVE_IMAGICK_GET_IMAGE_RANGE - /** - * return minima, float $maxima - */ - public function getImageRange(): array {} -#endif - -#if IM_HAVE_IMAGICK_GET_INTERPOLATE_METHOD - /** - * return int - PixelInterpolateMethod - */ - public function getInterpolateMethod(): int {} -#endif - -#if IM_HAVE_IMAGICK_GET_OPTIONS - /** - * return string - */ - public function getOptions(string $pattern = "*"): array {} -#endif - -#if IM_HAVE_IMAGICK_GET_ORIENTATION - /** - * return int OrientationType - */ - public function getOrientation(): int {} -#endif - -#if IM_HAVE_IMAGICK_GET_RESOLUTION - /** - * return x: float, y: float - */ - public function getResolution(): array {} -#endif - -#if IM_HAVE_IMAGICK_GET_TYPE - /** - * return ImageType - */ - public function getType(): int {} -#endif - -#if IM_HAVE_IMAGICK_POLYNOMIAL_IMAGE - //% o number_terms: the number of terms in the list. The actual list length - //% is 2 x number_terms + 1 (the constant). - public function polynomialImage(array $terms): bool {} -#endif - -#if IM_HAVE_IMAGICK_SET_DEPTH - public function setDepth(int $depth): bool {} -#endif - -#if IM_HAVE_IMAGICK_SET_EXTRACT - //% MagickSetExtract() sets the extract geometry before you read or write an - //% image file. Use it for inline cropping (e.g. 200x200+0+0) or resizing - //% (e.g.200x200). - public function setExtract(string $geometry): bool {} -#endif - -#if IM_HAVE_IMAGICK_SET_INTERPOLATE_METHOD -/** - * int $method - PixelInterpolateMethod - */ - public function setInterpolateMethod(int $method): bool{} -#endif - -#if IM_HAVE_IMAGICK_SET_ORIENTATION - /** - * $orientation - OrientationType - */ - public function setOrientation(int $orientation): bool {} -#endif - -}
View file
imagick-3.7.0.tgz/imagick-3.7.0/ImagickDraw.stub.php
Deleted
@@ -1,408 +0,0 @@ -<?php - -/** @generate-function-entries */ -class ImagickDraw -{ -#if MagickLibVersion > 0x628 - public function resetVectorGraphics(): bool {} -#endif -#if MagickLibVersion > 0x649 - public function getTextKerning(): float {} - public function setTextKerning(float $kerning): bool {} - public function getTextInterwordSpacing(): float {} - - public function setTextInterwordSpacing(float $spacing): bool {} -#endif -#if MagickLibVersion > 0x655 - public function getTextInterlineSpacing(): float {} - public function setTextInterlineSpacing(float $spacing): bool {} -#endif - - public function __construct() {} - - public function setFillColor(ImagickPixel|string $fill_color): bool {} - - public function setFillAlpha(float $alpha): bool {} - - public function setResolution(float $resolution_x, float $resolution_y): bool {} - - public function setStrokeColor(ImagickPixel|string $color): bool {} - - public function setStrokeAlpha(float $alpha): bool {} - - public function setStrokeWidth(float $width): bool {} - - public function clear(): bool {} - - public function circle( - float $origin_x, - float $origin_y, - float $perimeter_x, - float $perimeter_y - ): bool {} - - public function annotation(float $x, float $y, string $text): bool {} - - public function setTextAntialias(bool $antialias): bool {} - - public function setTextEncoding(string $encoding): bool {} - - public function setFont(string $font_name): bool {} - - public function setFontFamily(string $font_family): bool {} - - public function setFontSize(float $point_size): bool {} - - // STYLE_* - public function setFontStyle(int $style): bool {} - - /** - * $weight font weight (valid range 100-900) - */ - public function setFontWeight(int $weight): bool {} - - public function getFont(): string {} - - public function getFontFamily(): string {} - - public function getFontSize(): float {} - - public function getFontStyle(): int {} - - public function getFontWeight(): int {} - - /** @alias ImagickDraw::clear */ - public function destroy(): bool {} - - public function rectangle(float $top_left_x, float $top_left_y, float $bottom_right_x, float $bottom_right_y): bool {} - - public function roundRectangle(float $top_left_x, float $top_left_y, float $bottom_right_x, float $bottom_right_y, float $rounding_x, float $rounding_y): bool {} - - - //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 - - public function ellipse(float $origin_x, float $origin_y, float $radius_x, float $radius_y, float $angle_start, float $angle_end): bool {} - - public function skewX(float $degrees): bool {} - - public function skewY(float $degrees): bool {} - - public function translate(float $x, float $y): bool {} - - public function line(float $start_x, float $start_y, float $end_x, float $end_y): bool {} - - -//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 - - public function arc( - float $start_x, - float $start_y, - float $end_x, - float $end_y, - float $start_angle, - float $end_angle - ): bool {} - -#if MagickLibVersion >= 0x700 - // PAINT_* - public function alpha(float $x, float $y, int $paint): bool {} -#else - /** @deprecated */ - // PAINT_* - public function matte(float $x, float $y, int $paint): bool {} -#endif - - public function polygon(array $coordinates): bool {} - - public function point(float $x, float $y): bool {} - - public function getTextDecoration(): int {} - - public function getTextEncoding(): string {} - - public function getFontStretch(): int {} - - // STRETCH_* font_stretch - public function setFontStretch(int $stretch): bool {} - - public function setStrokeAntialias(bool $enabled): bool {} - - // ALIGN_* - public function setTextAlignment(int $align): bool {} - - // DECORATION_* - public function setTextDecoration(int $decoration): bool {} - - public function setTextUnderColor(ImagickPixel|string $under_color): bool {} - - public function setViewbox(int $left_x, int $top_y, int $right_x, int $bottom_y): bool {} - - public function clone(): ImagickDraw {} - - public function affine(array $affine): bool {} - - public function bezier(array $coordinates): bool {} - - // COMPOSITE_* - public function composite( - int $composite, - float $x, - float $y, - float $width, - float $height, - Imagick $image - ): bool {} - - // PAINT_* - public function color(float $x, float $y, int $paint): bool {} - - public function comment(string $comment): bool {} - - public function getClipPath(): string {} - - public function getClipRule(): int {} - - public function getClipUnits(): int {} - - public function getFillColor(): ImagickPixel {} - - public function getFillOpacity(): float {} - - public function getFillRule(): int {} - - public function getGravity(): int {} - - public function getStrokeAntialias(): bool {} - - public function getStrokeColor(): ImagickPixel {} - - public function getStrokeDashArray(): array {} - - public function getStrokeDashOffset(): float {} - - public function getStrokeLineCap(): int {} - - public function getStrokeLineJoin(): int {} - - public function getStrokeMiterLimit(): int {} - - public function getStrokeOpacity(): float {} - - public function getStrokeWidth(): float {} - - public function getTextAlignment(): int {} - - public function getTextAntialias(): bool {} - - public function getVectorGraphics(): string {} - - public function getTextUnderColor(): ImagickPixel {} - - public function pathClose(): bool {} - - // We use the following scheme for naming: - // * control points are numbered e.g. x1 - // * end points are not numbered. e.g. x - // - // This makes the functions that have control points match those which - // don't have control points. - -//x1 -//x ordinate of control point for curve beginning -//y1 -//y ordinate of control point for curve beginning -//x2 -//x ordinate of control point for curve ending -//y2 -//y ordinate of control point for curve ending -//x -//x ordinate of the end of the curve -//y -//y ordinate of the end of the curve - public function pathCurveToAbsolute(float $x1, float $y1, float $x2, float $y2, float $x, float $y): bool {} - - public function pathCurveToRelative(float $x1, float $y1, float $x2, float $y2, float $x, float $y): bool {} - - public function pathCurveToQuadraticBezierAbsolute(float $x1, float $y1, float $x_end, float $y): bool {} - - public function pathCurveToQuadraticBezierRelative(float $x1, float $y1, float $x_end, float $y): bool {} - - // TODO - should these be $x_end, float $y_end to be consistent? - // Or should the $x_end be $x above. - public function pathCurveToQuadraticBezierSmoothAbsolute(float $x, float $y): bool {} - - // TODO - should these be $x_end, float $y_end to be consistent - public function pathCurveToQuadraticBezierSmoothRelative(float $x, float $y): bool {} - - public function pathCurveToSmoothAbsolute(float $x2, float $y2, float $x, float $y): bool {} - - public function pathCurveToSmoothRelative(float $x2, float $y2, float $x, float $y): bool {} - - // rx x radius - // ry y radius - // x_axis_rotation indicates how the ellipse as a whole is rotated relative to the current coordinate system - // large_arc If non-zero (true) then draw the larger of the available arcs - // sweep If non-zero (true) then draw the arc matching a clock-wise rotation - public function pathEllipticArcAbsolute( - float $rx, - float $ry, - float $x_axis_rotation, - bool $large_arc, - bool $sweep, - float $x, float $y - ): bool {} - - public function pathEllipticArcRelative( - float $rx, - float $ry, - float $x_axis_rotation, - bool $large_arc, - bool $sweep, - float $x, - float $y - ): bool {} - - public function pathFinish(): bool {} - - public function pathLineToAbsolute(float $x, float $y): bool {} - - public function pathLineToRelative(float $x, float $y): bool {} - - public function pathLineToHorizontalAbsolute(float $x): bool {} - - public function pathLineToHorizontalRelative(float $x): bool {} - - public function pathLineToVerticalAbsolute(float $y): bool {} - - public function pathLineToVerticalRelative(float $y): bool {} - - public function pathMoveToAbsolute(float $x, float $y): bool {} - - public function pathMoveToRelative(float $x, float $y): bool {} - - public function pathStart(): bool {} - - public function polyline(array $coordinates): bool {} - - public function popClipPath(): bool {} - - public function popDefs(): bool {} - - public function popPattern(): bool {} - - public function pushClipPath(string $clip_mask_id): bool {} - - public function pushDefs(): bool {} - - public function pushPattern( - string $pattern_id, - float $x, - float $y, - float $width, - float $height - ): bool {} - - public function render(): bool {} - - public function rotate(float $degrees): bool {} - - public function scale(float $x, float $y): bool {} - - public function setClipPath(string $clip_mask): bool {} - - // FILLRULE_* - public function setClipRule(int $fillrule): bool {} - - // PATHUNITS_* uh, this is unfortunate. The ImageMagick constant - // is call ClipPathUnits. The constant dropped the 'clip' and the - // method call dropped the 'path'. _Maybe_ add a setClipPathUnits - // method, and deprecate this one. Or just ignore the issue. - public function setClipUnits(int $pathunits): bool {} - - public function setFillOpacity(float $opacity): bool {} - - public function setFillPatternUrl(string $fill_url): bool {} - - // FILLRULE_* - public function setFillRule(int $fillrule): bool {} - - // GRAVITY_* - public function setGravity(int $gravity): bool {} - - public function setStrokePatternUrl(string $stroke_url): bool {} - - public function setStrokeDashOffset(float $dash_offset): bool {} - - // LINECAP_* - public function setStrokeLineCap(int $linecap): bool {} - - // LINEJOIN_* - public function setStrokeLineJoin(int $linejoin): bool {} - - // The miterLimit' imposes a limit on the ratio of the miter length to the 'lineWidth'. - public function setStrokeMiterLimit(int $miterlimit): bool {} - - // range 0-1 - public function setStrokeOpacity(float $opacity): bool {} - - public function setVectorGraphics(string $xml): bool {} - - public function pop(): bool {} - - public function push(): bool {} - - // A typical stroke dash array might contain the members 5 3 2. - public function setStrokeDashArray(array $dashes): bool {} - -#if MagickLibVersion >= 0x693 - public function getOpacity(): float {} - - // TODO - imply 0 to 1 range. - public function setOpacity(float $opacity): bool {} -#endif - -#if MagickLibVersion >= 0x675 - public function getFontResolution(): array {} - - public function setFontResolution(float $x, float $y): bool {} - - public function getBorderColor(): ImagickPixel {} - - public function setBorderColor(ImagickPixel|string $color): bool {} -#endif - -#if MagickLibVersion >= 0x693 - public function setDensity(string $density): bool {} - - public function getDensity(): ?string {} -#endif - -#if MagickLibVersion >= 0x692 - public function getTextDirection(): int {} - - // DIRECTION_* - public function setTextDirection(int $direction): bool {} -#endif -}
View file
imagick-3.7.0.tgz/imagick-3.7.0/ImagickDraw_arginfo.h
Deleted
@@ -1,1947 +0,0 @@ -/* This is a generated file, edit the .stub.php file instead. -* Stub hash: regen with 'sh regen_arginfo.sh' -* file has been fixedup for different versions */ - -#if MagickLibVersion > 0x628 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_resetVectorGraphics, 0, 0, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_resetVectorGraphics, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x649 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_getTextKerning, 0, 0, IS_DOUBLE, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_getTextKerning, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x649 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setTextKerning, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setTextKerning, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, kerning, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, kerning) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x649 -#define arginfo_class_ImagickDraw_getTextInterwordSpacing arginfo_class_ImagickDraw_getTextKerning -#endif - -#if MagickLibVersion > 0x649 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setTextInterwordSpacing, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setTextInterwordSpacing, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, spacing, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, spacing) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x655 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_getTextInterlineSpacing, 0, 0, IS_DOUBLE, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_getTextInterlineSpacing, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x655 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setTextInterlineSpacing, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setTextInterlineSpacing, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, spacing, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, spacing) -#endif -ZEND_END_ARG_INFO() -#endif - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw___construct, 0, 0, 0) -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setFillColor, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setFillColor, 0, 0, 1) -#endif - - ZEND_ARG_OBJ_TYPE_MASK(0, fill_color, ImagickPixel, MAY_BE_STRING, NULL) -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setFillAlpha, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setFillAlpha, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, alpha, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, alpha) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setResolution, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setResolution, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, resolution_x, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, resolution_x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, resolution_y, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, resolution_y) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setStrokeColor, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setStrokeColor, 0, 0, 1) -#endif - - ZEND_ARG_OBJ_TYPE_MASK(0, color, ImagickPixel, MAY_BE_STRING, NULL) -ZEND_END_ARG_INFO() - -#define arginfo_class_ImagickDraw_setStrokeAlpha arginfo_class_ImagickDraw_setFillAlpha - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setStrokeWidth, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setStrokeWidth, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, width, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, width) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_clear, 0, 0, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_clear, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_circle, 0, 4, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_circle, 0, 0, 4) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, origin_x, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, origin_x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, origin_y, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, origin_y) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, perimeter_x, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, perimeter_x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, perimeter_y, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, perimeter_y) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_annotation, 0, 3, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_annotation, 0, 0, 3) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, y) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, text, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, text) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setTextAntialias, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setTextAntialias, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, antialias, _IS_BOOL, 0) -#else - ZEND_ARG_INFO(0, antialias) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setTextEncoding, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setTextEncoding, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, encoding, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, encoding) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setFont, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setFont, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, font_name, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, font_name) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setFontFamily, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setFontFamily, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, font_family, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, font_family) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setFontSize, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setFontSize, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, point_size, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, point_size) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setFontStyle, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setFontStyle, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, style, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, style) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setFontWeight, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setFontWeight, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, weight, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, weight) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_getFont, 0, 0, IS_STRING, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_getFont, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() - -#define arginfo_class_ImagickDraw_getFontFamily arginfo_class_ImagickDraw_getFont - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_getFontSize, 0, 0, IS_DOUBLE, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_getFontSize, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_getFontStyle, 0, 0, IS_LONG, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_getFontStyle, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() - -#define arginfo_class_ImagickDraw_getFontWeight arginfo_class_ImagickDraw_getFontStyle - -#define arginfo_class_ImagickDraw_destroy arginfo_class_ImagickDraw_clear - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_rectangle, 0, 4, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_rectangle, 0, 0, 4) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, top_left_x, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, top_left_x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, top_left_y, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, top_left_y) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, bottom_right_x, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, bottom_right_x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, bottom_right_y, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, bottom_right_y) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_roundRectangle, 0, 6, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_roundRectangle, 0, 0, 6) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, top_left_x, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, top_left_x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, top_left_y, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, top_left_y) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, bottom_right_x, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, bottom_right_x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, bottom_right_y, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, bottom_right_y) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, rounding_x, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, rounding_x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, rounding_y, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, rounding_y) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_ellipse, 0, 6, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_ellipse, 0, 0, 6) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, origin_x, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, origin_x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, origin_y, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, origin_y) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, radius_x, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, radius_x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, radius_y, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, radius_y) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, angle_start, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, angle_start) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, angle_end, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, angle_end) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_skewX, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_skewX, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, degrees, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, degrees) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_ImagickDraw_skewY arginfo_class_ImagickDraw_skewX - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_translate, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_translate, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, y) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_line, 0, 4, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_line, 0, 0, 4) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, start_x, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, start_x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, start_y, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, start_y) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, end_x, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, end_x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, end_y, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, end_y) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_arc, 0, 6, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_arc, 0, 0, 6) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, start_x, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, start_x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, start_y, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, start_y) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, end_x, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, end_x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, end_y, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, end_y) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, start_angle, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, start_angle) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, end_angle, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, end_angle) -#endif -ZEND_END_ARG_INFO() - -#if MagickLibVersion >= 0x700 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_alpha, 0, 3, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_alpha, 0, 0, 3) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, y) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, paint, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, paint) -#endif -ZEND_END_ARG_INFO() -#endif - -#if !(MagickLibVersion >= 0x700) - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_matte, 0, 3, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_matte, 0, 0, 3) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, y) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, paint, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, paint) -#endif -ZEND_END_ARG_INFO() -#endif - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_polygon, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_polygon, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, coordinates, IS_ARRAY, 0) -#else - ZEND_ARG_INFO(0, coordinates) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_ImagickDraw_point arginfo_class_ImagickDraw_translate - -#define arginfo_class_ImagickDraw_getTextDecoration arginfo_class_ImagickDraw_getFontStyle - -#define arginfo_class_ImagickDraw_getTextEncoding arginfo_class_ImagickDraw_getFont - -#define arginfo_class_ImagickDraw_getFontStretch arginfo_class_ImagickDraw_getFontStyle - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setFontStretch, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setFontStretch, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, stretch, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, stretch) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setStrokeAntialias, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setStrokeAntialias, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, enabled, _IS_BOOL, 0) -#else - ZEND_ARG_INFO(0, enabled) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setTextAlignment, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setTextAlignment, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, align, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, align) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setTextDecoration, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setTextDecoration, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, decoration, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, decoration) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setTextUnderColor, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setTextUnderColor, 0, 0, 1) -#endif - - ZEND_ARG_OBJ_TYPE_MASK(0, under_color, ImagickPixel, MAY_BE_STRING, NULL) -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setViewbox, 0, 4, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setViewbox, 0, 0, 4) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, left_x, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, left_x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, top_y, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, top_y) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, right_x, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, right_x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, bottom_y, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, bottom_y) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_ImagickDraw_clone, 0, 0, ImagickDraw, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_clone, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_affine, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_affine, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, affine, IS_ARRAY, 0) -#else - ZEND_ARG_INFO(0, affine) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_ImagickDraw_bezier arginfo_class_ImagickDraw_polygon - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_composite, 0, 6, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_composite, 0, 0, 6) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, composite, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, composite) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, y) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, width, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, width) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, height, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, height) -#endif - ZEND_ARG_OBJ_INFO(0, image, Imagick, 0) -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_color, 0, 3, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_color, 0, 0, 3) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, y) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, paint, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, paint) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_comment, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_comment, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, comment, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, comment) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_ImagickDraw_getClipPath arginfo_class_ImagickDraw_getFont - -#define arginfo_class_ImagickDraw_getClipRule arginfo_class_ImagickDraw_getFontStyle - -#define arginfo_class_ImagickDraw_getClipUnits arginfo_class_ImagickDraw_getFontStyle - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_ImagickDraw_getFillColor, 0, 0, ImagickPixel, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_getFillColor, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() - -#define arginfo_class_ImagickDraw_getFillOpacity arginfo_class_ImagickDraw_getFontSize - -#define arginfo_class_ImagickDraw_getFillRule arginfo_class_ImagickDraw_getFontStyle - -#define arginfo_class_ImagickDraw_getGravity arginfo_class_ImagickDraw_getFontStyle - -#define arginfo_class_ImagickDraw_getStrokeAntialias arginfo_class_ImagickDraw_clear - -#define arginfo_class_ImagickDraw_getStrokeColor arginfo_class_ImagickDraw_getFillColor - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_getStrokeDashArray, 0, 0, IS_ARRAY, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_getStrokeDashArray, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() - -#define arginfo_class_ImagickDraw_getStrokeDashOffset arginfo_class_ImagickDraw_getFontSize - -#define arginfo_class_ImagickDraw_getStrokeLineCap arginfo_class_ImagickDraw_getFontStyle - -#define arginfo_class_ImagickDraw_getStrokeLineJoin arginfo_class_ImagickDraw_getFontStyle - -#define arginfo_class_ImagickDraw_getStrokeMiterLimit arginfo_class_ImagickDraw_getFontStyle - -#define arginfo_class_ImagickDraw_getStrokeOpacity arginfo_class_ImagickDraw_getFontSize - -#define arginfo_class_ImagickDraw_getStrokeWidth arginfo_class_ImagickDraw_getFontSize - -#define arginfo_class_ImagickDraw_getTextAlignment arginfo_class_ImagickDraw_getFontStyle - -#define arginfo_class_ImagickDraw_getTextAntialias arginfo_class_ImagickDraw_clear - -#define arginfo_class_ImagickDraw_getVectorGraphics arginfo_class_ImagickDraw_getFont - -#define arginfo_class_ImagickDraw_getTextUnderColor arginfo_class_ImagickDraw_getFillColor - -#define arginfo_class_ImagickDraw_pathClose arginfo_class_ImagickDraw_clear - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_pathCurveToAbsolute, 0, 6, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_pathCurveToAbsolute, 0, 0, 6) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x1, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, x1) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y1, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, y1) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x2, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, x2) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y2, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, y2) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, y) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_ImagickDraw_pathCurveToRelative arginfo_class_ImagickDraw_pathCurveToAbsolute - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_pathCurveToQuadraticBezierAbsolute, 0, 4, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_pathCurveToQuadraticBezierAbsolute, 0, 0, 4) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x1, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, x1) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y1, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, y1) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x_end, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, x_end) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, y) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_ImagickDraw_pathCurveToQuadraticBezierRelative arginfo_class_ImagickDraw_pathCurveToQuadraticBezierAbsolute - -#define arginfo_class_ImagickDraw_pathCurveToQuadraticBezierSmoothAbsolute arginfo_class_ImagickDraw_translate - -#define arginfo_class_ImagickDraw_pathCurveToQuadraticBezierSmoothRelative arginfo_class_ImagickDraw_translate - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_pathCurveToSmoothAbsolute, 0, 4, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_pathCurveToSmoothAbsolute, 0, 0, 4) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x2, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, x2) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y2, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, y2) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, y) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_ImagickDraw_pathCurveToSmoothRelative arginfo_class_ImagickDraw_pathCurveToSmoothAbsolute - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_pathEllipticArcAbsolute, 0, 7, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_pathEllipticArcAbsolute, 0, 0, 7) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, rx, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, rx) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, ry, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, ry) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x_axis_rotation, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, x_axis_rotation) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, large_arc, _IS_BOOL, 0) -#else - ZEND_ARG_INFO(0, large_arc) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, sweep, _IS_BOOL, 0) -#else - ZEND_ARG_INFO(0, sweep) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, y) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_ImagickDraw_pathEllipticArcRelative arginfo_class_ImagickDraw_pathEllipticArcAbsolute - -#define arginfo_class_ImagickDraw_pathFinish arginfo_class_ImagickDraw_clear - -#define arginfo_class_ImagickDraw_pathLineToAbsolute arginfo_class_ImagickDraw_translate - -#define arginfo_class_ImagickDraw_pathLineToRelative arginfo_class_ImagickDraw_translate - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_pathLineToHorizontalAbsolute, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_pathLineToHorizontalAbsolute, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, x) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_ImagickDraw_pathLineToHorizontalRelative arginfo_class_ImagickDraw_pathLineToHorizontalAbsolute - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_pathLineToVerticalAbsolute, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_pathLineToVerticalAbsolute, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, y) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_ImagickDraw_pathLineToVerticalRelative arginfo_class_ImagickDraw_pathLineToVerticalAbsolute - -#define arginfo_class_ImagickDraw_pathMoveToAbsolute arginfo_class_ImagickDraw_translate - -#define arginfo_class_ImagickDraw_pathMoveToRelative arginfo_class_ImagickDraw_translate - -#define arginfo_class_ImagickDraw_pathStart arginfo_class_ImagickDraw_clear - -#define arginfo_class_ImagickDraw_polyline arginfo_class_ImagickDraw_polygon - -#define arginfo_class_ImagickDraw_popClipPath arginfo_class_ImagickDraw_clear - -#define arginfo_class_ImagickDraw_popDefs arginfo_class_ImagickDraw_clear - -#define arginfo_class_ImagickDraw_popPattern arginfo_class_ImagickDraw_clear - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_pushClipPath, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_pushClipPath, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, clip_mask_id, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, clip_mask_id) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_ImagickDraw_pushDefs arginfo_class_ImagickDraw_clear - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_pushPattern, 0, 5, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_pushPattern, 0, 0, 5) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, pattern_id, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, pattern_id) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, y) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, width, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, width) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, height, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, height) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_ImagickDraw_render arginfo_class_ImagickDraw_clear - -#define arginfo_class_ImagickDraw_rotate arginfo_class_ImagickDraw_skewX - -#define arginfo_class_ImagickDraw_scale arginfo_class_ImagickDraw_translate - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setClipPath, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setClipPath, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, clip_mask, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, clip_mask) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setClipRule, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setClipRule, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, fillrule, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, fillrule) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setClipUnits, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setClipUnits, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, pathunits, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, pathunits) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setFillOpacity, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setFillOpacity, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, opacity, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, opacity) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setFillPatternUrl, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setFillPatternUrl, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, fill_url, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, fill_url) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_ImagickDraw_setFillRule arginfo_class_ImagickDraw_setClipRule - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setGravity, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setGravity, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, gravity, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, gravity) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setStrokePatternUrl, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setStrokePatternUrl, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, stroke_url, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, stroke_url) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setStrokeDashOffset, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setStrokeDashOffset, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, dash_offset, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, dash_offset) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setStrokeLineCap, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setStrokeLineCap, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, linecap, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, linecap) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setStrokeLineJoin, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setStrokeLineJoin, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, linejoin, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, linejoin) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setStrokeMiterLimit, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setStrokeMiterLimit, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, miterlimit, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, miterlimit) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_ImagickDraw_setStrokeOpacity arginfo_class_ImagickDraw_setFillOpacity - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setVectorGraphics, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setVectorGraphics, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, xml, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, xml) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_ImagickDraw_pop arginfo_class_ImagickDraw_clear - -#define arginfo_class_ImagickDraw_push arginfo_class_ImagickDraw_clear - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setStrokeDashArray, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setStrokeDashArray, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, dashes, IS_ARRAY, 0) -#else - ZEND_ARG_INFO(0, dashes) -#endif -ZEND_END_ARG_INFO() - -#if MagickLibVersion >= 0x693 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_getOpacity, 0, 0, IS_DOUBLE, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_getOpacity, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion >= 0x693 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setOpacity, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setOpacity, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, opacity, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, opacity) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion >= 0x675 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_getFontResolution, 0, 0, IS_ARRAY, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_getFontResolution, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion >= 0x675 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setFontResolution, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setFontResolution, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, y) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion >= 0x675 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_ImagickDraw_getBorderColor, 0, 0, ImagickPixel, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_getBorderColor, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion >= 0x675 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setBorderColor, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setBorderColor, 0, 0, 1) -#endif - - ZEND_ARG_OBJ_TYPE_MASK(0, color, ImagickPixel, MAY_BE_STRING, NULL) -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion >= 0x693 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setDensity, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setDensity, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, density, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, density) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion >= 0x693 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_getDensity, 0, 0, IS_STRING, 1) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_getDensity, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion >= 0x692 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_getTextDirection, 0, 0, IS_LONG, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_getTextDirection, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion >= 0x692 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setTextDirection, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setTextDirection, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, direction, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, direction) -#endif -ZEND_END_ARG_INFO() -#endif - - -#if MagickLibVersion > 0x628 -ZEND_METHOD(ImagickDraw, resetVectorGraphics); -#endif -#if MagickLibVersion > 0x649 -ZEND_METHOD(ImagickDraw, getTextKerning); -#endif -#if MagickLibVersion > 0x649 -ZEND_METHOD(ImagickDraw, setTextKerning); -#endif -#if MagickLibVersion > 0x649 -ZEND_METHOD(ImagickDraw, getTextInterwordSpacing); -#endif -#if MagickLibVersion > 0x649 -ZEND_METHOD(ImagickDraw, setTextInterwordSpacing); -#endif -#if MagickLibVersion > 0x655 -ZEND_METHOD(ImagickDraw, getTextInterlineSpacing); -#endif -#if MagickLibVersion > 0x655 -ZEND_METHOD(ImagickDraw, setTextInterlineSpacing); -#endif -ZEND_METHOD(ImagickDraw, __construct); -ZEND_METHOD(ImagickDraw, setFillColor); -ZEND_METHOD(ImagickDraw, setFillAlpha); -ZEND_METHOD(ImagickDraw, setResolution); -ZEND_METHOD(ImagickDraw, setStrokeColor); -ZEND_METHOD(ImagickDraw, setStrokeAlpha); -ZEND_METHOD(ImagickDraw, setStrokeWidth); -ZEND_METHOD(ImagickDraw, clear); -ZEND_METHOD(ImagickDraw, circle); -ZEND_METHOD(ImagickDraw, annotation); -ZEND_METHOD(ImagickDraw, setTextAntialias); -ZEND_METHOD(ImagickDraw, setTextEncoding); -ZEND_METHOD(ImagickDraw, setFont); -ZEND_METHOD(ImagickDraw, setFontFamily); -ZEND_METHOD(ImagickDraw, setFontSize); -ZEND_METHOD(ImagickDraw, setFontStyle); -ZEND_METHOD(ImagickDraw, setFontWeight); -ZEND_METHOD(ImagickDraw, getFont); -ZEND_METHOD(ImagickDraw, getFontFamily); -ZEND_METHOD(ImagickDraw, getFontSize); -ZEND_METHOD(ImagickDraw, getFontStyle); -ZEND_METHOD(ImagickDraw, getFontWeight); -ZEND_METHOD(ImagickDraw, rectangle); -ZEND_METHOD(ImagickDraw, roundRectangle); -ZEND_METHOD(ImagickDraw, ellipse); -ZEND_METHOD(ImagickDraw, skewX); -ZEND_METHOD(ImagickDraw, skewY); -ZEND_METHOD(ImagickDraw, translate); -ZEND_METHOD(ImagickDraw, line); -ZEND_METHOD(ImagickDraw, arc); -#if MagickLibVersion >= 0x700 -ZEND_METHOD(ImagickDraw, alpha); -#endif -#if !(MagickLibVersion >= 0x700) -ZEND_METHOD(ImagickDraw, matte); -#endif -ZEND_METHOD(ImagickDraw, polygon); -ZEND_METHOD(ImagickDraw, point); -ZEND_METHOD(ImagickDraw, getTextDecoration); -ZEND_METHOD(ImagickDraw, getTextEncoding); -ZEND_METHOD(ImagickDraw, getFontStretch); -ZEND_METHOD(ImagickDraw, setFontStretch); -ZEND_METHOD(ImagickDraw, setStrokeAntialias); -ZEND_METHOD(ImagickDraw, setTextAlignment); -ZEND_METHOD(ImagickDraw, setTextDecoration); -ZEND_METHOD(ImagickDraw, setTextUnderColor); -ZEND_METHOD(ImagickDraw, setViewbox); -ZEND_METHOD(ImagickDraw, clone); -ZEND_METHOD(ImagickDraw, affine); -ZEND_METHOD(ImagickDraw, bezier); -ZEND_METHOD(ImagickDraw, composite); -ZEND_METHOD(ImagickDraw, color); -ZEND_METHOD(ImagickDraw, comment); -ZEND_METHOD(ImagickDraw, getClipPath); -ZEND_METHOD(ImagickDraw, getClipRule); -ZEND_METHOD(ImagickDraw, getClipUnits); -ZEND_METHOD(ImagickDraw, getFillColor); -ZEND_METHOD(ImagickDraw, getFillOpacity); -ZEND_METHOD(ImagickDraw, getFillRule); -ZEND_METHOD(ImagickDraw, getGravity); -ZEND_METHOD(ImagickDraw, getStrokeAntialias); -ZEND_METHOD(ImagickDraw, getStrokeColor); -ZEND_METHOD(ImagickDraw, getStrokeDashArray); -ZEND_METHOD(ImagickDraw, getStrokeDashOffset); -ZEND_METHOD(ImagickDraw, getStrokeLineCap); -ZEND_METHOD(ImagickDraw, getStrokeLineJoin); -ZEND_METHOD(ImagickDraw, getStrokeMiterLimit); -ZEND_METHOD(ImagickDraw, getStrokeOpacity); -ZEND_METHOD(ImagickDraw, getStrokeWidth); -ZEND_METHOD(ImagickDraw, getTextAlignment); -ZEND_METHOD(ImagickDraw, getTextAntialias); -ZEND_METHOD(ImagickDraw, getVectorGraphics); -ZEND_METHOD(ImagickDraw, getTextUnderColor); -ZEND_METHOD(ImagickDraw, pathClose); -ZEND_METHOD(ImagickDraw, pathCurveToAbsolute); -ZEND_METHOD(ImagickDraw, pathCurveToRelative); -ZEND_METHOD(ImagickDraw, pathCurveToQuadraticBezierAbsolute); -ZEND_METHOD(ImagickDraw, pathCurveToQuadraticBezierRelative); -ZEND_METHOD(ImagickDraw, pathCurveToQuadraticBezierSmoothAbsolute); -ZEND_METHOD(ImagickDraw, pathCurveToQuadraticBezierSmoothRelative); -ZEND_METHOD(ImagickDraw, pathCurveToSmoothAbsolute); -ZEND_METHOD(ImagickDraw, pathCurveToSmoothRelative); -ZEND_METHOD(ImagickDraw, pathEllipticArcAbsolute); -ZEND_METHOD(ImagickDraw, pathEllipticArcRelative); -ZEND_METHOD(ImagickDraw, pathFinish); -ZEND_METHOD(ImagickDraw, pathLineToAbsolute); -ZEND_METHOD(ImagickDraw, pathLineToRelative); -ZEND_METHOD(ImagickDraw, pathLineToHorizontalAbsolute); -ZEND_METHOD(ImagickDraw, pathLineToHorizontalRelative); -ZEND_METHOD(ImagickDraw, pathLineToVerticalAbsolute); -ZEND_METHOD(ImagickDraw, pathLineToVerticalRelative); -ZEND_METHOD(ImagickDraw, pathMoveToAbsolute); -ZEND_METHOD(ImagickDraw, pathMoveToRelative); -ZEND_METHOD(ImagickDraw, pathStart); -ZEND_METHOD(ImagickDraw, polyline); -ZEND_METHOD(ImagickDraw, popClipPath); -ZEND_METHOD(ImagickDraw, popDefs); -ZEND_METHOD(ImagickDraw, popPattern); -ZEND_METHOD(ImagickDraw, pushClipPath); -ZEND_METHOD(ImagickDraw, pushDefs); -ZEND_METHOD(ImagickDraw, pushPattern); -ZEND_METHOD(ImagickDraw, render); -ZEND_METHOD(ImagickDraw, rotate); -ZEND_METHOD(ImagickDraw, scale); -ZEND_METHOD(ImagickDraw, setClipPath); -ZEND_METHOD(ImagickDraw, setClipRule); -ZEND_METHOD(ImagickDraw, setClipUnits); -ZEND_METHOD(ImagickDraw, setFillOpacity); -ZEND_METHOD(ImagickDraw, setFillPatternUrl); -ZEND_METHOD(ImagickDraw, setFillRule); -ZEND_METHOD(ImagickDraw, setGravity); -ZEND_METHOD(ImagickDraw, setStrokePatternUrl); -ZEND_METHOD(ImagickDraw, setStrokeDashOffset); -ZEND_METHOD(ImagickDraw, setStrokeLineCap); -ZEND_METHOD(ImagickDraw, setStrokeLineJoin); -ZEND_METHOD(ImagickDraw, setStrokeMiterLimit); -ZEND_METHOD(ImagickDraw, setStrokeOpacity); -ZEND_METHOD(ImagickDraw, setVectorGraphics); -ZEND_METHOD(ImagickDraw, pop); -ZEND_METHOD(ImagickDraw, push); -ZEND_METHOD(ImagickDraw, setStrokeDashArray); -#if MagickLibVersion >= 0x693 -ZEND_METHOD(ImagickDraw, getOpacity); -#endif -#if MagickLibVersion >= 0x693 -ZEND_METHOD(ImagickDraw, setOpacity); -#endif -#if MagickLibVersion >= 0x675 -ZEND_METHOD(ImagickDraw, getFontResolution); -#endif -#if MagickLibVersion >= 0x675 -ZEND_METHOD(ImagickDraw, setFontResolution); -#endif -#if MagickLibVersion >= 0x675 -ZEND_METHOD(ImagickDraw, getBorderColor); -#endif -#if MagickLibVersion >= 0x675 -ZEND_METHOD(ImagickDraw, setBorderColor); -#endif -#if MagickLibVersion >= 0x693 -ZEND_METHOD(ImagickDraw, setDensity); -#endif -#if MagickLibVersion >= 0x693 -ZEND_METHOD(ImagickDraw, getDensity); -#endif -#if MagickLibVersion >= 0x692 -ZEND_METHOD(ImagickDraw, getTextDirection); -#endif -#if MagickLibVersion >= 0x692 -ZEND_METHOD(ImagickDraw, setTextDirection); -#endif - - -static const zend_function_entry class_ImagickDraw_methods = { -#if MagickLibVersion > 0x628 - ZEND_ME(ImagickDraw, resetVectorGraphics, arginfo_class_ImagickDraw_resetVectorGraphics, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x649 - ZEND_ME(ImagickDraw, getTextKerning, arginfo_class_ImagickDraw_getTextKerning, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x649 - ZEND_ME(ImagickDraw, setTextKerning, arginfo_class_ImagickDraw_setTextKerning, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x649 - ZEND_ME(ImagickDraw, getTextInterwordSpacing, arginfo_class_ImagickDraw_getTextInterwordSpacing, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x649 - ZEND_ME(ImagickDraw, setTextInterwordSpacing, arginfo_class_ImagickDraw_setTextInterwordSpacing, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x655 - ZEND_ME(ImagickDraw, getTextInterlineSpacing, arginfo_class_ImagickDraw_getTextInterlineSpacing, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x655 - ZEND_ME(ImagickDraw, setTextInterlineSpacing, arginfo_class_ImagickDraw_setTextInterlineSpacing, ZEND_ACC_PUBLIC) -#endif - ZEND_ME(ImagickDraw, __construct, arginfo_class_ImagickDraw___construct, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, setFillColor, arginfo_class_ImagickDraw_setFillColor, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, setFillAlpha, arginfo_class_ImagickDraw_setFillAlpha, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, setResolution, arginfo_class_ImagickDraw_setResolution, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, setStrokeColor, arginfo_class_ImagickDraw_setStrokeColor, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, setStrokeAlpha, arginfo_class_ImagickDraw_setStrokeAlpha, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, setStrokeWidth, arginfo_class_ImagickDraw_setStrokeWidth, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, clear, arginfo_class_ImagickDraw_clear, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, circle, arginfo_class_ImagickDraw_circle, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, annotation, arginfo_class_ImagickDraw_annotation, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, setTextAntialias, arginfo_class_ImagickDraw_setTextAntialias, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, setTextEncoding, arginfo_class_ImagickDraw_setTextEncoding, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, setFont, arginfo_class_ImagickDraw_setFont, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, setFontFamily, arginfo_class_ImagickDraw_setFontFamily, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, setFontSize, arginfo_class_ImagickDraw_setFontSize, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, setFontStyle, arginfo_class_ImagickDraw_setFontStyle, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, setFontWeight, arginfo_class_ImagickDraw_setFontWeight, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, getFont, arginfo_class_ImagickDraw_getFont, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, getFontFamily, arginfo_class_ImagickDraw_getFontFamily, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, getFontSize, arginfo_class_ImagickDraw_getFontSize, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, getFontStyle, arginfo_class_ImagickDraw_getFontStyle, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, getFontWeight, arginfo_class_ImagickDraw_getFontWeight, ZEND_ACC_PUBLIC) - ZEND_MALIAS(ImagickDraw, destroy, clear, arginfo_class_ImagickDraw_destroy, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, rectangle, arginfo_class_ImagickDraw_rectangle, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, roundRectangle, arginfo_class_ImagickDraw_roundRectangle, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, ellipse, arginfo_class_ImagickDraw_ellipse, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, skewX, arginfo_class_ImagickDraw_skewX, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, skewY, arginfo_class_ImagickDraw_skewY, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, translate, arginfo_class_ImagickDraw_translate, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, line, arginfo_class_ImagickDraw_line, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, arc, arginfo_class_ImagickDraw_arc, ZEND_ACC_PUBLIC) -#if MagickLibVersion >= 0x700 - ZEND_ME(ImagickDraw, alpha, arginfo_class_ImagickDraw_alpha, ZEND_ACC_PUBLIC) -#endif -#if !(MagickLibVersion >= 0x700) - ZEND_ME(ImagickDraw, matte, arginfo_class_ImagickDraw_matte, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) -#endif - ZEND_ME(ImagickDraw, polygon, arginfo_class_ImagickDraw_polygon, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, point, arginfo_class_ImagickDraw_point, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, getTextDecoration, arginfo_class_ImagickDraw_getTextDecoration, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, getTextEncoding, arginfo_class_ImagickDraw_getTextEncoding, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, getFontStretch, arginfo_class_ImagickDraw_getFontStretch, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, setFontStretch, arginfo_class_ImagickDraw_setFontStretch, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, setStrokeAntialias, arginfo_class_ImagickDraw_setStrokeAntialias, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, setTextAlignment, arginfo_class_ImagickDraw_setTextAlignment, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, setTextDecoration, arginfo_class_ImagickDraw_setTextDecoration, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, setTextUnderColor, arginfo_class_ImagickDraw_setTextUnderColor, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, setViewbox, arginfo_class_ImagickDraw_setViewbox, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, clone, arginfo_class_ImagickDraw_clone, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, affine, arginfo_class_ImagickDraw_affine, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, bezier, arginfo_class_ImagickDraw_bezier, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, composite, arginfo_class_ImagickDraw_composite, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, color, arginfo_class_ImagickDraw_color, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, comment, arginfo_class_ImagickDraw_comment, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, getClipPath, arginfo_class_ImagickDraw_getClipPath, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, getClipRule, arginfo_class_ImagickDraw_getClipRule, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, getClipUnits, arginfo_class_ImagickDraw_getClipUnits, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, getFillColor, arginfo_class_ImagickDraw_getFillColor, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, getFillOpacity, arginfo_class_ImagickDraw_getFillOpacity, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, getFillRule, arginfo_class_ImagickDraw_getFillRule, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, getGravity, arginfo_class_ImagickDraw_getGravity, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, getStrokeAntialias, arginfo_class_ImagickDraw_getStrokeAntialias, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, getStrokeColor, arginfo_class_ImagickDraw_getStrokeColor, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, getStrokeDashArray, arginfo_class_ImagickDraw_getStrokeDashArray, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, getStrokeDashOffset, arginfo_class_ImagickDraw_getStrokeDashOffset, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, getStrokeLineCap, arginfo_class_ImagickDraw_getStrokeLineCap, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, getStrokeLineJoin, arginfo_class_ImagickDraw_getStrokeLineJoin, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, getStrokeMiterLimit, arginfo_class_ImagickDraw_getStrokeMiterLimit, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, getStrokeOpacity, arginfo_class_ImagickDraw_getStrokeOpacity, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, getStrokeWidth, arginfo_class_ImagickDraw_getStrokeWidth, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, getTextAlignment, arginfo_class_ImagickDraw_getTextAlignment, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, getTextAntialias, arginfo_class_ImagickDraw_getTextAntialias, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, getVectorGraphics, arginfo_class_ImagickDraw_getVectorGraphics, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, getTextUnderColor, arginfo_class_ImagickDraw_getTextUnderColor, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, pathClose, arginfo_class_ImagickDraw_pathClose, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, pathCurveToAbsolute, arginfo_class_ImagickDraw_pathCurveToAbsolute, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, pathCurveToRelative, arginfo_class_ImagickDraw_pathCurveToRelative, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, pathCurveToQuadraticBezierAbsolute, arginfo_class_ImagickDraw_pathCurveToQuadraticBezierAbsolute, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, pathCurveToQuadraticBezierRelative, arginfo_class_ImagickDraw_pathCurveToQuadraticBezierRelative, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, pathCurveToQuadraticBezierSmoothAbsolute, arginfo_class_ImagickDraw_pathCurveToQuadraticBezierSmoothAbsolute, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, pathCurveToQuadraticBezierSmoothRelative, arginfo_class_ImagickDraw_pathCurveToQuadraticBezierSmoothRelative, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, pathCurveToSmoothAbsolute, arginfo_class_ImagickDraw_pathCurveToSmoothAbsolute, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, pathCurveToSmoothRelative, arginfo_class_ImagickDraw_pathCurveToSmoothRelative, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, pathEllipticArcAbsolute, arginfo_class_ImagickDraw_pathEllipticArcAbsolute, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, pathEllipticArcRelative, arginfo_class_ImagickDraw_pathEllipticArcRelative, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, pathFinish, arginfo_class_ImagickDraw_pathFinish, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, pathLineToAbsolute, arginfo_class_ImagickDraw_pathLineToAbsolute, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, pathLineToRelative, arginfo_class_ImagickDraw_pathLineToRelative, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, pathLineToHorizontalAbsolute, arginfo_class_ImagickDraw_pathLineToHorizontalAbsolute, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, pathLineToHorizontalRelative, arginfo_class_ImagickDraw_pathLineToHorizontalRelative, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, pathLineToVerticalAbsolute, arginfo_class_ImagickDraw_pathLineToVerticalAbsolute, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, pathLineToVerticalRelative, arginfo_class_ImagickDraw_pathLineToVerticalRelative, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, pathMoveToAbsolute, arginfo_class_ImagickDraw_pathMoveToAbsolute, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, pathMoveToRelative, arginfo_class_ImagickDraw_pathMoveToRelative, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, pathStart, arginfo_class_ImagickDraw_pathStart, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, polyline, arginfo_class_ImagickDraw_polyline, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, popClipPath, arginfo_class_ImagickDraw_popClipPath, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, popDefs, arginfo_class_ImagickDraw_popDefs, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, popPattern, arginfo_class_ImagickDraw_popPattern, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, pushClipPath, arginfo_class_ImagickDraw_pushClipPath, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, pushDefs, arginfo_class_ImagickDraw_pushDefs, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, pushPattern, arginfo_class_ImagickDraw_pushPattern, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, render, arginfo_class_ImagickDraw_render, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, rotate, arginfo_class_ImagickDraw_rotate, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, scale, arginfo_class_ImagickDraw_scale, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, setClipPath, arginfo_class_ImagickDraw_setClipPath, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, setClipRule, arginfo_class_ImagickDraw_setClipRule, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, setClipUnits, arginfo_class_ImagickDraw_setClipUnits, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, setFillOpacity, arginfo_class_ImagickDraw_setFillOpacity, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, setFillPatternUrl, arginfo_class_ImagickDraw_setFillPatternUrl, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, setFillRule, arginfo_class_ImagickDraw_setFillRule, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, setGravity, arginfo_class_ImagickDraw_setGravity, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, setStrokePatternUrl, arginfo_class_ImagickDraw_setStrokePatternUrl, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, setStrokeDashOffset, arginfo_class_ImagickDraw_setStrokeDashOffset, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, setStrokeLineCap, arginfo_class_ImagickDraw_setStrokeLineCap, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, setStrokeLineJoin, arginfo_class_ImagickDraw_setStrokeLineJoin, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, setStrokeMiterLimit, arginfo_class_ImagickDraw_setStrokeMiterLimit, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, setStrokeOpacity, arginfo_class_ImagickDraw_setStrokeOpacity, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, setVectorGraphics, arginfo_class_ImagickDraw_setVectorGraphics, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, pop, arginfo_class_ImagickDraw_pop, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, push, arginfo_class_ImagickDraw_push, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickDraw, setStrokeDashArray, arginfo_class_ImagickDraw_setStrokeDashArray, ZEND_ACC_PUBLIC) -#if MagickLibVersion >= 0x693 - ZEND_ME(ImagickDraw, getOpacity, arginfo_class_ImagickDraw_getOpacity, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion >= 0x693 - ZEND_ME(ImagickDraw, setOpacity, arginfo_class_ImagickDraw_setOpacity, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion >= 0x675 - ZEND_ME(ImagickDraw, getFontResolution, arginfo_class_ImagickDraw_getFontResolution, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion >= 0x675 - ZEND_ME(ImagickDraw, setFontResolution, arginfo_class_ImagickDraw_setFontResolution, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion >= 0x675 - ZEND_ME(ImagickDraw, getBorderColor, arginfo_class_ImagickDraw_getBorderColor, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion >= 0x675 - ZEND_ME(ImagickDraw, setBorderColor, arginfo_class_ImagickDraw_setBorderColor, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion >= 0x693 - ZEND_ME(ImagickDraw, setDensity, arginfo_class_ImagickDraw_setDensity, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion >= 0x693 - ZEND_ME(ImagickDraw, getDensity, arginfo_class_ImagickDraw_getDensity, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion >= 0x692 - ZEND_ME(ImagickDraw, getTextDirection, arginfo_class_ImagickDraw_getTextDirection, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion >= 0x692 - ZEND_ME(ImagickDraw, setTextDirection, arginfo_class_ImagickDraw_setTextDirection, ZEND_ACC_PUBLIC) -#endif - ZEND_FE_END -}; \ No newline at end of file
View file
imagick-3.7.0.tgz/imagick-3.7.0/ImagickKernel.stub.php
Deleted
@@ -1,25 +0,0 @@ -<?php - -/** @generate-function-entries */ - -#ifdef IMAGICK_WITH_KERNEL -class ImagickKernel -{ - public function addKernel(ImagickKernel $kernel): void {} - - public function addUnityKernel(float $scale): void {} - - // KERNEL_* - public static function fromBuiltin(int $kernel, string $shape): ImagickKernel {} - - public static function fromMatrix(array $matrix, ?array $origin): ImagickKernel {} - - public function getMatrix(): array {} - - // NORMALIZE_KERNEL_ - public function scale(float $scale, ?int $normalize_kernel = null): void {} - - public function separate(): array {} -} -#endif -
View file
imagick-3.7.0.tgz/imagick-3.7.0/ImagickKernel_arginfo.h
Deleted
@@ -1,166 +0,0 @@ -/* This is a generated file, edit the .stub.php file instead. -* Stub hash: regen with 'sh regen_arginfo.sh' -* file has been fixedup for different versions */ - -#if defined(IMAGICK_WITH_KERNEL) - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickKernel_addKernel, 0, 1, IS_VOID, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickKernel_addKernel, 0, 0, 1) -#endif - - ZEND_ARG_OBJ_INFO(0, kernel, ImagickKernel, 0) -ZEND_END_ARG_INFO() -#endif - -#if defined(IMAGICK_WITH_KERNEL) - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickKernel_addUnityKernel, 0, 1, IS_VOID, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickKernel_addUnityKernel, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, scale, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, scale) -#endif -ZEND_END_ARG_INFO() -#endif - -#if defined(IMAGICK_WITH_KERNEL) - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_ImagickKernel_fromBuiltin, 0, 2, ImagickKernel, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickKernel_fromBuiltin, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, kernel, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, kernel) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, shape, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, shape) -#endif -ZEND_END_ARG_INFO() -#endif - -#if defined(IMAGICK_WITH_KERNEL) - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_ImagickKernel_fromMatrix, 0, 2, ImagickKernel, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickKernel_fromMatrix, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, matrix, IS_ARRAY, 0) -#else - ZEND_ARG_INFO(0, matrix) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, origin, IS_ARRAY, 1) -#else - ZEND_ARG_INFO(0, origin) -#endif -ZEND_END_ARG_INFO() -#endif - -#if defined(IMAGICK_WITH_KERNEL) - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickKernel_getMatrix, 0, 0, IS_ARRAY, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickKernel_getMatrix, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if defined(IMAGICK_WITH_KERNEL) - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickKernel_scale, 0, 1, IS_VOID, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickKernel_scale, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, scale, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, scale) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, normalize_kernel, IS_LONG, 1, "null") -#else - ZEND_ARG_INFO(0, normalize_kernel) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if defined(IMAGICK_WITH_KERNEL) -#define arginfo_class_ImagickKernel_separate arginfo_class_ImagickKernel_getMatrix -#endif - - -#if defined(IMAGICK_WITH_KERNEL) -ZEND_METHOD(ImagickKernel, addKernel); -#endif -#if defined(IMAGICK_WITH_KERNEL) -ZEND_METHOD(ImagickKernel, addUnityKernel); -#endif -#if defined(IMAGICK_WITH_KERNEL) -ZEND_METHOD(ImagickKernel, fromBuiltin); -#endif -#if defined(IMAGICK_WITH_KERNEL) -ZEND_METHOD(ImagickKernel, fromMatrix); -#endif -#if defined(IMAGICK_WITH_KERNEL) -ZEND_METHOD(ImagickKernel, getMatrix); -#endif -#if defined(IMAGICK_WITH_KERNEL) -ZEND_METHOD(ImagickKernel, scale); -#endif -#if defined(IMAGICK_WITH_KERNEL) -ZEND_METHOD(ImagickKernel, separate); -#endif - - -static const zend_function_entry class_ImagickKernel_methods = { -#if defined(IMAGICK_WITH_KERNEL) - ZEND_ME(ImagickKernel, addKernel, arginfo_class_ImagickKernel_addKernel, ZEND_ACC_PUBLIC) -#endif -#if defined(IMAGICK_WITH_KERNEL) - ZEND_ME(ImagickKernel, addUnityKernel, arginfo_class_ImagickKernel_addUnityKernel, ZEND_ACC_PUBLIC) -#endif -#if defined(IMAGICK_WITH_KERNEL) - ZEND_ME(ImagickKernel, fromBuiltin, arginfo_class_ImagickKernel_fromBuiltin, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) -#endif -#if defined(IMAGICK_WITH_KERNEL) - ZEND_ME(ImagickKernel, fromMatrix, arginfo_class_ImagickKernel_fromMatrix, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) -#endif -#if defined(IMAGICK_WITH_KERNEL) - ZEND_ME(ImagickKernel, getMatrix, arginfo_class_ImagickKernel_getMatrix, ZEND_ACC_PUBLIC) -#endif -#if defined(IMAGICK_WITH_KERNEL) - ZEND_ME(ImagickKernel, scale, arginfo_class_ImagickKernel_scale, ZEND_ACC_PUBLIC) -#endif -#if defined(IMAGICK_WITH_KERNEL) - ZEND_ME(ImagickKernel, separate, arginfo_class_ImagickKernel_separate, ZEND_ACC_PUBLIC) -#endif - ZEND_FE_END -}; \ No newline at end of file
View file
imagick-3.7.0.tgz/imagick-3.7.0/ImagickPixel.stub.php
Deleted
@@ -1,83 +0,0 @@ -<?php - -/** @generate-function-entries */ - -class ImagickPixel -{ - public function __construct(?string $color = null) {} - - public function clear(): bool {} - - /** @alias ImagickPixel::clear */ - public function destroy(): bool {} - - public function getColor(int $normalized = 0): array {} - - public function getColorAsString(): string {} - - public function getColorCount(): int {} - - public function getColorQuantum(): array {} - - // COLOR_* - public function getColorValue(int $color): float {} - - /** - * $color // COLOR_* - * return - * - Float if IM compiled with HDRI - * - int if IM compiled with fixed point math - */ - public function getColorValueQuantum(int $color): IMAGICK_QUANTUM_TYPE {} - - public function getHSL(): array {} - - public function getIndex(): int {} - - public function isPixelSimilar(ImagickPixel|string $color, float $fuzz): bool {} - - // The fuzz value should be in the range 0-QuantumRange. The maximum value - // represents the longest possible distance in the colorspace. e.g. from - // RGB(0, 0, 0) to RGB(255, 255, 255) for the RGB colorspace - public function isPixelSimilarQuantum(ImagickPixel|string $color, float $fuzz_quantum_range_scaled_by_square_root_of_three): bool {} - - /** @alias ImagickPixel::isPixelSimilarQuantum */ - - public function isSimilar( - ImagickPixel|string $color, - // Feel free to not use named params for this. - float $fuzz_quantum_range_scaled_by_square_root_of_three - ): bool{} - - public function setColor(string $color): bool {} - - public function setColorCount(int $color_count): bool {} - - // COLOR_* - public function setColorValue(int $color, float $value): bool {} - - /** - * $color // COLOR_* - * $value - * - * Type of value depends on how ImageMagick was compiled. - * - Float if IM compiled with HDRI - * - int if IM compiled with fixed point math - * - */ - public function setColorValueQuantum(int $color, IMAGICK_QUANTUM_TYPE $value): bool{} - - public function setHSL(float $hue, float $saturation , float $luminosity): bool{} - - // This function could be described more clearly... - // https://imagemagick.org/api/pixel-wand.php#PixelSetIndex - public function setIndex(IMAGICK_QUANTUM_TYPE $index): bool {} - - //// Not in docs. -#if MagickLibVersion >= 0x693 - public function setColorFromPixel(ImagickPixel $pixel): bool {} -#endif -} - - -
View file
imagick-3.7.0.tgz/imagick-3.7.0/ImagickPixelIterator.stub.php
Deleted
@@ -1,66 +0,0 @@ -<?php - -/** @generate-function-entries */ -class ImagickPixelIterator { - public function __construct(Imagick $imagick) {} - - public function clear(): bool {} - - public static function getPixelIterator(Imagick $imagick) : ImagickPixelIterator {} - - public static function getPixelRegionIterator( - Imagick $imagick, - int $x, - int $y, - int $columns, - int $rows): ImagickPixelIterator {} - - - /** @alias ImagickPixelIterator::clear */ - public function destroy(): bool {} - - public function getCurrentIteratorRow(): array {} - - public function getIteratorRow(): int {} - - public function getNextIteratorRow(): array {} - - public function getPreviousIteratorRow(): array {} - - /** @alias ImagickPixelIterator::getIteratorRow */ - public function key(): int {} - - /** @alias ImagickPixelIterator::getNextIteratorRow - * @tentative-return-type - */ - public function next(): void {} - - /** @alias ImagickPixelIterator::resetIterator - * @tentative-return-type - */ - public function rewind(): void {} - - /** @alias ImagickPixelIterator::getCurrentIteratorRow */ - public function current(): array {} - - public function newPixelIterator(Imagick $imagick): bool {} - - public function newPixelRegionIterator( - Imagick $imagick, - int $x, - int $y, - int $columns, - int $rows): bool {} - - public function resetIterator(): bool {} - - public function setIteratorFirstRow(): bool {} - - public function setIteratorLastRow(): bool {} - - public function setIteratorRow(int $row): bool {} - - public function syncIterator(): bool {} - - public function valid(): bool {} -}
View file
imagick-3.7.0.tgz/imagick-3.7.0/ImagickPixelIterator_arginfo.h
Deleted
@@ -1,206 +0,0 @@ -/* This is a generated file, edit the .stub.php file instead. -* Stub hash: regen with 'sh regen_arginfo.sh' -* file has been fixedup for different versions */ - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixelIterator___construct, 0, 0, 1) - ZEND_ARG_OBJ_INFO(0, imagick, Imagick, 0) -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixelIterator_clear, 0, 0, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixelIterator_clear, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_ImagickPixelIterator_getPixelIterator, 0, 1, ImagickPixelIterator, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixelIterator_getPixelIterator, 0, 0, 1) -#endif - - ZEND_ARG_OBJ_INFO(0, imagick, Imagick, 0) -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_ImagickPixelIterator_getPixelRegionIterator, 0, 5, ImagickPixelIterator, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixelIterator_getPixelRegionIterator, 0, 0, 5) -#endif - - ZEND_ARG_OBJ_INFO(0, imagick, Imagick, 0) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, y) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, columns, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, columns) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, rows, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, rows) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_ImagickPixelIterator_destroy arginfo_class_ImagickPixelIterator_clear - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixelIterator_getCurrentIteratorRow, 0, 0, IS_ARRAY, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixelIterator_getCurrentIteratorRow, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixelIterator_getIteratorRow, 0, 0, IS_LONG, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixelIterator_getIteratorRow, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() - -#define arginfo_class_ImagickPixelIterator_getNextIteratorRow arginfo_class_ImagickPixelIterator_getCurrentIteratorRow - -#define arginfo_class_ImagickPixelIterator_getPreviousIteratorRow arginfo_class_ImagickPixelIterator_getCurrentIteratorRow - -#define arginfo_class_ImagickPixelIterator_key arginfo_class_ImagickPixelIterator_getIteratorRow - -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixelIterator_next, 0, 0, IS_VOID, 0) -ZEND_END_ARG_INFO() - -#define arginfo_class_ImagickPixelIterator_rewind arginfo_class_ImagickPixelIterator_next - -#define arginfo_class_ImagickPixelIterator_current arginfo_class_ImagickPixelIterator_getCurrentIteratorRow - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixelIterator_newPixelIterator, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixelIterator_newPixelIterator, 0, 0, 1) -#endif - - ZEND_ARG_OBJ_INFO(0, imagick, Imagick, 0) -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixelIterator_newPixelRegionIterator, 0, 5, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixelIterator_newPixelRegionIterator, 0, 0, 5) -#endif - - ZEND_ARG_OBJ_INFO(0, imagick, Imagick, 0) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, y) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, columns, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, columns) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, rows, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, rows) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_ImagickPixelIterator_resetIterator arginfo_class_ImagickPixelIterator_clear - -#define arginfo_class_ImagickPixelIterator_setIteratorFirstRow arginfo_class_ImagickPixelIterator_clear - -#define arginfo_class_ImagickPixelIterator_setIteratorLastRow arginfo_class_ImagickPixelIterator_clear - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixelIterator_setIteratorRow, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixelIterator_setIteratorRow, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, row, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, row) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_ImagickPixelIterator_syncIterator arginfo_class_ImagickPixelIterator_clear - -#define arginfo_class_ImagickPixelIterator_valid arginfo_class_ImagickPixelIterator_clear - - -ZEND_METHOD(ImagickPixelIterator, __construct); -ZEND_METHOD(ImagickPixelIterator, clear); -ZEND_METHOD(ImagickPixelIterator, getPixelIterator); -ZEND_METHOD(ImagickPixelIterator, getPixelRegionIterator); -ZEND_METHOD(ImagickPixelIterator, getCurrentIteratorRow); -ZEND_METHOD(ImagickPixelIterator, getIteratorRow); -ZEND_METHOD(ImagickPixelIterator, getNextIteratorRow); -ZEND_METHOD(ImagickPixelIterator, getPreviousIteratorRow); -ZEND_METHOD(ImagickPixelIterator, resetIterator); -ZEND_METHOD(ImagickPixelIterator, newPixelIterator); -ZEND_METHOD(ImagickPixelIterator, newPixelRegionIterator); -ZEND_METHOD(ImagickPixelIterator, setIteratorFirstRow); -ZEND_METHOD(ImagickPixelIterator, setIteratorLastRow); -ZEND_METHOD(ImagickPixelIterator, setIteratorRow); -ZEND_METHOD(ImagickPixelIterator, syncIterator); -ZEND_METHOD(ImagickPixelIterator, valid); - - -static const zend_function_entry class_ImagickPixelIterator_methods = { - ZEND_ME(ImagickPixelIterator, __construct, arginfo_class_ImagickPixelIterator___construct, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickPixelIterator, clear, arginfo_class_ImagickPixelIterator_clear, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickPixelIterator, getPixelIterator, arginfo_class_ImagickPixelIterator_getPixelIterator, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - ZEND_ME(ImagickPixelIterator, getPixelRegionIterator, arginfo_class_ImagickPixelIterator_getPixelRegionIterator, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - ZEND_MALIAS(ImagickPixelIterator, destroy, clear, arginfo_class_ImagickPixelIterator_destroy, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickPixelIterator, getCurrentIteratorRow, arginfo_class_ImagickPixelIterator_getCurrentIteratorRow, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickPixelIterator, getIteratorRow, arginfo_class_ImagickPixelIterator_getIteratorRow, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickPixelIterator, getNextIteratorRow, arginfo_class_ImagickPixelIterator_getNextIteratorRow, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickPixelIterator, getPreviousIteratorRow, arginfo_class_ImagickPixelIterator_getPreviousIteratorRow, ZEND_ACC_PUBLIC) - ZEND_MALIAS(ImagickPixelIterator, key, getIteratorRow, arginfo_class_ImagickPixelIterator_key, ZEND_ACC_PUBLIC) - ZEND_MALIAS(ImagickPixelIterator, next, getNextIteratorRow, arginfo_class_ImagickPixelIterator_next, ZEND_ACC_PUBLIC) - ZEND_MALIAS(ImagickPixelIterator, rewind, resetIterator, arginfo_class_ImagickPixelIterator_rewind, ZEND_ACC_PUBLIC) - ZEND_MALIAS(ImagickPixelIterator, current, getCurrentIteratorRow, arginfo_class_ImagickPixelIterator_current, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickPixelIterator, newPixelIterator, arginfo_class_ImagickPixelIterator_newPixelIterator, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickPixelIterator, newPixelRegionIterator, arginfo_class_ImagickPixelIterator_newPixelRegionIterator, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickPixelIterator, resetIterator, arginfo_class_ImagickPixelIterator_resetIterator, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickPixelIterator, setIteratorFirstRow, arginfo_class_ImagickPixelIterator_setIteratorFirstRow, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickPixelIterator, setIteratorLastRow, arginfo_class_ImagickPixelIterator_setIteratorLastRow, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickPixelIterator, setIteratorRow, arginfo_class_ImagickPixelIterator_setIteratorRow, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickPixelIterator, syncIterator, arginfo_class_ImagickPixelIterator_syncIterator, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickPixelIterator, valid, arginfo_class_ImagickPixelIterator_valid, ZEND_ACC_PUBLIC) - ZEND_FE_END -}; \ No newline at end of file
View file
imagick-3.7.0.tgz/imagick-3.7.0/ImagickPixel_arginfo.h
Deleted
@@ -1,346 +0,0 @@ -/* This is a generated file, edit the .stub.php file instead. -* Stub hash: regen with 'sh regen_arginfo.sh' -* file has been fixedup for different versions */ - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel___construct, 0, 0, 0) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, color, IS_STRING, 1, "null") -#else - ZEND_ARG_INFO(0, color) -#endif - -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_clear, 0, 0, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_clear, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() - -#define arginfo_class_ImagickPixel_destroy arginfo_class_ImagickPixel_clear - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_getColor, 0, 0, IS_ARRAY, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_getColor, 0, 0, 0) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, normalized, IS_LONG, 0, "0") -#else - ZEND_ARG_INFO(0, normalized) -#endif - -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_getColorAsString, 0, 0, IS_STRING, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_getColorAsString, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_getColorCount, 0, 0, IS_LONG, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_getColorCount, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_getColorQuantum, 0, 0, IS_ARRAY, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_getColorQuantum, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_getColorValue, 0, 1, IS_DOUBLE, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_getColorValue, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, color, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, color) -#endif -ZEND_END_ARG_INFO() - - -#if MAGICKCORE_HDRI_ENABLE - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_getColorValueQuantum, 0, 1, IS_DOUBLE, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_getColorValueQuantum, 0, 0, 1) -#endif - -#else - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_getColorValueQuantum, 0, 1, IS_LONG, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_getColorValueQuantum, 0, 0, 1) -#endif - -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, color, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, color) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_ImagickPixel_getHSL arginfo_class_ImagickPixel_getColorQuantum - -#define arginfo_class_ImagickPixel_getIndex arginfo_class_ImagickPixel_getColorCount - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_isPixelSimilar, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_isPixelSimilar, 0, 0, 2) -#endif - - ZEND_ARG_OBJ_TYPE_MASK(0, color, ImagickPixel, MAY_BE_STRING, NULL) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, fuzz, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, fuzz) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_isPixelSimilarQuantum, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_isPixelSimilarQuantum, 0, 0, 2) -#endif - - ZEND_ARG_OBJ_TYPE_MASK(0, color, ImagickPixel, MAY_BE_STRING, NULL) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, fuzz_quantum_range_scaled_by_square_root_of_three, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, fuzz_quantum_range_scaled_by_square_root_of_three) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_ImagickPixel_isSimilar arginfo_class_ImagickPixel_isPixelSimilarQuantum - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_setColor, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_setColor, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, color, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, color) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_setColorCount, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_setColorCount, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, color_count, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, color_count) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_setColorValue, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_setColorValue, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, color, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, color) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, value, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, value) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_setColorValueQuantum, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_setColorValueQuantum, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, color, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, color) -#endif - -#if MAGICKCORE_HDRI_ENABLE - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, value, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, value) -#endif -#else - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, value, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, value) -#endif -#endif - -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_setHSL, 0, 3, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_setHSL, 0, 0, 3) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, hue, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, hue) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, saturation, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, saturation) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, luminosity, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, luminosity) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_setIndex, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_setIndex, 0, 0, 1) -#endif - - -#if MAGICKCORE_HDRI_ENABLE - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, index, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, index) -#endif -#else - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, index) -#endif -#endif - -ZEND_END_ARG_INFO() - -#if MagickLibVersion >= 0x693 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_setColorFromPixel, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_setColorFromPixel, 0, 0, 1) -#endif - - ZEND_ARG_OBJ_INFO(0, pixel, ImagickPixel, 0) -ZEND_END_ARG_INFO() -#endif - - -ZEND_METHOD(ImagickPixel, __construct); -ZEND_METHOD(ImagickPixel, clear); -ZEND_METHOD(ImagickPixel, getColor); -ZEND_METHOD(ImagickPixel, getColorAsString); -ZEND_METHOD(ImagickPixel, getColorCount); -ZEND_METHOD(ImagickPixel, getColorQuantum); -ZEND_METHOD(ImagickPixel, getColorValue); -ZEND_METHOD(ImagickPixel, getColorValueQuantum); -ZEND_METHOD(ImagickPixel, getHSL); -ZEND_METHOD(ImagickPixel, getIndex); -ZEND_METHOD(ImagickPixel, isPixelSimilar); -ZEND_METHOD(ImagickPixel, isPixelSimilarQuantum); -ZEND_METHOD(ImagickPixel, setColor); -ZEND_METHOD(ImagickPixel, setColorCount); -ZEND_METHOD(ImagickPixel, setColorValue); -ZEND_METHOD(ImagickPixel, setColorValueQuantum); -ZEND_METHOD(ImagickPixel, setHSL); -ZEND_METHOD(ImagickPixel, setIndex); -#if MagickLibVersion >= 0x693 -ZEND_METHOD(ImagickPixel, setColorFromPixel); -#endif - - -static const zend_function_entry class_ImagickPixel_methods = { - ZEND_ME(ImagickPixel, __construct, arginfo_class_ImagickPixel___construct, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickPixel, clear, arginfo_class_ImagickPixel_clear, ZEND_ACC_PUBLIC) - ZEND_MALIAS(ImagickPixel, destroy, clear, arginfo_class_ImagickPixel_destroy, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickPixel, getColor, arginfo_class_ImagickPixel_getColor, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickPixel, getColorAsString, arginfo_class_ImagickPixel_getColorAsString, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickPixel, getColorCount, arginfo_class_ImagickPixel_getColorCount, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickPixel, getColorQuantum, arginfo_class_ImagickPixel_getColorQuantum, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickPixel, getColorValue, arginfo_class_ImagickPixel_getColorValue, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickPixel, getColorValueQuantum, arginfo_class_ImagickPixel_getColorValueQuantum, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickPixel, getHSL, arginfo_class_ImagickPixel_getHSL, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickPixel, getIndex, arginfo_class_ImagickPixel_getIndex, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickPixel, isPixelSimilar, arginfo_class_ImagickPixel_isPixelSimilar, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickPixel, isPixelSimilarQuantum, arginfo_class_ImagickPixel_isPixelSimilarQuantum, ZEND_ACC_PUBLIC) - ZEND_MALIAS(ImagickPixel, isSimilar, isPixelSimilarQuantum, arginfo_class_ImagickPixel_isSimilar, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickPixel, setColor, arginfo_class_ImagickPixel_setColor, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickPixel, setColorCount, arginfo_class_ImagickPixel_setColorCount, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickPixel, setColorValue, arginfo_class_ImagickPixel_setColorValue, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickPixel, setColorValueQuantum, arginfo_class_ImagickPixel_setColorValueQuantum, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickPixel, setHSL, arginfo_class_ImagickPixel_setHSL, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickPixel, setIndex, arginfo_class_ImagickPixel_setIndex, ZEND_ACC_PUBLIC) -#if MagickLibVersion >= 0x693 - ZEND_ME(ImagickPixel, setColorFromPixel, arginfo_class_ImagickPixel_setColorFromPixel, ZEND_ACC_PUBLIC) -#endif - ZEND_FE_END -}; \ No newline at end of file
View file
imagick-3.7.0.tgz/imagick-3.7.0/Imagick_arginfo.h
Deleted
@@ -1,7686 +0,0 @@ -/* This is a generated file, edit the .stub.php file instead. -* Stub hash: regen with 'sh regen_arginfo.sh' -* file has been fixedup for different versions */ - -#if MagickLibVersion > 0x628 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_optimizeImageLayers, 0, 0, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_optimizeImageLayers, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_compareImageLayers, 0, 1, Imagick, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_compareImageLayers, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, metric, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, metric) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_pingImageBlob, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_pingImageBlob, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, image, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, image) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_pingImageFile, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_pingImageFile, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, filehandle, IS_MIXED, 0) -#else - ZEND_ARG_INFO(0, filehandle) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, filename, IS_STRING, 1, "null") -#else - ZEND_ARG_INFO(0, filename) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 -#define arginfo_class_Imagick_transposeImage arginfo_class_Imagick_optimizeImageLayers -#endif - -#if MagickLibVersion > 0x628 -#define arginfo_class_Imagick_transverseImage arginfo_class_Imagick_optimizeImageLayers -#endif - -#if MagickLibVersion > 0x628 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_trimImage, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_trimImage, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, fuzz, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, fuzz) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_waveImage, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_waveImage, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, amplitude, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, amplitude) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, length, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, length) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x700 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_waveImageWithMethod, 0, 3, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_waveImageWithMethod, 0, 0, 3) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, amplitude, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, amplitude) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, length, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, length) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, interpolate_method, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, interpolate_method) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_vignetteImage, 0, 4, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_vignetteImage, 0, 0, 4) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, black_point, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, black_point) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, white_point, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, white_point) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, y) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 -#define arginfo_class_Imagick_uniqueImageColors arginfo_class_Imagick_optimizeImageLayers -#endif - -#if MagickLibVersion > 0x628 && !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageMatte, 0, 0, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageMatte, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageMatte, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageMatte, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, matte, _IS_BOOL, 0) -#else - ZEND_ARG_INFO(0, matte) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_adaptiveResizeImage, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_adaptiveResizeImage, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, columns, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, columns) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, rows, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, rows) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, bestfit, _IS_BOOL, 0, "false") -#else - ZEND_ARG_INFO(0, bestfit) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, legacy, _IS_BOOL, 0, "false") -#else - ZEND_ARG_INFO(0, legacy) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_sketchImage, 0, 3, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_sketchImage, 0, 0, 3) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, radius, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, radius) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, sigma, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, sigma) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, angle, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, angle) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_shadeImage, 0, 3, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_shadeImage, 0, 0, 3) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, gray, _IS_BOOL, 0) -#else - ZEND_ARG_INFO(0, gray) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, azimuth, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, azimuth) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, elevation, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, elevation) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getSizeOffset, 0, 0, IS_LONG, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getSizeOffset, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setSizeOffset, 0, 3, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setSizeOffset, 0, 0, 3) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, columns, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, columns) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, rows, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, rows) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, offset) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_adaptiveBlurImage, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_adaptiveBlurImage, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, radius, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, radius) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, sigma, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, sigma) -#endif - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_contrastStretchImage, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_contrastStretchImage, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, black_point, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, black_point) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, white_point, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, white_point) -#endif - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 -#define arginfo_class_Imagick_adaptiveSharpenImage arginfo_class_Imagick_adaptiveBlurImage -#endif - -#if MagickLibVersion > 0x628 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_randomThresholdImage, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_randomThresholdImage, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, low, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, low) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, high, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, high) -#endif - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_roundCornersImage, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_roundCornersImage, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x_rounding, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, x_rounding) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y_rounding, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, y_rounding) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, stroke_width, IS_DOUBLE, 0, "10") -#else - ZEND_ARG_INFO(0, stroke_width) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, displace, IS_DOUBLE, 0, "5") -#else - ZEND_ARG_INFO(0, displace) -#endif - - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, size_correction, IS_DOUBLE, 0, "-6") -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 -#define arginfo_class_Imagick_roundCorners arginfo_class_Imagick_roundCornersImage -#endif - -#if MagickLibVersion > 0x628 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setIteratorIndex, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setIteratorIndex, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, index) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 -#define arginfo_class_Imagick_getIteratorIndex arginfo_class_Imagick_getSizeOffset -#endif - -#if MagickLibVersion > 0x628 && MagickLibVersion < 0x700 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_transformImage, 0, 2, Imagick, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_transformImage, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, crop, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, crop) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, geometry, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, geometry) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x630 && MagickLibVersion < 0x700 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageOpacity, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageOpacity, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, opacity, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, opacity) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x630 && MagickLibVersion >= 0x700 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageAlpha, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageAlpha, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, alpha, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, alpha) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x630 && MagickLibVersion < 0x700 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_orderedPosterizeImage, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_orderedPosterizeImage, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, threshold_map, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, threshold_map) -#endif - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion >= 0x700 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_polaroidWithTextAndMethod, 0, 4, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_polaroidWithTextAndMethod, 0, 0, 4) -#endif - - ZEND_ARG_OBJ_INFO(0, settings, ImagickDraw, 0) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, angle, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, angle) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, caption, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, caption) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, method, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, method) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x631 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_polaroidImage, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_polaroidImage, 0, 0, 2) -#endif - - ZEND_ARG_OBJ_INFO(0, settings, ImagickDraw, 0) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, angle, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, angle) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x631 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageProperty, 0, 1, IS_STRING, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageProperty, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, name) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x631 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageProperty, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageProperty, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, name) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, value) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x631 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_deleteImageProperty, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_deleteImageProperty, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, name) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x631 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_identifyFormat, 0, 1, IS_STRING, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_identifyFormat, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, format, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, format) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x631 && IM_HAVE_IMAGICK_SETIMAGEINTERPOLATEMETHOD - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageInterpolateMethod, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageInterpolateMethod, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, method, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, method) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x631 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageInterpolateMethod, 0, 0, IS_LONG, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageInterpolateMethod, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x631 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_linearStretchImage, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_linearStretchImage, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, black_point, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, black_point) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, white_point, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, white_point) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x631 -#define arginfo_class_Imagick_getImageLength arginfo_class_Imagick_getImageInterpolateMethod -#endif - -#if MagickLibVersion > 0x631 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_extentImage, 0, 4, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_extentImage, 0, 0, 4) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, width) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, height) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, y) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x633 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageOrientation, 0, 0, IS_LONG, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageOrientation, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x633 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageOrientation, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageOrientation, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, orientation, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, orientation) -#endif -ZEND_END_ARG_INFO() -#endif - -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion > 0x634 && MagickLibVersion < 0x700 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_paintFloodfillImage, 0, 5, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_paintFloodfillImage, 0, 0, 5) -#endif - - ZEND_ARG_OBJ_TYPE_MASK(0, fill_color, ImagickPixel, MAY_BE_STRING, NULL) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, fuzz, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, fuzz) -#endif - ZEND_ARG_OBJ_TYPE_MASK(0, border_color, ImagickPixel, MAY_BE_STRING, NULL) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, y) -#endif - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x635 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_clutImage, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_clutImage, 0, 0, 1) -#endif - - ZEND_ARG_OBJ_INFO(0, lookup_table, Imagick, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x635 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageProperties, 0, 0, IS_ARRAY, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageProperties, 0, 0, 0) -#endif - - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 0, "\"*\"") - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, include_values, _IS_BOOL, 0, "true") -#else - ZEND_ARG_INFO(0, include_values) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x635 -#define arginfo_class_Imagick_getImageProfiles arginfo_class_Imagick_getImageProperties -#endif - -#if MagickLibVersion > 0x635 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_distortImage, 0, 3, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_distortImage, 0, 0, 3) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, distortion, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, distortion) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, arguments, IS_ARRAY, 0) -#else - ZEND_ARG_INFO(0, arguments) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, bestfit, _IS_BOOL, 0) -#else - ZEND_ARG_INFO(0, bestfit) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x635 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_writeImageFile, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_writeImageFile, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, filehandle, IS_MIXED, 0) -#else - ZEND_ARG_INFO(0, filehandle) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, format, IS_STRING, 1, "null") -#else - ZEND_ARG_INFO(0, format) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x635 -#define arginfo_class_Imagick_writeImagesFile arginfo_class_Imagick_writeImageFile -#endif - -#if MagickLibVersion > 0x635 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_resetImagePage, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_resetImagePage, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, page, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, page) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x635 && MagickLibVersion < 0x700 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageClipMask, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageClipMask, 0, 0, 1) -#endif - - ZEND_ARG_OBJ_INFO(0, clip_mask, imagick, 0) -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x635 && MagickLibVersion < 0x700 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_getImageClipMask, 0, 0, Imagick, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageClipMask, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x635 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_animateImages, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_animateImages, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x_server, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, x_server) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x635 && !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_recolorImage, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_recolorImage, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, matrix, IS_ARRAY, 0) -#else - ZEND_ARG_INFO(0, matrix) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x636 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setFont, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setFont, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, font, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, font) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x636 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getFont, 0, 0, IS_STRING, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getFont, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x636 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setPointSize, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setPointSize, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, point_size, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, point_size) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x636 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getPointSize, 0, 0, IS_DOUBLE, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getPointSize, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x636 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_mergeImageLayers, 0, 1, Imagick, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_mergeImageLayers, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, layermethod, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, layermethod) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x637 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageAlphaChannel, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageAlphaChannel, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, alphachannel, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, alphachannel) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x637 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_floodfillPaintImage, 0, 6, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_floodfillPaintImage, 0, 0, 6) -#endif - - ZEND_ARG_OBJ_TYPE_MASK(0, fill_color, ImagickPixel, MAY_BE_STRING, NULL) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, fuzz, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, fuzz) -#endif - ZEND_ARG_OBJ_TYPE_MASK(0, border_color, ImagickPixel, MAY_BE_STRING, NULL) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, y) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, invert, _IS_BOOL, 0) -#else - ZEND_ARG_INFO(0, invert) -#endif - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 1, "Imagick::CHANNEL_DEFAULT") -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x637 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_opaquePaintImage, 0, 4, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_opaquePaintImage, 0, 0, 4) -#endif - - ZEND_ARG_OBJ_TYPE_MASK(0, target_color, ImagickPixel, MAY_BE_STRING, NULL) - ZEND_ARG_OBJ_TYPE_MASK(0, fill_color, ImagickPixel, MAY_BE_STRING, NULL) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, fuzz, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, fuzz) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, invert, _IS_BOOL, 0) -#else - ZEND_ARG_INFO(0, invert) -#endif - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x637 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_transparentPaintImage, 0, 4, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_transparentPaintImage, 0, 0, 4) -#endif - - ZEND_ARG_OBJ_TYPE_MASK(0, target_color, ImagickPixel, MAY_BE_STRING, NULL) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, alpha, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, alpha) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, fuzz, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, fuzz) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, invert, _IS_BOOL, 0) -#else - ZEND_ARG_INFO(0, invert) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x638 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_liquidRescaleImage, 0, 4, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_liquidRescaleImage, 0, 0, 4) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, width) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, height) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, delta_x, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, delta_x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, rigidity, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, rigidity) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x638 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_encipherImage, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_encipherImage, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, passphrase, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, passphrase) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x638 -#define arginfo_class_Imagick_decipherImage arginfo_class_Imagick_encipherImage -#endif - -#if MagickLibVersion > 0x639 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setGravity, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setGravity, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, gravity, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, gravity) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x639 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getGravity, 0, 0, IS_LONG, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getGravity, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x639 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageChannelRange, 0, 1, IS_ARRAY, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageChannelRange, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, channel, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, channel) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x639 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageAlphaChannel, 0, 0, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageAlphaChannel, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x642 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageChannelDistortions, 0, 2, IS_DOUBLE, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageChannelDistortions, 0, 0, 2) -#endif - - ZEND_ARG_OBJ_INFO(0, reference_image, Imagick, 0) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, metric, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, metric) -#endif - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x643 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageGravity, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageGravity, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, gravity, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, gravity) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x643 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageGravity, 0, 0, IS_LONG, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageGravity, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x645 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_importImagePixels, 0, 7, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_importImagePixels, 0, 0, 7) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, y) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, width) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, height) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, map, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, map) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, pixelstorage, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, pixelstorage) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, pixels, IS_ARRAY, 0) -#else - ZEND_ARG_INFO(0, pixels) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x645 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_deskewImage, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_deskewImage, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, threshold, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, threshold) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x645 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_segmentImage, 0, 3, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_segmentImage, 0, 0, 3) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, colorspace, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, colorspace) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, cluster_threshold, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, cluster_threshold) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, smooth_threshold, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, smooth_threshold) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, verbose, _IS_BOOL, 0, "false") -#else - ZEND_ARG_INFO(0, verbose) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x645 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_sparseColorImage, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_sparseColorImage, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, sparsecolormethod, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, sparsecolormethod) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, arguments, IS_ARRAY, 0) -#else - ZEND_ARG_INFO(0, arguments) -#endif - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x645 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_remapImage, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_remapImage, 0, 0, 2) -#endif - - ZEND_ARG_OBJ_INFO(0, replacement, Imagick, 0) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, dither_method, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, dither_method) -#endif -ZEND_END_ARG_INFO() -#endif - -#if PHP_IMAGICK_HAVE_HOUGHLINE - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_houghLineImage, 0, 3, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_houghLineImage, 0, 0, 3) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, width) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, height) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, threshold, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, threshold) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x646 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_exportImagePixels, 0, 6, IS_ARRAY, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_exportImagePixels, 0, 0, 6) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, y) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, width) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, height) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, map, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, map) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, pixelstorage, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, pixelstorage) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x648 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageChannelKurtosis, 0, 0, IS_ARRAY, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageChannelKurtosis, 0, 0, 0) -#endif - - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x648 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_functionImage, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_functionImage, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, function, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, function) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, parameters, IS_ARRAY, 0) -#else - ZEND_ARG_INFO(0, parameters) -#endif - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x651 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_transformImageColorspace, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_transformImageColorspace, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, colorspace, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, colorspace) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x652 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_haldClutImage, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_haldClutImage, 0, 0, 1) -#endif - - ZEND_ARG_OBJ_INFO(0, clut, Imagick, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x655 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_autoLevelImage, 0, 0, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_autoLevelImage, 0, 0, 0) -#endif - - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x655 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_blueShiftImage, 0, 0, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_blueShiftImage, 0, 0, 0) -#endif - - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, factor, IS_DOUBLE, 0, "1.5") -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x656 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageArtifact, 0, 1, IS_STRING, 1) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageArtifact, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, artifact, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, artifact) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x656 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageArtifact, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageArtifact, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, artifact, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, artifact) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 1) -#else - ZEND_ARG_INFO(0, value) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x656 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_deleteImageArtifact, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_deleteImageArtifact, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, artifact, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, artifact) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x656 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getColorspace, 0, 0, IS_LONG, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getColorspace, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x656 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setColorspace, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setColorspace, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, colorspace, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, colorspace) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x656 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_clampImage, 0, 0, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_clampImage, 0, 0, 0) -#endif - - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x667 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_smushImages, 0, 2, Imagick, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_smushImages, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, stack, _IS_BOOL, 0) -#else - ZEND_ARG_INFO(0, stack) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, offset) -#endif -ZEND_END_ARG_INFO() -#endif - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick___construct, 0, 0, 0) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_MASK(0, files, MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_NULL, "null") -#else - ZEND_ARG_INFO(0, files) -#endif - -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick___toString, 0, 0, IS_STRING, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick___toString, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 50600 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_count, 0, 0, IS_LONG, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_count, 0, 0, 0) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "0") -#else - ZEND_ARG_INFO(0, mode) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if !(PHP_VERSION_ID >= 50600) - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_count, 0, 0, IS_LONG, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_count, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_getPixelIterator, 0, 0, ImagickPixelIterator, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getPixelIterator, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_getPixelRegionIterator, 0, 4, ImagickPixelIterator, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getPixelRegionIterator, 0, 0, 4) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, y) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, columns, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, columns) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, rows, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, rows) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_readImage, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_readImage, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, filename) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_readImages, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_readImages, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, filenames, IS_ARRAY, 0) -#else - ZEND_ARG_INFO(0, filenames) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_readImageBlob, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_readImageBlob, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, image, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, image) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, filename, IS_STRING, 1, "null") -#else - ZEND_ARG_INFO(0, filename) -#endif - -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageFormat, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageFormat, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, format, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, format) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_scaleImage, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_scaleImage, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, columns, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, columns) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, rows, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, rows) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, bestfit, _IS_BOOL, 0, "false") -#else - ZEND_ARG_INFO(0, bestfit) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, legacy, _IS_BOOL, 0, "false") -#else - ZEND_ARG_INFO(0, legacy) -#endif - -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_writeImage, 0, 0, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_writeImage, 0, 0, 0) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, filename, IS_STRING, 1, "null") -#else - ZEND_ARG_INFO(0, filename) -#endif - -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_writeImages, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_writeImages, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, filename) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, adjoin, _IS_BOOL, 0) -#else - ZEND_ARG_INFO(0, adjoin) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_blurImage, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_blurImage, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, radius, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, radius) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, sigma, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, sigma) -#endif - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_thumbnailImage, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_thumbnailImage, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, columns, IS_LONG, 1) -#else - ZEND_ARG_INFO(0, columns) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, rows, IS_LONG, 1) -#else - ZEND_ARG_INFO(0, rows) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, bestfit, _IS_BOOL, 0, "false") -#else - ZEND_ARG_INFO(0, bestfit) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, fill, _IS_BOOL, 0, "false") -#else - ZEND_ARG_INFO(0, fill) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, legacy, _IS_BOOL, 0, "false") -#else - ZEND_ARG_INFO(0, legacy) -#endif - -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_cropThumbnailImage, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_cropThumbnailImage, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, width) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, height) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, legacy, _IS_BOOL, 0, "false") -#else - ZEND_ARG_INFO(0, legacy) -#endif - -ZEND_END_ARG_INFO() - -#define arginfo_class_Imagick_getImageFilename arginfo_class_Imagick___toString - -#define arginfo_class_Imagick_setImageFilename arginfo_class_Imagick_readImage - -#define arginfo_class_Imagick_getImageFormat arginfo_class_Imagick___toString - -#define arginfo_class_Imagick_getImageMimeType arginfo_class_Imagick___toString - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_removeImage, 0, 0, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_removeImage, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() - -#define arginfo_class_Imagick_destroy arginfo_class_Imagick_removeImage - -#define arginfo_class_Imagick_clear arginfo_class_Imagick_removeImage - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_clone, 0, 0, Imagick, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_clone, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageSize, 0, 0, IS_LONG, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageSize, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() - -#define arginfo_class_Imagick_getImageBlob arginfo_class_Imagick___toString - -#define arginfo_class_Imagick_getImagesBlob arginfo_class_Imagick___toString - -#define arginfo_class_Imagick_setFirstIterator arginfo_class_Imagick_removeImage - -#define arginfo_class_Imagick_setLastIterator arginfo_class_Imagick_removeImage - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_resetIterator, 0, 0, IS_VOID, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_resetIterator, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() - -#define arginfo_class_Imagick_previousImage arginfo_class_Imagick_removeImage - -#define arginfo_class_Imagick_nextImage arginfo_class_Imagick_removeImage - -#define arginfo_class_Imagick_hasPreviousImage arginfo_class_Imagick_removeImage - -#define arginfo_class_Imagick_hasNextImage arginfo_class_Imagick_removeImage - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageIndex, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageIndex, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, index) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_Imagick_getImageIndex arginfo_class_Imagick_getImageSize - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_commentImage, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_commentImage, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, comment, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, comment) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_cropImage, 0, 4, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_cropImage, 0, 0, 4) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, width) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, height) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, y) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_labelImage, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_labelImage, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, label, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, label) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageGeometry, 0, 0, IS_ARRAY, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageGeometry, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_drawImage, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_drawImage, 0, 0, 1) -#endif - - ZEND_ARG_OBJ_INFO(0, drawing, ImagickDraw, 0) -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageCompressionQuality, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageCompressionQuality, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, quality, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, quality) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_Imagick_getImageCompressionQuality arginfo_class_Imagick_getImageSize - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageCompression, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageCompression, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, compression, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, compression) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_Imagick_getImageCompression arginfo_class_Imagick_getImageSize - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_annotateImage, 0, 5, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_annotateImage, 0, 0, 5) -#endif - - ZEND_ARG_OBJ_INFO(0, settings, ImagickDraw, 0) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, y) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, angle, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, angle) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, text, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, text) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_compositeImage, 0, 4, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_compositeImage, 0, 0, 4) -#endif - - ZEND_ARG_OBJ_INFO(0, composite_image, Imagick, 0) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, composite, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, composite) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, y) -#endif - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_modulateImage, 0, 3, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_modulateImage, 0, 0, 3) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, brightness, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, brightness) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, saturation, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, saturation) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, hue, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, hue) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_Imagick_getImageColors arginfo_class_Imagick_getImageSize - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_montageImage, 0, 5, Imagick, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_montageImage, 0, 0, 5) -#endif - - ZEND_ARG_OBJ_INFO(0, settings, ImagickDraw, 0) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, tile_geometry, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, tile_geometry) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, thumbnail_geometry, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, thumbnail_geometry) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, monatgemode, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, monatgemode) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, frame, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, frame) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_identifyImage, 0, 0, IS_ARRAY, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_identifyImage, 0, 0, 0) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, append_raw_output, _IS_BOOL, 0, "false") -#else - ZEND_ARG_INFO(0, append_raw_output) -#endif - -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_thresholdImage, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_thresholdImage, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, threshold, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, threshold) -#endif - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_adaptiveThresholdImage, 0, 3, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_adaptiveThresholdImage, 0, 0, 3) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, width) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, height) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, offset) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_blackThresholdImage, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_blackThresholdImage, 0, 0, 1) -#endif - - ZEND_ARG_OBJ_TYPE_MASK(0, threshold_color, ImagickPixel, MAY_BE_STRING, NULL) -ZEND_END_ARG_INFO() - -#define arginfo_class_Imagick_whiteThresholdImage arginfo_class_Imagick_blackThresholdImage - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_appendImages, 0, 1, Imagick, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_appendImages, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, stack, _IS_BOOL, 0) -#else - ZEND_ARG_INFO(0, stack) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_charcoalImage, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_charcoalImage, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, radius, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, radius) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, sigma, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, sigma) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_normalizeImage, 0, 0, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_normalizeImage, 0, 0, 0) -#endif - - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") -ZEND_END_ARG_INFO() - -#if MagickLibVersion >= 0x700 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_oilPaintImageWithSigma, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_oilPaintImageWithSigma, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, radius, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, radius) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, sigma, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, sigma) -#endif -ZEND_END_ARG_INFO() -#endif - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_oilPaintImage, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_oilPaintImage, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, radius, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, radius) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_posterizeImage, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_posterizeImage, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, levels, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, levels) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, dither, _IS_BOOL, 0) -#else - ZEND_ARG_INFO(0, dither) -#endif -ZEND_END_ARG_INFO() - -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_radialBlurImage, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_radialBlurImage, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, angle, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, angle) -#endif - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") -ZEND_END_ARG_INFO() -#endif - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_raiseImage, 0, 5, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_raiseImage, 0, 0, 5) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, width) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, height) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, y) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, raise, _IS_BOOL, 0) -#else - ZEND_ARG_INFO(0, raise) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_resampleImage, 0, 4, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_resampleImage, 0, 0, 4) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x_resolution, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, x_resolution) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y_resolution, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, y_resolution) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, filter, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, filter) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, blur, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, blur) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_resizeImage, 0, 4, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_resizeImage, 0, 0, 4) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, columns, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, columns) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, rows, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, rows) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, filter, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, filter) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, blur, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, blur) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, bestfit, _IS_BOOL, 0, "false") -#else - ZEND_ARG_INFO(0, bestfit) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, legacy, _IS_BOOL, 0, "false") -#else - ZEND_ARG_INFO(0, legacy) -#endif - -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_rollImage, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_rollImage, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, y) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_rotateImage, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_rotateImage, 0, 0, 2) -#endif - - ZEND_ARG_OBJ_TYPE_MASK(0, background_color, ImagickPixel, MAY_BE_STRING, NULL) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, degrees, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, degrees) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_sampleImage, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_sampleImage, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, columns, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, columns) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, rows, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, rows) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_solarizeImage, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_solarizeImage, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, threshold, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, threshold) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_shadowImage, 0, 4, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_shadowImage, 0, 0, 4) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, opacity, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, opacity) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, sigma, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, sigma) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, y) -#endif -ZEND_END_ARG_INFO() - -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageAttribute, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageAttribute, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, key) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, value) -#endif -ZEND_END_ARG_INFO() -#endif - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageBackgroundColor, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageBackgroundColor, 0, 0, 1) -#endif - - ZEND_ARG_OBJ_TYPE_MASK(0, background_color, ImagickPixel, MAY_BE_STRING, NULL) -ZEND_END_ARG_INFO() - -#if MagickLibVersion >= 0x700 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageChannelMask, 0, 1, IS_LONG, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageChannelMask, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, channel, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, channel) -#endif -ZEND_END_ARG_INFO() -#endif - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageCompose, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageCompose, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, compose, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, compose) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageDelay, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageDelay, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, delay, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, delay) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageDepth, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageDepth, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, depth, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, depth) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageGamma, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageGamma, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, gamma, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, gamma) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageIterations, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageIterations, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, iterations, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, iterations) -#endif -ZEND_END_ARG_INFO() - -#if MagickLibVersion < 0x700 || MagickLibVersion >= 0x705 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageMatteColor, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageMatteColor, 0, 0, 1) -#endif - - ZEND_ARG_OBJ_TYPE_MASK(0, matte_color, ImagickPixel, MAY_BE_STRING, NULL) -ZEND_END_ARG_INFO() -#endif - -#define arginfo_class_Imagick_setImagePage arginfo_class_Imagick_cropImage - -#define arginfo_class_Imagick_setImageProgressMonitor arginfo_class_Imagick_readImage - -#if MagickLibVersion > 0x653 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setProgressMonitor, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setProgressMonitor, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0) -#else - ZEND_ARG_INFO(0, callback) -#endif -ZEND_END_ARG_INFO() -#endif - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageResolution, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageResolution, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x_resolution, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, x_resolution) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y_resolution, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, y_resolution) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageScene, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageScene, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, scene, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, scene) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageTicksPerSecond, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageTicksPerSecond, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, ticks_per_second, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, ticks_per_second) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageType, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageType, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, image_type, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, image_type) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageUnits, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageUnits, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, units, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, units) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_Imagick_sharpenImage arginfo_class_Imagick_blurImage - -#define arginfo_class_Imagick_shaveImage arginfo_class_Imagick_sampleImage - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_shearImage, 0, 3, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_shearImage, 0, 0, 3) -#endif - - ZEND_ARG_OBJ_TYPE_MASK(0, background_color, ImagickPixel, MAY_BE_STRING, NULL) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x_shear, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, x_shear) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y_shear, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, y_shear) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_Imagick_spliceImage arginfo_class_Imagick_cropImage - -#define arginfo_class_Imagick_pingImage arginfo_class_Imagick_readImage - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_readImageFile, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_readImageFile, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, filehandle, IS_MIXED, 0) -#else - ZEND_ARG_INFO(0, filehandle) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, filename, IS_STRING, 1, "null") -#else - ZEND_ARG_INFO(0, filename) -#endif - -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_displayImage, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_displayImage, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, servername, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, servername) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_Imagick_displayImages arginfo_class_Imagick_displayImage - -#define arginfo_class_Imagick_spreadImage arginfo_class_Imagick_oilPaintImage - -#if MagickLibVersion >= 0x700 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_spreadImageWithMethod, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_spreadImageWithMethod, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, radius, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, radius) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, interpolate_method, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, interpolate_method) -#endif -ZEND_END_ARG_INFO() -#endif - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_swirlImage, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_swirlImage, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, degrees, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, degrees) -#endif -ZEND_END_ARG_INFO() - -#if MagickLibVersion >= 0x700 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_swirlImageWithMethod, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_swirlImageWithMethod, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, degrees, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, degrees) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, interpolate_method, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, interpolate_method) -#endif -ZEND_END_ARG_INFO() -#endif - -#define arginfo_class_Imagick_stripImage arginfo_class_Imagick_removeImage - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_queryFormats, 0, 0, IS_ARRAY, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_queryFormats, 0, 0, 0) -#endif - - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 0, "\"*\"") -ZEND_END_ARG_INFO() - -#define arginfo_class_Imagick_queryFonts arginfo_class_Imagick_queryFormats - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_queryFontMetrics, 0, 2, IS_ARRAY, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_queryFontMetrics, 0, 0, 2) -#endif - - ZEND_ARG_OBJ_INFO(0, settings, ImagickDraw, 0) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, text, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, text) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, multiline, _IS_BOOL, 1, "null") -#else - ZEND_ARG_INFO(0, multiline) -#endif - -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_steganoImage, 0, 2, Imagick, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_steganoImage, 0, 0, 2) -#endif - - ZEND_ARG_OBJ_INFO(0, watermark, Imagick, 0) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, offset) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_addNoiseImage, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_addNoiseImage, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, noise, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, noise) -#endif - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") -ZEND_END_ARG_INFO() - -#if IM_HAVE_IMAGICK_ADD_NOISE_WITH_ATTENUATE - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_addNoiseImageWithAttenuate, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_addNoiseImageWithAttenuate, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, noise, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, noise) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, attenuate, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, attenuate) -#endif - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") -ZEND_END_ARG_INFO() -#endif - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_motionBlurImage, 0, 3, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_motionBlurImage, 0, 0, 3) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, radius, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, radius) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, sigma, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, sigma) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, angle, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, angle) -#endif - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") -ZEND_END_ARG_INFO() - -#if MagickLibVersion < 0x700 && !defined(MAGICKCORE_EXCLUDE_DEPRECATED) - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_mosaicImages, 0, 0, Imagick, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_mosaicImages, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_morphImages, 0, 1, Imagick, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_morphImages, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, number_frames, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, number_frames) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_Imagick_minifyImage arginfo_class_Imagick_removeImage - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_affineTransformImage, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_affineTransformImage, 0, 0, 1) -#endif - - ZEND_ARG_OBJ_INFO(0, settings, ImagickDraw, 0) -ZEND_END_ARG_INFO() - -#define arginfo_class_Imagick_averageImages arginfo_class_Imagick_clone - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_borderImage, 0, 3, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_borderImage, 0, 0, 3) -#endif - - ZEND_ARG_OBJ_TYPE_MASK(0, border_color, ImagickPixel, MAY_BE_STRING, NULL) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, width) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, height) -#endif -ZEND_END_ARG_INFO() - -#if MagickLibVersion >= 0x700 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_borderImageWithComposite, 0, 4, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_borderImageWithComposite, 0, 0, 4) -#endif - - ZEND_ARG_OBJ_TYPE_MASK(0, border_color, ImagickPixel, MAY_BE_STRING, NULL) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, width) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, height) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, composite, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, composite) -#endif -ZEND_END_ARG_INFO() -#endif - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_calculateCrop, 0, 4, IS_ARRAY, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_calculateCrop, 0, 0, 4) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, original_width, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, original_width) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, original_height, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, original_height) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, desired_width, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, desired_width) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, desired_height, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, desired_height) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, legacy, _IS_BOOL, 0, "false") -#else - ZEND_ARG_INFO(0, legacy) -#endif - -ZEND_END_ARG_INFO() - -#define arginfo_class_Imagick_chopImage arginfo_class_Imagick_cropImage - -#define arginfo_class_Imagick_clipImage arginfo_class_Imagick_removeImage - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_clipPathImage, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_clipPathImage, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, pathname, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, pathname) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, inside, _IS_BOOL, 0) -#else - ZEND_ARG_INFO(0, inside) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_clipImagePath, 0, 2, IS_VOID, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_clipImagePath, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, pathname, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, pathname) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, inside, _IS_BOOL, 0) -#else - ZEND_ARG_INFO(0, inside) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_Imagick_coalesceImages arginfo_class_Imagick_clone - -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_colorFloodfillImage, 0, 5, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_colorFloodfillImage, 0, 0, 5) -#endif - - ZEND_ARG_OBJ_TYPE_MASK(0, fill_color, ImagickPixel, MAY_BE_STRING, NULL) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, fuzz, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, fuzz) -#endif - ZEND_ARG_OBJ_TYPE_MASK(0, border_color, ImagickPixel, MAY_BE_STRING, NULL) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, y) -#endif -ZEND_END_ARG_INFO() -#endif - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_colorizeImage, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_colorizeImage, 0, 0, 2) -#endif - - ZEND_ARG_OBJ_TYPE_MASK(0, colorize_color, ImagickPixel, MAY_BE_STRING, NULL) - ZEND_ARG_OBJ_TYPE_MASK(0, opacity_color, ImagickPixel, MAY_BE_STRING|MAY_BE_FALSE, NULL) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, legacy, _IS_BOOL, 1, "false") -#else - ZEND_ARG_INFO(0, legacy) -#endif - -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_compareImageChannels, 0, 3, IS_ARRAY, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_compareImageChannels, 0, 0, 3) -#endif - - ZEND_ARG_OBJ_INFO(0, reference, Imagick, 0) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, channel, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, channel) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, metric, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, metric) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_compareImages, 0, 2, IS_ARRAY, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_compareImages, 0, 0, 2) -#endif - - ZEND_ARG_OBJ_INFO(0, reference, Imagick, 0) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, metric, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, metric) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_contrastImage, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_contrastImage, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, sharpen, _IS_BOOL, 0) -#else - ZEND_ARG_INFO(0, sharpen) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_combineImages, 0, 1, Imagick, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_combineImages, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, colorspace, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, colorspace) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_convolveImage, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_convolveImage, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, kernel, IS_ARRAY, 0) -#else - ZEND_ARG_INFO(0, kernel) -#endif - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_cycleColormapImage, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_cycleColormapImage, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, displace, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, displace) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_Imagick_deconstructImages arginfo_class_Imagick_clone - -#define arginfo_class_Imagick_despeckleImage arginfo_class_Imagick_removeImage - -#define arginfo_class_Imagick_edgeImage arginfo_class_Imagick_oilPaintImage - -#define arginfo_class_Imagick_embossImage arginfo_class_Imagick_charcoalImage - -#define arginfo_class_Imagick_enhanceImage arginfo_class_Imagick_removeImage - -#define arginfo_class_Imagick_equalizeImage arginfo_class_Imagick_removeImage - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_evaluateImage, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_evaluateImage, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, evaluate, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, evaluate) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, constant, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, constant) -#endif - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") -ZEND_END_ARG_INFO() - -#if MagickLibVersion >= 0x687 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_evaluateImages, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_evaluateImages, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, evaluate, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, evaluate) -#endif -ZEND_END_ARG_INFO() -#endif - -#define arginfo_class_Imagick_flattenImages arginfo_class_Imagick_clone - -#define arginfo_class_Imagick_flipImage arginfo_class_Imagick_removeImage - -#define arginfo_class_Imagick_flopImage arginfo_class_Imagick_removeImage - -#if MagickLibVersion >= 0x655 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_forwardFourierTransformImage, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_forwardFourierTransformImage, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, magnitude, _IS_BOOL, 0) -#else - ZEND_ARG_INFO(0, magnitude) -#endif -ZEND_END_ARG_INFO() -#endif - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_frameImage, 0, 5, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_frameImage, 0, 0, 5) -#endif - - ZEND_ARG_OBJ_TYPE_MASK(0, matte_color, ImagickPixel, MAY_BE_STRING, NULL) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, width) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, height) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, inner_bevel, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, inner_bevel) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, outer_bevel, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, outer_bevel) -#endif -ZEND_END_ARG_INFO() - -#if MagickLibVersion >= 0x700 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_frameImageWithComposite, 0, 6, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_frameImageWithComposite, 0, 0, 6) -#endif - - ZEND_ARG_OBJ_TYPE_MASK(0, matte_color, ImagickPixel, MAY_BE_STRING, NULL) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, width) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, height) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, inner_bevel, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, inner_bevel) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, outer_bevel, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, outer_bevel) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, composite, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, composite) -#endif -ZEND_END_ARG_INFO() -#endif - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_fxImage, 0, 1, Imagick, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_fxImage, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, expression, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, expression) -#endif - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_gammaImage, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_gammaImage, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, gamma, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, gamma) -#endif - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") -ZEND_END_ARG_INFO() - -#define arginfo_class_Imagick_gaussianBlurImage arginfo_class_Imagick_blurImage - -#if MagickLibVersion < 0x700 && !defined(MAGICKCORE_EXCLUDE_DEPRECATED) - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageAttribute, 0, 1, IS_STRING, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageAttribute, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, key) -#endif -ZEND_END_ARG_INFO() -#endif - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_getImageBackgroundColor, 0, 0, ImagickPixel, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageBackgroundColor, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() - -#define arginfo_class_Imagick_getImageBluePrimary arginfo_class_Imagick_getImageGeometry - -#define arginfo_class_Imagick_getImageBorderColor arginfo_class_Imagick_getImageBackgroundColor - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageChannelDepth, 0, 1, IS_LONG, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageChannelDepth, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, channel, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, channel) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageChannelDistortion, 0, 3, IS_DOUBLE, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageChannelDistortion, 0, 0, 3) -#endif - - ZEND_ARG_OBJ_INFO(0, reference, Imagick, 0) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, channel, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, channel) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, metric, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, metric) -#endif -ZEND_END_ARG_INFO() - -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageChannelExtrema, 0, 1, IS_ARRAY, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageChannelExtrema, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, channel, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, channel) -#endif -ZEND_END_ARG_INFO() -#endif - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageChannelMean, 0, 1, IS_ARRAY, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageChannelMean, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, channel, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, channel) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_Imagick_getImageChannelStatistics arginfo_class_Imagick_getImageGeometry - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_getImageColormapColor, 0, 1, ImagickPixel, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageColormapColor, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, index) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_Imagick_getImageColorspace arginfo_class_Imagick_getImageSize - -#define arginfo_class_Imagick_getImageCompose arginfo_class_Imagick_getImageSize - -#define arginfo_class_Imagick_getImageDelay arginfo_class_Imagick_getImageSize - -#define arginfo_class_Imagick_getImageDepth arginfo_class_Imagick_getImageSize - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageDistortion, 0, 2, IS_DOUBLE, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageDistortion, 0, 0, 2) -#endif - - ZEND_ARG_OBJ_INFO(0, reference, Imagick, 0) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, metric, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, metric) -#endif -ZEND_END_ARG_INFO() - -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageExtrema, 0, 0, IS_ARRAY, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageExtrema, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#define arginfo_class_Imagick_getImageDispose arginfo_class_Imagick_getImageSize - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageGamma, 0, 0, IS_DOUBLE, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageGamma, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() - -#define arginfo_class_Imagick_getImageGreenPrimary arginfo_class_Imagick_getImageGeometry - -#define arginfo_class_Imagick_getImageHeight arginfo_class_Imagick_getImageSize - -#define arginfo_class_Imagick_getImageHistogram arginfo_class_Imagick_getImageGeometry - -#define arginfo_class_Imagick_getImageInterlaceScheme arginfo_class_Imagick_getImageSize - -#define arginfo_class_Imagick_getImageIterations arginfo_class_Imagick_getImageSize - -#if MagickLibVersion < 0x700 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_getImageMatteColor, 0, 0, ImagickPixel, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageMatteColor, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#define arginfo_class_Imagick_getImagePage arginfo_class_Imagick_getImageGeometry - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_getImagePixelColor, 0, 2, ImagickPixel, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImagePixelColor, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, y) -#endif -ZEND_END_ARG_INFO() - -#if IM_HAVE_IMAGICK_SETIMAGEPIXELCOLOR - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_setImagePixelColor, 0, 3, ImagickPixel, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImagePixelColor, 0, 0, 3) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, y) -#endif - ZEND_ARG_OBJ_TYPE_MASK(0, color, ImagickPixel, MAY_BE_STRING, NULL) -ZEND_END_ARG_INFO() -#endif - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageProfile, 0, 1, IS_STRING, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageProfile, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, name) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_Imagick_getImageRedPrimary arginfo_class_Imagick_getImageGeometry - -#define arginfo_class_Imagick_getImageRenderingIntent arginfo_class_Imagick_getImageSize - -#define arginfo_class_Imagick_getImageResolution arginfo_class_Imagick_getImageGeometry - -#define arginfo_class_Imagick_getImageScene arginfo_class_Imagick_getImageSize - -#define arginfo_class_Imagick_getImageSignature arginfo_class_Imagick___toString - -#define arginfo_class_Imagick_getImageTicksPerSecond arginfo_class_Imagick_getImageSize - -#define arginfo_class_Imagick_getImageType arginfo_class_Imagick_getImageSize - -#define arginfo_class_Imagick_getImageUnits arginfo_class_Imagick_getImageSize - -#define arginfo_class_Imagick_getImageVirtualPixelMethod arginfo_class_Imagick_getImageSize - -#define arginfo_class_Imagick_getImageWhitePoint arginfo_class_Imagick_getImageGeometry - -#define arginfo_class_Imagick_getImageWidth arginfo_class_Imagick_getImageSize - -#define arginfo_class_Imagick_getNumberImages arginfo_class_Imagick_getImageSize - -#define arginfo_class_Imagick_getImageTotalInkDensity arginfo_class_Imagick_getImageGamma - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_getImageRegion, 0, 4, Imagick, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageRegion, 0, 0, 4) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, width) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, height) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, y) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_Imagick_implodeImage arginfo_class_Imagick_oilPaintImage - -#if MagickLibVersion >= 0x700 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_implodeImageWithMethod, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_implodeImageWithMethod, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, radius, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, radius) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, pixel_interpolate_method, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, pixel_interpolate_method) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion >= 0x658 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_inverseFourierTransformImage, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_inverseFourierTransformImage, 0, 0, 2) -#endif - - ZEND_ARG_OBJ_INFO(0, complement, Imagick, 0) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, magnitude, _IS_BOOL, 0) -#else - ZEND_ARG_INFO(0, magnitude) -#endif -ZEND_END_ARG_INFO() -#endif - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_levelImage, 0, 3, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_levelImage, 0, 0, 3) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, black_point, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, black_point) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, gamma, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, gamma) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, white_point, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, white_point) -#endif - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") -ZEND_END_ARG_INFO() - -#define arginfo_class_Imagick_magnifyImage arginfo_class_Imagick_removeImage - -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_mapImage, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_mapImage, 0, 0, 2) -#endif - - ZEND_ARG_OBJ_INFO(0, map, imagick, 0) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, dither, _IS_BOOL, 0) -#else - ZEND_ARG_INFO(0, dither) -#endif -ZEND_END_ARG_INFO() -#endif - -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_matteFloodfillImage, 0, 5, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_matteFloodfillImage, 0, 0, 5) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, alpha, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, alpha) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, fuzz, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, fuzz) -#endif - ZEND_ARG_OBJ_TYPE_MASK(0, border_color, ImagickPixel, MAY_BE_STRING, NULL) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, y) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion < 0x700 && !defined(MAGICKCORE_EXCLUDE_DEPRECATED) - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_medianFilterImage, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_medianFilterImage, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, radius, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, radius) -#endif -ZEND_END_ARG_INFO() -#endif - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_negateImage, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_negateImage, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, gray, _IS_BOOL, 0) -#else - ZEND_ARG_INFO(0, gray) -#endif - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") -ZEND_END_ARG_INFO() - -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_paintOpaqueImage, 0, 3, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_paintOpaqueImage, 0, 0, 3) -#endif - - ZEND_ARG_OBJ_TYPE_MASK(0, target_color, ImagickPixel, MAY_BE_STRING, NULL) - ZEND_ARG_OBJ_TYPE_MASK(0, fill_color, ImagickPixel, MAY_BE_STRING, NULL) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, fuzz, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, fuzz) -#endif - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") -ZEND_END_ARG_INFO() -#endif - -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_paintTransparentImage, 0, 3, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_paintTransparentImage, 0, 0, 3) -#endif - - ZEND_ARG_OBJ_TYPE_MASK(0, target_color, ImagickPixel, MAY_BE_STRING, NULL) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, alpha, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, alpha) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, fuzz, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, fuzz) -#endif -ZEND_END_ARG_INFO() -#endif - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_previewImages, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_previewImages, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, preview, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, preview) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_profileImage, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_profileImage, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, name) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, profile, IS_STRING, 1) -#else - ZEND_ARG_INFO(0, profile) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_quantizeImage, 0, 5, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_quantizeImage, 0, 0, 5) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, number_colors, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, number_colors) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, colorspace, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, colorspace) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, tree_depth, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, tree_depth) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, dither, _IS_BOOL, 0) -#else - ZEND_ARG_INFO(0, dither) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, measure_error, _IS_BOOL, 0) -#else - ZEND_ARG_INFO(0, measure_error) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_Imagick_quantizeImages arginfo_class_Imagick_quantizeImage - -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_reduceNoiseImage, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_reduceNoiseImage, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, radius, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, radius) -#endif -ZEND_END_ARG_INFO() -#endif - -#define arginfo_class_Imagick_removeImageProfile arginfo_class_Imagick_getImageProfile - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_separateImageChannel, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_separateImageChannel, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, channel, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, channel) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_sepiaToneImage, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_sepiaToneImage, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, threshold, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, threshold) -#endif -ZEND_END_ARG_INFO() - -#if MagickLibVersion < 0x700 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageBias, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageBias, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, bias, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, bias) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion < 0x700 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageBiasQuantum, 0, 1, IS_VOID, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageBiasQuantum, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, bias, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, bias) -#endif -ZEND_END_ARG_INFO() -#endif - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageBluePrimary, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageBluePrimary, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, y) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageBorderColor, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageBorderColor, 0, 0, 1) -#endif - - ZEND_ARG_OBJ_TYPE_MASK(0, border_color, ImagickPixel, MAY_BE_STRING, NULL) -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageChannelDepth, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageChannelDepth, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, channel, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, channel) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, depth, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, depth) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageColormapColor, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageColormapColor, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, index) -#endif - ZEND_ARG_OBJ_TYPE_MASK(0, color, ImagickPixel, MAY_BE_STRING, NULL) -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageColorspace, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageColorspace, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, colorspace, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, colorspace) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageDispose, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageDispose, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, dispose, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, dispose) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_Imagick_setImageExtent arginfo_class_Imagick_sampleImage - -#define arginfo_class_Imagick_setImageGreenPrimary arginfo_class_Imagick_setImageBluePrimary - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageInterlaceScheme, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageInterlaceScheme, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, interlace, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, interlace) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageProfile, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageProfile, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, name) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, profile, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, profile) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_Imagick_setImageRedPrimary arginfo_class_Imagick_setImageBluePrimary - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageRenderingIntent, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageRenderingIntent, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, rendering_intent, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, rendering_intent) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageVirtualPixelMethod, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageVirtualPixelMethod, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, method, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, method) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_Imagick_setImageWhitePoint arginfo_class_Imagick_setImageBluePrimary - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_sigmoidalContrastImage, 0, 3, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_sigmoidalContrastImage, 0, 0, 3) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, sharpen, _IS_BOOL, 0) -#else - ZEND_ARG_INFO(0, sharpen) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, alpha, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, alpha) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, beta, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, beta) -#endif - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_stereoImage, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_stereoImage, 0, 0, 1) -#endif - - ZEND_ARG_OBJ_INFO(0, offset_image, Imagick, 0) -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_textureImage, 0, 1, Imagick, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_textureImage, 0, 0, 1) -#endif - - ZEND_ARG_OBJ_INFO(0, texture, Imagick, 0) -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_tintImage, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_tintImage, 0, 0, 2) -#endif - - ZEND_ARG_OBJ_TYPE_MASK(0, tint_color, ImagickPixel, MAY_BE_STRING, NULL) - ZEND_ARG_OBJ_TYPE_MASK(0, opacity_color, ImagickPixel, MAY_BE_STRING, NULL) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, legacy, _IS_BOOL, 0, "false") -#else - ZEND_ARG_INFO(0, legacy) -#endif - -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_unsharpMaskImage, 0, 4, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_unsharpMaskImage, 0, 0, 4) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, radius, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, radius) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, sigma, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, sigma) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, amount, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, amount) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, threshold, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, threshold) -#endif - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") -ZEND_END_ARG_INFO() - -#define arginfo_class_Imagick_getImage arginfo_class_Imagick_clone - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_addImage, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_addImage, 0, 0, 1) -#endif - - ZEND_ARG_OBJ_INFO(0, image, Imagick, 0) -ZEND_END_ARG_INFO() - -#define arginfo_class_Imagick_setImage arginfo_class_Imagick_addImage - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_newImage, 0, 3, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_newImage, 0, 0, 3) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, columns, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, columns) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, rows, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, rows) -#endif - ZEND_ARG_OBJ_TYPE_MASK(0, background_color, ImagickPixel, MAY_BE_STRING, NULL) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, format, IS_STRING, 0, "null") -#else - ZEND_ARG_INFO(0, format) -#endif - -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_newPseudoImage, 0, 3, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_newPseudoImage, 0, 0, 3) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, columns, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, columns) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, rows, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, rows) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, pseudo_format, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, pseudo_format) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_Imagick_getCompression arginfo_class_Imagick_getImageSize - -#define arginfo_class_Imagick_getCompressionQuality arginfo_class_Imagick_getImageSize - -#define arginfo_class_Imagick_getCopyright arginfo_class_Imagick___toString - -#define arginfo_class_Imagick_getConfigureOptions arginfo_class_Imagick_queryFormats - -#if MagickLibVersion > 0x660 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getFeatures, 0, 0, IS_STRING, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getFeatures, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#define arginfo_class_Imagick_getFilename arginfo_class_Imagick___toString - -#define arginfo_class_Imagick_getFormat arginfo_class_Imagick___toString - -#define arginfo_class_Imagick_getHomeURL arginfo_class_Imagick___toString - -#define arginfo_class_Imagick_getInterlaceScheme arginfo_class_Imagick_getImageSize - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getOption, 0, 1, IS_STRING, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getOption, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, key) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_Imagick_getPackageName arginfo_class_Imagick___toString - -#define arginfo_class_Imagick_getPage arginfo_class_Imagick_getImageGeometry - -#define arginfo_class_Imagick_getQuantum arginfo_class_Imagick_getImageSize - -#define arginfo_class_Imagick_getHdriEnabled arginfo_class_Imagick_removeImage - -#define arginfo_class_Imagick_getQuantumDepth arginfo_class_Imagick_getImageGeometry - -#define arginfo_class_Imagick_getQuantumRange arginfo_class_Imagick_getImageGeometry - -#define arginfo_class_Imagick_getReleaseDate arginfo_class_Imagick___toString - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getResource, 0, 1, IS_LONG, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getResource, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, type) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_Imagick_getResourceLimit arginfo_class_Imagick_getResource - -#define arginfo_class_Imagick_getSamplingFactors arginfo_class_Imagick_getImageGeometry - -#define arginfo_class_Imagick_getSize arginfo_class_Imagick_getImageGeometry - -#define arginfo_class_Imagick_getVersion arginfo_class_Imagick_getImageGeometry - -#define arginfo_class_Imagick_setBackgroundColor arginfo_class_Imagick_setImageBackgroundColor - -#define arginfo_class_Imagick_setCompression arginfo_class_Imagick_setImageCompression - -#define arginfo_class_Imagick_setCompressionQuality arginfo_class_Imagick_setImageCompressionQuality - -#define arginfo_class_Imagick_setFilename arginfo_class_Imagick_readImage - -#define arginfo_class_Imagick_setFormat arginfo_class_Imagick_setImageFormat - -#define arginfo_class_Imagick_setInterlaceScheme arginfo_class_Imagick_setImageInterlaceScheme - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setOption, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setOption, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, key) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, value) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_Imagick_setPage arginfo_class_Imagick_cropImage - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setResourceLimit, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setResourceLimit, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, type) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, limit, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, limit) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_Imagick_setResolution arginfo_class_Imagick_setImageResolution - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setSamplingFactors, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setSamplingFactors, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, factors, IS_ARRAY, 0) -#else - ZEND_ARG_INFO(0, factors) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_Imagick_setSize arginfo_class_Imagick_sampleImage - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setType, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setType, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, imgtype, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, imgtype) -#endif -ZEND_END_ARG_INFO() - -#if MagickLibVersion > 0x628 -#define arginfo_class_Imagick_key arginfo_class_Imagick_getSizeOffset -#endif - -#if MagickLibVersion > 0x628 -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_next, 0, 0, IS_VOID, 0) -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 -#define arginfo_class_Imagick_rewind arginfo_class_Imagick_next -#endif - -#if MagickLibVersion > 0x628 -#define arginfo_class_Imagick_valid arginfo_class_Imagick_optimizeImageLayers -#endif - -#if MagickLibVersion > 0x628 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_current, 0, 0, Imagick, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_current, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x659 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_brightnessContrastImage, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_brightnessContrastImage, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, brightness, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, brightness) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, contrast, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, contrast) -#endif - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && MagickLibVersion > 0x661 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_colorMatrixImage, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_colorMatrixImage, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, color_matrix, IS_ARRAY, 0) -#else - ZEND_ARG_INFO(0, color_matrix) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_selectiveBlurImage, 0, 3, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_selectiveBlurImage, 0, 0, 3) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, radius, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, radius) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, sigma, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, sigma) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, threshold, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, threshold) -#endif - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x689 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_rotationalBlurImage, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_rotationalBlurImage, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, angle, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, angle) -#endif - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x683 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_statisticImage, 0, 3, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_statisticImage, 0, 0, 3) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, type) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, width) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, height) -#endif - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x652 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_subimageMatch, 0, 1, Imagick, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_subimageMatch, 0, 0, 1) -#endif - - ZEND_ARG_OBJ_INFO(0, image, Imagick, 0) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(1, offset, IS_ARRAY, 1, "null") -#else - ZEND_ARG_INFO(1, offset) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(1, similarity, IS_DOUBLE, 1, "null") -#else - ZEND_ARG_INFO(1, similarity) -#endif - - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, threshold, IS_DOUBLE, 0, "0.0") - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, metric, IS_LONG, 0, "0") -#else - ZEND_ARG_INFO(0, metric) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x652 -#define arginfo_class_Imagick_similarityImage arginfo_class_Imagick_subimageMatch -#endif - -#if MagickLibVersion > 0x628 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setRegistry, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setRegistry, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, key) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, value) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getRegistry, 0, 1, IS_STRING, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getRegistry, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, key) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_listRegistry, 0, 0, IS_ARRAY, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_listRegistry, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x680 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_morphology, 0, 3, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_morphology, 0, 0, 3) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, morphology, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, morphology) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, iterations, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, iterations) -#endif - ZEND_ARG_OBJ_INFO(0, kernel, ImagickKernel, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && defined(IMAGICK_WITH_KERNEL) && MagickLibVersion < 0x700 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_filter, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_filter, 0, 0, 1) -#endif - - ZEND_ARG_OBJ_INFO(0, kernel, ImagickKernel, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_UNDEFINED") -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setAntialias, 0, 1, IS_VOID, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setAntialias, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, antialias, _IS_BOOL, 0) -#else - ZEND_ARG_INFO(0, antialias) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 -#define arginfo_class_Imagick_getAntialias arginfo_class_Imagick_optimizeImageLayers -#endif - -#if MagickLibVersion > 0x628 && MagickLibVersion > 0x676 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_colorDecisionListImage, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_colorDecisionListImage, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, color_correction_collection, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, color_correction_collection) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x687 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_optimizeImageTransparency, 0, 0, IS_VOID, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_optimizeImageTransparency, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x660 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_autoGammaImage, 0, 0, IS_VOID, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_autoGammaImage, 0, 0, 0) -#endif - - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 1, "Imagick::CHANNEL_ALL") -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x692 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_autoOrient, 0, 0, IS_VOID, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_autoOrient, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x692 -#define arginfo_class_Imagick_autoOrientate arginfo_class_Imagick_autoOrient -#endif - -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x692 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_compositeImageGravity, 0, 3, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_compositeImageGravity, 0, 0, 3) -#endif - - ZEND_ARG_OBJ_INFO(0, image, Imagick, 0) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, composite_constant, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, composite_constant) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, gravity, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, gravity) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x693 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_localContrastImage, 0, 2, IS_VOID, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_localContrastImage, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, radius, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, radius) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, strength, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, strength) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x700 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_identifyImageType, 0, 0, IS_LONG, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_identifyImageType, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GETSETIMAGEMASK - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_getImageMask, 0, 1, Imagick, 1) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageMask, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, pixelmask, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, pixelmask) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GETSETIMAGEMASK - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageMask, 0, 2, IS_VOID, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageMask, 0, 0, 2) -#endif - - ZEND_ARG_OBJ_INFO(0, clip_mask, Imagick, 0) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, pixelmask, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, pixelmask) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x709 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_cannyEdgeImage, 0, 4, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_cannyEdgeImage, 0, 0, 4) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, radius, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, radius) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, sigma, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, sigma) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, lower_percent, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, lower_percent) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, upper_percent, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, upper_percent) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_SETSEED - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setSeed, 0, 1, IS_VOID, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setSeed, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, seed, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, seed) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_WAVELETDENOISEIMAGE - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_waveletDenoiseImage, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_waveletDenoiseImage, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, threshold, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, threshold) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, softness, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, softness) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_MEANSHIFTIMAGE - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_meanShiftImage, 0, 3, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_meanShiftImage, 0, 0, 3) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, width) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, height) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, color_distance, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, color_distance) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_KMEANSIMAGE - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_kmeansImage, 0, 3, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_kmeansImage, 0, 0, 3) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, number_colors, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, number_colors) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, max_iterations, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, max_iterations) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, tolerance, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, tolerance) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_RANGETHRESHOLDIMAGE - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_rangeThresholdImage, 0, 4, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_rangeThresholdImage, 0, 0, 4) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, low_black, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, low_black) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, low_white, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, low_white) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, high_white, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, high_white) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, high_black, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, high_black) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_AUTOTHRESHOLDIMAGE - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_autoThresholdImage, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_autoThresholdImage, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, auto_threshold_method, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, auto_threshold_method) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_BILATERALBLURIMAGE - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_bilateralBlurImage, 0, 4, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_bilateralBlurImage, 0, 0, 4) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, radius, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, radius) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, sigma, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, sigma) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, intensity_sigma, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, intensity_sigma) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, spatial_sigma, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, spatial_sigma) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_CLAHEIMAGE - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_claheImage, 0, 4, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_claheImage, 0, 0, 4) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, width) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, height) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, number_bins, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, number_bins) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, clip_limit, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, clip_limit) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_CHANNELFXIMAGE - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_channelFxImage, 0, 1, Imagick, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_channelFxImage, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, expression, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, expression) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_COLORTHRESHOLDIMAGE - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_colorThresholdImage, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_colorThresholdImage, 0, 0, 2) -#endif - - ZEND_ARG_OBJ_TYPE_MASK(0, start_color, ImagickPixel, MAY_BE_STRING, NULL) - ZEND_ARG_OBJ_TYPE_MASK(0, stop_color, ImagickPixel, MAY_BE_STRING, NULL) -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_COMPLEXIMAGES - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_complexImages, 0, 1, Imagick, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_complexImages, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, complex_operator, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, complex_operator) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_INTERPOLATIVERESIZEIMAGE - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_interpolativeResizeImage, 0, 3, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_interpolativeResizeImage, 0, 0, 3) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, columns, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, columns) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, rows, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, rows) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, interpolate, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, interpolate) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_LEVELIMAGECOLORS - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_levelImageColors, 0, 3, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_levelImageColors, 0, 0, 3) -#endif - - ZEND_ARG_OBJ_TYPE_MASK(0, black_color, ImagickPixel, MAY_BE_STRING, NULL) - ZEND_ARG_OBJ_TYPE_MASK(0, white_color, ImagickPixel, MAY_BE_STRING, NULL) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, invert, _IS_BOOL, 0) -#else - ZEND_ARG_INFO(0, invert) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_LEVELIZEIMAGE - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_levelizeImage, 0, 3, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_levelizeImage, 0, 0, 3) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, black_point, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, black_point) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, gamma, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, gamma) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, white_point, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, white_point) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_ORDEREDDITHERIMAGE - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_orderedDitherImage, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_orderedDitherImage, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, dither_format, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, dither_format) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_WHITEBALANCEIMAGE - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_whiteBalanceImage, 0, 0, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_whiteBalanceImage, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_DELETE_OPTION - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_deleteOption, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_deleteOption, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, option, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, option) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_BACKGROUND_COLOR - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_getBackgroundColor, 0, 0, ImagickPixel, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getBackgroundColor, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_IMAGE_ARTIFACTS - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageArtifacts, 0, 0, IS_ARRAY, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageArtifacts, 0, 0, 0) -#endif - - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 0, "\"*\"") -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_IMAGE_KURTOSIS - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageKurtosis, 0, 0, IS_ARRAY, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageKurtosis, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_IMAGE_MEAN - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageMean, 0, 0, IS_ARRAY, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageMean, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_IMAGE_RANGE - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageRange, 0, 0, IS_ARRAY, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageRange, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_INTERPOLATE_METHOD - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getInterpolateMethod, 0, 0, IS_LONG, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getInterpolateMethod, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_OPTIONS - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getOptions, 0, 0, IS_ARRAY, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getOptions, 0, 0, 0) -#endif - - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 0, "\"*\"") -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_ORIENTATION - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getOrientation, 0, 0, IS_LONG, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getOrientation, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_RESOLUTION - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getResolution, 0, 0, IS_ARRAY, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getResolution, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_TYPE - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getType, 0, 0, IS_LONG, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getType, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_POLYNOMIAL_IMAGE - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_polynomialImage, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_polynomialImage, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, terms, IS_ARRAY, 0) -#else - ZEND_ARG_INFO(0, terms) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_SET_DEPTH - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setDepth, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setDepth, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, depth, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, depth) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_SET_EXTRACT - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setExtract, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setExtract, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, geometry, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, geometry) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_SET_INTERPOLATE_METHOD - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setInterpolateMethod, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setInterpolateMethod, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, method, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, method) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_SET_ORIENTATION - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setOrientation, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setOrientation, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, orientation, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, orientation) -#endif -ZEND_END_ARG_INFO() -#endif - - -#if MagickLibVersion > 0x628 -ZEND_METHOD(Imagick, optimizeImageLayers); -#endif -#if MagickLibVersion > 0x628 -ZEND_METHOD(Imagick, compareImageLayers); -#endif -#if MagickLibVersion > 0x628 -ZEND_METHOD(Imagick, pingImageBlob); -#endif -#if MagickLibVersion > 0x628 -ZEND_METHOD(Imagick, pingImageFile); -#endif -#if MagickLibVersion > 0x628 -ZEND_METHOD(Imagick, transposeImage); -#endif -#if MagickLibVersion > 0x628 -ZEND_METHOD(Imagick, transverseImage); -#endif -#if MagickLibVersion > 0x628 -ZEND_METHOD(Imagick, trimImage); -#endif -#if MagickLibVersion > 0x628 -ZEND_METHOD(Imagick, waveImage); -#endif -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x700 -ZEND_METHOD(Imagick, waveImageWithMethod); -#endif -#if MagickLibVersion > 0x628 -ZEND_METHOD(Imagick, vignetteImage); -#endif -#if MagickLibVersion > 0x628 -ZEND_METHOD(Imagick, uniqueImageColors); -#endif -#if MagickLibVersion > 0x628 && !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 -ZEND_METHOD(Imagick, getImageMatte); -#endif -#if MagickLibVersion > 0x628 -ZEND_METHOD(Imagick, setImageMatte); -#endif -#if MagickLibVersion > 0x628 -ZEND_METHOD(Imagick, adaptiveResizeImage); -#endif -#if MagickLibVersion > 0x628 -ZEND_METHOD(Imagick, sketchImage); -#endif -#if MagickLibVersion > 0x628 -ZEND_METHOD(Imagick, shadeImage); -#endif -#if MagickLibVersion > 0x628 -ZEND_METHOD(Imagick, getSizeOffset); -#endif -#if MagickLibVersion > 0x628 -ZEND_METHOD(Imagick, setSizeOffset); -#endif -#if MagickLibVersion > 0x628 -ZEND_METHOD(Imagick, adaptiveBlurImage); -#endif -#if MagickLibVersion > 0x628 -ZEND_METHOD(Imagick, contrastStretchImage); -#endif -#if MagickLibVersion > 0x628 -ZEND_METHOD(Imagick, adaptiveSharpenImage); -#endif -#if MagickLibVersion > 0x628 -ZEND_METHOD(Imagick, randomThresholdImage); -#endif -#if MagickLibVersion > 0x628 -ZEND_METHOD(Imagick, roundCornersImage); -#endif -#if MagickLibVersion > 0x628 -ZEND_METHOD(Imagick, setIteratorIndex); -#endif -#if MagickLibVersion > 0x628 -ZEND_METHOD(Imagick, getIteratorIndex); -#endif -#if MagickLibVersion > 0x628 && MagickLibVersion < 0x700 -ZEND_METHOD(Imagick, transformImage); -#endif -#if MagickLibVersion > 0x630 && MagickLibVersion < 0x700 -ZEND_METHOD(Imagick, setImageOpacity); -#endif -#if MagickLibVersion > 0x630 && MagickLibVersion >= 0x700 -ZEND_METHOD(Imagick, setImageAlpha); -#endif -#if MagickLibVersion > 0x630 && MagickLibVersion < 0x700 -ZEND_METHOD(Imagick, orderedPosterizeImage); -#endif -#if MagickLibVersion >= 0x700 -ZEND_METHOD(Imagick, polaroidWithTextAndMethod); -#endif -#if MagickLibVersion > 0x631 -ZEND_METHOD(Imagick, polaroidImage); -#endif -#if MagickLibVersion > 0x631 -ZEND_METHOD(Imagick, getImageProperty); -#endif -#if MagickLibVersion > 0x631 -ZEND_METHOD(Imagick, setImageProperty); -#endif -#if MagickLibVersion > 0x631 -ZEND_METHOD(Imagick, deleteImageProperty); -#endif -#if MagickLibVersion > 0x631 -ZEND_METHOD(Imagick, identifyFormat); -#endif -#if MagickLibVersion > 0x631 && IM_HAVE_IMAGICK_SETIMAGEINTERPOLATEMETHOD -ZEND_METHOD(Imagick, setImageInterpolateMethod); -#endif -#if MagickLibVersion > 0x631 -ZEND_METHOD(Imagick, getImageInterpolateMethod); -#endif -#if MagickLibVersion > 0x631 -ZEND_METHOD(Imagick, linearStretchImage); -#endif -#if MagickLibVersion > 0x631 -ZEND_METHOD(Imagick, getImageLength); -#endif -#if MagickLibVersion > 0x631 -ZEND_METHOD(Imagick, extentImage); -#endif -#if MagickLibVersion > 0x633 -ZEND_METHOD(Imagick, getImageOrientation); -#endif -#if MagickLibVersion > 0x633 -ZEND_METHOD(Imagick, setImageOrientation); -#endif -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion > 0x634 && MagickLibVersion < 0x700 -ZEND_METHOD(Imagick, paintFloodfillImage); -#endif -#if MagickLibVersion > 0x635 -ZEND_METHOD(Imagick, clutImage); -#endif -#if MagickLibVersion > 0x635 -ZEND_METHOD(Imagick, getImageProperties); -#endif -#if MagickLibVersion > 0x635 -ZEND_METHOD(Imagick, getImageProfiles); -#endif -#if MagickLibVersion > 0x635 -ZEND_METHOD(Imagick, distortImage); -#endif -#if MagickLibVersion > 0x635 -ZEND_METHOD(Imagick, writeImageFile); -#endif -#if MagickLibVersion > 0x635 -ZEND_METHOD(Imagick, writeImagesFile); -#endif -#if MagickLibVersion > 0x635 -ZEND_METHOD(Imagick, resetImagePage); -#endif -#if MagickLibVersion > 0x635 && MagickLibVersion < 0x700 -ZEND_METHOD(Imagick, setImageClipMask); -#endif -#if MagickLibVersion > 0x635 && MagickLibVersion < 0x700 -ZEND_METHOD(Imagick, getImageClipMask); -#endif -#if MagickLibVersion > 0x635 -ZEND_METHOD(Imagick, animateImages); -#endif -#if MagickLibVersion > 0x635 && !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 -ZEND_METHOD(Imagick, recolorImage); -#endif -#if MagickLibVersion > 0x636 -ZEND_METHOD(Imagick, setFont); -#endif -#if MagickLibVersion > 0x636 -ZEND_METHOD(Imagick, getFont); -#endif -#if MagickLibVersion > 0x636 -ZEND_METHOD(Imagick, setPointSize); -#endif -#if MagickLibVersion > 0x636 -ZEND_METHOD(Imagick, getPointSize); -#endif -#if MagickLibVersion > 0x636 -ZEND_METHOD(Imagick, mergeImageLayers); -#endif -#if MagickLibVersion > 0x637 -ZEND_METHOD(Imagick, setImageAlphaChannel); -#endif -#if MagickLibVersion > 0x637 -ZEND_METHOD(Imagick, floodfillPaintImage); -#endif -#if MagickLibVersion > 0x637 -ZEND_METHOD(Imagick, opaquePaintImage); -#endif -#if MagickLibVersion > 0x637 -ZEND_METHOD(Imagick, transparentPaintImage); -#endif -#if MagickLibVersion > 0x638 -ZEND_METHOD(Imagick, liquidRescaleImage); -#endif -#if MagickLibVersion > 0x638 -ZEND_METHOD(Imagick, encipherImage); -#endif -#if MagickLibVersion > 0x638 -ZEND_METHOD(Imagick, decipherImage); -#endif -#if MagickLibVersion > 0x639 -ZEND_METHOD(Imagick, setGravity); -#endif -#if MagickLibVersion > 0x639 -ZEND_METHOD(Imagick, getGravity); -#endif -#if MagickLibVersion > 0x639 -ZEND_METHOD(Imagick, getImageChannelRange); -#endif -#if MagickLibVersion > 0x639 -ZEND_METHOD(Imagick, getImageAlphaChannel); -#endif -#if MagickLibVersion > 0x642 -ZEND_METHOD(Imagick, getImageChannelDistortions); -#endif -#if MagickLibVersion > 0x643 -ZEND_METHOD(Imagick, setImageGravity); -#endif -#if MagickLibVersion > 0x643 -ZEND_METHOD(Imagick, getImageGravity); -#endif -#if MagickLibVersion > 0x645 -ZEND_METHOD(Imagick, importImagePixels); -#endif -#if MagickLibVersion > 0x645 -ZEND_METHOD(Imagick, deskewImage); -#endif -#if MagickLibVersion > 0x645 -ZEND_METHOD(Imagick, segmentImage); -#endif -#if MagickLibVersion > 0x645 -ZEND_METHOD(Imagick, sparseColorImage); -#endif -#if MagickLibVersion > 0x645 -ZEND_METHOD(Imagick, remapImage); -#endif -#if PHP_IMAGICK_HAVE_HOUGHLINE -ZEND_METHOD(Imagick, houghLineImage); -#endif -#if MagickLibVersion > 0x646 -ZEND_METHOD(Imagick, exportImagePixels); -#endif -#if MagickLibVersion > 0x648 -ZEND_METHOD(Imagick, getImageChannelKurtosis); -#endif -#if MagickLibVersion > 0x648 -ZEND_METHOD(Imagick, functionImage); -#endif -#if MagickLibVersion > 0x651 -ZEND_METHOD(Imagick, transformImageColorspace); -#endif -#if MagickLibVersion > 0x652 -ZEND_METHOD(Imagick, haldClutImage); -#endif -#if MagickLibVersion > 0x655 -ZEND_METHOD(Imagick, autoLevelImage); -#endif -#if MagickLibVersion > 0x655 -ZEND_METHOD(Imagick, blueShiftImage); -#endif -#if MagickLibVersion > 0x656 -ZEND_METHOD(Imagick, getImageArtifact); -#endif -#if MagickLibVersion > 0x656 -ZEND_METHOD(Imagick, setImageArtifact); -#endif -#if MagickLibVersion > 0x656 -ZEND_METHOD(Imagick, deleteImageArtifact); -#endif -#if MagickLibVersion > 0x656 -ZEND_METHOD(Imagick, getColorspace); -#endif -#if MagickLibVersion > 0x656 -ZEND_METHOD(Imagick, setColorspace); -#endif -#if MagickLibVersion > 0x656 -ZEND_METHOD(Imagick, clampImage); -#endif -#if MagickLibVersion > 0x667 -ZEND_METHOD(Imagick, smushImages); -#endif -ZEND_METHOD(Imagick, __construct); -ZEND_METHOD(Imagick, __toString); -#if PHP_VERSION_ID >= 50600 -ZEND_METHOD(Imagick, count); -#endif -#if !(PHP_VERSION_ID >= 50600) -ZEND_METHOD(Imagick, count); -#endif -ZEND_METHOD(Imagick, getPixelIterator); -ZEND_METHOD(Imagick, getPixelRegionIterator); -ZEND_METHOD(Imagick, readImage); -ZEND_METHOD(Imagick, readImages); -ZEND_METHOD(Imagick, readImageBlob); -ZEND_METHOD(Imagick, setImageFormat); -ZEND_METHOD(Imagick, scaleImage); -ZEND_METHOD(Imagick, writeImage); -ZEND_METHOD(Imagick, writeImages); -ZEND_METHOD(Imagick, blurImage); -ZEND_METHOD(Imagick, thumbnailImage); -ZEND_METHOD(Imagick, cropThumbnailImage); -ZEND_METHOD(Imagick, getImageFilename); -ZEND_METHOD(Imagick, setImageFilename); -ZEND_METHOD(Imagick, getImageFormat); -ZEND_METHOD(Imagick, getImageMimeType); -ZEND_METHOD(Imagick, removeImage); -ZEND_METHOD(Imagick, clear); -ZEND_METHOD(Imagick, clone); -ZEND_METHOD(Imagick, getImageSize); -ZEND_METHOD(Imagick, getImageBlob); -ZEND_METHOD(Imagick, getImagesBlob); -ZEND_METHOD(Imagick, setFirstIterator); -ZEND_METHOD(Imagick, setLastIterator); -ZEND_METHOD(Imagick, resetIterator); -ZEND_METHOD(Imagick, previousImage); -ZEND_METHOD(Imagick, nextImage); -ZEND_METHOD(Imagick, hasPreviousImage); -ZEND_METHOD(Imagick, hasNextImage); -ZEND_METHOD(Imagick, setImageIndex); -ZEND_METHOD(Imagick, getImageIndex); -ZEND_METHOD(Imagick, commentImage); -ZEND_METHOD(Imagick, cropImage); -ZEND_METHOD(Imagick, labelImage); -ZEND_METHOD(Imagick, getImageGeometry); -ZEND_METHOD(Imagick, drawImage); -ZEND_METHOD(Imagick, setImageCompressionQuality); -ZEND_METHOD(Imagick, getImageCompressionQuality); -ZEND_METHOD(Imagick, setImageCompression); -ZEND_METHOD(Imagick, getImageCompression); -ZEND_METHOD(Imagick, annotateImage); -ZEND_METHOD(Imagick, compositeImage); -ZEND_METHOD(Imagick, modulateImage); -ZEND_METHOD(Imagick, getImageColors); -ZEND_METHOD(Imagick, montageImage); -ZEND_METHOD(Imagick, identifyImage); -ZEND_METHOD(Imagick, thresholdImage); -ZEND_METHOD(Imagick, adaptiveThresholdImage); -ZEND_METHOD(Imagick, blackThresholdImage); -ZEND_METHOD(Imagick, whiteThresholdImage); -ZEND_METHOD(Imagick, appendImages); -ZEND_METHOD(Imagick, charcoalImage); -ZEND_METHOD(Imagick, normalizeImage); -#if MagickLibVersion >= 0x700 -ZEND_METHOD(Imagick, oilPaintImageWithSigma); -#endif -ZEND_METHOD(Imagick, oilPaintImage); -ZEND_METHOD(Imagick, posterizeImage); -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 -ZEND_METHOD(Imagick, radialBlurImage); -#endif -ZEND_METHOD(Imagick, raiseImage); -ZEND_METHOD(Imagick, resampleImage); -ZEND_METHOD(Imagick, resizeImage); -ZEND_METHOD(Imagick, rollImage); -ZEND_METHOD(Imagick, rotateImage); -ZEND_METHOD(Imagick, sampleImage); -ZEND_METHOD(Imagick, solarizeImage); -ZEND_METHOD(Imagick, shadowImage); -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 -ZEND_METHOD(Imagick, setImageAttribute); -#endif -ZEND_METHOD(Imagick, setImageBackgroundColor); -#if MagickLibVersion >= 0x700 -ZEND_METHOD(Imagick, setImageChannelMask); -#endif -ZEND_METHOD(Imagick, setImageCompose); -ZEND_METHOD(Imagick, setImageDelay); -ZEND_METHOD(Imagick, setImageDepth); -ZEND_METHOD(Imagick, setImageGamma); -ZEND_METHOD(Imagick, setImageIterations); -#if MagickLibVersion < 0x700 || MagickLibVersion >= 0x705 -ZEND_METHOD(Imagick, setImageMatteColor); -#endif -ZEND_METHOD(Imagick, setImagePage); -ZEND_METHOD(Imagick, setImageProgressMonitor); -#if MagickLibVersion > 0x653 -ZEND_METHOD(Imagick, setProgressMonitor); -#endif -ZEND_METHOD(Imagick, setImageResolution); -ZEND_METHOD(Imagick, setImageScene); -ZEND_METHOD(Imagick, setImageTicksPerSecond); -ZEND_METHOD(Imagick, setImageType); -ZEND_METHOD(Imagick, setImageUnits); -ZEND_METHOD(Imagick, sharpenImage); -ZEND_METHOD(Imagick, shaveImage); -ZEND_METHOD(Imagick, shearImage); -ZEND_METHOD(Imagick, spliceImage); -ZEND_METHOD(Imagick, pingImage); -ZEND_METHOD(Imagick, readImageFile); -ZEND_METHOD(Imagick, displayImage); -ZEND_METHOD(Imagick, displayImages); -ZEND_METHOD(Imagick, spreadImage); -#if MagickLibVersion >= 0x700 -ZEND_METHOD(Imagick, spreadImageWithMethod); -#endif -ZEND_METHOD(Imagick, swirlImage); -#if MagickLibVersion >= 0x700 -ZEND_METHOD(Imagick, swirlImageWithMethod); -#endif -ZEND_METHOD(Imagick, stripImage); -ZEND_METHOD(Imagick, queryFormats); -ZEND_METHOD(Imagick, queryFonts); -ZEND_METHOD(Imagick, queryFontMetrics); -ZEND_METHOD(Imagick, steganoImage); -ZEND_METHOD(Imagick, addNoiseImage); -#if IM_HAVE_IMAGICK_ADD_NOISE_WITH_ATTENUATE -ZEND_METHOD(Imagick, addNoiseImageWithAttenuate); -#endif -ZEND_METHOD(Imagick, motionBlurImage); -#if MagickLibVersion < 0x700 && !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -ZEND_METHOD(Imagick, mosaicImages); -#endif -ZEND_METHOD(Imagick, morphImages); -ZEND_METHOD(Imagick, minifyImage); -ZEND_METHOD(Imagick, affineTransformImage); -ZEND_METHOD(Imagick, averageImages); -ZEND_METHOD(Imagick, borderImage); -#if MagickLibVersion >= 0x700 -ZEND_METHOD(Imagick, borderImageWithComposite); -#endif -ZEND_METHOD(Imagick, calculateCrop); -ZEND_METHOD(Imagick, chopImage); -ZEND_METHOD(Imagick, clipImage); -ZEND_METHOD(Imagick, clipPathImage); -ZEND_METHOD(Imagick, coalesceImages); -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 -ZEND_METHOD(Imagick, colorFloodfillImage); -#endif -ZEND_METHOD(Imagick, colorizeImage); -ZEND_METHOD(Imagick, compareImageChannels); -ZEND_METHOD(Imagick, compareImages); -ZEND_METHOD(Imagick, contrastImage); -ZEND_METHOD(Imagick, combineImages); -ZEND_METHOD(Imagick, convolveImage); -ZEND_METHOD(Imagick, cycleColormapImage); -ZEND_METHOD(Imagick, deconstructImages); -ZEND_METHOD(Imagick, despeckleImage); -ZEND_METHOD(Imagick, edgeImage); -ZEND_METHOD(Imagick, embossImage); -ZEND_METHOD(Imagick, enhanceImage); -ZEND_METHOD(Imagick, equalizeImage); -ZEND_METHOD(Imagick, evaluateImage); -#if MagickLibVersion >= 0x687 -ZEND_METHOD(Imagick, evaluateImages); -#endif -ZEND_METHOD(Imagick, flattenImages); -ZEND_METHOD(Imagick, flipImage); -ZEND_METHOD(Imagick, flopImage); -#if MagickLibVersion >= 0x655 -ZEND_METHOD(Imagick, forwardFourierTransformImage); -#endif -ZEND_METHOD(Imagick, frameImage); -#if MagickLibVersion >= 0x700 -ZEND_METHOD(Imagick, frameImageWithComposite); -#endif -ZEND_METHOD(Imagick, fxImage); -ZEND_METHOD(Imagick, gammaImage); -ZEND_METHOD(Imagick, gaussianBlurImage); -#if MagickLibVersion < 0x700 && !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -ZEND_METHOD(Imagick, getImageAttribute); -#endif -ZEND_METHOD(Imagick, getImageBackgroundColor); -ZEND_METHOD(Imagick, getImageBluePrimary); -ZEND_METHOD(Imagick, getImageBorderColor); -ZEND_METHOD(Imagick, getImageChannelDepth); -ZEND_METHOD(Imagick, getImageChannelDistortion); -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 -ZEND_METHOD(Imagick, getImageChannelExtrema); -#endif -ZEND_METHOD(Imagick, getImageChannelMean); -ZEND_METHOD(Imagick, getImageChannelStatistics); -ZEND_METHOD(Imagick, getImageColormapColor); -ZEND_METHOD(Imagick, getImageColorspace); -ZEND_METHOD(Imagick, getImageCompose); -ZEND_METHOD(Imagick, getImageDelay); -ZEND_METHOD(Imagick, getImageDepth); -ZEND_METHOD(Imagick, getImageDistortion); -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 -ZEND_METHOD(Imagick, getImageExtrema); -#endif -ZEND_METHOD(Imagick, getImageDispose); -ZEND_METHOD(Imagick, getImageGamma); -ZEND_METHOD(Imagick, getImageGreenPrimary); -ZEND_METHOD(Imagick, getImageHeight); -ZEND_METHOD(Imagick, getImageHistogram); -ZEND_METHOD(Imagick, getImageInterlaceScheme); -ZEND_METHOD(Imagick, getImageIterations); -#if MagickLibVersion < 0x700 -ZEND_METHOD(Imagick, getImageMatteColor); -#endif -ZEND_METHOD(Imagick, getImagePage); -ZEND_METHOD(Imagick, getImagePixelColor); -#if IM_HAVE_IMAGICK_SETIMAGEPIXELCOLOR -ZEND_METHOD(Imagick, setImagePixelColor); -#endif -ZEND_METHOD(Imagick, getImageProfile); -ZEND_METHOD(Imagick, getImageRedPrimary); -ZEND_METHOD(Imagick, getImageRenderingIntent); -ZEND_METHOD(Imagick, getImageResolution); -ZEND_METHOD(Imagick, getImageScene); -ZEND_METHOD(Imagick, getImageSignature); -ZEND_METHOD(Imagick, getImageTicksPerSecond); -ZEND_METHOD(Imagick, getImageType); -ZEND_METHOD(Imagick, getImageUnits); -ZEND_METHOD(Imagick, getImageVirtualPixelMethod); -ZEND_METHOD(Imagick, getImageWhitePoint); -ZEND_METHOD(Imagick, getImageWidth); -ZEND_METHOD(Imagick, getNumberImages); -ZEND_METHOD(Imagick, getImageTotalInkDensity); -ZEND_METHOD(Imagick, getImageRegion); -ZEND_METHOD(Imagick, implodeImage); -#if MagickLibVersion >= 0x700 -ZEND_METHOD(Imagick, implodeImageWithMethod); -#endif -#if MagickLibVersion >= 0x658 -ZEND_METHOD(Imagick, inverseFourierTransformImage); -#endif -ZEND_METHOD(Imagick, levelImage); -ZEND_METHOD(Imagick, magnifyImage); -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 -ZEND_METHOD(Imagick, mapImage); -#endif -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 -ZEND_METHOD(Imagick, matteFloodfillImage); -#endif -#if MagickLibVersion < 0x700 && !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -ZEND_METHOD(Imagick, medianFilterImage); -#endif -ZEND_METHOD(Imagick, negateImage); -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 -ZEND_METHOD(Imagick, paintOpaqueImage); -#endif -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 -ZEND_METHOD(Imagick, paintTransparentImage); -#endif -ZEND_METHOD(Imagick, previewImages); -ZEND_METHOD(Imagick, profileImage); -ZEND_METHOD(Imagick, quantizeImage); -ZEND_METHOD(Imagick, quantizeImages); -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 -ZEND_METHOD(Imagick, reduceNoiseImage); -#endif -ZEND_METHOD(Imagick, removeImageProfile); -ZEND_METHOD(Imagick, separateImageChannel); -ZEND_METHOD(Imagick, sepiaToneImage); -#if MagickLibVersion < 0x700 -ZEND_METHOD(Imagick, setImageBias); -#endif -#if MagickLibVersion < 0x700 -ZEND_METHOD(Imagick, setImageBiasQuantum); -#endif -ZEND_METHOD(Imagick, setImageBluePrimary); -ZEND_METHOD(Imagick, setImageBorderColor); -ZEND_METHOD(Imagick, setImageChannelDepth); -ZEND_METHOD(Imagick, setImageColormapColor); -ZEND_METHOD(Imagick, setImageColorspace); -ZEND_METHOD(Imagick, setImageDispose); -ZEND_METHOD(Imagick, setImageExtent); -ZEND_METHOD(Imagick, setImageGreenPrimary); -ZEND_METHOD(Imagick, setImageInterlaceScheme); -ZEND_METHOD(Imagick, setImageProfile); -ZEND_METHOD(Imagick, setImageRedPrimary); -ZEND_METHOD(Imagick, setImageRenderingIntent); -ZEND_METHOD(Imagick, setImageVirtualPixelMethod); -ZEND_METHOD(Imagick, setImageWhitePoint); -ZEND_METHOD(Imagick, sigmoidalContrastImage); -ZEND_METHOD(Imagick, stereoImage); -ZEND_METHOD(Imagick, textureImage); -ZEND_METHOD(Imagick, tintImage); -ZEND_METHOD(Imagick, unsharpMaskImage); -ZEND_METHOD(Imagick, getImage); -ZEND_METHOD(Imagick, addImage); -ZEND_METHOD(Imagick, setImage); -ZEND_METHOD(Imagick, newImage); -ZEND_METHOD(Imagick, newPseudoImage); -ZEND_METHOD(Imagick, getCompression); -ZEND_METHOD(Imagick, getCompressionQuality); -ZEND_METHOD(Imagick, getCopyright); -ZEND_METHOD(Imagick, getConfigureOptions); -#if MagickLibVersion > 0x660 -ZEND_METHOD(Imagick, getFeatures); -#endif -ZEND_METHOD(Imagick, getFilename); -ZEND_METHOD(Imagick, getFormat); -ZEND_METHOD(Imagick, getHomeURL); -ZEND_METHOD(Imagick, getInterlaceScheme); -ZEND_METHOD(Imagick, getOption); -ZEND_METHOD(Imagick, getPackageName); -ZEND_METHOD(Imagick, getPage); -ZEND_METHOD(Imagick, getQuantum); -ZEND_METHOD(Imagick, getHdriEnabled); -ZEND_METHOD(Imagick, getQuantumDepth); -ZEND_METHOD(Imagick, getQuantumRange); -ZEND_METHOD(Imagick, getReleaseDate); -ZEND_METHOD(Imagick, getResource); -ZEND_METHOD(Imagick, getResourceLimit); -ZEND_METHOD(Imagick, getSamplingFactors); -ZEND_METHOD(Imagick, getSize); -ZEND_METHOD(Imagick, getVersion); -ZEND_METHOD(Imagick, setBackgroundColor); -ZEND_METHOD(Imagick, setCompression); -ZEND_METHOD(Imagick, setCompressionQuality); -ZEND_METHOD(Imagick, setFilename); -ZEND_METHOD(Imagick, setFormat); -ZEND_METHOD(Imagick, setInterlaceScheme); -ZEND_METHOD(Imagick, setOption); -ZEND_METHOD(Imagick, setPage); -ZEND_METHOD(Imagick, setResourceLimit); -ZEND_METHOD(Imagick, setResolution); -ZEND_METHOD(Imagick, setSamplingFactors); -ZEND_METHOD(Imagick, setSize); -ZEND_METHOD(Imagick, setType); -#if MagickLibVersion > 0x628 -ZEND_METHOD(Imagick, nextImage); -#endif -#if MagickLibVersion > 0x628 -ZEND_METHOD(Imagick, setFirstIterator); -#endif -#if MagickLibVersion > 0x628 -ZEND_METHOD(Imagick, valid); -#endif -#if MagickLibVersion > 0x628 -ZEND_METHOD(Imagick, current); -#endif -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x659 -ZEND_METHOD(Imagick, brightnessContrastImage); -#endif -#if MagickLibVersion > 0x628 && MagickLibVersion > 0x661 -ZEND_METHOD(Imagick, colorMatrixImage); -#endif -#if MagickLibVersion > 0x628 -ZEND_METHOD(Imagick, selectiveBlurImage); -#endif -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x689 -ZEND_METHOD(Imagick, rotationalBlurImage); -#endif -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x683 -ZEND_METHOD(Imagick, statisticImage); -#endif -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x652 -ZEND_METHOD(Imagick, subimageMatch); -#endif -#if MagickLibVersion > 0x628 -ZEND_METHOD(Imagick, setRegistry); -#endif -#if MagickLibVersion > 0x628 -ZEND_METHOD(Imagick, getRegistry); -#endif -#if MagickLibVersion > 0x628 -ZEND_METHOD(Imagick, listRegistry); -#endif -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x680 -ZEND_METHOD(Imagick, morphology); -#endif -#if MagickLibVersion > 0x628 && defined(IMAGICK_WITH_KERNEL) && MagickLibVersion < 0x700 -ZEND_METHOD(Imagick, filter); -#endif -#if MagickLibVersion > 0x628 -ZEND_METHOD(Imagick, setAntialias); -#endif -#if MagickLibVersion > 0x628 -ZEND_METHOD(Imagick, getAntialias); -#endif -#if MagickLibVersion > 0x628 && MagickLibVersion > 0x676 -ZEND_METHOD(Imagick, colorDecisionListImage); -#endif -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x687 -ZEND_METHOD(Imagick, optimizeImageTransparency); -#endif -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x660 -ZEND_METHOD(Imagick, autoGammaImage); -#endif -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x692 -ZEND_METHOD(Imagick, autoOrient); -#endif -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x692 -ZEND_METHOD(Imagick, compositeImageGravity); -#endif -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x693 -ZEND_METHOD(Imagick, localContrastImage); -#endif -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x700 -ZEND_METHOD(Imagick, identifyImageType); -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GETSETIMAGEMASK -ZEND_METHOD(Imagick, getImageMask); -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GETSETIMAGEMASK -ZEND_METHOD(Imagick, setImageMask); -#endif -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x709 -ZEND_METHOD(Imagick, cannyEdgeImage); -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_SETSEED -ZEND_METHOD(Imagick, setSeed); -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_WAVELETDENOISEIMAGE -ZEND_METHOD(Imagick, waveletDenoiseImage); -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_MEANSHIFTIMAGE -ZEND_METHOD(Imagick, meanShiftImage); -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_KMEANSIMAGE -ZEND_METHOD(Imagick, kmeansImage); -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_RANGETHRESHOLDIMAGE -ZEND_METHOD(Imagick, rangeThresholdImage); -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_AUTOTHRESHOLDIMAGE -ZEND_METHOD(Imagick, autoThresholdImage); -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_BILATERALBLURIMAGE -ZEND_METHOD(Imagick, bilateralBlurImage); -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_CLAHEIMAGE -ZEND_METHOD(Imagick, claheImage); -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_CHANNELFXIMAGE -ZEND_METHOD(Imagick, channelFxImage); -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_COLORTHRESHOLDIMAGE -ZEND_METHOD(Imagick, colorThresholdImage); -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_COMPLEXIMAGES -ZEND_METHOD(Imagick, complexImages); -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_INTERPOLATIVERESIZEIMAGE -ZEND_METHOD(Imagick, interpolativeResizeImage); -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_LEVELIMAGECOLORS -ZEND_METHOD(Imagick, levelImageColors); -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_LEVELIZEIMAGE -ZEND_METHOD(Imagick, levelizeImage); -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_ORDEREDDITHERIMAGE -ZEND_METHOD(Imagick, orderedDitherImage); -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_WHITEBALANCEIMAGE -ZEND_METHOD(Imagick, whiteBalanceImage); -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_DELETE_OPTION -ZEND_METHOD(Imagick, deleteOption); -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_BACKGROUND_COLOR -ZEND_METHOD(Imagick, getBackgroundColor); -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_IMAGE_ARTIFACTS -ZEND_METHOD(Imagick, getImageArtifacts); -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_IMAGE_KURTOSIS -ZEND_METHOD(Imagick, getImageKurtosis); -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_IMAGE_MEAN -ZEND_METHOD(Imagick, getImageMean); -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_IMAGE_RANGE -ZEND_METHOD(Imagick, getImageRange); -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_INTERPOLATE_METHOD -ZEND_METHOD(Imagick, getInterpolateMethod); -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_OPTIONS -ZEND_METHOD(Imagick, getOptions); -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_ORIENTATION -ZEND_METHOD(Imagick, getOrientation); -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_RESOLUTION -ZEND_METHOD(Imagick, getResolution); -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_TYPE -ZEND_METHOD(Imagick, getType); -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_POLYNOMIAL_IMAGE -ZEND_METHOD(Imagick, polynomialImage); -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_SET_DEPTH -ZEND_METHOD(Imagick, setDepth); -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_SET_EXTRACT -ZEND_METHOD(Imagick, setExtract); -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_SET_INTERPOLATE_METHOD -ZEND_METHOD(Imagick, setInterpolateMethod); -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_SET_ORIENTATION -ZEND_METHOD(Imagick, setOrientation); -#endif - - -static const zend_function_entry class_Imagick_methods = { -#if MagickLibVersion > 0x628 - ZEND_ME(Imagick, optimizeImageLayers, arginfo_class_Imagick_optimizeImageLayers, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 - ZEND_ME(Imagick, compareImageLayers, arginfo_class_Imagick_compareImageLayers, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 - ZEND_ME(Imagick, pingImageBlob, arginfo_class_Imagick_pingImageBlob, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 - ZEND_ME(Imagick, pingImageFile, arginfo_class_Imagick_pingImageFile, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 - ZEND_ME(Imagick, transposeImage, arginfo_class_Imagick_transposeImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 - ZEND_ME(Imagick, transverseImage, arginfo_class_Imagick_transverseImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 - ZEND_ME(Imagick, trimImage, arginfo_class_Imagick_trimImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 - ZEND_ME(Imagick, waveImage, arginfo_class_Imagick_waveImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x700 - ZEND_ME(Imagick, waveImageWithMethod, arginfo_class_Imagick_waveImageWithMethod, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 - ZEND_ME(Imagick, vignetteImage, arginfo_class_Imagick_vignetteImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 - ZEND_ME(Imagick, uniqueImageColors, arginfo_class_Imagick_uniqueImageColors, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 - ZEND_ME(Imagick, getImageMatte, arginfo_class_Imagick_getImageMatte, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) -#endif -#if MagickLibVersion > 0x628 - ZEND_ME(Imagick, setImageMatte, arginfo_class_Imagick_setImageMatte, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 - ZEND_ME(Imagick, adaptiveResizeImage, arginfo_class_Imagick_adaptiveResizeImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 - ZEND_ME(Imagick, sketchImage, arginfo_class_Imagick_sketchImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 - ZEND_ME(Imagick, shadeImage, arginfo_class_Imagick_shadeImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 - ZEND_ME(Imagick, getSizeOffset, arginfo_class_Imagick_getSizeOffset, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 - ZEND_ME(Imagick, setSizeOffset, arginfo_class_Imagick_setSizeOffset, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 - ZEND_ME(Imagick, adaptiveBlurImage, arginfo_class_Imagick_adaptiveBlurImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 - ZEND_ME(Imagick, contrastStretchImage, arginfo_class_Imagick_contrastStretchImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 - ZEND_ME(Imagick, adaptiveSharpenImage, arginfo_class_Imagick_adaptiveSharpenImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 - ZEND_ME(Imagick, randomThresholdImage, arginfo_class_Imagick_randomThresholdImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 - ZEND_ME(Imagick, roundCornersImage, arginfo_class_Imagick_roundCornersImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 - ZEND_MALIAS(Imagick, roundCorners, roundCornersImage, arginfo_class_Imagick_roundCorners, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 - ZEND_ME(Imagick, setIteratorIndex, arginfo_class_Imagick_setIteratorIndex, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 - ZEND_ME(Imagick, getIteratorIndex, arginfo_class_Imagick_getIteratorIndex, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && MagickLibVersion < 0x700 - ZEND_ME(Imagick, transformImage, arginfo_class_Imagick_transformImage, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) -#endif -#if MagickLibVersion > 0x630 && MagickLibVersion < 0x700 - ZEND_ME(Imagick, setImageOpacity, arginfo_class_Imagick_setImageOpacity, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) -#endif -#if MagickLibVersion > 0x630 && MagickLibVersion >= 0x700 - ZEND_ME(Imagick, setImageAlpha, arginfo_class_Imagick_setImageAlpha, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x630 && MagickLibVersion < 0x700 - ZEND_ME(Imagick, orderedPosterizeImage, arginfo_class_Imagick_orderedPosterizeImage, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) -#endif -#if MagickLibVersion >= 0x700 - ZEND_ME(Imagick, polaroidWithTextAndMethod, arginfo_class_Imagick_polaroidWithTextAndMethod, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x631 - ZEND_ME(Imagick, polaroidImage, arginfo_class_Imagick_polaroidImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x631 - ZEND_ME(Imagick, getImageProperty, arginfo_class_Imagick_getImageProperty, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x631 - ZEND_ME(Imagick, setImageProperty, arginfo_class_Imagick_setImageProperty, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x631 - ZEND_ME(Imagick, deleteImageProperty, arginfo_class_Imagick_deleteImageProperty, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x631 - ZEND_ME(Imagick, identifyFormat, arginfo_class_Imagick_identifyFormat, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x631 && IM_HAVE_IMAGICK_SETIMAGEINTERPOLATEMETHOD - ZEND_ME(Imagick, setImageInterpolateMethod, arginfo_class_Imagick_setImageInterpolateMethod, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x631 - ZEND_ME(Imagick, getImageInterpolateMethod, arginfo_class_Imagick_getImageInterpolateMethod, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x631 - ZEND_ME(Imagick, linearStretchImage, arginfo_class_Imagick_linearStretchImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x631 - ZEND_ME(Imagick, getImageLength, arginfo_class_Imagick_getImageLength, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x631 - ZEND_ME(Imagick, extentImage, arginfo_class_Imagick_extentImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x633 - ZEND_ME(Imagick, getImageOrientation, arginfo_class_Imagick_getImageOrientation, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x633 - ZEND_ME(Imagick, setImageOrientation, arginfo_class_Imagick_setImageOrientation, ZEND_ACC_PUBLIC) -#endif -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion > 0x634 && MagickLibVersion < 0x700 - ZEND_ME(Imagick, paintFloodfillImage, arginfo_class_Imagick_paintFloodfillImage, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) -#endif -#if MagickLibVersion > 0x635 - ZEND_ME(Imagick, clutImage, arginfo_class_Imagick_clutImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x635 - ZEND_ME(Imagick, getImageProperties, arginfo_class_Imagick_getImageProperties, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x635 - ZEND_ME(Imagick, getImageProfiles, arginfo_class_Imagick_getImageProfiles, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x635 - ZEND_ME(Imagick, distortImage, arginfo_class_Imagick_distortImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x635 - ZEND_ME(Imagick, writeImageFile, arginfo_class_Imagick_writeImageFile, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x635 - ZEND_ME(Imagick, writeImagesFile, arginfo_class_Imagick_writeImagesFile, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x635 - ZEND_ME(Imagick, resetImagePage, arginfo_class_Imagick_resetImagePage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x635 && MagickLibVersion < 0x700 - ZEND_ME(Imagick, setImageClipMask, arginfo_class_Imagick_setImageClipMask, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) -#endif -#if MagickLibVersion > 0x635 && MagickLibVersion < 0x700 - ZEND_ME(Imagick, getImageClipMask, arginfo_class_Imagick_getImageClipMask, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) -#endif -#if MagickLibVersion > 0x635 - ZEND_ME(Imagick, animateImages, arginfo_class_Imagick_animateImages, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x635 && !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 - ZEND_ME(Imagick, recolorImage, arginfo_class_Imagick_recolorImage, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) -#endif -#if MagickLibVersion > 0x636 - ZEND_ME(Imagick, setFont, arginfo_class_Imagick_setFont, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x636 - ZEND_ME(Imagick, getFont, arginfo_class_Imagick_getFont, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x636 - ZEND_ME(Imagick, setPointSize, arginfo_class_Imagick_setPointSize, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x636 - ZEND_ME(Imagick, getPointSize, arginfo_class_Imagick_getPointSize, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x636 - ZEND_ME(Imagick, mergeImageLayers, arginfo_class_Imagick_mergeImageLayers, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x637 - ZEND_ME(Imagick, setImageAlphaChannel, arginfo_class_Imagick_setImageAlphaChannel, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x637 - ZEND_ME(Imagick, floodfillPaintImage, arginfo_class_Imagick_floodfillPaintImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x637 - ZEND_ME(Imagick, opaquePaintImage, arginfo_class_Imagick_opaquePaintImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x637 - ZEND_ME(Imagick, transparentPaintImage, arginfo_class_Imagick_transparentPaintImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x638 - ZEND_ME(Imagick, liquidRescaleImage, arginfo_class_Imagick_liquidRescaleImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x638 - ZEND_ME(Imagick, encipherImage, arginfo_class_Imagick_encipherImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x638 - ZEND_ME(Imagick, decipherImage, arginfo_class_Imagick_decipherImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x639 - ZEND_ME(Imagick, setGravity, arginfo_class_Imagick_setGravity, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x639 - ZEND_ME(Imagick, getGravity, arginfo_class_Imagick_getGravity, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x639 - ZEND_ME(Imagick, getImageChannelRange, arginfo_class_Imagick_getImageChannelRange, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x639 - ZEND_ME(Imagick, getImageAlphaChannel, arginfo_class_Imagick_getImageAlphaChannel, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x642 - ZEND_ME(Imagick, getImageChannelDistortions, arginfo_class_Imagick_getImageChannelDistortions, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x643 - ZEND_ME(Imagick, setImageGravity, arginfo_class_Imagick_setImageGravity, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x643 - ZEND_ME(Imagick, getImageGravity, arginfo_class_Imagick_getImageGravity, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x645 - ZEND_ME(Imagick, importImagePixels, arginfo_class_Imagick_importImagePixels, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x645 - ZEND_ME(Imagick, deskewImage, arginfo_class_Imagick_deskewImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x645 - ZEND_ME(Imagick, segmentImage, arginfo_class_Imagick_segmentImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x645 - ZEND_ME(Imagick, sparseColorImage, arginfo_class_Imagick_sparseColorImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x645 - ZEND_ME(Imagick, remapImage, arginfo_class_Imagick_remapImage, ZEND_ACC_PUBLIC) -#endif -#if PHP_IMAGICK_HAVE_HOUGHLINE - ZEND_ME(Imagick, houghLineImage, arginfo_class_Imagick_houghLineImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x646 - ZEND_ME(Imagick, exportImagePixels, arginfo_class_Imagick_exportImagePixels, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x648 - ZEND_ME(Imagick, getImageChannelKurtosis, arginfo_class_Imagick_getImageChannelKurtosis, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x648 - ZEND_ME(Imagick, functionImage, arginfo_class_Imagick_functionImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x651 - ZEND_ME(Imagick, transformImageColorspace, arginfo_class_Imagick_transformImageColorspace, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x652 - ZEND_ME(Imagick, haldClutImage, arginfo_class_Imagick_haldClutImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x655 - ZEND_ME(Imagick, autoLevelImage, arginfo_class_Imagick_autoLevelImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x655 - ZEND_ME(Imagick, blueShiftImage, arginfo_class_Imagick_blueShiftImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x656 - ZEND_ME(Imagick, getImageArtifact, arginfo_class_Imagick_getImageArtifact, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x656 - ZEND_ME(Imagick, setImageArtifact, arginfo_class_Imagick_setImageArtifact, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x656 - ZEND_ME(Imagick, deleteImageArtifact, arginfo_class_Imagick_deleteImageArtifact, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x656 - ZEND_ME(Imagick, getColorspace, arginfo_class_Imagick_getColorspace, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x656 - ZEND_ME(Imagick, setColorspace, arginfo_class_Imagick_setColorspace, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x656 - ZEND_ME(Imagick, clampImage, arginfo_class_Imagick_clampImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x667 - ZEND_ME(Imagick, smushImages, arginfo_class_Imagick_smushImages, ZEND_ACC_PUBLIC) -#endif - ZEND_ME(Imagick, __construct, arginfo_class_Imagick___construct, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, __toString, arginfo_class_Imagick___toString, ZEND_ACC_PUBLIC) -#if PHP_VERSION_ID >= 50600 - ZEND_ME(Imagick, count, arginfo_class_Imagick_count, ZEND_ACC_PUBLIC) -#endif -#if !(PHP_VERSION_ID >= 50600) - ZEND_ME(Imagick, count, arginfo_class_Imagick_count, ZEND_ACC_PUBLIC) -#endif - ZEND_ME(Imagick, getPixelIterator, arginfo_class_Imagick_getPixelIterator, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getPixelRegionIterator, arginfo_class_Imagick_getPixelRegionIterator, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, readImage, arginfo_class_Imagick_readImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, readImages, arginfo_class_Imagick_readImages, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, readImageBlob, arginfo_class_Imagick_readImageBlob, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setImageFormat, arginfo_class_Imagick_setImageFormat, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, scaleImage, arginfo_class_Imagick_scaleImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, writeImage, arginfo_class_Imagick_writeImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, writeImages, arginfo_class_Imagick_writeImages, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, blurImage, arginfo_class_Imagick_blurImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, thumbnailImage, arginfo_class_Imagick_thumbnailImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, cropThumbnailImage, arginfo_class_Imagick_cropThumbnailImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImageFilename, arginfo_class_Imagick_getImageFilename, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setImageFilename, arginfo_class_Imagick_setImageFilename, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImageFormat, arginfo_class_Imagick_getImageFormat, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImageMimeType, arginfo_class_Imagick_getImageMimeType, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, removeImage, arginfo_class_Imagick_removeImage, ZEND_ACC_PUBLIC) - ZEND_MALIAS(Imagick, destroy, clear, arginfo_class_Imagick_destroy, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, clear, arginfo_class_Imagick_clear, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, clone, arginfo_class_Imagick_clone, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImageSize, arginfo_class_Imagick_getImageSize, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImageBlob, arginfo_class_Imagick_getImageBlob, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImagesBlob, arginfo_class_Imagick_getImagesBlob, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setFirstIterator, arginfo_class_Imagick_setFirstIterator, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setLastIterator, arginfo_class_Imagick_setLastIterator, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, resetIterator, arginfo_class_Imagick_resetIterator, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, previousImage, arginfo_class_Imagick_previousImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, nextImage, arginfo_class_Imagick_nextImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, hasPreviousImage, arginfo_class_Imagick_hasPreviousImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, hasNextImage, arginfo_class_Imagick_hasNextImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setImageIndex, arginfo_class_Imagick_setImageIndex, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImageIndex, arginfo_class_Imagick_getImageIndex, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, commentImage, arginfo_class_Imagick_commentImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, cropImage, arginfo_class_Imagick_cropImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, labelImage, arginfo_class_Imagick_labelImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImageGeometry, arginfo_class_Imagick_getImageGeometry, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, drawImage, arginfo_class_Imagick_drawImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setImageCompressionQuality, arginfo_class_Imagick_setImageCompressionQuality, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImageCompressionQuality, arginfo_class_Imagick_getImageCompressionQuality, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setImageCompression, arginfo_class_Imagick_setImageCompression, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImageCompression, arginfo_class_Imagick_getImageCompression, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, annotateImage, arginfo_class_Imagick_annotateImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, compositeImage, arginfo_class_Imagick_compositeImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, modulateImage, arginfo_class_Imagick_modulateImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImageColors, arginfo_class_Imagick_getImageColors, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, montageImage, arginfo_class_Imagick_montageImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, identifyImage, arginfo_class_Imagick_identifyImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, thresholdImage, arginfo_class_Imagick_thresholdImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, adaptiveThresholdImage, arginfo_class_Imagick_adaptiveThresholdImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, blackThresholdImage, arginfo_class_Imagick_blackThresholdImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, whiteThresholdImage, arginfo_class_Imagick_whiteThresholdImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, appendImages, arginfo_class_Imagick_appendImages, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, charcoalImage, arginfo_class_Imagick_charcoalImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, normalizeImage, arginfo_class_Imagick_normalizeImage, ZEND_ACC_PUBLIC) -#if MagickLibVersion >= 0x700 - ZEND_ME(Imagick, oilPaintImageWithSigma, arginfo_class_Imagick_oilPaintImageWithSigma, ZEND_ACC_PUBLIC) -#endif - ZEND_ME(Imagick, oilPaintImage, arginfo_class_Imagick_oilPaintImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, posterizeImage, arginfo_class_Imagick_posterizeImage, ZEND_ACC_PUBLIC) -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 - ZEND_ME(Imagick, radialBlurImage, arginfo_class_Imagick_radialBlurImage, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) -#endif - ZEND_ME(Imagick, raiseImage, arginfo_class_Imagick_raiseImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, resampleImage, arginfo_class_Imagick_resampleImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, resizeImage, arginfo_class_Imagick_resizeImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, rollImage, arginfo_class_Imagick_rollImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, rotateImage, arginfo_class_Imagick_rotateImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, sampleImage, arginfo_class_Imagick_sampleImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, solarizeImage, arginfo_class_Imagick_solarizeImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, shadowImage, arginfo_class_Imagick_shadowImage, ZEND_ACC_PUBLIC) -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 - ZEND_ME(Imagick, setImageAttribute, arginfo_class_Imagick_setImageAttribute, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) -#endif - ZEND_ME(Imagick, setImageBackgroundColor, arginfo_class_Imagick_setImageBackgroundColor, ZEND_ACC_PUBLIC) -#if MagickLibVersion >= 0x700 - ZEND_ME(Imagick, setImageChannelMask, arginfo_class_Imagick_setImageChannelMask, ZEND_ACC_PUBLIC) -#endif - ZEND_ME(Imagick, setImageCompose, arginfo_class_Imagick_setImageCompose, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setImageDelay, arginfo_class_Imagick_setImageDelay, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setImageDepth, arginfo_class_Imagick_setImageDepth, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setImageGamma, arginfo_class_Imagick_setImageGamma, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setImageIterations, arginfo_class_Imagick_setImageIterations, ZEND_ACC_PUBLIC) -#if MagickLibVersion < 0x700 || MagickLibVersion >= 0x705 - ZEND_ME(Imagick, setImageMatteColor, arginfo_class_Imagick_setImageMatteColor, ZEND_ACC_PUBLIC) -#endif - ZEND_ME(Imagick, setImagePage, arginfo_class_Imagick_setImagePage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setImageProgressMonitor, arginfo_class_Imagick_setImageProgressMonitor, ZEND_ACC_PUBLIC) -#if MagickLibVersion > 0x653 - ZEND_ME(Imagick, setProgressMonitor, arginfo_class_Imagick_setProgressMonitor, ZEND_ACC_PUBLIC) -#endif - ZEND_ME(Imagick, setImageResolution, arginfo_class_Imagick_setImageResolution, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setImageScene, arginfo_class_Imagick_setImageScene, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setImageTicksPerSecond, arginfo_class_Imagick_setImageTicksPerSecond, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setImageType, arginfo_class_Imagick_setImageType, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setImageUnits, arginfo_class_Imagick_setImageUnits, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, sharpenImage, arginfo_class_Imagick_sharpenImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, shaveImage, arginfo_class_Imagick_shaveImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, shearImage, arginfo_class_Imagick_shearImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, spliceImage, arginfo_class_Imagick_spliceImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, pingImage, arginfo_class_Imagick_pingImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, readImageFile, arginfo_class_Imagick_readImageFile, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, displayImage, arginfo_class_Imagick_displayImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, displayImages, arginfo_class_Imagick_displayImages, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, spreadImage, arginfo_class_Imagick_spreadImage, ZEND_ACC_PUBLIC) -#if MagickLibVersion >= 0x700 - ZEND_ME(Imagick, spreadImageWithMethod, arginfo_class_Imagick_spreadImageWithMethod, ZEND_ACC_PUBLIC) -#endif - ZEND_ME(Imagick, swirlImage, arginfo_class_Imagick_swirlImage, ZEND_ACC_PUBLIC) -#if MagickLibVersion >= 0x700 - ZEND_ME(Imagick, swirlImageWithMethod, arginfo_class_Imagick_swirlImageWithMethod, ZEND_ACC_PUBLIC) -#endif - ZEND_ME(Imagick, stripImage, arginfo_class_Imagick_stripImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, queryFormats, arginfo_class_Imagick_queryFormats, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - ZEND_ME(Imagick, queryFonts, arginfo_class_Imagick_queryFonts, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - ZEND_ME(Imagick, queryFontMetrics, arginfo_class_Imagick_queryFontMetrics, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, steganoImage, arginfo_class_Imagick_steganoImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, addNoiseImage, arginfo_class_Imagick_addNoiseImage, ZEND_ACC_PUBLIC) -#if IM_HAVE_IMAGICK_ADD_NOISE_WITH_ATTENUATE - ZEND_ME(Imagick, addNoiseImageWithAttenuate, arginfo_class_Imagick_addNoiseImageWithAttenuate, ZEND_ACC_PUBLIC) -#endif - ZEND_ME(Imagick, motionBlurImage, arginfo_class_Imagick_motionBlurImage, ZEND_ACC_PUBLIC) -#if MagickLibVersion < 0x700 && !defined(MAGICKCORE_EXCLUDE_DEPRECATED) - ZEND_ME(Imagick, mosaicImages, arginfo_class_Imagick_mosaicImages, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) -#endif - ZEND_ME(Imagick, morphImages, arginfo_class_Imagick_morphImages, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, minifyImage, arginfo_class_Imagick_minifyImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, affineTransformImage, arginfo_class_Imagick_affineTransformImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, averageImages, arginfo_class_Imagick_averageImages, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, borderImage, arginfo_class_Imagick_borderImage, ZEND_ACC_PUBLIC) -#if MagickLibVersion >= 0x700 - ZEND_ME(Imagick, borderImageWithComposite, arginfo_class_Imagick_borderImageWithComposite, ZEND_ACC_PUBLIC) -#endif - ZEND_ME(Imagick, calculateCrop, arginfo_class_Imagick_calculateCrop, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - ZEND_ME(Imagick, chopImage, arginfo_class_Imagick_chopImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, clipImage, arginfo_class_Imagick_clipImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, clipPathImage, arginfo_class_Imagick_clipPathImage, ZEND_ACC_PUBLIC) - ZEND_MALIAS(Imagick, clipImagePath, clipPathImage, arginfo_class_Imagick_clipImagePath, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, coalesceImages, arginfo_class_Imagick_coalesceImages, ZEND_ACC_PUBLIC) -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 - ZEND_ME(Imagick, colorFloodfillImage, arginfo_class_Imagick_colorFloodfillImage, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) -#endif - ZEND_ME(Imagick, colorizeImage, arginfo_class_Imagick_colorizeImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, compareImageChannels, arginfo_class_Imagick_compareImageChannels, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, compareImages, arginfo_class_Imagick_compareImages, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, contrastImage, arginfo_class_Imagick_contrastImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, combineImages, arginfo_class_Imagick_combineImages, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, convolveImage, arginfo_class_Imagick_convolveImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, cycleColormapImage, arginfo_class_Imagick_cycleColormapImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, deconstructImages, arginfo_class_Imagick_deconstructImages, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, despeckleImage, arginfo_class_Imagick_despeckleImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, edgeImage, arginfo_class_Imagick_edgeImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, embossImage, arginfo_class_Imagick_embossImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, enhanceImage, arginfo_class_Imagick_enhanceImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, equalizeImage, arginfo_class_Imagick_equalizeImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, evaluateImage, arginfo_class_Imagick_evaluateImage, ZEND_ACC_PUBLIC) -#if MagickLibVersion >= 0x687 - ZEND_ME(Imagick, evaluateImages, arginfo_class_Imagick_evaluateImages, ZEND_ACC_PUBLIC) -#endif - ZEND_ME(Imagick, flattenImages, arginfo_class_Imagick_flattenImages, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, flipImage, arginfo_class_Imagick_flipImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, flopImage, arginfo_class_Imagick_flopImage, ZEND_ACC_PUBLIC) -#if MagickLibVersion >= 0x655 - ZEND_ME(Imagick, forwardFourierTransformImage, arginfo_class_Imagick_forwardFourierTransformImage, ZEND_ACC_PUBLIC) -#endif - ZEND_ME(Imagick, frameImage, arginfo_class_Imagick_frameImage, ZEND_ACC_PUBLIC) -#if MagickLibVersion >= 0x700 - ZEND_ME(Imagick, frameImageWithComposite, arginfo_class_Imagick_frameImageWithComposite, ZEND_ACC_PUBLIC) -#endif - ZEND_ME(Imagick, fxImage, arginfo_class_Imagick_fxImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, gammaImage, arginfo_class_Imagick_gammaImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, gaussianBlurImage, arginfo_class_Imagick_gaussianBlurImage, ZEND_ACC_PUBLIC) -#if MagickLibVersion < 0x700 && !defined(MAGICKCORE_EXCLUDE_DEPRECATED) - ZEND_ME(Imagick, getImageAttribute, arginfo_class_Imagick_getImageAttribute, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) -#endif - ZEND_ME(Imagick, getImageBackgroundColor, arginfo_class_Imagick_getImageBackgroundColor, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImageBluePrimary, arginfo_class_Imagick_getImageBluePrimary, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImageBorderColor, arginfo_class_Imagick_getImageBorderColor, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImageChannelDepth, arginfo_class_Imagick_getImageChannelDepth, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImageChannelDistortion, arginfo_class_Imagick_getImageChannelDistortion, ZEND_ACC_PUBLIC) -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 - ZEND_ME(Imagick, getImageChannelExtrema, arginfo_class_Imagick_getImageChannelExtrema, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) -#endif - ZEND_ME(Imagick, getImageChannelMean, arginfo_class_Imagick_getImageChannelMean, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImageChannelStatistics, arginfo_class_Imagick_getImageChannelStatistics, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImageColormapColor, arginfo_class_Imagick_getImageColormapColor, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImageColorspace, arginfo_class_Imagick_getImageColorspace, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImageCompose, arginfo_class_Imagick_getImageCompose, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImageDelay, arginfo_class_Imagick_getImageDelay, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImageDepth, arginfo_class_Imagick_getImageDepth, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImageDistortion, arginfo_class_Imagick_getImageDistortion, ZEND_ACC_PUBLIC) -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 - ZEND_ME(Imagick, getImageExtrema, arginfo_class_Imagick_getImageExtrema, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) -#endif - ZEND_ME(Imagick, getImageDispose, arginfo_class_Imagick_getImageDispose, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImageGamma, arginfo_class_Imagick_getImageGamma, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImageGreenPrimary, arginfo_class_Imagick_getImageGreenPrimary, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImageHeight, arginfo_class_Imagick_getImageHeight, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImageHistogram, arginfo_class_Imagick_getImageHistogram, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImageInterlaceScheme, arginfo_class_Imagick_getImageInterlaceScheme, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImageIterations, arginfo_class_Imagick_getImageIterations, ZEND_ACC_PUBLIC) -#if MagickLibVersion < 0x700 - ZEND_ME(Imagick, getImageMatteColor, arginfo_class_Imagick_getImageMatteColor, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) -#endif - ZEND_ME(Imagick, getImagePage, arginfo_class_Imagick_getImagePage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImagePixelColor, arginfo_class_Imagick_getImagePixelColor, ZEND_ACC_PUBLIC) -#if IM_HAVE_IMAGICK_SETIMAGEPIXELCOLOR - ZEND_ME(Imagick, setImagePixelColor, arginfo_class_Imagick_setImagePixelColor, ZEND_ACC_PUBLIC) -#endif - ZEND_ME(Imagick, getImageProfile, arginfo_class_Imagick_getImageProfile, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImageRedPrimary, arginfo_class_Imagick_getImageRedPrimary, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImageRenderingIntent, arginfo_class_Imagick_getImageRenderingIntent, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImageResolution, arginfo_class_Imagick_getImageResolution, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImageScene, arginfo_class_Imagick_getImageScene, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImageSignature, arginfo_class_Imagick_getImageSignature, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImageTicksPerSecond, arginfo_class_Imagick_getImageTicksPerSecond, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImageType, arginfo_class_Imagick_getImageType, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImageUnits, arginfo_class_Imagick_getImageUnits, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImageVirtualPixelMethod, arginfo_class_Imagick_getImageVirtualPixelMethod, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImageWhitePoint, arginfo_class_Imagick_getImageWhitePoint, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImageWidth, arginfo_class_Imagick_getImageWidth, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getNumberImages, arginfo_class_Imagick_getNumberImages, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImageTotalInkDensity, arginfo_class_Imagick_getImageTotalInkDensity, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImageRegion, arginfo_class_Imagick_getImageRegion, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, implodeImage, arginfo_class_Imagick_implodeImage, ZEND_ACC_PUBLIC) -#if MagickLibVersion >= 0x700 - ZEND_ME(Imagick, implodeImageWithMethod, arginfo_class_Imagick_implodeImageWithMethod, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion >= 0x658 - ZEND_ME(Imagick, inverseFourierTransformImage, arginfo_class_Imagick_inverseFourierTransformImage, ZEND_ACC_PUBLIC) -#endif - ZEND_ME(Imagick, levelImage, arginfo_class_Imagick_levelImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, magnifyImage, arginfo_class_Imagick_magnifyImage, ZEND_ACC_PUBLIC) -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 - ZEND_ME(Imagick, mapImage, arginfo_class_Imagick_mapImage, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) -#endif -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 - ZEND_ME(Imagick, matteFloodfillImage, arginfo_class_Imagick_matteFloodfillImage, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) -#endif -#if MagickLibVersion < 0x700 && !defined(MAGICKCORE_EXCLUDE_DEPRECATED) - ZEND_ME(Imagick, medianFilterImage, arginfo_class_Imagick_medianFilterImage, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) -#endif - ZEND_ME(Imagick, negateImage, arginfo_class_Imagick_negateImage, ZEND_ACC_PUBLIC) -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 - ZEND_ME(Imagick, paintOpaqueImage, arginfo_class_Imagick_paintOpaqueImage, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) -#endif -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 - ZEND_ME(Imagick, paintTransparentImage, arginfo_class_Imagick_paintTransparentImage, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) -#endif - ZEND_ME(Imagick, previewImages, arginfo_class_Imagick_previewImages, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, profileImage, arginfo_class_Imagick_profileImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, quantizeImage, arginfo_class_Imagick_quantizeImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, quantizeImages, arginfo_class_Imagick_quantizeImages, ZEND_ACC_PUBLIC) -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 - ZEND_ME(Imagick, reduceNoiseImage, arginfo_class_Imagick_reduceNoiseImage, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) -#endif - ZEND_ME(Imagick, removeImageProfile, arginfo_class_Imagick_removeImageProfile, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, separateImageChannel, arginfo_class_Imagick_separateImageChannel, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, sepiaToneImage, arginfo_class_Imagick_sepiaToneImage, ZEND_ACC_PUBLIC) -#if MagickLibVersion < 0x700 - ZEND_ME(Imagick, setImageBias, arginfo_class_Imagick_setImageBias, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) -#endif -#if MagickLibVersion < 0x700 - ZEND_ME(Imagick, setImageBiasQuantum, arginfo_class_Imagick_setImageBiasQuantum, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) -#endif - ZEND_ME(Imagick, setImageBluePrimary, arginfo_class_Imagick_setImageBluePrimary, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setImageBorderColor, arginfo_class_Imagick_setImageBorderColor, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setImageChannelDepth, arginfo_class_Imagick_setImageChannelDepth, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setImageColormapColor, arginfo_class_Imagick_setImageColormapColor, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setImageColorspace, arginfo_class_Imagick_setImageColorspace, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setImageDispose, arginfo_class_Imagick_setImageDispose, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setImageExtent, arginfo_class_Imagick_setImageExtent, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setImageGreenPrimary, arginfo_class_Imagick_setImageGreenPrimary, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setImageInterlaceScheme, arginfo_class_Imagick_setImageInterlaceScheme, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setImageProfile, arginfo_class_Imagick_setImageProfile, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setImageRedPrimary, arginfo_class_Imagick_setImageRedPrimary, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setImageRenderingIntent, arginfo_class_Imagick_setImageRenderingIntent, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setImageVirtualPixelMethod, arginfo_class_Imagick_setImageVirtualPixelMethod, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setImageWhitePoint, arginfo_class_Imagick_setImageWhitePoint, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, sigmoidalContrastImage, arginfo_class_Imagick_sigmoidalContrastImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, stereoImage, arginfo_class_Imagick_stereoImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, textureImage, arginfo_class_Imagick_textureImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, tintImage, arginfo_class_Imagick_tintImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, unsharpMaskImage, arginfo_class_Imagick_unsharpMaskImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getImage, arginfo_class_Imagick_getImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, addImage, arginfo_class_Imagick_addImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setImage, arginfo_class_Imagick_setImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, newImage, arginfo_class_Imagick_newImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, newPseudoImage, arginfo_class_Imagick_newPseudoImage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getCompression, arginfo_class_Imagick_getCompression, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getCompressionQuality, arginfo_class_Imagick_getCompressionQuality, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getCopyright, arginfo_class_Imagick_getCopyright, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - ZEND_ME(Imagick, getConfigureOptions, arginfo_class_Imagick_getConfigureOptions, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) -#if MagickLibVersion > 0x660 - ZEND_ME(Imagick, getFeatures, arginfo_class_Imagick_getFeatures, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) -#endif - ZEND_ME(Imagick, getFilename, arginfo_class_Imagick_getFilename, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getFormat, arginfo_class_Imagick_getFormat, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getHomeURL, arginfo_class_Imagick_getHomeURL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - ZEND_ME(Imagick, getInterlaceScheme, arginfo_class_Imagick_getInterlaceScheme, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getOption, arginfo_class_Imagick_getOption, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getPackageName, arginfo_class_Imagick_getPackageName, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - ZEND_ME(Imagick, getPage, arginfo_class_Imagick_getPage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getQuantum, arginfo_class_Imagick_getQuantum, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - ZEND_ME(Imagick, getHdriEnabled, arginfo_class_Imagick_getHdriEnabled, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - ZEND_ME(Imagick, getQuantumDepth, arginfo_class_Imagick_getQuantumDepth, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - ZEND_ME(Imagick, getQuantumRange, arginfo_class_Imagick_getQuantumRange, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - ZEND_ME(Imagick, getReleaseDate, arginfo_class_Imagick_getReleaseDate, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - ZEND_ME(Imagick, getResource, arginfo_class_Imagick_getResource, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - ZEND_ME(Imagick, getResourceLimit, arginfo_class_Imagick_getResourceLimit, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - ZEND_ME(Imagick, getSamplingFactors, arginfo_class_Imagick_getSamplingFactors, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getSize, arginfo_class_Imagick_getSize, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, getVersion, arginfo_class_Imagick_getVersion, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - ZEND_ME(Imagick, setBackgroundColor, arginfo_class_Imagick_setBackgroundColor, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setCompression, arginfo_class_Imagick_setCompression, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setCompressionQuality, arginfo_class_Imagick_setCompressionQuality, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setFilename, arginfo_class_Imagick_setFilename, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setFormat, arginfo_class_Imagick_setFormat, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setInterlaceScheme, arginfo_class_Imagick_setInterlaceScheme, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setOption, arginfo_class_Imagick_setOption, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setPage, arginfo_class_Imagick_setPage, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setResourceLimit, arginfo_class_Imagick_setResourceLimit, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - ZEND_ME(Imagick, setResolution, arginfo_class_Imagick_setResolution, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setSamplingFactors, arginfo_class_Imagick_setSamplingFactors, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setSize, arginfo_class_Imagick_setSize, ZEND_ACC_PUBLIC) - ZEND_ME(Imagick, setType, arginfo_class_Imagick_setType, ZEND_ACC_PUBLIC) -#if MagickLibVersion > 0x628 - ZEND_MALIAS(Imagick, key, getIteratorIndex, arginfo_class_Imagick_key, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 - ZEND_MALIAS(Imagick, next, nextImage, arginfo_class_Imagick_next, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 - ZEND_MALIAS(Imagick, rewind, setFirstIterator, arginfo_class_Imagick_rewind, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 - ZEND_ME(Imagick, valid, arginfo_class_Imagick_valid, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 - ZEND_ME(Imagick, current, arginfo_class_Imagick_current, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x659 - ZEND_ME(Imagick, brightnessContrastImage, arginfo_class_Imagick_brightnessContrastImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && MagickLibVersion > 0x661 - ZEND_ME(Imagick, colorMatrixImage, arginfo_class_Imagick_colorMatrixImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 - ZEND_ME(Imagick, selectiveBlurImage, arginfo_class_Imagick_selectiveBlurImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x689 - ZEND_ME(Imagick, rotationalBlurImage, arginfo_class_Imagick_rotationalBlurImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x683 - ZEND_ME(Imagick, statisticImage, arginfo_class_Imagick_statisticImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x652 - ZEND_ME(Imagick, subimageMatch, arginfo_class_Imagick_subimageMatch, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x652 - ZEND_MALIAS(Imagick, similarityImage, subimageMatch, arginfo_class_Imagick_similarityImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 - ZEND_ME(Imagick, setRegistry, arginfo_class_Imagick_setRegistry, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) -#endif -#if MagickLibVersion > 0x628 - ZEND_ME(Imagick, getRegistry, arginfo_class_Imagick_getRegistry, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) -#endif -#if MagickLibVersion > 0x628 - ZEND_ME(Imagick, listRegistry, arginfo_class_Imagick_listRegistry, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) -#endif -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x680 - ZEND_ME(Imagick, morphology, arginfo_class_Imagick_morphology, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && defined(IMAGICK_WITH_KERNEL) && MagickLibVersion < 0x700 - ZEND_ME(Imagick, filter, arginfo_class_Imagick_filter, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) -#endif -#if MagickLibVersion > 0x628 - ZEND_ME(Imagick, setAntialias, arginfo_class_Imagick_setAntialias, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 - ZEND_ME(Imagick, getAntialias, arginfo_class_Imagick_getAntialias, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && MagickLibVersion > 0x676 - ZEND_ME(Imagick, colorDecisionListImage, arginfo_class_Imagick_colorDecisionListImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x687 - ZEND_ME(Imagick, optimizeImageTransparency, arginfo_class_Imagick_optimizeImageTransparency, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x660 - ZEND_ME(Imagick, autoGammaImage, arginfo_class_Imagick_autoGammaImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x692 - ZEND_ME(Imagick, autoOrient, arginfo_class_Imagick_autoOrient, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x692 - ZEND_MALIAS(Imagick, autoOrientate, autoOrient, arginfo_class_Imagick_autoOrientate, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x692 - ZEND_ME(Imagick, compositeImageGravity, arginfo_class_Imagick_compositeImageGravity, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x693 - ZEND_ME(Imagick, localContrastImage, arginfo_class_Imagick_localContrastImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x700 - ZEND_ME(Imagick, identifyImageType, arginfo_class_Imagick_identifyImageType, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GETSETIMAGEMASK - ZEND_ME(Imagick, getImageMask, arginfo_class_Imagick_getImageMask, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GETSETIMAGEMASK - ZEND_ME(Imagick, setImageMask, arginfo_class_Imagick_setImageMask, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x709 - ZEND_ME(Imagick, cannyEdgeImage, arginfo_class_Imagick_cannyEdgeImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_SETSEED - ZEND_ME(Imagick, setSeed, arginfo_class_Imagick_setSeed, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_WAVELETDENOISEIMAGE - ZEND_ME(Imagick, waveletDenoiseImage, arginfo_class_Imagick_waveletDenoiseImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_MEANSHIFTIMAGE - ZEND_ME(Imagick, meanShiftImage, arginfo_class_Imagick_meanShiftImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_KMEANSIMAGE - ZEND_ME(Imagick, kmeansImage, arginfo_class_Imagick_kmeansImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_RANGETHRESHOLDIMAGE - ZEND_ME(Imagick, rangeThresholdImage, arginfo_class_Imagick_rangeThresholdImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_AUTOTHRESHOLDIMAGE - ZEND_ME(Imagick, autoThresholdImage, arginfo_class_Imagick_autoThresholdImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_BILATERALBLURIMAGE - ZEND_ME(Imagick, bilateralBlurImage, arginfo_class_Imagick_bilateralBlurImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_CLAHEIMAGE - ZEND_ME(Imagick, claheImage, arginfo_class_Imagick_claheImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_CHANNELFXIMAGE - ZEND_ME(Imagick, channelFxImage, arginfo_class_Imagick_channelFxImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_COLORTHRESHOLDIMAGE - ZEND_ME(Imagick, colorThresholdImage, arginfo_class_Imagick_colorThresholdImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_COMPLEXIMAGES - ZEND_ME(Imagick, complexImages, arginfo_class_Imagick_complexImages, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_INTERPOLATIVERESIZEIMAGE - ZEND_ME(Imagick, interpolativeResizeImage, arginfo_class_Imagick_interpolativeResizeImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_LEVELIMAGECOLORS - ZEND_ME(Imagick, levelImageColors, arginfo_class_Imagick_levelImageColors, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_LEVELIZEIMAGE - ZEND_ME(Imagick, levelizeImage, arginfo_class_Imagick_levelizeImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_ORDEREDDITHERIMAGE - ZEND_ME(Imagick, orderedDitherImage, arginfo_class_Imagick_orderedDitherImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_WHITEBALANCEIMAGE - ZEND_ME(Imagick, whiteBalanceImage, arginfo_class_Imagick_whiteBalanceImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_DELETE_OPTION - ZEND_ME(Imagick, deleteOption, arginfo_class_Imagick_deleteOption, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_BACKGROUND_COLOR - ZEND_ME(Imagick, getBackgroundColor, arginfo_class_Imagick_getBackgroundColor, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_IMAGE_ARTIFACTS - ZEND_ME(Imagick, getImageArtifacts, arginfo_class_Imagick_getImageArtifacts, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_IMAGE_KURTOSIS - ZEND_ME(Imagick, getImageKurtosis, arginfo_class_Imagick_getImageKurtosis, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_IMAGE_MEAN - ZEND_ME(Imagick, getImageMean, arginfo_class_Imagick_getImageMean, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_IMAGE_RANGE - ZEND_ME(Imagick, getImageRange, arginfo_class_Imagick_getImageRange, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_INTERPOLATE_METHOD - ZEND_ME(Imagick, getInterpolateMethod, arginfo_class_Imagick_getInterpolateMethod, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_OPTIONS - ZEND_ME(Imagick, getOptions, arginfo_class_Imagick_getOptions, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_ORIENTATION - ZEND_ME(Imagick, getOrientation, arginfo_class_Imagick_getOrientation, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_RESOLUTION - ZEND_ME(Imagick, getResolution, arginfo_class_Imagick_getResolution, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_GET_TYPE - ZEND_ME(Imagick, getType, arginfo_class_Imagick_getType, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_POLYNOMIAL_IMAGE - ZEND_ME(Imagick, polynomialImage, arginfo_class_Imagick_polynomialImage, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_SET_DEPTH - ZEND_ME(Imagick, setDepth, arginfo_class_Imagick_setDepth, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_SET_EXTRACT - ZEND_ME(Imagick, setExtract, arginfo_class_Imagick_setExtract, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_SET_INTERPOLATE_METHOD - ZEND_ME(Imagick, setInterpolateMethod, arginfo_class_Imagick_setInterpolateMethod, ZEND_ACC_PUBLIC) -#endif -#if MagickLibVersion > 0x628 && IM_HAVE_IMAGICK_SET_ORIENTATION - ZEND_ME(Imagick, setOrientation, arginfo_class_Imagick_setOrientation, ZEND_ACC_PUBLIC) -#endif - ZEND_FE_END -}; \ No newline at end of file
View file
imagick-3.7.0.tgz/imagick-3.7.0/config.m4
Deleted
@@ -1,111 +0,0 @@ -PHP_ARG_WITH(imagick, whether to enable the imagick extension, - --with-imagick=DIR Enables the imagick extension. DIR is the prefix to ImageMagick installation directory., no) - - -if test $PHP_IMAGICK != "no"; then - -# -# Find ImageMagick -# -if test "$ext_shared" != "yes" && test "$ext_shared" != "shared"; then - define('PHP_IMAGICK_STATIC', 1) - PHP_IMAGICK_STATIC=yes -fi -m4_include(ifdef('PHP_IMAGICK_STATIC',PHP_EXT_BUILDDIR(imagick)/,)imagemagick.m4) - -# This line checks that ImageMagick is available, and -# meets our minimum supported version. TODO change to 6.7.0 -IM_FIND_IMAGEMAGICK(6.2.4, $PHP_IMAGICK) - -# -# PHP minimum version -# - AC_MSG_CHECKING(PHP version is at least 5.3.2) - - if test -z "${PHP_VERSION_ID}"; then - if test -z "${PHP_CONFIG}"; then - AC_MSG_ERROR(php-config not found) - fi - if test -z "${AWK}"; then - AC_MSG_ERROR(awk not found) - fi - PHP_IMAGICK_FOUND_VERSION=`${PHP_CONFIG} --version` - PHP_IMAGICK_FOUND_VERNUM=`echo "${PHP_IMAGICK_FOUND_VERSION}" | $AWK 'BEGIN { FS = "."; } { printf "%d", ($1 * 100 + $2) * 100 + $3;}'` - else - PHP_IMAGICK_FOUND_VERNUM="${PHP_VERSION_ID}" - PHP_IMAGICK_FOUND_VERSION="${PHP_VERSION}" - fi - - if test "$PHP_IMAGICK_FOUND_VERNUM" -ge "50302"; then - AC_MSG_RESULT(yes. found $PHP_IMAGICK_FOUND_VERSION) - else - AC_MSG_ERROR(no. found $PHP_IMAGICK_FOUND_VERSION) - fi - -# -# Set libs and CFLAGS for building -# - echo "libs" - echo $IM_IMAGEMAGICK_LIBS - echo "" - echo $IMAGICK_SHARED_LIBADD - - PHP_EVAL_LIBLINE($IM_IMAGEMAGICK_LIBS, IMAGICK_SHARED_LIBADD) - PHP_EVAL_INCLINE($IM_IMAGEMAGICK_CFLAGS) - - old_LIBS=$LIBS - LIBS="$LIBS $IM_IMAGEMAGICK_LIBS" - - PHP_CHECK_FUNC(MagickGetVersion) - - LIBS=$old_LIBS - - AC_MSG_CHECKING(omp_pause_resource_all usability) - AC_COMPILE_IFELSE(AC_LANG_PROGRAM( - #include <omp.h> - , - omp_pause_resource_all(omp_pause_hard); - ), - AC_MSG_RESULT(yes) - AC_MSG_CHECKING(Which flavour of OpenMP to link) - - if test "${GCC}" = "yes"; then - # Open64 (passes for GCC but uses different OpenMP implementation) - if test "x$GOMP_LIBS" = x ; then - if $CC --version 2>&1 | grep Open64 > /dev/null ; then - PHP_CHECK_FUNC(omp_pause_resource_all, openmp) - if test "x$ac_cv_func_omp_pause_resource_all" = "xyes"; then - PHP_ADD_LIBRARY(openmp,, IMAGICK_SHARED_LIBADD) - AC_MSG_RESULT(Open64 flavoured OpenMP) - fi - fi - fi - # Clang (passes for GCC but uses different OpenMP implementation) - if test "x$LIB_OMP" = x ; then - if $CC --version 2>&1 | grep clang > /dev/null ; then - PHP_CHECK_FUNC(omp_pause_resource_all, omp) - if test "x$ac_cv_func_omp_pause_resource_all" = "xyes"; then - PHP_ADD_LIBRARY(omp,, IMAGICK_SHARED_LIBADD) - AC_MSG_RESULT(Clang flavoured OpenMP) - fi - fi - fi - # GCC - if test "x$ac_cv_func_omp_pause_resource_all" = x ; then - PHP_CHECK_FUNC(omp_pause_resource_all, gomp) - if test "x$ac_cv_func_omp_pause_resource_all" = "xyes"; then - PHP_ADD_LIBRARY(gomp,, IMAGICK_SHARED_LIBADD) - AC_MSG_RESULT(GCC flavoured OpenMP) - fi - fi - fi - - , - AC_MSG_RESULT(no) - ) - - PHP_SUBST(IMAGICK_SHARED_LIBADD) - AC_DEFINE(HAVE_IMAGICK,1, ) - PHP_NEW_EXTENSION(imagick, imagick_file.c imagick_class.c imagickdraw_class.c imagickpixel_class.c imagickpixeliterator_class.c imagick_helpers.c imagick.c imagickkernel_class.c shim_im6_to_im7.c, $ext_shared,, $IM_IMAGEMAGICK_CFLAGS) - PHP_INSTALL_HEADERS(ext/imagick, php_imagick_shared.h) -fi
View file
imagick-3.7.0.tgz/imagick-3.7.0/imagick.c
Deleted
@@ -1,1295 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 / Imagick | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 Mikko Koppanen, Scott MacVicar | - | ImageMagick (c) ImageMagick Studio LLC | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Mikko Kopppanen <mkoppanen@php.net> | - | Scott MacVicar <scottmac@php.net> | - +----------------------------------------------------------------------+ -*/ - -#include "php_imagick.h" -#include "php_imagick_defs.h" -#include "php_imagick_macros.h" -#include "php_imagick_helpers.h" -#include "php_imagick_shared.h" - -#if PHP_VERSION_ID >= 70000 -#include "ext/standard/php_smart_string.h" -#else -#include "ext/standard/php_smart_str.h" -#endif - -#if PHP_VERSION_ID < 70200 -///* For the countable interface */ -#include "ext/spl/spl_iterators.h" -#endif - -#include "shim_php7_to_php8.h" - -#if HAVE_OMP_PAUSE_RESOURCE_ALL -#include <omp.h> -#endif - -ZEND_DECLARE_MODULE_GLOBALS(imagick) - -#ifdef IMAGICK_WITH_KERNEL - #if PHP_VERSION_ID >= 80000 - HashTable* php_imagickkernel_get_debug_info(zend_object *obj, int *is_temp TSRMLS_DC); /* {{{ */ - #else - HashTable* php_imagickkernel_get_debug_info(zval *obj, int *is_temp TSRMLS_DC); /* {{{ */ - #endif -#endif - -#if MAGICKCORE_HDRI_ENABLE - #define IMAGICK_QUANTUM_TYPE IS_DOUBLE -#else - #define IMAGICK_QUANTUM_TYPE IS_LONG -#endif - -zend_class_entry *php_imagick_sc_entry; -zend_class_entry *php_imagick_exception_class_entry; -zend_class_entry *php_imagickdraw_sc_entry; -zend_class_entry *php_imagickdraw_exception_class_entry; -zend_class_entry *php_imagickpixel_sc_entry; -zend_class_entry *php_imagickpixel_exception_class_entry; -zend_class_entry *php_imagickpixeliterator_sc_entry; -zend_class_entry *php_imagickpixeliterator_exception_class_entry; -#ifdef IMAGICK_WITH_KERNEL -zend_class_entry *php_imagickkernel_sc_entry; -zend_class_entry *php_imagickkernel_exception_class_entry; -#endif - -#if defined(ZTS) && defined(PHP_WIN32) -static MUTEX_T imagick_mutex; -static THREAD_T imagick_thread_id; -#endif - -/* Handlers */ -static zend_object_handlers imagick_object_handlers; -static zend_object_handlers imagickdraw_object_handlers; -static zend_object_handlers imagickpixel_object_handlers; -static zend_object_handlers imagickpixeliterator_object_handlers; -#ifdef IMAGICK_WITH_KERNEL -static zend_object_handlers imagickkernel_object_handlers; -#endif - -/* External API */ -PHP_IMAGICK_API zend_class_entry *php_imagick_get_class_entry() -{ - return php_imagick_sc_entry; -} - -PHP_IMAGICK_API zend_class_entry *php_imagickdraw_get_class_entry() -{ - return php_imagickdraw_sc_entry; -} - -PHP_IMAGICK_API zend_class_entry *php_imagickpixel_get_class_entry() -{ - return php_imagickpixel_sc_entry; -} - -static zend_function_entry php_imagick_functions = -{ - { NULL, NULL, NULL, 0, 0 } -}; - - -#include "ImagickDraw_arginfo.h" -const zend_function_entry *php_imagickdraw_class_methods = class_ImagickDraw_methods; - -#include "ImagickPixelIterator_arginfo.h" -const zend_function_entry *php_imagickpixeliterator_class_methods = class_ImagickPixelIterator_methods; - -#include "ImagickPixel_arginfo.h" -const zend_function_entry *php_imagickpixel_class_methods = class_ImagickPixel_methods; - -#include "Imagick_arginfo.h" -const zend_function_entry *php_imagick_class_methods = class_Imagick_methods; - -#ifdef IMAGICK_WITH_KERNEL -#include "ImagickKernel_arginfo.h" -const zend_function_entry *php_imagickkernel_class_methods = class_ImagickKernel_methods; -#endif - -static void php_imagick_object_free_storage(IM_ZEND_OBJECT *object TSRMLS_DC) -{ - php_imagick_object *intern = php_imagick_fetch_object(object); - - if (!intern) { - return; - } - - if (intern->progress_monitor_name) { - //TODO - is this meant to be free by us? - efree(intern->progress_monitor_name); - } - - if (intern->magick_wand != NULL) { - intern->magick_wand = DestroyMagickWand(intern->magick_wand); - } - - zend_object_std_dtor(&intern->zo TSRMLS_CC); -#if PHP_VERSION_ID < 70000 - efree(intern); -#endif -} - - -static void php_imagickdraw_object_free_storage(IM_ZEND_OBJECT *object TSRMLS_DC) -{ - php_imagickdraw_object *intern = php_imagickdraw_fetch_object(object); - - if (!intern) { - return; - } - - if (intern->drawing_wand != NULL) { - intern->drawing_wand = DestroyDrawingWand(intern->drawing_wand); - } - - zend_object_std_dtor(&intern->zo TSRMLS_CC); - - #if PHP_VERSION_ID < 70000 - efree(intern); - #endif -} - -static void php_imagickpixeliterator_object_free_storage(IM_ZEND_OBJECT *object TSRMLS_DC) -{ - php_imagickpixeliterator_object *intern = php_imagickpixeliterator_fetch_object(object); - - if (!intern) { - return; - } - - if (intern->pixel_iterator != NULL) { - intern->pixel_iterator = DestroyPixelIterator(intern->pixel_iterator); - } - - zend_object_std_dtor(&intern->zo TSRMLS_CC); - #if PHP_VERSION_ID < 70000 - efree(intern); - #endif -} - - - -static void php_imagickpixel_object_free_storage(IM_ZEND_OBJECT *object TSRMLS_DC) -{ - php_imagickpixel_object *intern = php_imagickpixel_fetch_object(object); - - if (!intern) { - return; - } - if (!intern->initialized_via_iterator && intern->pixel_wand) - intern->pixel_wand = DestroyPixelWand(intern->pixel_wand); - - zend_object_std_dtor(&intern->zo TSRMLS_CC); - #if PHP_VERSION_ID < 70000 - efree(intern); - #endif -} - -#ifdef IMAGICK_WITH_KERNEL -static void php_imagickkernel_object_free_storage(IM_ZEND_OBJECT *object TSRMLS_DC) -{ - php_imagickkernel_object *intern = php_imagickkernel_fetch_object(object); - - if (!intern) { - return; - } - - if (intern->kernel_info != NULL) { - // This segfaults in PHP 5.6 - //intern->kernel_info = DestroyKernelInfo(intern->kernel_info); - intern->kernel_info = NULL; - } - - zend_object_std_dtor(&intern->zo TSRMLS_CC); -#if PHP_VERSION_ID < 70000 - efree(intern); -#endif -} -#endif - - -#if PHP_VERSION_ID < 50399 -# define object_properties_init(zo, class_type) { \ - zval *tmp; \ - zend_hash_copy((*zo).properties, \ - &class_type->default_properties, \ - (copy_ctor_func_t) zval_add_ref, \ - (void *) &tmp, \ - sizeof(zval *)); \ - } -#endif - -#if PHP_VERSION_ID >= 70000 -static zend_object * php_imagick_object_new_ex(zend_class_entry *class_type, php_imagick_object **ptr, zend_bool init_wand TSRMLS_DC) -#else -static zend_object_value php_imagick_object_new_ex(zend_class_entry *class_type, php_imagick_object **ptr, zend_bool init_wand TSRMLS_DC) -#endif - -{ - php_imagick_object *intern; - - /* Allocate memory for it */ -#if PHP_VERSION_ID >= 70000 - intern = ecalloc(1, - sizeof(php_imagick_object) + - zend_object_properties_size(class_type)); -#else - zend_object_value retval; - - intern = (php_imagick_object *) emalloc(sizeof(php_imagick_object)); - memset(&intern->zo, 0, sizeof(zend_object)); -#endif - -#if defined(ZTS) && defined(PHP_WIN32) - /* If its our thread then we already have the lock so no need to lock again */ - if (imagick_thread_id != tsrm_thread_id()) { - tsrm_mutex_lock(imagick_mutex); - imagick_thread_id = tsrm_thread_id(); - } -#endif - - if (ptr) { - *ptr = intern; - } - - /* Set the magickwand */ - if (init_wand) { - intern->magick_wand = NewMagickWand(); - - if (!intern->magick_wand) { - zend_error(E_ERROR, "Failed to create Imagick object, could not set magick_wand"); - } - } else { - intern->magick_wand = NULL; - } - intern->next_out_of_bound = 0; - intern->progress_monitor_name = NULL; - - zend_object_std_init(&intern->zo, class_type TSRMLS_CC); - object_properties_init(&intern->zo, class_type); - -#if PHP_VERSION_ID >= 70000 - intern->zo.handlers = &imagick_object_handlers; - return &intern->zo; -#else - retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) php_imagick_object_free_storage, NULL TSRMLS_CC); - retval.handlers = (zend_object_handlers *) &imagick_object_handlers; - return retval; -#endif -} - - -#if PHP_VERSION_ID >= 70000 -static zend_object * php_imagick_object_new(zend_class_entry *class_type TSRMLS_DC) -#else -static zend_object_value php_imagick_object_new(zend_class_entry *class_type TSRMLS_DC) -#endif -{ - return php_imagick_object_new_ex(class_type, NULL, 1 TSRMLS_CC); -} - -#if PHP_VERSION_ID >= 70000 -static zend_object * php_imagickdraw_object_new_ex(zend_class_entry *class_type, php_imagickdraw_object **ptr, zend_bool init_wand TSRMLS_DC) -#else -static zend_object_value php_imagickdraw_object_new_ex(zend_class_entry *class_type, php_imagickdraw_object **ptr, zend_bool init_wand TSRMLS_DC) -#endif -{ - php_imagickdraw_object *intern; - -#if PHP_VERSION_ID >= 70000 - /* Allocate memory for it */ - intern = ecalloc(1, - sizeof(php_imagickdraw_object) + - zend_object_properties_size(class_type)); - - zend_object_std_init(&intern->zo, class_type TSRMLS_CC); - object_properties_init(&intern->zo, class_type); - intern->zo.handlers = &imagickdraw_object_handlers; -#else - zend_object_value retval; - intern = (php_imagickdraw_object *) emalloc(sizeof(php_imagickdraw_object)); - memset(&intern->zo, 0, sizeof(zend_object)); -#endif - - if (ptr) { - *ptr = intern; - } - - /* Set the DrawingWand */ - if (init_wand) { - intern->drawing_wand = NewDrawingWand(); - - if (!intern->drawing_wand) { - zend_error(E_ERROR, "Failed to create ImagickDraw object"); - } - } else { - intern->drawing_wand = NULL; - } -#if PHP_VERSION_ID >= 70000 - intern->zo.handlers = &imagickdraw_object_handlers; - - return &intern->zo; -#else - /* ALLOC_HASHTABLE(intern->zo.properties); */ - zend_object_std_init(&intern->zo, class_type TSRMLS_CC); - object_properties_init(&intern->zo, class_type); - retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) php_imagickdraw_object_free_storage, NULL TSRMLS_CC); - retval.handlers = (zend_object_handlers *) &imagickdraw_object_handlers; - - return retval; -#endif -} - -#if PHP_VERSION_ID >= 70000 -static zend_object * php_imagickdraw_object_new(zend_class_entry *class_type TSRMLS_DC) -#else -static zend_object_value php_imagickdraw_object_new(zend_class_entry *class_type TSRMLS_DC) -#endif -{ - return php_imagickdraw_object_new_ex(class_type, NULL, 1 TSRMLS_CC); -} - -#if PHP_VERSION_ID >= 70000 -static zend_object * php_imagickpixeliterator_object_new(zend_class_entry *class_type TSRMLS_DC) -#else -static zend_object_value php_imagickpixeliterator_object_new(zend_class_entry *class_type TSRMLS_DC) -#endif -{ - php_imagickpixeliterator_object *intern; - - /* Allocate memory for it */ -#if PHP_VERSION_ID >= 70000 - intern = ecalloc(1, - sizeof(php_imagickpixeliterator_object) + - zend_object_properties_size(class_type)); -#else - zend_object_value retval; - intern = (php_imagickpixeliterator_object *) emalloc(sizeof(php_imagickpixeliterator_object)); - memset(&intern->zo, 0, sizeof(zend_object)); -#endif - - /* We cant initialize yet */ - intern->pixel_iterator = NULL; - intern->initialized = 0; - -#if MagickLibVersion <= 0x628 - intern->rows = 0; - intern->iterator_position = 0; -#endif - - zend_object_std_init(&intern->zo, class_type TSRMLS_CC); - object_properties_init(&intern->zo, class_type); - -#if PHP_VERSION_ID >= 70000 - intern->zo.handlers = &imagickpixeliterator_object_handlers; - - return &intern->zo; -#else - retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) php_imagickpixeliterator_object_free_storage, NULL TSRMLS_CC); - retval.handlers = (zend_object_handlers *) &imagickpixeliterator_object_handlers; - - return retval; -#endif -} - -#if PHP_VERSION_ID >= 70000 -static zend_object * php_imagickpixel_object_new_ex(zend_class_entry *class_type, php_imagickpixel_object **ptr TSRMLS_DC) -#else -static zend_object_value php_imagickpixel_object_new_ex(zend_class_entry *class_type, php_imagickpixel_object **ptr TSRMLS_DC) -#endif -{ - php_imagickpixel_object *intern; - -#if PHP_VERSION_ID >= 70000 - /* Allocate memory for it */ - intern = ecalloc(1, - sizeof(php_imagickpixel_object) + - zend_object_properties_size(class_type)); -#else - zend_object_value retval; - intern = (php_imagickpixel_object *) emalloc(sizeof(php_imagickpixel_object)); - memset(&intern->zo, 0, sizeof(zend_object)); -#endif - - if (ptr) { - *ptr = intern; - } - - /* Set the pixeliterator */ - intern->pixel_wand = NULL; - intern->initialized_via_iterator = 0; - zend_object_std_init(&intern->zo, class_type TSRMLS_CC); - object_properties_init(&intern->zo, class_type); - -#if PHP_VERSION_ID >= 70000 - intern->zo.handlers = &imagickpixel_object_handlers; - - return &intern->zo; -#else - retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) php_imagickpixel_object_free_storage, NULL TSRMLS_CC); - retval.handlers = (zend_object_handlers *) &imagickpixel_object_handlers; - - return retval; -#endif - -} - -#if PHP_VERSION_ID >= 70000 -static zend_object * php_imagickpixel_object_new(zend_class_entry *class_type TSRMLS_DC) -#else -static zend_object_value php_imagickpixel_object_new(zend_class_entry *class_type TSRMLS_DC) -#endif -{ - return php_imagickpixel_object_new_ex(class_type, NULL TSRMLS_CC); -} - -#ifdef IMAGICK_WITH_KERNEL - -#if PHP_VERSION_ID >= 70000 -static zend_object * php_imagickkernel_object_new_ex(zend_class_entry *class_type, php_imagickkernel_object **ptr TSRMLS_DC) -#else -static zend_object_value php_imagickkernel_object_new_ex(zend_class_entry *class_type, php_imagickkernel_object **ptr TSRMLS_DC) -#endif -{ - - php_imagickkernel_object *intern; - - /* Allocate memory for it */ -#if PHP_VERSION_ID >= 70000 - intern = ecalloc(1, - sizeof(php_imagickkernel_object) + - zend_object_properties_size(class_type)); -#else - zend_object_value retval; - intern = (php_imagickkernel_object *) emalloc(sizeof(php_imagickkernel_object)); - memset(&intern->zo, 0, sizeof(zend_object)); -#endif - - if (ptr) { - *ptr = intern; - } - - /* Set the kernel */ - intern->kernel_info = NULL; - - /* ALLOC_HASHTABLE(intern->zo.properties); */ - zend_object_std_init(&intern->zo, class_type TSRMLS_CC); - object_properties_init(&intern->zo, class_type); - -#if PHP_VERSION_ID >= 70000 - intern->zo.handlers = &imagickkernel_object_handlers; - - return &intern->zo; -#else - retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) php_imagickkernel_object_free_storage, NULL TSRMLS_CC); - retval.handlers = (zend_object_handlers *) &imagickkernel_object_handlers; - - return retval; -#endif -} -#endif - -#undef object_properties_init - -#ifdef IMAGICK_WITH_KERNEL -#if PHP_VERSION_ID >= 70000 -static zend_object * php_imagickkernel_object_new(zend_class_entry *class_type TSRMLS_DC) -#else -static zend_object_value php_imagickkernel_object_new(zend_class_entry *class_type TSRMLS_DC) -#endif -{ - return php_imagickkernel_object_new_ex(class_type, NULL TSRMLS_CC); -} -#endif - - - -PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("imagick.locale_fix", "0", PHP_INI_ALL, OnUpdateBool, locale_fix, zend_imagick_globals, imagick_globals) - STD_PHP_INI_ENTRY("imagick.skip_version_check", "0", PHP_INI_ALL, OnUpdateBool, skip_version_check, zend_imagick_globals, imagick_globals) - STD_PHP_INI_ENTRY("imagick.progress_monitor", "0", PHP_INI_SYSTEM, OnUpdateBool, progress_monitor, zend_imagick_globals, imagick_globals) - - STD_PHP_INI_ENTRY("imagick.set_single_thread", "1", PHP_INI_SYSTEM, OnUpdateBool, set_single_thread, zend_imagick_globals, imagick_globals) - STD_PHP_INI_ENTRY("imagick.shutdown_sleep_count", "10", PHP_INI_ALL, OnUpdateLong, shutdown_sleep_count, zend_imagick_globals, imagick_globals) - STD_PHP_INI_ENTRY("imagick.allow_zero_dimension_images", "0", PHP_INI_ALL, OnUpdateBool, allow_zero_dimension_images, zend_imagick_globals, imagick_globals) -PHP_INI_END() - -static void php_imagick_init_globals(zend_imagick_globals *imagick_globals) -{ - imagick_globals->locale_fix = 0; - imagick_globals->progress_monitor = 0; - imagick_globals->skip_version_check = 0; - imagick_globals->set_single_thread = 1; - imagick_globals->allow_zero_dimension_images = 0; - // 10 is magick number, that seems to be enough. - imagick_globals->shutdown_sleep_count = 10; -} - - -#if PHP_VERSION_ID >= 80000 -static int php_imagick_count_elements(zend_object *object, im_long *count) /* {{{ */ -{ - php_imagick_object *intern= php_imagick_fetch_object(object); -#else -static int php_imagick_count_elements(zval *object, im_long *count TSRMLS_DC) /* {{{ */ -{ - php_imagick_object *intern= Z_IMAGICK_P(object); -#endif - - if (intern->magick_wand) { - *count = MagickGetNumberImages(intern->magick_wand); - return SUCCESS; - } - return FAILURE; -} - - -#if PHP_VERSION_ID >= 80000 -static zval *php_imagick_read_property(zend_object *object, zend_string *member, int type, void **cache_slot, zval *rv) -{ - int ret; - php_imagick_object *intern; - zval *retval = NULL; - const zend_object_handlers *std_hnd; - - - std_hnd = zend_get_std_object_handlers(); - - ret = std_hnd->has_property(object, member, type, cache_slot TSRMLS_CC); - - if (ret) { - //TODO - this would allow better immutability - //ZVAL_COPY_VALUE(retval, std_hnd->read_property(object, member, type, cache_slot, rv TSRMLS_CC)); - retval = std_hnd->read_property(object, member, type, cache_slot, rv TSRMLS_CC); - } - else { - - intern = php_imagick_fetch_object(object); - /* Do we have any images? */ - if (MagickGetNumberImages(intern->magick_wand)) { - - //TODO - this seems redundant - /* Is this overloaded? */ - if (!strcmp(ZSTR_VAL(member), "width") || - !strcmp(ZSTR_VAL(member), "height") || - !strcmp(ZSTR_VAL(member), "format")) { - - if (!strcmp(ZSTR_VAL(member), "width")) { - retval = rv; - ZVAL_LONG(retval, MagickGetImageWidth(intern->magick_wand)); - } else if (!strcmp(ZSTR_VAL(member), "height")) { - retval = rv; - ZVAL_LONG(retval, MagickGetImageHeight(intern->magick_wand)); - } else if (!strcmp(ZSTR_VAL(member), "format")) { - char *format = MagickGetImageFormat(intern->magick_wand); - - if (format) { - retval = rv; - ZVAL_STRING(retval, format); - php_strtolower(Z_STRVAL_P(retval), Z_STRLEN_P(retval)); - IMAGICK_FREE_MAGICK_MEMORY(format); - } else { - retval = rv; - ZVAL_STRING(retval, ""); - } - } - } - } - } - - if (!retval) { - //TODO - why is the error silent - it would be a small BC break - //to enable the warning. I think it would be the correct thing to do though. - //zend_error(E_NOTICE,"Undefined property: \Imagick::$%s", Z_STRVAL_P(member)); - retval = &EG(uninitialized_zval); - } - - return retval; -} - -#else // PHP_VERSION_ID >= 80000 - -#if PHP_VERSION_ID >= 70000 -static zval *php_imagick_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC) -{ - int ret; - php_imagick_object *intern; - zval *retval = NULL; - zval tmp_member; - const zend_object_handlers *std_hnd; - - ZVAL_DEREF(member); - if (Z_TYPE_P(member) != IS_STRING) { - tmp_member = *member; - zval_copy_ctor(&tmp_member); - convert_to_string(&tmp_member); - member = &tmp_member; - } - - std_hnd = zend_get_std_object_handlers(); - - ret = std_hnd->has_property(object, member, type, cache_slot TSRMLS_CC); - - if (ret) { - //TODO - this would allow better immutability - //ZVAL_COPY_VALUE(retval, std_hnd->read_property(object, member, type, cache_slot, rv TSRMLS_CC)); - retval = std_hnd->read_property(object, member, type, cache_slot, rv TSRMLS_CC); - } - else { - - intern = Z_IMAGICK_P(object); - /* Do we have any images? */ - if (MagickGetNumberImages(intern->magick_wand)) { - - //TODO - this seems redundant - /* Is this overloaded? */ - if (!strcmp(Z_STRVAL_P(member), "width") || - !strcmp(Z_STRVAL_P(member), "height") || - !strcmp(Z_STRVAL_P(member), "format")) { - - if (!strcmp(Z_STRVAL_P(member), "width")) { - retval = rv; - ZVAL_LONG(retval, MagickGetImageWidth(intern->magick_wand)); - } else if (!strcmp(Z_STRVAL_P(member), "height")) { - retval = rv; - ZVAL_LONG(retval, MagickGetImageHeight(intern->magick_wand)); - } else if (!strcmp(Z_STRVAL_P(member), "format")) { - char *format = MagickGetImageFormat(intern->magick_wand); - - if (format) { - retval = rv; - ZVAL_STRING(retval, format); - php_strtolower(Z_STRVAL_P(retval), Z_STRLEN_P(retval)); - IMAGICK_FREE_MAGICK_MEMORY(format); - } else { - retval = rv; - ZVAL_STRING(retval, ""); - } - } - } - } - } - - if (!retval) { - //TODO - why is the error silent - it would be a small BC break - //to enable the warning. I think it would be the correct thing to do though. - //zend_error(E_NOTICE,"Undefined property: \Imagick::$%s", Z_STRVAL_P(member)); - retval = &EG(uninitialized_zval); - } - - if (member == &tmp_member) { - zval_dtor(member); - } - - return retval; -} - -#else - -#if PHP_VERSION_ID < 50399 -static zval *php_imagick_read_property(zval *object, zval *member, int type TSRMLS_DC) -#else -static zval *php_imagick_read_property(zval *object, zval *member, int type, const zend_literal *key TSRMLS_DC) -#endif -{ - int ret; - php_imagick_object *intern; - zval *retval = NULL, tmp_member; - zend_object_handlers *std_hnd; - - if (Z_TYPE_P(member) != IS_STRING) { - tmp_member = *member; - zval_copy_ctor(&tmp_member); - convert_to_string(&tmp_member); - member = &tmp_member; - } - - std_hnd = zend_get_std_object_handlers(); -#if PHP_VERSION_ID < 50399 - ret = std_hnd->has_property(object, member, 2 TSRMLS_CC); -#else - ret = std_hnd->has_property(object, member, 2, key TSRMLS_CC); -#endif - - if (ret) { - std_hnd = zend_get_std_object_handlers(); -#if PHP_VERSION_ID < 50399 - retval = std_hnd->read_property(object, member, type TSRMLS_CC); -#else - retval = std_hnd->read_property(object, member, type, key TSRMLS_CC); -#endif - } else { - intern = (php_imagick_object *) zend_object_store_get_object(object TSRMLS_CC); - /* Do we have any images? */ - if (MagickGetNumberImages(intern->magick_wand)) { - /* Is this overloaded? */ - if (!strcmp(Z_STRVAL_P(member), "width") || - !strcmp(Z_STRVAL_P(member), "height") || - !strcmp(Z_STRVAL_P(member), "format")) { - - MAKE_STD_ZVAL(retval); -#ifdef Z_SET_REFCOUNT_P - Z_SET_REFCOUNT_P(retval, 0); -#else - retval->refcount = 0; -#endif - if (!strcmp(Z_STRVAL_P(member), "width")) { - ZVAL_LONG(retval, MagickGetImageWidth(intern->magick_wand)); - } else if (!strcmp(Z_STRVAL_P(member), "height")) { - ZVAL_LONG(retval, MagickGetImageHeight(intern->magick_wand)); - } else if (!strcmp(Z_STRVAL_P(member), "format")) { - char *format = MagickGetImageFormat(intern->magick_wand); - - if (format) { - ZVAL_STRING(retval, format, 1); - php_strtolower(Z_STRVAL_P(retval), Z_STRLEN_P(retval)); - IMAGICK_FREE_MAGICK_MEMORY(format); - } else { - ZVAL_STRING(retval, "", 1); - } - } - } - } - } - if (member == &tmp_member) { - zval_dtor(member); - } - - if (!retval) { - retval = EG(uninitialized_zval_ptr); - } - return retval; -} -#endif - -#endif - -#if PHP_VERSION_ID >= 80000 -static zend_object * php_imagick_clone_imagick_object(zend_object *this_ptr) -#elif PHP_VERSION_ID >= 70000 -static zend_object * php_imagick_clone_imagick_object(zval *this_ptr TSRMLS_DC) -#else -static zend_object_value php_imagick_clone_imagick_object(zval *this_ptr TSRMLS_DC) -#endif -{ - MagickWand *wand_copy = NULL; - php_imagick_object *new_obj = NULL; -#if PHP_VERSION_ID >= 80000 - php_imagick_object *old_obj = php_imagick_fetch_object(this_ptr); - zend_object * new_zo = php_imagick_object_new_ex(old_obj->zo.ce, &new_obj, 0 TSRMLS_CC); - zend_objects_clone_members(&new_obj->zo, &old_obj->zo TSRMLS_CC); -#elif PHP_VERSION_ID >= 70000 - php_imagick_object *old_obj = Z_IMAGICK_P(this_ptr); - zend_object * new_zo = php_imagick_object_new_ex(old_obj->zo.ce, &new_obj, 0 TSRMLS_CC); - zend_objects_clone_members(&new_obj->zo, &old_obj->zo TSRMLS_CC); -#else - php_imagick_object *old_obj = (php_imagick_object *) zend_object_store_get_object(this_ptr TSRMLS_CC); - zend_object_value new_zo = php_imagick_object_new_ex(old_obj->zo.ce, &new_obj, 0 TSRMLS_CC); - zend_objects_clone_members(&new_obj->zo, new_zo, &old_obj->zo, Z_OBJ_HANDLE_P(this_ptr) TSRMLS_CC); -#endif - - wand_copy = CloneMagickWand(old_obj->magick_wand); - if (!wand_copy) { - zend_error(E_ERROR, "Failed to clone Imagick object"); - } else { - php_imagick_replace_magickwand(new_obj, wand_copy); - new_obj->next_out_of_bound = old_obj->next_out_of_bound; - - if (old_obj->progress_monitor_name) { - new_obj->progress_monitor_name = estrdup(old_obj->progress_monitor_name); - } - } - return new_zo; -} - -#if PHP_VERSION_ID >= 80000 -static zend_object * php_imagick_clone_imagickdraw_object(zend_object *this_ptr) -#elif PHP_VERSION_ID >= 70000 -static zend_object * php_imagick_clone_imagickdraw_object(zval *this_ptr TSRMLS_DC) -#else -static zend_object_value php_imagick_clone_imagickdraw_object(zval *this_ptr TSRMLS_DC) -#endif -{ - DrawingWand *wand_copy = NULL; - php_imagickdraw_object *new_obj = NULL; -#if PHP_VERSION_ID >= 80000 - php_imagickdraw_object *old_obj = php_imagickdraw_fetch_object(this_ptr); - zend_object * new_zo = php_imagickdraw_object_new_ex(old_obj->zo.ce, &new_obj, 0 TSRMLS_CC); - zend_objects_clone_members(&new_obj->zo, &old_obj->zo TSRMLS_CC); -#elif PHP_VERSION_ID >= 70000 - php_imagickdraw_object *old_obj = Z_IMAGICKDRAW_P(this_ptr); - zend_object * new_zo = php_imagickdraw_object_new_ex(old_obj->zo.ce, &new_obj, 0 TSRMLS_CC); - zend_objects_clone_members(&new_obj->zo, &old_obj->zo TSRMLS_CC); -#else - php_imagickdraw_object *old_obj = (php_imagickdraw_object *) zend_object_store_get_object(this_ptr TSRMLS_CC); - zend_object_value new_zo = php_imagickdraw_object_new_ex(old_obj->zo.ce, &new_obj, 0 TSRMLS_CC); - zend_objects_clone_members(&new_obj->zo, new_zo, &old_obj->zo, Z_OBJ_HANDLE_P(this_ptr) TSRMLS_CC); -#endif - - wand_copy = CloneDrawingWand(old_obj->drawing_wand); - - if (!wand_copy) { - zend_error(E_ERROR, "Failed to clone ImagickDraw object"); - } else { - php_imagick_replace_drawingwand(new_obj, wand_copy); - } - return new_zo; -} - - -#if PHP_VERSION_ID >= 80000 -static zend_object * php_imagick_clone_imagickpixel_object(zend_object *this_ptr) -#elif PHP_VERSION_ID >= 70000 -static zend_object * php_imagick_clone_imagickpixel_object(zval *this_ptr TSRMLS_DC) -#else -static zend_object_value php_imagick_clone_imagickpixel_object(zval *this_ptr TSRMLS_DC) -#endif -{ - PixelWand *wand_copy = NULL; - php_imagickpixel_object *new_obj = NULL; - -#if PHP_VERSION_ID >= 80000 - zend_object *new_zo; - php_imagickpixel_object *old_obj = php_imagickpixel_fetch_object(this_ptr); - new_zo = php_imagickpixel_object_new_ex(old_obj->zo.ce, &new_obj TSRMLS_CC); - zend_objects_clone_members(&new_obj->zo, &old_obj->zo TSRMLS_CC); -#elif PHP_VERSION_ID >= 70000 - zend_object *new_zo; - php_imagickpixel_object *old_obj = Z_IMAGICKPIXEL_P(this_ptr); - new_zo = php_imagickpixel_object_new_ex(old_obj->zo.ce, &new_obj TSRMLS_CC); - zend_objects_clone_members(&new_obj->zo, &old_obj->zo TSRMLS_CC); -#else - php_imagickpixel_object *old_obj = (php_imagickpixel_object *) zend_object_store_get_object(this_ptr TSRMLS_CC); - zend_object_value new_zo = php_imagickpixel_object_new_ex(old_obj->zo.ce, &new_obj TSRMLS_CC); - zend_objects_clone_members(&new_obj->zo, new_zo, &old_obj->zo, Z_OBJ_HANDLE_P(this_ptr) TSRMLS_CC); -#endif - - wand_copy = php_imagick_clone_pixelwand (old_obj->pixel_wand); - if (!wand_copy) { - zend_error(E_ERROR, "Failed to clone ImagickPixel object"); - } else { - php_imagick_replace_pixelwand(new_obj, wand_copy); - new_obj->initialized_via_iterator = 0; - } - return new_zo; -} - -#ifdef IMAGICK_WITH_KERNEL - -#if PHP_VERSION_ID >= 80000 -static zend_object * php_imagick_clone_imagickkernel_object(zend_object *this_ptr TSRMLS_DC) -#elif PHP_VERSION_ID >= 70000 -static zend_object * php_imagick_clone_imagickkernel_object(zval *this_ptr TSRMLS_DC) -#else -static zend_object_value php_imagick_clone_imagickkernel_object(zval *this_ptr TSRMLS_DC) -#endif -{ - KernelInfo *kernel_info_copy = NULL; - php_imagickkernel_object *new_obj = NULL; - -#if PHP_VERSION_ID >= 80000 - zend_object *new_zo; - php_imagickkernel_object *old_obj = php_imagickkernel_fetch_object(this_ptr); - new_zo = php_imagickkernel_object_new_ex(old_obj->zo.ce, &new_obj TSRMLS_CC); - zend_objects_clone_members(&new_obj->zo, &old_obj->zo TSRMLS_CC); -#elif PHP_VERSION_ID >= 70000 - zend_object *new_zo; - php_imagickkernel_object *old_obj = Z_IMAGICKKERNEL_P(this_ptr); - new_zo = php_imagickkernel_object_new_ex(old_obj->zo.ce, &new_obj TSRMLS_CC); - zend_objects_clone_members(&new_obj->zo, &old_obj->zo TSRMLS_CC); -#else - zend_object_value new_zo; - php_imagickkernel_object *old_obj = (php_imagickkernel_object *) zend_object_store_get_object(this_ptr TSRMLS_CC); - new_zo = php_imagickkernel_object_new_ex(old_obj->zo.ce, &new_obj TSRMLS_CC); - zend_objects_clone_members(&new_obj->zo, new_zo, &old_obj->zo, Z_OBJ_HANDLE_P(this_ptr) TSRMLS_CC); -#endif - - if (old_obj->kernel_info != NULL) { - kernel_info_copy = CloneKernelInfo(old_obj->kernel_info); - - if (!kernel_info_copy) { - zend_error(E_ERROR, "Failed to clone ImagickKernel object"); - } - else { - new_obj->kernel_info = kernel_info_copy; - } - } - - return new_zo; -} -#endif - - -static void checkImagickVersion() -{ - //This gets the version that Imagick was compiled against. - size_t imagickVersion = MagickLibVersion; - - //This gets the version of ImageMagick that has been loaded - size_t imageMagickLibraryVersion; - - GetMagickVersion(&imageMagickLibraryVersion); - - if (imagickVersion == imageMagickLibraryVersion) { - return; - } - - zend_error( - E_WARNING, - "Version warning: Imagick was compiled against ImageMagick version %lu but version %lu is loaded. Imagick will run but may behave surprisingly", - (unsigned long)imagickVersion, - (unsigned long)imageMagickLibraryVersion - ); -} - -PHP_MINIT_FUNCTION(imagick) -{ - zend_class_entry ce; - - /* Initialize globals */ - ZEND_INIT_MODULE_GLOBALS(imagick, php_imagick_init_globals, NULL); - - - // This suppresses an 'unused parameter' warning. - (void)type; - - /* - Allocate some memory - */ - memcpy(&imagick_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - memcpy(&imagickdraw_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - memcpy(&imagickpixeliterator_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - memcpy(&imagickpixel_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); -#ifdef IMAGICK_WITH_KERNEL - memcpy(&imagickkernel_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); -#endif - - /* Set custom allocators */ - MagickWandGenesis(); - - /* - Initialize exceptions (Imagick exception) - */ - INIT_CLASS_ENTRY(ce, PHP_IMAGICK_EXCEPTION_SC_NAME, NULL); -#if PHP_VERSION_ID >= 70000 - php_imagick_exception_class_entry = zend_register_internal_class_ex(&ce, zend_ce_exception); -#else - php_imagick_exception_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default(TSRMLS_C), NULL TSRMLS_CC); -#endif - - /* - Initialize exceptions (ImagickDraw exception) - */ - INIT_CLASS_ENTRY(ce, PHP_IMAGICKDRAW_EXCEPTION_SC_NAME, NULL); -#if PHP_VERSION_ID >= 70000 - php_imagickdraw_exception_class_entry = zend_register_internal_class_ex(&ce, zend_ce_exception); -#else - php_imagickdraw_exception_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default(TSRMLS_C), NULL TSRMLS_CC); -#endif - - /* - Initialize exceptions (ImagickPixelIterator exception) - */ - INIT_CLASS_ENTRY(ce, PHP_IMAGICKPIXELITERATOR_EXCEPTION_SC_NAME, NULL); -#if PHP_VERSION_ID >= 70000 - php_imagickpixeliterator_exception_class_entry = zend_register_internal_class_ex(&ce, zend_ce_exception); -#else - php_imagickpixeliterator_exception_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default(TSRMLS_C), NULL TSRMLS_CC); -#endif - - /* - Initialize exceptions (ImagickPixel exception) - */ - INIT_CLASS_ENTRY(ce, PHP_IMAGICKPIXEL_EXCEPTION_SC_NAME, NULL); -#if PHP_VERSION_ID >= 70000 - php_imagickpixel_exception_class_entry = zend_register_internal_class_ex(&ce, zend_ce_exception); -#else - php_imagickpixel_exception_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default(TSRMLS_C), NULL TSRMLS_CC); -#endif - -#ifdef IMAGICK_WITH_KERNEL - /* - Initialize exceptions (ImagickKernel exception) - */ - INIT_CLASS_ENTRY(ce, PHP_IMAGICKKERNEL_EXCEPTION_SC_NAME, NULL); - #if PHP_VERSION_ID >= 70000 - php_imagickkernel_exception_class_entry = zend_register_internal_class_ex(&ce, zend_ce_exception); - #else - php_imagickkernel_exception_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default(TSRMLS_C), NULL TSRMLS_CC); - #endif - -#endif - - /* - Initialize the class (Imagick) - */ - INIT_CLASS_ENTRY(ce, PHP_IMAGICK_SC_NAME, php_imagick_class_methods); - ce.create_object = php_imagick_object_new; - imagick_object_handlers.clone_obj = php_imagick_clone_imagick_object; - imagick_object_handlers.read_property = php_imagick_read_property; - imagick_object_handlers.count_elements = php_imagick_count_elements; -#if PHP_VERSION_ID >= 70000 - imagick_object_handlers.offset = XtOffsetOf(php_imagick_object, zo); - imagick_object_handlers.free_obj = php_imagick_object_free_storage; -#endif - - php_imagick_sc_entry = zend_register_internal_class(&ce TSRMLS_CC); - zend_class_implements(php_imagick_sc_entry TSRMLS_CC, 2, zend_ce_iterator, im_ce_countable); - - /* - Initialize the class (ImagickDraw) - */ - INIT_CLASS_ENTRY(ce, PHP_IMAGICKDRAW_SC_NAME, php_imagickdraw_class_methods); - ce.create_object = php_imagickdraw_object_new; - imagickdraw_object_handlers.clone_obj = php_imagick_clone_imagickdraw_object; -#if PHP_VERSION_ID >= 70000 - imagickdraw_object_handlers.offset = XtOffsetOf(php_imagickdraw_object, zo); - imagickdraw_object_handlers.free_obj = php_imagickdraw_object_free_storage; -#endif - php_imagickdraw_sc_entry = zend_register_internal_class(&ce TSRMLS_CC); - - /* - Initialize the class (ImagickPixelIterator) - */ - INIT_CLASS_ENTRY(ce, PHP_IMAGICKPIXELITERATOR_SC_NAME, php_imagickpixeliterator_class_methods); - ce.create_object = php_imagickpixeliterator_object_new; - imagickpixeliterator_object_handlers.clone_obj = NULL; -#if PHP_VERSION_ID >= 70000 - imagickpixeliterator_object_handlers.offset = XtOffsetOf(php_imagickpixeliterator_object, zo); - imagickpixeliterator_object_handlers.free_obj = php_imagickpixeliterator_object_free_storage; -#endif - php_imagickpixeliterator_sc_entry = zend_register_internal_class(&ce TSRMLS_CC); - zend_class_implements(php_imagickpixeliterator_sc_entry TSRMLS_CC, 1, zend_ce_iterator); - - /* - Initialize the class (ImagickPixel) - */ - INIT_CLASS_ENTRY(ce, PHP_IMAGICKPIXEL_SC_NAME, php_imagickpixel_class_methods); - ce.create_object = php_imagickpixel_object_new; - imagickpixel_object_handlers.clone_obj = php_imagick_clone_imagickpixel_object; -#if PHP_VERSION_ID >= 70000 - imagickpixel_object_handlers.offset = XtOffsetOf(php_imagickpixel_object, zo); - imagickpixel_object_handlers.free_obj = php_imagickpixel_object_free_storage; -#endif - - php_imagickpixel_sc_entry = zend_register_internal_class(&ce TSRMLS_CC); - -#ifdef IMAGICK_WITH_KERNEL - /* - Initialize the class (ImagickKernel) - */ - INIT_CLASS_ENTRY(ce, PHP_IMAGICKKERNEL_SC_NAME, php_imagickkernel_class_methods); - ce.create_object = php_imagickkernel_object_new; - // Disabled until can be compiled under wall correctly - imagickkernel_object_handlers.get_debug_info = php_imagickkernel_get_debug_info; - imagickkernel_object_handlers.clone_obj = php_imagick_clone_imagickkernel_object; - #if PHP_VERSION_ID >= 70000 - imagickkernel_object_handlers.offset = XtOffsetOf(php_imagickkernel_object, zo); - imagickkernel_object_handlers.free_obj = php_imagickkernel_object_free_storage; - #endif - - php_imagickkernel_sc_entry = zend_register_internal_class(&ce TSRMLS_CC); -#endif - - php_imagick_initialize_constants (TSRMLS_C); - -#if defined(ZTS) && defined(PHP_WIN32) - imagick_mutex = tsrm_mutex_alloc(); -#endif - - REGISTER_INI_ENTRIES(); - - if (!IMAGICK_G(skip_version_check)) { - checkImagickVersion(); - } - - return SUCCESS; -} - - -PHP_MINFO_FUNCTION(imagick) -{ - -#if PHP_VERSION_ID >= 70000 - smart_string formats = {0}; -#else - smart_str formats = {0}; -#endif - - char **supported_formats, *buffer; - unsigned long i; - size_t num_formats; - size_t version_number; - - num_formats = 0; - - supported_formats = MagickQueryFormats("*", &num_formats); - spprintf(&buffer, 0, "%ld", (long)num_formats); - - php_info_print_table_start(); - php_info_print_table_header(2, "imagick module", "enabled"); - php_info_print_table_row(2, "imagick module version", PHP_IMAGICK_VERSION); -#ifdef IMAGICK_WITH_KERNEL - php_info_print_table_row(2, "imagick classes", "Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator, ImagickKernel"); -#else - php_info_print_table_row(2, "imagick classes", "Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator"); -#endif -#ifdef MagickVersion - php_info_print_table_row(2, "Imagick compiled with ImageMagick version", MagickVersion); -#endif - php_info_print_table_row(2, "Imagick using ImageMagick library version", MagickGetVersion(&version_number)); - php_info_print_table_row(2, "ImageMagick copyright", MagickGetCopyright()); - php_info_print_table_row(2, "ImageMagick release date", MagickGetReleaseDate()); - php_info_print_table_row(2, "ImageMagick number of supported formats: ", buffer); - - efree (buffer); - - if (supported_formats) { - for (i = 0; i < num_formats; i++) { -#if PHP_VERSION_ID >= 70000 - if (i != 0) { - smart_string_appends(&formats, ", "); - } - smart_string_appends(&formats, supported_formatsi); -#else - smart_str_appends(&formats, supported_formatsi); - if (i != (num_formats - 1)) { - smart_str_appends(&formats, ", "); - } -#endif - IMAGICK_FREE_MAGICK_MEMORY(supported_formatsi); - } - -#if PHP_VERSION_ID >= 70000 - smart_string_0(&formats); - php_info_print_table_row(2, "ImageMagick supported formats", formats.c); - smart_string_free(&formats); -#else - smart_str_0(&formats); - php_info_print_table_row(2, "ImageMagick supported formats", formats.c); - smart_str_free(&formats); -#endif - IMAGICK_FREE_MAGICK_MEMORY(supported_formats); - } - - php_info_print_table_end(); - DISPLAY_INI_ENTRIES(); -} - - -PHP_MSHUTDOWN_FUNCTION(imagick) -{ -#if !HAVE_OMP_PAUSE_RESOURCE_ALL - int i; -#endif - -// This suppresses an 'unused parameter' warning. - (void)type; - - MagickWandTerminus(); - -#if HAVE_OMP_PAUSE_RESOURCE_ALL - omp_pause_resource_all(omp_pause_hard); -#else - // Sleep for a bit to hopefully allow OpenMP to - // shut down the threads it created, and avoid a segfault - // This hack won't be needed once everyone is compiling ImageMagick - // against a version of OpenMP that has omp_pause_resource_all() - for (i = 0; i < 100 && i < IMAGICK_G(shutdown_sleep_count); i += 1) { - usleep(1000); - } -#endif - -#if defined(ZTS) && defined(PHP_WIN32) - tsrm_mutex_free(imagick_mutex); -#endif - UNREGISTER_INI_ENTRIES(); - return SUCCESS; -} - -PHP_RINIT_FUNCTION(imagick) -{ - // This suppresses an 'unused parameter' warning. - (void)type; - (void)module_number; - - IMAGICK_G(progress_callback) = NULL; - - if (IMAGICK_G(set_single_thread)) { - MagickSetResourceLimit(ThreadResource, 1); - } - - return SUCCESS; -} - -PHP_RSHUTDOWN_FUNCTION(imagick) -{ - php_imagick_callback* progress_callback = IMAGICK_G(progress_callback); - // This suppresses an 'unused parameter' warning. - (void)type; - (void)module_number; - - if (progress_callback) { - php_imagick_cleanup_progress_callback(progress_callback TSRMLS_CC); - efree(progress_callback); - IMAGICK_G(progress_callback) = NULL; - } - -#if defined(ZTS) && defined(PHP_WIN32) - /* We have the lock so lets release it */ - if (imagick_thread_id == tsrm_thread_id()) { - imagick_thread_id = (THREAD_T)NULL; - tsrm_mutex_unlock(imagick_mutex); - } -#endif - return SUCCESS; -} - -#if ZEND_MODULE_API_NO >= 20050922 -static const zend_module_dep imagick_deps = { - ZEND_MOD_CONFLICTS("gmagick") - ZEND_MOD_REQUIRED("standard") - ZEND_MOD_REQUIRED("spl") - ZEND_MOD_END -}; -#endif - -zend_module_entry imagick_module_entry = -{ -#if ZEND_MODULE_API_NO >= 20050922 - STANDARD_MODULE_HEADER_EX, NULL, - imagick_deps, -#else - STANDARD_MODULE_HEADER, -#endif - PHP_IMAGICK_EXTNAME, - php_imagick_functions, /* Functions */ - PHP_MINIT(imagick), /* MINIT */ - PHP_MSHUTDOWN(imagick), /* MSHUTDOWN */ - PHP_RINIT(imagick), /* RINIT */ - PHP_RSHUTDOWN(imagick), - PHP_MINFO(imagick), /* MINFO */ - PHP_IMAGICK_VERSION, - STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_IMAGICK -ZEND_GET_MODULE(imagick) -#endif
View file
imagick-3.7.0.tgz/imagick-3.7.0/imagick_class.c
Deleted
@@ -1,14638 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 / Imagick | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 Mikko Koppanen, Scott MacVicar | - | ImageMagick (c) ImageMagick Studio LLC | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Mikko Kopppanen <mkoppanen@php.net> | - | Scott MacVicar <scottmac@php.net> | - +----------------------------------------------------------------------+ -*/ - -#include "php_imagick.h" -#include "php_imagick_defs.h" -#include "php_imagick_macros.h" -#include "php_imagick_helpers.h" -#include "php_imagick_file.h" - - -#if MagickLibVersion > 0x628 -/* {{{ proto bool Imagick::pingImageFile(resource filehandle) - Query image information without reading the whole image to memory -*/ -PHP_METHOD(Imagick, pingImageFile) -{ - char *filename = NULL; - IM_LEN_TYPE filename_len; - php_imagick_object *intern; - zval *zstream; - php_stream *stream; - zend_bool result; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|s!", &zstream, &filename, &filename_len) == FAILURE) - { - return; - } - - intern = Z_IMAGICK_P(getThis()); - -#if PHP_VERSION_ID >= 70000 - php_stream_from_zval(stream, zstream); -#else - php_stream_from_zval(stream, &zstream); -#endif - result = php_imagick_stream_handler(intern, stream, ImagickPingImageFile TSRMLS_CC); - - if (result == 0) { - if (!EG(exception)) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to ping image from the filehandle" TSRMLS_CC); - } - return; - } - - if (filename) { - MagickSetImageFilename(intern->magick_wand, filename); - MagickSetLastIterator(intern->magick_wand); - } - RETURN_TRUE; -} -/* }}} */ - - -/* {{{ proto bool Imagick::pingImageBlob(string image ) - Query image information without reading the whole image to memory -*/ -PHP_METHOD(Imagick, pingImageBlob) -{ - char *image_string; - IM_LEN_TYPE image_string_len; - MagickBooleanType status; - php_imagick_object *intern; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &image_string, &image_string_len) == FAILURE) { - return; - } - - if (image_string_len == 0) { - php_imagick_throw_exception(IMAGICK_CLASS, "Empty image string passed" TSRMLS_CC); - return; - } - - intern = Z_IMAGICK_P(getThis()); - status = MagickPingImageBlob(intern->magick_wand, image_string, image_string_len); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to ping image blob" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::vignetteImage(float blackPoint, float whitePoint, int x, int y ) - Adds vignette filter to the image -*/ -PHP_METHOD(Imagick, vignetteImage) -{ - double black_point, white_point; - im_long x, y; - php_imagick_object *intern; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddll", &black_point, &white_point, &x, &y) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickVignetteImage(intern->magick_wand, black_point, white_point, x, y); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to apply vignette filter" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::transposeImage() - Creates a vertical mirror image -*/ -PHP_METHOD(Imagick, transposeImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickTransposeImage(intern->magick_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to transpose image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::transverseImage() - Creates a horizontal mirror image -*/ -PHP_METHOD(Imagick, transverseImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickTransverseImage(intern->magick_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to transverse image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::adaptiveBlurImage(float radius, float sigma, int channel ) - Adds adaptive blur filter to image -*/ -PHP_METHOD(Imagick, adaptiveBlurImage) -{ - double radius, sigma; - php_imagick_object *intern; - MagickBooleanType status; - im_long channel = IM_DEFAULT_CHANNEL; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd|l", &radius, &sigma, &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickAdaptiveBlurImageChannel(intern->magick_wand, channel, radius, sigma); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to adaptive blur image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::uniqueImageColors() - Discards all but one of any pixel color -*/ -PHP_METHOD(Imagick, uniqueImageColors) -{ - php_imagick_object *intern; - MagickBooleanType status; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickUniqueImageColors(intern->magick_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get unique image colors" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::contrastStretchImage(float black_point, float white_point, int channel) - Enhances the contrast of a color image -*/ -PHP_METHOD(Imagick, contrastStretchImage) -{ - php_imagick_object *intern; - double black_point, white_point; - MagickBooleanType status; - im_long channel = IM_DEFAULT_CHANNEL; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd|l", &black_point, &white_point, &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickContrastStretchImageChannel(intern->magick_wand, channel, black_point, white_point); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to contrast strech image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -#if MagickLibVersion < 0x700 -/* {{{ proto int Imagick::getImageMatte() - Returns true if the image has a matte channel otherwise false -*/ -PHP_METHOD(Imagick, getImageMatte) -{ - php_imagick_object *intern; - MagickBooleanType matte; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - IMAGICK_METHOD_DEPRECATED ("Imagick", "getImageMatte"); - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - matte = MagickGetImageMatte(intern->magick_wand); - - if (matte == MagickTrue) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ -#endif //#if MagickLibVersion < 0x700 -#endif - -/* {{{ proto bool Imagick::setImageMatte(bool matte) - Sets the image matte channel -*/ -PHP_METHOD(Imagick, setImageMatte) -{ - php_imagick_object *intern; - zend_bool matte; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &matte) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSetImageMatte(intern->magick_wand, matte); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image matte" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::adaptiveResizeImage(int width, int height, bool bestfit, bool legacy) - Adaptively resize image with data dependent triangulation - If legacy is true, the calculations are done with the small rounding bug that existed in - Imagick before 3.4.0. If false, the calculations should produce the same results as - ImageMagick CLI does. -*/ -PHP_METHOD(Imagick, adaptiveResizeImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - im_long width, height, new_width, new_height; - zend_bool bestfit = 0; - zend_bool legacy = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll|bb", &width, &height, &bestfit, &legacy) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - if (!php_imagick_thumbnail_dimensions(intern->magick_wand, bestfit, width, height, &new_width, &new_height, legacy)) { - php_imagick_throw_exception(IMAGICK_CLASS, "Invalid image geometry" TSRMLS_CC); - return; - } - - status = MagickAdaptiveResizeImage(intern->magick_wand, new_width, new_height); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to adaptive resize image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -/* {{{ proto bool Imagick::sketchImage(float radius, float sigma, float angle) - Simulates a pencil sketch -*/ -PHP_METHOD(Imagick, sketchImage) -{ - double radius, sigma, angle; - MagickBooleanType status; - php_imagick_object *intern; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddd", &radius, &sigma, &angle) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSketchImage(intern->magick_wand, sigma, radius, angle); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to sketch image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::shadeImage(bool gray, float azimuth, float elevation) - Shines a distant light on an image -*/ -PHP_METHOD(Imagick, shadeImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - double azimuth, elevation; - zend_bool gray; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "bdd", &gray, &azimuth, &elevation) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickShadeImage(intern->magick_wand, gray, azimuth, elevation); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to shade image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int Imagick::getSizeOffset() - Returns the size offset associated with the Imagick object -*/ -PHP_METHOD(Imagick, getSizeOffset) -{ - php_imagick_object *intern; - ssize_t offset; - MagickBooleanType status; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - status = MagickGetSizeOffset(intern->magick_wand, &offset); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get size offset" TSRMLS_CC); - return; - } - - RETVAL_LONG(offset); -} -/* }}} */ - -/* {{{ proto bool Imagick::setSizeOffset(int columns, int rows, int offset) - Sets the size and offset of the Imagick object -*/ -PHP_METHOD(Imagick, setSizeOffset) -{ - php_imagick_object *intern; - im_long columns, rows, offset; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &columns, &rows, &offset) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - status = MagickSetSizeOffset(intern->magick_wand, columns, rows, offset); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set size offset" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::adaptiveSharpenImage(float radius, float sigma, int channel) - Adaptively sharpen image with data dependent triangulation -*/ -PHP_METHOD(Imagick, adaptiveSharpenImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - double radius, sigma; - im_long channel = IM_DEFAULT_CHANNEL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd|l", &radius, &sigma, &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickAdaptiveSharpenImageChannel(intern->magick_wand, channel, radius, sigma); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to adaptive sharpen image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - - -/* {{{ proto bool Imagick::randomThresholdImage(float low, float high, int channel) - Changes the value of individual pixels -*/ -PHP_METHOD(Imagick, randomThresholdImage) -{ - php_imagick_object *intern; - double low, high; - MagickBooleanType status; - im_long channel = IM_DEFAULT_CHANNEL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd|l", &low, &high, &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickRandomThresholdImageChannel(intern->magick_wand, channel, low, high); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to random threshold image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto string Imagick::roundCornersImage(float x_rounding, float y_rounding, float stroke_width = 10, float displace = 5, float size_correction = -6 ) - Rounds image corners -*/ -PHP_METHOD(Imagick, roundCornersImage) -{ - char *old_locale; - double x_rounding, y_rounding; - DrawingWand *draw; - MagickWand *mask_image; - PixelWand *color; - php_imagick_object *intern; - long image_width, image_height; - MagickBooleanType status; - double stroke_width = 10, displace = 5, correction = -6; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd|ddd", &x_rounding, &y_rounding, &stroke_width, &displace, &correction) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - image_width = MagickGetImageWidth(intern->magick_wand); - image_height = MagickGetImageHeight(intern->magick_wand); - - if (!image_width || !image_height) { - php_imagick_throw_exception(IMAGICK_CLASS, "Unable to round corners on empty image" TSRMLS_CC); - return; - } - - status = MagickSetImageMatte(intern->magick_wand, MagickTrue); - - if (status == MagickFalse) { - php_imagick_throw_exception(IMAGICK_CLASS, "Unable to set image matte" TSRMLS_CC); - return; - } - - /* Here we go.. */ - color = NewPixelWand(); - if (!color) { - php_imagick_throw_exception (IMAGICK_CLASS, "Failed to allocate PixelWand structure" TSRMLS_CC); - return; - } - - draw = NewDrawingWand(); - if (!draw) { - DestroyPixelWand (color); - php_imagick_throw_exception (IMAGICK_CLASS, "Failed to allocate DrawingWand structure" TSRMLS_CC); - return; - } - - mask_image = NewMagickWand(); - if (!mask_image) { - DestroyPixelWand (color); - DestroyDrawingWand (draw); - php_imagick_throw_exception (IMAGICK_CLASS, "Failed to allocate MagickWand structure" TSRMLS_CC); - return; - } - - -#define exit_cleanup() \ - if (color != NULL) color = DestroyPixelWand(color); \ - if (draw != NULL) draw = DestroyDrawingWand(draw); \ - if (mask_image != NULL) mask_image = DestroyMagickWand(mask_image); - - status = PixelSetColor(color, "transparent"); - - if (status == MagickFalse) { - exit_cleanup(); - php_imagick_throw_exception(IMAGICK_CLASS, "Unable to set pixel color" TSRMLS_CC); - return; - } - - status = MagickNewImage(mask_image, image_width, image_height, color); - - if (status == MagickFalse) { - exit_cleanup(); - php_imagick_throw_exception(IMAGICK_CLASS, "Unable to allocate mask image" TSRMLS_CC); - return; - } - - MagickSetImageBackgroundColor(mask_image, color); - status = PixelSetColor(color, "white"); - - if (status == MagickFalse) { - exit_cleanup(); - php_imagick_throw_exception(IMAGICK_CLASS, "Unable to set pixel color" TSRMLS_CC); - return; - } - - DrawSetFillColor(draw, color); - status = PixelSetColor(color, "black"); - - if (status == MagickFalse) { - exit_cleanup(); - php_imagick_throw_exception(IMAGICK_CLASS, "Unable to set pixel color" TSRMLS_CC); - return; - } - - DrawSetStrokeColor(draw, color); - DrawSetStrokeWidth(draw, stroke_width); - DrawRoundRectangle(draw, displace, displace, image_width + correction, image_height + correction, x_rounding, y_rounding); - - old_locale = php_imagick_set_locale (TSRMLS_C); - - status = MagickDrawImage(mask_image, draw); - - php_imagick_restore_locale (old_locale); - - if (old_locale) - efree (old_locale); - - if (status == MagickFalse) { - exit_cleanup(); - php_imagick_throw_exception(IMAGICK_CLASS, "Unable to draw on image" TSRMLS_CC); - return; - } - - -#if MagickLibVersion >= 0x700 - status = MagickCompositeImage(intern->magick_wand, mask_image, DstInCompositeOp, MagickTrue, 0, 0); -#else - status = MagickCompositeImage(intern->magick_wand, mask_image, DstInCompositeOp, 0, 0); -#endif - - if (status == MagickFalse) { - exit_cleanup(); - php_imagick_throw_exception(IMAGICK_CLASS, "Unable to composite image" TSRMLS_CC); - return; - } - - exit_cleanup(); - RETURN_TRUE; -#undef exit_cleanup -} -/* }}} */ - -/* {{{ proto int Imagick::getIteratorIndex() - Returns the index of the current active image -*/ -PHP_METHOD(Imagick, getIteratorIndex) -{ - MagickBooleanType status; - php_imagick_object *intern; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - status = MagickGetIteratorIndex(intern->magick_wand); - ZVAL_LONG(return_value, (long)status); - return; -} -/* }}} */ - -/* {{{ proto bool Imagick::setIteratorIndex(int index) - Sets the index of the Imagick object -*/ -PHP_METHOD(Imagick, setIteratorIndex) -{ - const im_long index; - MagickBooleanType status; - php_imagick_object *intern; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &index) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - status = MagickSetIteratorIndex(intern->magick_wand, index); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set iterator index" TSRMLS_CC); - return; - } - - intern->next_out_of_bound = 0; - RETURN_TRUE; -} -/* }}} */ - -#if MagickLibVersion < 0x700 -/* {{{ proto Imagick Imagick::transformImage(string crop, string geometry ) - Comfortability method for crop and resize -*/ -PHP_METHOD(Imagick, transformImage) -{ - char *crop, *geometry; - IM_LEN_TYPE crop_len, geometry_len; - MagickWand *transformed; - php_imagick_object *intern, *intern_return; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &crop, &crop_len, &geometry, &geometry_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - transformed = MagickTransformImage(intern->magick_wand, crop, geometry); - - if (!transformed) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Transforming image failed" TSRMLS_CC); - return; - } - - object_init_ex(return_value, php_imagick_sc_entry); - intern_return = Z_IMAGICK_P(return_value); - - php_imagick_replace_magickwand(intern_return, transformed); - return; -} -#endif //#if MagickLibVersion < 0x700 - -/* }}} */ -#endif - -#if MagickLibVersion > 0x630 -#if MagickLibVersion < 0x700 -/* {{{ proto bool Imagick::setImageOpacity(float opacity) - Sets the image to the specified opacity level -*/ -PHP_METHOD(Imagick, setImageOpacity) -{ - double opacity; - MagickBooleanType status; - php_imagick_object *intern; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &opacity) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSetImageOpacity(intern->magick_wand, opacity); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image opacity" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif - - - -#if MagickLibVersion >= 0x700 -/* {{{ proto bool Imagick::setImageAlpha(float alpha) - Sets the image to the specified alpha level -*/ -PHP_METHOD(Imagick, setImageAlpha) -{ - double alpha; - MagickBooleanType status; - php_imagick_object *intern; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &alpha) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSetImageAlpha(intern->magick_wand, alpha); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image alpha" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif - - - -#if MagickLibVersion < 0x700 -/* {{{ proto bool Imagick::orderedPosterizeImage(string threshold_map, int CHANNEL) - Performs an ordered dither -*/ -PHP_METHOD(Imagick, orderedPosterizeImage) -{ - char *map; - IM_LEN_TYPE map_len; - MagickBooleanType status; - php_imagick_object *intern; - im_long channel = IM_DEFAULT_CHANNEL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &map, &map_len, &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickOrderedPosterizeImageChannel(intern->magick_wand, channel, map); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to posterize image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif //#if MagickLibVersion < 0x700 -#endif //#if MagickLibVersion > 0x630 - -#if MagickLibVersion >= 0x700 -/* {{{ proto bool Imagick::polaroidWithTextAndMethod(ImagickDraw properties, double angle, string text, int method) - Simulates a Polaroid picture with text and PixelInterpolateMethod -*/ -PHP_METHOD(Imagick, polaroidWithTextAndMethod) -{ - zval *objvar; - php_imagick_object *intern; - MagickBooleanType status; - php_imagickdraw_object *internd; - double angle; - char *caption; - IM_LEN_TYPE caption_len; - im_long method; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Odsl", &objvar, php_imagickdraw_sc_entry, &angle, &caption, &caption_len, &method) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - internd = Z_IMAGICKDRAW_P(objvar); - - status = MagickPolaroidImage( - intern->magick_wand, - internd->drawing_wand, - caption, - angle, - method - ); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to polaroidWithTextAndMethod image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif // MagickLibVersion >= 0x700 - - -#if MagickLibVersion > 0x631 -/* {{{ proto bool Imagick::polaroidImage(ImagickDraw properties, double angle ) - Simulates a Polaroid picture -*/ -PHP_METHOD(Imagick, polaroidImage) -{ - zval *objvar; - php_imagick_object *intern; - MagickBooleanType status; - php_imagickdraw_object *internd; - double angle; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Od", &objvar, php_imagickdraw_sc_entry, &angle) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - internd = Z_IMAGICKDRAW_P(objvar); -#if MagickLibVersion >= 0x700 - { - PixelInterpolateMethod method = BilinearInterpolatePixel; - char *caption = "TODO FIXME"; - status = MagickPolaroidImage(intern->magick_wand,internd->drawing_wand,caption,angle,method); - } -#else - status = MagickPolaroidImage(intern->magick_wand, internd->drawing_wand, angle); -#endif - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to polaroid image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto string Imagick::getImageProperty(string name ) - Eeturns a value associated with the specified property -*/ -PHP_METHOD(Imagick, getImageProperty) -{ - php_imagick_object *intern; - char *name, *value; - IM_LEN_TYPE name_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - value = MagickGetImageProperty(intern->magick_wand, name); - - if (value) { - IM_ZVAL_STRING(return_value, (char *)value); - IMAGICK_FREE_MAGICK_MEMORY(value); - return; - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool Imagick::setImageProperty(string name, string value ) - returns a value associated with the specified property -*/ -PHP_METHOD(Imagick, setImageProperty) -{ - php_imagick_object *intern; - char *name, *value; - IM_LEN_TYPE name_len, value_len; - MagickBooleanType status; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &name_len, &value, &value_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - status = MagickSetImageProperty(intern->magick_wand, name, value); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image property" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::deleteImageProperty(string name) - Deletes an image property. -*/ -PHP_METHOD(Imagick, deleteImageProperty) -{ - php_imagick_object *intern; - char *name; - IM_LEN_TYPE name_len; - MagickBooleanType status; - - Image *image; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - image = GetImageFromMagickWand(intern->magick_wand); - status = DeleteImageProperty(image, name); - - if (status == MagickFalse) { - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - - -/* {{{ proto bool Imagick::identifyFormat(string embedText) - Replaces any embedded formatting characters with the appropriate image property and returns the interpreted text. See http://www.imagemagick.org/script/escape.php for escape sequences. -*/ -PHP_METHOD(Imagick, identifyFormat) -{ - php_imagick_object *intern; - char *embedText; - IM_LEN_TYPE embedText_len; - char *result; - - ImageInfo *image_info; - Image *image; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &embedText, &embedText_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) { - return; - } - - image_info = AcquireImageInfo(); - image = GetImageFromMagickWand(intern->magick_wand); - -#if MagickLibVersion >= 0x700 - { - //TODO - handle exception info. - ExceptionInfo *exception = NULL; - result = InterpretImageProperties(image_info, image, embedText, exception); - } -#else - result = InterpretImageProperties(image_info, image, embedText); -#endif - image_info = DestroyImageInfo(image_info); - - if (result) { -#if PHP_VERSION_ID >= 70000 - RETVAL_STRING(result); -#else - RETVAL_STRING(result, 1); -#endif - IMAGICK_FREE_MAGICK_MEMORY(result); - - return; - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto int Imagick::getImageInterpolateMethod() - Returns the interpolation method for the sepcified image. -*/ -PHP_METHOD(Imagick, getImageInterpolateMethod) -{ - php_imagick_object *intern; - long interpolate; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - interpolate = MagickGetImageInterpolateMethod(intern->magick_wand); - RETVAL_LONG(interpolate); -} -/* }}} */ - -#if IM_HAVE_IMAGICK_SETIMAGEINTERPOLATEMETHOD -/* {{{ proto bool Imagick::setImageInterpolateMethod(int method) - Sets the image interpolate pixel method. -*/ -PHP_METHOD(Imagick, setImageInterpolateMethod) -{ - php_imagick_object *intern; - im_long interpolate; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &interpolate) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSetImageInterpolateMethod(intern->magick_wand, interpolate); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set the image interpolate method" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ -#endif // #if IM_HAVE_IMAGICK_SETIMAGEINTERPOLATEMETHOD - -/* {{{ proto bool Imagick::linearStretchImage(float blackPoint, float whitePoint) - Stretches with saturation the image intensity. -*/ -PHP_METHOD(Imagick, linearStretchImage) -{ - php_imagick_object *intern; - double blackPoint, whitePoint; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &blackPoint, &whitePoint) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickLinearStretchImage(intern->magick_wand, blackPoint, whitePoint); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to linear strech image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int Imagick::getImageLength() - returns the image length in bytes -*/ -PHP_METHOD(Imagick, getImageLength) -{ - php_imagick_object *intern; - MagickSizeType length; - MagickBooleanType status; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickGetImageLength(intern->magick_wand, &length); - - if (status == MagickFalse) { - php_imagick_throw_exception(IMAGICK_CLASS, "Unable to acquire image length" TSRMLS_CC); - return; - } - - RETVAL_LONG(length); -} -/* }}} */ - -/* {{{ proto bool Imagick::extentImage(int width, int height, int x, int y ) - Sets the image size -*/ -PHP_METHOD(Imagick, extentImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - im_long width, height, x, y; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llll", &width, &height, &x, &y) == FAILURE) - { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickExtentImage(intern->magick_wand, width, height, x, y); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to extent image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif - -#if MagickLibVersion > 0x633 -/* {{{ proto Imagick Imagick::getImageOrientation(void) - Gets the image orientation -*/ -PHP_METHOD(Imagick, getImageOrientation) -{ - php_imagick_object *intern; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - RETVAL_LONG(MagickGetImageOrientation(intern->magick_wand)); -} -/* }}} */ - -/* {{{ proto Imagick Imagick::setImageOrientation(int orientation) - Sets the image orientation -*/ -PHP_METHOD(Imagick, setImageOrientation) -{ - php_imagick_object *intern; - im_long orientation; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &orientation) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSetImageOrientation(intern->magick_wand, orientation); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image orientation" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif - -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -#if MagickLibVersion > 0x634 -#if MagickLibVersion < 0x700 -/* {{{ proto Imagick Imagick::paintFloodfillImage(mixed fill, float fuzz, mixed bordercolor, int x, int y, int channel) - Sets the image orientation -*/ -PHP_METHOD(Imagick, paintFloodfillImage) -{ - php_imagick_object *intern; - zval *fill_param, *border_param; - im_long x, y, channel = DefaultChannels; - double fuzz; - MagickBooleanType status; - PixelWand *fill_wand, *border_wand = NULL; - zend_bool fill_allocated = 0, border_allocated = 0; - - IMAGICK_METHOD_DEPRECATED ("Imagick", "paintFloodfillImage"); - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zdzll|l", &fill_param, &fuzz, &border_param, &x, &y, &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - fill_wand = php_imagick_zval_to_pixelwand (fill_param, IMAGICK_CLASS, &fill_allocated TSRMLS_CC); - if (!fill_wand) - return; - - if (Z_TYPE_P(border_param) == IS_NULL) { - status = MagickPaintFloodfillImage(intern->magick_wand, channel, fill_wand, fuzz, NULL, x, y); - } else { - border_wand = php_imagick_zval_to_pixelwand (border_param, IMAGICK_CLASS, &border_allocated TSRMLS_CC); - if (!border_wand) { - if (fill_allocated) - DestroyPixelWand (fill_wand); - return; - } - status = MagickPaintFloodfillImage(intern->magick_wand, channel, fill_wand, fuzz, border_wand, x, y); - } - - if (fill_allocated) - DestroyPixelWand (fill_wand); - - if (border_wand) - DestroyPixelWand (border_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to paint floodfill image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ -#endif // #if MagickLibVersion < 0x700 -#endif -#endif - -#if MagickLibVersion > 0x635 -/* {{{ proto Imagick Imagick::clutImage(Imagick lookup, int channel ) - Replaces colors in the image from a color lookup table -*/ -PHP_METHOD(Imagick, clutImage) -{ - zval *objvar; - php_imagick_object *intern, *lookup; - MagickBooleanType status; - im_long channel = IM_DEFAULT_CHANNEL; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|l", &objvar, php_imagick_sc_entry, &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - lookup = Z_IMAGICK_P(objvar); - if (php_imagick_ensure_not_empty (lookup->magick_wand) == 0) - return; - - status = MagickClutImageChannel(intern->magick_wand, channel, lookup->magick_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to replace colors in the image from a color lookup table" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto Imagick Imagick::getImageProperties(string pattern, bool values ) - Returns all the property names that match the specified pattern -*/ -PHP_METHOD(Imagick, getImageProperties) -{ - zend_bool values = 1; - char *pattern = "*", **properties, *property; - IM_LEN_TYPE pattern_len; - unsigned long i; - size_t properties_count; - php_imagick_object *intern; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sb", &pattern, &pattern_len, &values) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - properties = MagickGetImageProperties(intern->magick_wand, pattern, &properties_count); - - if (!properties) { - php_imagick_throw_exception(IMAGICK_CLASS, "Unable to get image properties" TSRMLS_CC); - return; - } - - array_init(return_value); - - if (values) { - - for (i = 0; i < properties_count; i++) { - property = MagickGetImageProperty(intern->magick_wand, propertiesi); - IM_add_assoc_string(return_value, propertiesi, property); - IMAGICK_FREE_MAGICK_MEMORY(property); - } - - } else { - - for (i = 0; i < properties_count; i++) { - IM_add_next_index_string(return_value, propertiesi); - } - } - - IMAGICK_FREE_MAGICK_MEMORY(properties); - return; -} -/* }}} */ - -/* {{{ proto Imagick Imagick::getImageProfiles(string pattern, bool values ) - Returns all the profile names that match the specified pattern -*/ -PHP_METHOD(Imagick, getImageProfiles) -{ - zend_bool values = 1; - char *pattern = "*", **profiles, *profile; - IM_LEN_TYPE pattern_len; - unsigned long i; - php_imagick_object *intern; - size_t length, profiles_count; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sb", &pattern, &pattern_len, &values) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - profiles = MagickGetImageProfiles(intern->magick_wand, pattern, &profiles_count); - - if (!profiles) { - php_imagick_throw_exception(IMAGICK_CLASS, "Unable to get image profiles" TSRMLS_CC); - return; - } - - array_init(return_value); - - if (values) { - - for (i = 0; i < profiles_count; i++) { - - profile = (char *)MagickGetImageProfile(intern->magick_wand, profilesi, &length); -#if PHP_VERSION_ID >= 70000 - add_assoc_stringl(return_value, profilesi, profile, length); -#else - add_assoc_stringl(return_value, profilesi, profile, length, 1); -#endif - IMAGICK_FREE_MAGICK_MEMORY(profile); - } - - } else { - - for (i = 0; i < profiles_count; i++) { - IM_add_next_index_string(return_value, profilesi); - } - } - - IMAGICK_FREE_MAGICK_MEMORY(profiles); - return; -} -/* }}} */ -#endif - -#if MagickLibVersion > 0x635 -/* {{{ proto Imagick Imagick::distortImage(int distortMethod, array arguments, bool bestfit ) - Distorts an image using various distortion methods -*/ -PHP_METHOD(Imagick, distortImage) -{ - php_imagick_object *intern; - double *arguments; - im_long distort_method, elements; - zend_bool bestfit; - zval *arg_array; - MagickBooleanType status; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lab", &distort_method, &arg_array, &bestfit) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - arguments = php_imagick_zval_to_double_array(arg_array, &elements TSRMLS_CC); - - if (!arguments) { - php_imagick_throw_exception (IMAGICK_CLASS, "Can't read argument array" TSRMLS_CC); - return; - } - - status = MagickDistortImage(intern->magick_wand, distort_method, elements, arguments, bestfit); - efree(arguments); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to distort the image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::writeImageFile(resource $handle, string $format) - Writes image to an open filehandle. Optional parameter format defines the format the file - is stored with -*/ -PHP_METHOD(Imagick, writeImageFile) -{ - php_imagick_object *intern; - zval *zstream; - php_stream *stream; - zend_bool result; - char *format = NULL; - IM_LEN_TYPE format_len; - char *orig_name = NULL, *buffer; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|s!", &zstream, &format, &format_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - // Get the current name - if (format) { - orig_name = MagickGetImageFilename (intern->magick_wand); - - spprintf (&buffer, 0, "%s:", format); - MagickSetImageFilename (intern->magick_wand, buffer); - efree (buffer); - } - -#if PHP_VERSION_ID >= 70000 - php_stream_from_zval(stream, zstream); -#else - php_stream_from_zval(stream, &zstream); -#endif - result = php_imagick_stream_handler(intern, stream, ImagickWriteImageFile TSRMLS_CC); - - /* Restore the original name after write */ - if (orig_name) { - MagickSetImageFilename (intern->magick_wand, orig_name); - MagickRelinquishMemory (orig_name); - } - - if (result == 0) { - /* php_stream_cast returns warning on some streams but still does not return FAILURE */ - if (!EG(exception)) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to write image to the filehandle" TSRMLS_CC); - return; - } - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::writeImagesFile(resource $handle, string $format) - Writes images to an open filehandle -*/ -PHP_METHOD(Imagick, writeImagesFile) -{ - php_imagick_object *intern; - zval *zstream; - php_stream *stream; - zend_bool result; - char *format = NULL; - IM_LEN_TYPE format_len; - char *orig_name = NULL, *buffer; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|s!", &zstream, &format, &format_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - // Get the current name - if (format) { - orig_name = MagickGetImageFilename (intern->magick_wand); - - spprintf (&buffer, 0, "%s:", format); - MagickSetImageFilename (intern->magick_wand, buffer); - efree (buffer); - } - -#if PHP_VERSION_ID >= 70000 - php_stream_from_zval(stream, zstream); -#else - php_stream_from_zval(stream, &zstream); -#endif - result = php_imagick_stream_handler(intern, stream, ImagickWriteImagesFile TSRMLS_CC); - - /* Restore the original name after write */ - if (orig_name) { - MagickSetImageFilename (intern->magick_wand, orig_name); - MagickRelinquishMemory (orig_name); - } - - if (result == 0) { - if (!EG(exception)) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to write images to the filehandle" TSRMLS_CC); - return; - } - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::resetImagePage(string page) - Resets the page canvas and position -*/ -PHP_METHOD(Imagick, resetImagePage) -{ - php_imagick_object *intern; - MagickBooleanType status; - char *page; - IM_LEN_TYPE page_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &page, &page_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickResetImagePage(intern->magick_wand, page); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to reset image page" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - - -/* {{{ proto Imagick Imagick::getImageClipMask() - Gets image clip mask -*/ -#if MagickLibVersion < 0x700 -PHP_METHOD(Imagick, getImageClipMask) -{ - MagickWand *tmp_wand; - php_imagick_object *intern; - php_imagick_object *intern_return; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - tmp_wand = MagickGetImageClipMask(intern->magick_wand); - - /* No magick is going to happen */ - if (!tmp_wand) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image clip mask" TSRMLS_CC); - return; - } - - object_init_ex(return_value, php_imagick_sc_entry); - intern_return = Z_IMAGICK_P(return_value); - - php_imagick_replace_magickwand(intern_return, tmp_wand); - return; -} -#endif -/* }}} */ - -/* {{{ proto bool Imagick::setImageClipMask(Imagick clip_mask) - Sets the image clip mask -*/ -#if MagickLibVersion < 0x700 -PHP_METHOD(Imagick, setImageClipMask) -{ - php_imagick_object *intern; - php_imagick_object *clip_mask; - MagickBooleanType status; - zval *objvar; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &objvar, php_imagick_sc_entry) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - clip_mask = Z_IMAGICK_P(objvar); - if (php_imagick_ensure_not_empty (clip_mask->magick_wand) == 0) - return; - - status = MagickSetImageClipMask(intern->magick_wand, clip_mask->magick_wand); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image clip mask" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -#endif -/* }}} */ - -/* {{{ proto bool Imagick::animateImages(string server_name) - Animates an image or image sequence -*/ -PHP_METHOD(Imagick, animateImages) -{ - php_imagick_object *intern; - MagickBooleanType status; - char *server_name; - IM_LEN_TYPE server_name_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &server_name, &server_name_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - /* TODO: should this call be there? Not sure */ - (void)MagickSetFirstIterator(intern->magick_wand); - status = MagickAnimateImages(intern->magick_wand, server_name); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to animate images" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -#if MagickLibVersion < 0x700 -/* {{{ proto bool Imagick::recolorImage(array matrix) - Translate, scale, shear, or rotate image colors -*/ -PHP_METHOD(Imagick, recolorImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - im_long num_elements; - zval *matrix; - double *array; - unsigned long order; - - IMAGICK_METHOD_DEPRECATED ("Imagick", "recolorImage"); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &matrix) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - array = php_imagick_zval_to_double_array(matrix, &num_elements TSRMLS_CC); - - if (!array) { - php_imagick_throw_exception (IMAGICK_CLASS, "The map contains disallowed characters" TSRMLS_CC); - return; - } - - order = (unsigned long)sqrt(num_elements); - - if ((order * order) != num_elements) { - efree(array); - php_imagick_throw_exception(IMAGICK_CLASS, "The color matrix must contain a square number of elements" TSRMLS_CC); - return; - } - - status = MagickRecolorImage(intern->magick_wand, order, array); - efree(array); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to recolor image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif -#endif -#endif - -#if MagickLibVersion > 0x636 -PHP_METHOD(Imagick, setFont) -{ - php_imagick_object *intern; - char *font, *absolute; - IM_LEN_TYPE font_len; - MagickBooleanType status; - php_imagick_rw_result_t rc; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &font, &font_len) == FAILURE) { - return; - } - - /* Check that no empty string is passed */ - if (font_len == 0) { - php_imagick_throw_exception(IMAGICK_CLASS, "Can not set empty font" TSRMLS_CC); - return; - } - - intern = Z_IMAGICK_P(getThis()); - - /* And if it wasn't */ - if (!php_imagick_check_font(font, font_len TSRMLS_CC)) { - - if (!(absolute = expand_filepath(font, NULL TSRMLS_CC))) { - php_imagick_throw_exception(IMAGICK_CLASS, "Unable to set font" TSRMLS_CC); - return; - } - - if ((rc = php_imagick_file_access_check (absolute TSRMLS_CC)) != IMAGICK_RW_OK) { - php_imagick_rw_fail_to_exception (intern->magick_wand, rc, absolute TSRMLS_CC); - efree(absolute); - return; - } - status = MagickSetFont(intern->magick_wand, absolute); - efree(absolute); - } else { - status = MagickSetFont(intern->magick_wand, font); - } - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set font" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} - -PHP_METHOD(Imagick, getFont) -{ - char *font; - php_imagick_object *intern; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - font = MagickGetFont(intern->magick_wand); - - if (font) { - IM_ZVAL_STRING(return_value, font); - IMAGICK_FREE_MAGICK_MEMORY(font); - return; - } - RETURN_FALSE; -} - -PHP_METHOD(Imagick, setPointSize) -{ - php_imagick_object *intern; - double point_size; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &point_size) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - status = MagickSetPointsize(intern->magick_wand, point_size); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set point size" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} - -PHP_METHOD(Imagick, getPointSize) -{ - php_imagick_object *intern; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - RETVAL_DOUBLE(MagickGetPointsize(intern->magick_wand)); -} - -PHP_METHOD(Imagick, mergeImageLayers) -{ - php_imagick_object *intern, *intern_return; - im_long layer_method; - MagickWand *merged; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &layer_method) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - /* TODO: SHOULD THIS BE HERE? - Reset the iterator */ - (void)MagickSetFirstIterator(intern->magick_wand); - - merged = MagickMergeImageLayers(intern->magick_wand, layer_method); - - /* No magick is going to happen */ - if (!merged) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to merge image layers" TSRMLS_CC); - return; - } - - object_init_ex(return_value, php_imagick_sc_entry); - intern_return = Z_IMAGICK_P(return_value); - - php_imagick_replace_magickwand(intern_return, merged); - return; -} -#endif - -#if MagickLibVersion > 0x637 -/* {{{ proto bool Imagick::floodfillPaintImage(mixed fill, float fuzz, mixed bordercolor, int x, int y, bool invert, int CHANNEL) - Changes the color value of any pixel that matches target -*/ -PHP_METHOD(Imagick, floodfillPaintImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - zval *fill_param, *border_param; - im_long x, y, channel = IM_DEFAULT_CHANNEL; - zend_bool invert; - double fuzz; - PixelWand *fill_wand, *border_wand; - zend_bool fill_allocated = 0, border_allocated = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zdzllb|l", - &fill_param, &fuzz, &border_param, &x, &y, &invert, &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - fill_wand = php_imagick_zval_to_pixelwand (fill_param, IMAGICK_CLASS, &fill_allocated TSRMLS_CC); - if (!fill_wand) - return; - - border_wand = php_imagick_zval_to_pixelwand (border_param, IMAGICK_CLASS, &border_allocated TSRMLS_CC); - if (!border_wand) { - if (fill_allocated) - fill_wand = DestroyPixelWand (fill_wand); - - return; - } - -#if MagickLibVersion >= 0x700 - status = MagickFloodfillPaintImageChannel(intern->magick_wand, channel, fill_wand, fuzz, border_wand, x, y, invert); -#else - status = MagickFloodfillPaintImage(intern->magick_wand, channel, fill_wand, fuzz, border_wand, x, y, invert); -#endif - - if (fill_allocated) - fill_wand = DestroyPixelWand (fill_wand); - - if (border_allocated) - border_wand = DestroyPixelWand (border_wand); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception (intern->magick_wand, "Unable to floodfill paint image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::opaquePaintImage(mixed target, mixed fill, float fuzz, bool invert, int CHANNEL) - Changes any pixel that matches color with the color defined by fill. -*/ -PHP_METHOD(Imagick, opaquePaintImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - zval *fill_param, *target_param; - zend_bool invert; - double fuzz; - im_long channel = IM_DEFAULT_CHANNEL; - PixelWand *fill_wand, *target_wand; - zend_bool fill_allocated = 0, target_allocated = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zzdb|l", &fill_param, &target_param, &fuzz, &invert, &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - fill_wand = php_imagick_zval_to_pixelwand (fill_param, IMAGICK_CLASS, &fill_allocated TSRMLS_CC); - if (!fill_wand) - return; - - target_wand = php_imagick_zval_to_pixelwand (target_param, IMAGICK_CLASS, &target_allocated TSRMLS_CC); - if (!target_wand) { - if (fill_allocated) - DestroyPixelWand (fill_wand); - return; - } - - status = MagickOpaquePaintImageChannel(intern->magick_wand, channel, fill_wand, target_wand, fuzz, invert); - - if (fill_allocated) - DestroyPixelWand (fill_wand); - - if (target_allocated) - DestroyPixelWand (target_wand); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to opaque paint image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::transparentPaintImage(mixed target, float alpha, float fuzz, bool invert) - Changes any pixel that matches color with the color defined by fill -*/ -PHP_METHOD(Imagick, transparentPaintImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - zval *target_param; - zend_bool invert; - double fuzz, alpha; - PixelWand *target_wand; - zend_bool target_allocated; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zddb", &target_param, &alpha, &fuzz, &invert) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - target_wand = php_imagick_zval_to_pixelwand (target_param, IMAGICK_CLASS, &target_allocated TSRMLS_CC); - if (!target_wand) - return; - - status = MagickTransparentPaintImage(intern->magick_wand, target_wand, alpha, fuzz, invert); - - if (target_allocated) - target_wand = DestroyPixelWand (target_wand); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to paint transparent image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto Imagick Imagick::setImageAlphaChannel(int ALPHACHANNEL ) - Activates, deactivates, resets, or sets the alpha channel -*/ -PHP_METHOD(Imagick, setImageAlphaChannel) -{ - php_imagick_object *intern; - im_long alpha_channel; - MagickBooleanType status; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &alpha_channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - // TODO - allegedly only - // ActivateAlphaChannel, DeactivateAlphaChannel, OpaqueAlphaChannel, or SetAlphaChannel. - // should be allowed? - status = MagickSetImageAlphaChannel(intern->magick_wand, alpha_channel); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image alpha channel" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -#endif - -#if MagickLibVersion > 0x638 -/* {{{ proto Imagick Imagick::liquidRescaleImage(int cols, int rows, float delta_x, float rigidity ) - Rescales image with seam carving -*/ -PHP_METHOD(Imagick, liquidRescaleImage) -{ - php_imagick_object *intern; - im_long cols, rows; - double delta_x, rigidity; - MagickBooleanType status; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lldd", &cols, &rows, &delta_x, &rigidity) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickLiquidRescaleImage(intern->magick_wand, cols, rows, delta_x, rigidity); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to liquid rescale image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::decipherImage(string passphrase) - Converts cipher pixels to plain pixels -*/ -PHP_METHOD(Imagick, decipherImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - char *passphrase; - IM_LEN_TYPE passphrase_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &passphrase, &passphrase_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickDecipherImage(intern->magick_wand, passphrase); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to decipher image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::encipherImage(string passphrase) - Converts plain pixels to cipher pixels -*/ -PHP_METHOD(Imagick, encipherImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - char *passphrase; - IM_LEN_TYPE passphrase_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &passphrase, &passphrase_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickEncipherImage(intern->magick_wand, passphrase); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to encipher image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ -#endif - -#if MagickLibVersion > 0x639 -/* {{ proto bool Imagick::setGravity(int GRAVITY) - Sets the gravity value -*/ -PHP_METHOD(Imagick, setGravity) -{ - php_imagick_object *intern; - im_long gravity; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &gravity) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - if (MagickSetGravity(intern->magick_wand, gravity) == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set gravity" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{ proto int Imagick::getGravity() - Gets the gravity value -*/ -PHP_METHOD(Imagick, getGravity) -{ - php_imagick_object *intern; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - RETVAL_LONG(MagickGetGravity(intern->magick_wand)); -} -/* }}} */ - -/* {{ proto Imagick Imagick::getImageChannelRange(int CHANNEL) - Gets the image channel's range - */ -PHP_METHOD(Imagick, getImageChannelRange) -{ - php_imagick_object *intern; - im_long channel; - double maxima, minima; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - if (MagickGetImageChannelRange(intern->magick_wand, channel, &minima, &maxima) == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get channel range" TSRMLS_CC); - return; - } - - array_init(return_value); - - add_assoc_double(return_value, "minima", minima); - add_assoc_double(return_value, "maxima", maxima); - - return; -} -/* }}} */ - -/* {{{ proto bool Imagick::getImageAlphaChannel() - Returns true if the image has an alpha channel value and false if not, - aka the image is RGB rather than RGBA or CMYK rather than CMYKA. -*/ -PHP_METHOD(Imagick, getImageAlphaChannel) -{ - php_imagick_object *intern; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - RETVAL_BOOL(MagickGetImageAlphaChannel(intern->magick_wand)); -} -/* }}} */ -#endif - -#if MagickLibVersion > 0x642 -/* {{{ proto float Imagick::getImageChannelDistortions(Imagick reference, int METRICTYPE, int CHANNEL) - Compares one or more image channels of an image to a reconstructed image and returns the specified distortion metrics -*/ -PHP_METHOD(Imagick, getImageChannelDistortions) -{ - php_imagick_object *intern; - php_imagick_object *intern_reference; - zval *reference_param; - double distortion; - im_long metric, channel = DefaultChannels; - MagickBooleanType status; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ol|l", &reference_param, php_imagick_sc_entry, &metric, &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - intern_reference = Z_IMAGICK_P(reference_param); - if (php_imagick_ensure_not_empty (intern_reference->magick_wand) == 0) - return; - - status = MagickGetImageChannelDistortion(intern->magick_wand, intern_reference->magick_wand, channel, metric, &distortion); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image channel distortion metrics" TSRMLS_CC); - return; - } - - RETVAL_DOUBLE(distortion); -} -/* }}} */ -#endif - -#if MagickLibVersion > 0x643 -/* {{{ proto int Imagick::getImageGravity() - Gets the image gravity -*/ -PHP_METHOD(Imagick, getImageGravity) -{ - php_imagick_object *intern; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - RETVAL_LONG(MagickGetImageGravity(intern->magick_wand)); -} -/* }}} */ - -/* {{{ proto bool Imagick::setImageGravity(int GRAVITY) - Sets the image gravity -*/ -PHP_METHOD(Imagick, setImageGravity) -{ - php_imagick_object *intern; - MagickBooleanType status; - im_long gravity; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &gravity) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSetImageGravity(intern->magick_wand, gravity); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image gravity" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif - -#if MagickLibVersion > 0x645 -/* {{ proto Imagick Imagick::importImagePixels(int x, int y, int width, int height, string map, int STORAGE, array pixels) - Accepts pixel data and stores it in the image at the location you specify - */ -PHP_METHOD(Imagick, importImagePixels) -{ - double *double_array; - im_long *long_array; - unsigned char *char_array; - - php_imagick_object *intern; - MagickBooleanType status; - - im_long storage, num_elements; - im_long x, y, width, height; - IM_LEN_TYPE map_len; - char *map; - zval *pixels; - HashTable *array; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llllsla", &x, &y, &width, &height, &map, &map_len, &storage, &pixels) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - if (x < 0 || y < 0) { - php_imagick_throw_exception (IMAGICK_CLASS, "The coordinates must be non-negative" TSRMLS_CC); - return; - } - - if (width <= 0 || height <= 0) { - php_imagick_throw_exception(IMAGICK_CLASS, "The width and height must be greater than zero" TSRMLS_CC); - return; - } - - array = Z_ARRVAL_P(pixels); - - if (zend_hash_num_elements(array) != ((width * height) * map_len)) { - zend_throw_exception_ex( - php_imagick_exception_class_entry, - 0, - "The map contains incorrect number of elements. Expected %ld, array has %d", - (width * height) * map_len, - zend_hash_num_elements(array) - ); - - return; - } else { - if (!php_imagick_validate_map(map TSRMLS_CC)) { - php_imagick_throw_exception(IMAGICK_CLASS, "The map contains disallowed characters" TSRMLS_CC); - return; - } - } - - switch (storage) { - case FloatPixel: - case DoublePixel: - /* Use doubles */ - storage = DoublePixel; - double_array = php_imagick_zval_to_double_array(pixels, &num_elements TSRMLS_CC); - if (!double_array) { - php_imagick_throw_exception(IMAGICK_CLASS, "The map must contain only numeric values" TSRMLS_CC); - return; - } - status = MagickImportImagePixels(intern->magick_wand, x, y, width, height, map, storage, double_array); - efree(double_array); - break; - - case ShortPixel: -#if MagickLibVersion < 0x700 - case IntegerPixel: -#endif - case LongPixel: - /* Use longs */ - storage = LongPixel; - long_array = php_imagick_zval_to_long_array(pixels, &num_elements TSRMLS_CC); - if (!long_array) { - php_imagick_throw_exception(IMAGICK_CLASS, "The map must contain only numeric values" TSRMLS_CC); - return; - } - status = MagickImportImagePixels(intern->magick_wand, x, y, width, height, map, storage, long_array); - efree(long_array); - break; - - case CharPixel: - char_array = php_imagick_zval_to_char_array(pixels, &num_elements TSRMLS_CC); - if (!char_array) { - php_imagick_throw_exception(IMAGICK_CLASS, "The character array contains incorrect values" TSRMLS_CC); - return; - } - status = MagickImportImagePixels(intern->magick_wand, x, y, width, height, map, storage, char_array); - efree(char_array); - break; - - default: - php_imagick_throw_exception(IMAGICK_CLASS, "Unknown storage format" TSRMLS_CC); - return; - break; - } - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to import image pixels" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -PHP_METHOD(Imagick, deskewImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - double threshold; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &threshold) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickDeskewImage(intern->magick_wand, threshold); - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to deskew image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} - - -#if PHP_IMAGICK_HAVE_HOUGHLINE -/* {{{ proto bool Imagick::houghLineImage(int width, int height, float threshold) - Draw hough lines for the image - -*/ -PHP_METHOD(Imagick, houghLineImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - double threshold; - im_long width, height; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lld", &width, &height, &threshold) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickHoughLineImage(intern->magick_wand, width, height, threshold); - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to Hough line image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ -#endif - -PHP_METHOD(Imagick, segmentImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - im_long colorspace; - zend_bool verbose = 0; - double cluster_threshold, smooth_threshold; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ldd|b", &colorspace, &cluster_threshold, &smooth_threshold, &verbose) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSegmentImage(intern->magick_wand, colorspace, verbose, cluster_threshold, smooth_threshold); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to segment image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} - -PHP_METHOD(Imagick, sparseColorImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - im_long num_elements, sparse_method, channel = IM_DEFAULT_CHANNEL; - zval *arguments; - double *double_array; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "la|l", &sparse_method, &arguments, &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - double_array = php_imagick_zval_to_double_array(arguments, &num_elements TSRMLS_CC); - - if (!double_array) { - php_imagick_throw_exception(IMAGICK_CLASS, "The map must contain only numeric values" TSRMLS_CC); - return; - } - -#if MagickLibVersion >= 0x700 - status = MagickSparseColorImageChannel(intern->magick_wand, channel, sparse_method, num_elements, double_array); -#else - status = MagickSparseColorImage(intern->magick_wand, channel, sparse_method, num_elements, double_array); -#endif - - efree(double_array); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to sparse color image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} - -/* {{{ proto bool Imagick::remapImage(Imagick remap, int DITHERMETHOD) - replaces the colors of an image with the closest color from a reference image -*/ -PHP_METHOD(Imagick, remapImage) -{ - php_imagick_object *intern; - php_imagick_object *intern_remap; - MagickBooleanType status; - im_long dither_method; - zval *remap_param; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ol", &remap_param, php_imagick_sc_entry, &dither_method) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - intern_remap = Z_IMAGICK_P(remap_param); - if (php_imagick_ensure_not_empty (intern_remap->magick_wand) == 0) - return; - - status = MagickRemapImage(intern->magick_wand, intern_remap->magick_wand, dither_method); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to remap image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif - -#if MagickLibVersion > 0x646 -/* {{{ proto bool Imagick::exportImagePixels(int x, int y, int width, int height, string map, INT STORAGE) - -The types for the PixelStorage types are: - -CharPixel - unsigned 1 byte integer -DoublePixel - 8 byte floating point -FloatPixel - 4 byte floating point -IntegerPixel - Removed in IM7 unsigned 4 byte integer -LongPixel - unsigned 4 byte integer -QuantumPixel - Quantum, use the defined type from the IM headers. -ShortPixel - unsigned 2 byte integer - - -*/ -PHP_METHOD(Imagick, exportImagePixels) -{ - php_imagick_object *intern; - MagickBooleanType status; - im_long x, y, width, height, storage; - char *map; - int map_size, i = 0; - IM_LEN_TYPE map_len; - double *double_array; - float *float_array; - unsigned char *char_array; - unsigned short *short_array; - unsigned int *long_array; // The long pixel type is implemented in ImageMagick as 'unsigned int' - Quantum *quantum_array; -#if MagickLibVersion >= 0x700 - unsigned long long int *longlong_array; -#endif - -#if INT_MAX != 0x7FFFFFFF - #error "INT_MAX is not 0x7FFFFFFF, the code below assumes it is, as does the ImageMagick code" - // If this happens, you will need to figure out how to make long_array be an array of - // 4 byte unsigned ints -#endif - - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llllsl", &x, &y, &width, &height, &map, &map_len, &storage) == FAILURE) { - return; - } - - if ((x < 0) || (y < 0)) { - php_imagick_throw_exception(IMAGICK_CLASS, "The coordinates must be non-negative" TSRMLS_CC); - return; - } - - if (width <= 0 || height <= 0) { - php_imagick_throw_exception(IMAGICK_CLASS, "The width and height must be greater than zero" TSRMLS_CC); - return; - } - - if (!php_imagick_validate_map(map TSRMLS_CC)) { - php_imagick_throw_exception(IMAGICK_CLASS, "The map contains disallowed characters" TSRMLS_CC); - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - map_size = (map_len * width * height); - - switch (storage) { - case FloatPixel: - float_array = emalloc(map_size * sizeof(float)); - status = MagickExportImagePixels(intern->magick_wand, x, y, width, height, map, FloatPixel, (void *)float_array); - - if (status != MagickFalse) { - array_init(return_value); - for (i = 0; i < map_size; i++) { - add_next_index_double(return_value, float_arrayi); - } - efree(float_array); - return; - } - break; - - case DoublePixel: - double_array = emalloc(map_size * sizeof(double)); - status = MagickExportImagePixels(intern->magick_wand, x, y, width, height, map, DoublePixel, (void *)double_array); - - if (status != MagickFalse) { - array_init(return_value); - for (i = 0; i < map_size; i++) { - add_next_index_double(return_value, double_arrayi); - } - efree(double_array); - return; - } - break; - - case ShortPixel: - short_array = emalloc(map_size * sizeof(unsigned short)); - status = MagickExportImagePixels(intern->magick_wand, x, y, width, height, map, ShortPixel, (void *)short_array); - - if (status != MagickFalse) { - array_init(return_value); - for (i = 0; i < map_size; i++) { - add_next_index_long(return_value, short_arrayi); - } - efree(short_array); - return; - } - break; - -#if MagickLibVersion >= 0x700 - case LongLongPixel: - longlong_array = emalloc(map_size * sizeof(unsigned long long int)); - status = MagickExportImagePixels(intern->magick_wand, x, y, width, height, map, LongLongPixel, (void *)longlong_array); - - if (status != MagickFalse) { - array_init(return_value); - for (i = 0; i < map_size; i++) { - //TODO - think about this. - // on 32bit platforms this will be truncating data - // on 64bit platforms where sizeof(longlong) > 64bits, it will be truncating - // on 64bit platforms where sizeof(longlong) = 64bits, PHP will be - // converting values close to 64bit to be floats... - add_next_index_long(return_value, longlong_arrayi); - } - efree(longlong_array); - return; - } - break; -#endif - -#if MagickLibVersion < 0x700 - case IntegerPixel: -#endif - case LongPixel: - long_array = emalloc(map_size * sizeof(unsigned int)); - status = MagickExportImagePixels(intern->magick_wand, x, y, width, height, map, LongPixel, (void *)long_array); - - if (status != MagickFalse) { - array_init(return_value); - for (i = 0; i < map_size; i++) { - add_next_index_long(return_value, long_arrayi); - } - efree(long_array); - return; - } - break; - - case CharPixel: - char_array = emalloc(map_size * sizeof(char)); - status = MagickExportImagePixels(intern->magick_wand, x, y, width, height, map, CharPixel, (void *)char_array); - - if (status != MagickFalse) { - array_init(return_value); - for (i = 0; i < map_size; i++) { - add_next_index_long(return_value, (int)char_arrayi); - } - efree(char_array); - return; - } - break; - - case QuantumPixel: - quantum_array = emalloc(map_size * sizeof(Quantum)); - status = MagickExportImagePixels(intern->magick_wand, x, y, width, height, map, QuantumPixel, (void *)quantum_array); - - if (status != MagickFalse) { - array_init(return_value); - for (i = 0; i < map_size; i++) { -#if MAGICKCORE_HDRI_ENABLE - add_next_index_double(return_value, quantum_arrayi); -#else - add_next_index_long(return_value, quantum_arrayi); -#endif - } - efree(quantum_array); - return; - } - break; - - default: - php_imagick_throw_exception(IMAGICK_CLASS, "Unknown pixel type " TSRMLS_CC); - return; - break; - } - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to export image pixels" TSRMLS_CC); - return; - } - return; -} -/* }}} */ -#endif - -#if MagickLibVersion > 0x648 -/* {{{ proto array Imagick::getImageChannelKurtosis(int CHANNEL) - Gets the kurtosis and skewness of one or more image channels -*/ -PHP_METHOD(Imagick, getImageChannelKurtosis) -{ - php_imagick_object *intern; - MagickBooleanType status; - double kurtosis, skewness; - im_long channel = DefaultChannels; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickGetImageChannelKurtosis(intern->magick_wand, channel, &kurtosis, &skewness); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image channel kurtosis" TSRMLS_CC); - return; - } - - array_init(return_value); - add_assoc_double(return_value, "kurtosis", kurtosis); - add_assoc_double(return_value, "skewness", skewness); - return; -} -/* }}} */ - -/* {{{ proto bool Imagick::functionImage(int FUNCTION, array arguments, int CHANNEL) - Applies an arithmetic, relational, or logical expression to an image -*/ -PHP_METHOD(Imagick, functionImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - zval *arguments; - im_long func, num_elements, channel = IM_DEFAULT_CHANNEL; - double *array; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "la|l", &func, &arguments, &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - array = php_imagick_zval_to_double_array(arguments, &num_elements TSRMLS_CC); - - if (!array) { - php_imagick_throw_exception(IMAGICK_CLASS, "The arguments array contains disallowed characters or is empty." TSRMLS_CC); - return; - } - - status = MagickFunctionImageChannel(intern->magick_wand, channel, func, num_elements, array); - efree(array); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to execute function on the image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif - -#if MagickLibVersion > 0x651 -/* {{{ proto boolean Imagick::transformImageColorspace(int COLORSPACE) - Transform image colorspace -*/ -PHP_METHOD(Imagick, transformImageColorspace) -{ - php_imagick_object *intern; - im_long colorspace; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &colorspace) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickTransformImageColorspace(intern->magick_wand, colorspace); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to transform image colorspace" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ -#endif - -#if MagickLibVersion > 0x652 -/* {{{ proto boolean Imagick::haldClutImage(Imagick hald, int CHANNEL) - Replaces colors in the image from a Hald color lookup table -*/ -PHP_METHOD(Imagick, haldClutImage) -{ - zval *objvar; - MagickBooleanType status; - php_imagick_object *intern, *hald; - im_long channel = IM_DEFAULT_CHANNEL; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|l", &objvar, php_imagick_sc_entry, &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - hald = Z_IMAGICK_P(objvar); - if (php_imagick_ensure_not_empty (hald->magick_wand) == 0) - return; - - status = MagickHaldClutImageChannel(intern->magick_wand, channel, hald->magick_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to hald clut image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ -#endif - -#if MagickLibVersion > 0x655 -/* {{{ proto boolean Imagick::autoLevelImage(int CHANNEL) - Adjusts the levels of a particular image channel by scaling the minimum and maximum values to the full quantum range. -*/ -PHP_METHOD(Imagick, autoLevelImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - im_long channel = IM_DEFAULT_CHANNEL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickAutoLevelImageChannel(intern->magick_wand, channel); - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to autolevel image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto boolean Imagick::blueShiftImage(float $factor = 1.5) - Mutes the colors of the image to simulate a scene at nighttime in the moonlight. -*/ -PHP_METHOD(Imagick, blueShiftImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - double factor = 1.5; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|d", &factor) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickBlueShiftImage(intern->magick_wand, factor); - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to blue shift image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ -#endif - -#if MagickLibVersion > 0x656 -PHP_METHOD(Imagick, setImageArtifact) -{ - php_imagick_object *intern; - MagickBooleanType status; - char *artifact, *value; - IM_LEN_TYPE artifact_len, value_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss!", &artifact, &artifact_len, &value, &value_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSetImageArtifact(intern->magick_wand, artifact, value); - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image artifact" TSRMLS_CC); - return; - } - RETURN_TRUE; -} - - -PHP_METHOD(Imagick, getImageArtifact) -{ - php_imagick_object *intern; - char *artifact, *value; - IM_LEN_TYPE artifact_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &artifact, &artifact_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - value = MagickGetImageArtifact(intern->magick_wand, artifact); - - if (value == NULL) { - RETVAL_NULL(); - } - else { -#if PHP_VERSION_ID >= 70000 - RETVAL_STRING(value); -#else - RETVAL_STRING(value, 1); -#endif - IMAGICK_FREE_MAGICK_MEMORY(value); - } - - return; -} - -/* {{{ proto boolean Imagick::deleteImageArtifact(string $artifact) - Delete image artifact -*/ -PHP_METHOD(Imagick, deleteImageArtifact) -{ - php_imagick_object *intern; - MagickBooleanType status; - char *artifact; - IM_LEN_TYPE artifact_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &artifact, &artifact_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickDeleteImageArtifact(intern->magick_wand, artifact); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to delete image artifact" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto integer Imagick::getColorspace() - Get the object colorspace property -*/ -PHP_METHOD(Imagick, getColorspace) -{ - php_imagick_object *intern; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - RETURN_LONG(MagickGetColorspace(intern->magick_wand)); -} -/* }}} */ - -/* {{{ proto boolean Imagick::setColorspace(int COLORSPACE) - Set the object colorspace property -*/ -PHP_METHOD(Imagick, setColorspace) -{ - php_imagick_object *intern; - im_long colorspace; - MagickBooleanType status; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &colorspace) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - status = MagickSetColorspace(intern->magick_wand, colorspace); - - RETURN_BOOL(status == MagickTrue); -} -/* }}} */ - -/* {{{ proto boolean Imagick::clampImage(int CHANNEL) - Restricts the color range from 0 to the quantum depth. -*/ -PHP_METHOD(Imagick, clampImage) -{ - php_imagick_object *intern; - im_long channel = IM_DEFAULT_CHANNEL; - MagickBooleanType status; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickClampImageChannel(intern->magick_wand, channel); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to clamp image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif - -#if MagickLibVersion > 0x667 -/* {{{ proto Imagick Imagick::smushImages(boolean stack, int offset) - Takes all images from the current image pointer to the end of the image list and smushs - them to each other top-to-bottom if the stack parameter is true, otherwise left-to-right. -*/ -PHP_METHOD(Imagick, smushImages) -{ - php_imagick_object *intern, *intern_return; - zend_bool stack; - im_long offset; - MagickWand *retwand; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "bl", &stack, &offset) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - retwand = MagickSmushImages(intern->magick_wand, (stack ? MagickTrue : MagickFalse), offset); - - if (!retwand) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to smush images" TSRMLS_CC); - return; - } - - object_init_ex(return_value, php_imagick_sc_entry); - intern_return = Z_IMAGICK_P(return_value); - php_imagick_replace_magickwand(intern_return, retwand); - return; -} -/* }}} */ -#endif - -/* {{{ proto Imagick Imagick::__construct(mixed files ) - The Imagick constructor -*/ -#if PHP_VERSION_ID >= 70000 -PHP_METHOD(Imagick, __construct) -{ - php_imagick_object *intern; - zval *files = NULL; - - zval *pzval; - php_imagick_rw_result_t rc; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z!/", &files) == FAILURE) { - return; - } - - /* No files given.. or null passed */ - if (!files) { - return; - } - intern = Z_IMAGICK_P(getThis()); - - if (Z_TYPE_P (files) == IS_LONG || Z_TYPE_P (files) == IS_DOUBLE) { - convert_to_string (files); - } - - /* A single file was given */ - if (Z_TYPE_P(files) == IS_STRING) { - struct php_imagick_file_t file = {0}; - - if (!php_imagick_file_init(&file, Z_STRVAL_P(files), Z_STRLEN_P(files) TSRMLS_CC)) { - php_imagick_throw_exception(IMAGICK_CLASS, "Invalid filename provided" TSRMLS_CC); - return; - } - rc = php_imagick_read_file(intern, &file, ImagickReadImage TSRMLS_CC); - php_imagick_file_deinit(&file); - - if (rc != IMAGICK_RW_OK) { - php_imagick_rw_fail_to_exception (intern->magick_wand, rc, Z_STRVAL_P(files) TSRMLS_CC); - return; - } - } - - /* an array of filenames was given */ - else - if (Z_TYPE_P(files) == IS_ARRAY) { - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(files), pzval) { - struct php_imagick_file_t file = {0}; - ZVAL_DEREF(pzval); - - if (!php_imagick_file_init(&file, Z_STRVAL_P(pzval), Z_STRLEN_P(pzval) TSRMLS_CC)) { - php_imagick_throw_exception(IMAGICK_CLASS, "Invalid filename provided" TSRMLS_CC); - return; - } - - rc = php_imagick_read_file(intern, &file, ImagickReadImage TSRMLS_CC); - php_imagick_file_deinit(&file); - - if (rc != IMAGICK_RW_OK) { - php_imagick_rw_fail_to_exception (intern->magick_wand, rc, Z_STRVAL_P(pzval) TSRMLS_CC); - return; - } - } ZEND_HASH_FOREACH_END(); - } - if (Z_TYPE_P(files) == IS_FALSE || Z_TYPE_P(files) == IS_TRUE) { - php_imagick_throw_exception(IMAGICK_CLASS, "Constructor shouldn't be called with a boolean as the filename"); - } - - RETURN_TRUE; -} -#else -PHP_METHOD(Imagick, __construct) -{ - php_imagick_object *intern; - zval *files = NULL; - HashPosition pos; - php_imagick_rw_result_t rc; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z!/", &files) == FAILURE) { - return; - } - - /* No files given.. or null passed */ - if (!files) { - return; - } - intern = Z_IMAGICK_P(getThis()); - - if (Z_TYPE_P (files) == IS_LONG || Z_TYPE_P (files) == IS_DOUBLE) { - convert_to_string (files); - } - - /* A single file was given */ - if (Z_TYPE_P(files) == IS_STRING) { - struct php_imagick_file_t file = {0}; - - if (!php_imagick_file_init(&file, Z_STRVAL_P(files), Z_STRLEN_P(files) TSRMLS_CC)) { - php_imagick_throw_exception(IMAGICK_CLASS, "Invalid filename provided" TSRMLS_CC); - return; - } - rc = php_imagick_read_file(intern, &file, ImagickReadImage TSRMLS_CC); - php_imagick_file_deinit(&file); - - if (rc != IMAGICK_RW_OK) { - php_imagick_rw_fail_to_exception (intern->magick_wand, rc, Z_STRVAL_P(files) TSRMLS_CC); - return; - } - } - - /* an array of filenames was given */ - else - if (Z_TYPE_P(files) == IS_ARRAY) { - for(zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(files), &pos); - zend_hash_has_more_elements_ex(Z_ARRVAL_P(files), &pos) == SUCCESS; - zend_hash_move_forward_ex(Z_ARRVAL_P(files), &pos)) { - - struct php_imagick_file_t file = {0}; - zval **ppzval; - - if (zend_hash_get_current_data_ex(Z_ARRVAL_P(files), (void**)&ppzval, &pos) == FAILURE) { - continue; - } - - if (!php_imagick_file_init(&file, Z_STRVAL_PP(ppzval), Z_STRLEN_PP(ppzval) TSRMLS_CC)) { - php_imagick_throw_exception(IMAGICK_CLASS, "Invalid filename provided" TSRMLS_CC); - return; - } - - rc = php_imagick_read_file(intern, &file, ImagickReadImage TSRMLS_CC); - php_imagick_file_deinit(&file); - - if (rc != IMAGICK_RW_OK) { - php_imagick_rw_fail_to_exception (intern->magick_wand, rc, Z_STRVAL_PP(ppzval) TSRMLS_CC); - return; - } - } - } - - if (Z_TYPE_P(files) == IS_BOOL) { - php_imagick_throw_exception(IMAGICK_CLASS, "Constructor shouldn't be called with a boolean as the filename" TSRMLS_CC); - } - - RETURN_TRUE; -} -#endif -/* }}} */ - -/* {{{ proto string Imagick::__toString() - Returns the current image as string -*/ -PHP_METHOD(Imagick, __toString) -{ - php_imagick_object *intern; - unsigned char *image; - char *buffer; - size_t image_size; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - if (MagickGetNumberImages(intern->magick_wand) == 0) { - IM_ZVAL_STRING(return_value, ""); - return; - } - - buffer = MagickGetImageFormat(intern->magick_wand); - - if (!buffer) { - IM_ZVAL_STRING(return_value, ""); - return; - } else { - IMAGICK_FREE_MAGICK_MEMORY(buffer); - } - - image = MagickGetImageBlob(intern->magick_wand, &image_size); - IM_ZVAL_STRINGL(return_value, (char *)image, image_size); - IMAGICK_FREE_MAGICK_MEMORY(image); - return; -} -/* }}} */ - -/* {{{ proto string Imagick::count() - Returns the number of images -*/ -PHP_METHOD(Imagick, count) -{ - php_imagick_object *intern; - im_long mode = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &mode) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - RETVAL_LONG (MagickGetNumberImages(intern->magick_wand)); -} -/* }}} */ - -/* {{{ proto array Imagick::queryFormats(string pattern ) - Returns formats supported by ImageMagick -*/ -PHP_METHOD(Imagick, queryFormats) -{ - char **supported_formats; - unsigned long i; - char *pattern = "*"; - IM_LEN_TYPE pattern_len = 1; - size_t num_formats = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &pattern, &pattern_len) == FAILURE) { - return; - } - - supported_formats = (char **) MagickQueryFormats(pattern, &num_formats); - array_init(return_value); - - for (i = 0 ; i < num_formats ; i++) { - IM_add_next_index_string(return_value, supported_formatsi); - IMAGICK_FREE_MAGICK_MEMORY(supported_formatsi); - } - - IMAGICK_FREE_MAGICK_MEMORY(supported_formats); - return; -} -/* }}} */ - -/* {{{ proto array Imagick::queryFonts(string pattern ) - Returns fonts supported by ImageMagick -*/ -PHP_METHOD(Imagick, queryFonts) -{ - char **fonts; - unsigned long i; - char *pattern = "*"; - IM_LEN_TYPE pattern_len = 1; - size_t num_fonts; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &pattern, &pattern_len) == FAILURE) { - return; - } - - fonts = (char **) MagickQueryFonts(pattern, &num_fonts); - array_init(return_value); - - for (i = 0 ; i < num_fonts ; i++) { - IM_add_next_index_string(return_value, fontsi); - IMAGICK_FREE_MAGICK_MEMORY(fontsi); - } - - IMAGICK_FREE_MAGICK_MEMORY(fonts); - return; -} -/* }}} */ - -/* {{{ proto array Imagick::queryFontMetrics(ImagickDraw draw, string text, bool multiline ) - Returns a 13 element array representing the font metrics -*/ -PHP_METHOD(Imagick, queryFontMetrics) -{ - zval *objvar, *multiline; - zend_bool remove_canvas, query_multiline; - php_imagick_object *intern; - php_imagickdraw_object *internd; - char *text; - IM_LEN_TYPE text_len; - double *metrics; - - multiline = NULL; - remove_canvas = 0; - query_multiline = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os|z!", &objvar, php_imagickdraw_sc_entry, &text, &text_len, &multiline) == FAILURE) { - return; - } - - /* No parameter passed, this means we should autodetect */ - if (!multiline) { - if (strchr (text, '\n') != NULL) { - query_multiline = 1; - } - } else { - convert_to_boolean(multiline); -#if PHP_VERSION_ID >= 70000 - if (Z_TYPE_P(multiline) == IS_TRUE) { - query_multiline = 1; - } -#else - query_multiline = Z_BVAL_P(multiline); -#endif - } - - /* fetch the objects */ - intern = Z_IMAGICK_P(getThis()); - internd = Z_IMAGICKDRAW_P(objvar); - - /* If wand is empty, create a 1x1 pixel image to use as a temporary canvas */ - if (MagickGetNumberImages(intern->magick_wand) < 1) { - PixelWand *pixel_wand; - MagickBooleanType status; - - /* Empty bg color */ - pixel_wand = NewPixelWand(); - - if (!pixel_wand) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to allocate background color for the temporary canvas" TSRMLS_CC); - return; - } - - /* 1x1 should be enough to get the metrics */ - status = MagickNewImage(intern->magick_wand, 1, 1, pixel_wand); - pixel_wand = DestroyPixelWand(pixel_wand); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to allocate temporary canvas" TSRMLS_CC); - return; - } - remove_canvas = 1; - } - - /* Multiline testing */ - if (query_multiline) { - metrics = MagickQueryMultilineFontMetrics(intern->magick_wand, internd->drawing_wand, text); - } else { - metrics = MagickQueryFontMetrics(intern->magick_wand, internd->drawing_wand, text); - } - - /* Remove the image from the stack*/ - if (remove_canvas) { - MagickRemoveImage(intern->magick_wand); - } - - if (!metrics) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Failed to query the font metrics" TSRMLS_CC); - return; - } else { - zval *pbounding; -#if PHP_VERSION_ID >= 70000 - zval bounding; - pbounding = &bounding; -#else - MAKE_STD_ZVAL(pbounding) -#endif - - array_init(return_value); - add_assoc_double(return_value, "characterWidth", metrics0); - add_assoc_double(return_value, "characterHeight", metrics1); - add_assoc_double(return_value, "ascender", metrics2); - add_assoc_double(return_value, "descender", metrics3); - add_assoc_double(return_value, "textWidth", metrics4); - add_assoc_double(return_value, "textHeight", metrics5); - add_assoc_double(return_value, "maxHorizontalAdvance", metrics6); - - array_init(pbounding); - add_assoc_double(pbounding, "x1", metrics7); - add_assoc_double(pbounding, "y1", metrics8); - add_assoc_double(pbounding, "x2", metrics9); - add_assoc_double(pbounding, "y2", metrics10); - add_assoc_zval(return_value, "boundingBox", pbounding); - add_assoc_double(return_value, "originX", metrics11); - add_assoc_double(return_value, "originY", metrics12); - - IMAGICK_FREE_MAGICK_MEMORY(metrics); - return; - } -} -/* }}} */ - -/* {{{ proto bool Imagick::valid() - Checks if the current item is valid -*/ -PHP_METHOD(Imagick, valid) -{ - php_imagick_object *intern; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - if (intern->next_out_of_bound) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto Imagick Imagick::current() - Returns reference to the current imagick object with image pointer at the correct sequence. -*/ -PHP_METHOD(Imagick, current) -{ - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - RETURN_ZVAL(getThis(), 1, 0); -} -/* }}} */ - -/* {{{ proto bool Imagick::readImage(string filename) - Reads image from filename -*/ -PHP_METHOD(Imagick, readImage) -{ - char *filename; - IM_LEN_TYPE filename_len; - php_imagick_object *intern; - struct php_imagick_file_t file = {0}; - php_imagick_rw_result_t rc; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - if (!php_imagick_file_init(&file, filename, filename_len TSRMLS_CC)) { - php_imagick_throw_exception(IMAGICK_CLASS, "Invalid filename provided" TSRMLS_CC); - return; - } - - rc = php_imagick_read_file(intern, &file, ImagickReadImage TSRMLS_CC); - php_imagick_file_deinit(&file); - - if (rc != IMAGICK_RW_OK) { - php_imagick_rw_fail_to_exception (intern->magick_wand, rc, filename TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::readImages(array files ) - Reads image from an array of filenames -*/ -#if PHP_VERSION_ID >= 70000 -PHP_METHOD(Imagick, readImages) -{ - - zval *value; - zval *files; - php_imagick_object *intern; - php_imagick_rw_result_t rc; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &files) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(files), value) { - struct php_imagick_file_t file = {0}; - ZVAL_DEREF(value); - - if (!php_imagick_file_init(&file, Z_STRVAL_P(value), Z_STRLEN_P(value) TSRMLS_CC)) { - php_imagick_throw_exception(IMAGICK_CLASS, "Invalid filename provided" TSRMLS_CC); - return; - } - - rc = php_imagick_read_file(intern, &file, ImagickReadImage TSRMLS_CC); - php_imagick_file_deinit(&file); - - if (rc != IMAGICK_RW_OK) { - php_imagick_rw_fail_to_exception (intern->magick_wand, rc, Z_STRVAL_P(value) TSRMLS_CC); - return; - } - } ZEND_HASH_FOREACH_END(); - RETURN_TRUE; -} -#else -PHP_METHOD(Imagick, readImages) -{ - zval *files; - php_imagick_object *intern; - HashPosition pos; - php_imagick_rw_result_t rc; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &files) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - for(zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(files), &pos); - zend_hash_has_more_elements_ex(Z_ARRVAL_P(files), &pos) == SUCCESS; - zend_hash_move_forward_ex(Z_ARRVAL_P(files), &pos)) { - - struct php_imagick_file_t file = {0}; - zval **ppzval; - - if (zend_hash_get_current_data_ex(Z_ARRVAL_P(files), (void**)&ppzval, &pos) == FAILURE) { - continue; - } - - if (!php_imagick_file_init(&file, Z_STRVAL_PP(ppzval), Z_STRLEN_PP(ppzval) TSRMLS_CC)) { - php_imagick_throw_exception(IMAGICK_CLASS, "Invalid filename provided" TSRMLS_CC); - return; - } - - rc = php_imagick_read_file(intern, &file, ImagickReadImage TSRMLS_CC); - php_imagick_file_deinit(&file); - - if (rc != IMAGICK_RW_OK) { - php_imagick_rw_fail_to_exception (intern->magick_wand, rc, Z_STRVAL_PP(ppzval) TSRMLS_CC); - return; - } - } - RETURN_TRUE; -} -#endif - - -/* {{{ proto bool Imagick::pingImage(string filename ) - This method can be used to query image width, height, size, and format without reading the whole image in to memory. -*/ -PHP_METHOD(Imagick, pingImage) -{ - char *filename; - IM_LEN_TYPE filename_len; - php_imagick_object *intern; - struct php_imagick_file_t file = {0}; - php_imagick_rw_result_t rc; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - if (!php_imagick_file_init(&file, filename, filename_len TSRMLS_CC)) { - php_imagick_throw_exception(IMAGICK_CLASS, "Invalid filename provided" TSRMLS_CC); - return; - } - rc = php_imagick_read_file(intern, &file, ImagickPingImage TSRMLS_CC); - php_imagick_file_deinit(&file); - - if (rc != IMAGICK_RW_OK) { - php_imagick_rw_fail_to_exception (intern->magick_wand, rc, filename TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::readImageFile(resource filehandle, string filename) - Reads image from open filehandle -*/ -PHP_METHOD(Imagick, readImageFile) -{ - char *filename = NULL; - IM_LEN_TYPE filename_len; - php_imagick_object *intern; - zval *zstream; - zend_bool result; - php_stream *stream; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|s!", &zstream, &filename, &filename_len) == FAILURE) - { - return; - } - - intern = Z_IMAGICK_P(getThis()); - -#if PHP_VERSION_ID >= 70000 - php_stream_from_zval(stream, zstream); -#else - php_stream_from_zval(stream, &zstream); -#endif - result = php_imagick_stream_handler(intern, stream, ImagickReadImageFile TSRMLS_CC); - - if (result == 0) { - if (!EG(exception)) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to read image from the filehandle" TSRMLS_CC); - return; - } - return; - } - - if (filename) { - MagickSetImageFilename(intern->magick_wand, filename); - MagickSetLastIterator(intern->magick_wand); - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::displayImage(string serverName ) - Displays an image -*/ -PHP_METHOD(Imagick, displayImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - char *server_name; - IM_LEN_TYPE server_name_len; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &server_name, &server_name_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickDisplayImage(intern->magick_wand, server_name); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to display image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::displayImages(string serverName ) - displays an image or image sequence -*/ -PHP_METHOD(Imagick, displayImages) -{ - php_imagick_object *intern; - MagickBooleanType status; - char *server_name; - IM_LEN_TYPE server_name_len; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &server_name, &server_name_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickDisplayImages(intern->magick_wand, server_name); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to display images" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::readBlob(string image ) - Reads image from a binary string -*/ -PHP_METHOD(Imagick, readImageBlob) -{ - char *image_string; - char *filename = NULL; - long filename_len; - IM_LEN_TYPE image_string_len; - MagickBooleanType status; - php_imagick_object *intern; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!", &image_string, &image_string_len, &filename, &filename_len) == FAILURE) { - return; - } - - if (!image_string_len) { - php_imagick_throw_exception(IMAGICK_CLASS, "Zero size image string passed" TSRMLS_CC); - return; - } - - intern = Z_IMAGICK_P(getThis()); - status = MagickReadImageBlob(intern->magick_wand, image_string, image_string_len); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to read image blob" TSRMLS_CC); - return; - } - - /* Even if filename is null we need to give a name here. Otherwise segfaults will happen */ - MagickSetImageFilename(intern->magick_wand, filename); - MagickSetLastIterator(intern->magick_wand); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::blurImage(float radius, float sigma, int channel ) - Adds blur filter to image. Optional third parameter to blur a specific channel. -*/ -PHP_METHOD(Imagick, blurImage) -{ - double radius, sigma; - php_imagick_object *intern; - MagickBooleanType status; - /* Initialize channel type to all channels*/ - im_long channel = IM_DEFAULT_CHANNEL; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd|l", &radius, &sigma, &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickBlurImageChannel(intern->magick_wand, channel, radius, sigma); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to blur image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::waveImage(float amplitude, float length ) - Adds wave filter to the image. -*/ -PHP_METHOD(Imagick, waveImage) -{ - double amplitude, wave_length; - php_imagick_object *intern; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &litude, &wave_length) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - -#if MagickLibVersion >= 0x700 - { - //TODO allow PixelInterpolateMethod be set - PixelInterpolateMethod method = BilinearInterpolatePixel; - status = MagickWaveImage(intern->magick_wand, amplitude, wave_length, method); - } -#else - status = MagickWaveImage(intern->magick_wand, amplitude, wave_length); -#endif - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to wave image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - - - -#if MagickLibVersion >= 0x700 -/* {{{ proto bool Imagick::waveImageWithMethod(float amplitude, float length, int pixel_interpolate_method) - Adds wave filter to the image. -*/ -PHP_METHOD(Imagick, waveImageWithMethod) -{ - double amplitude, wave_length; - php_imagick_object *intern; - MagickBooleanType status; - im_long method; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddl", &litude, &wave_length, &method) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickWaveImage(intern->magick_wand, amplitude, wave_length, method); - - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to wave image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif //MagickLibVersion >= 0x700 - -/* {{{ proto bool Imagick::clear() - Clears all resources associated to Imagick object -*/ -PHP_METHOD(Imagick, clear) -{ - php_imagick_object *intern; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - if (!intern->magick_wand) { - RETURN_FALSE; - } - - ClearMagickWand(intern->magick_wand); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::scaleImage(int width, int height, bool bestfit = false, bool legacy ) - Scales the size of an image to the given dimensions. Passing zero as either of - the arguments will preserve dimension while scaling. - If legacy is true, the calculations are done with the small rounding bug that existed in - Imagick before 3.4.0. If false, the calculations should produce the same results as - ImageMagick CLI does. -*/ -PHP_METHOD(Imagick, scaleImage) -{ - im_long width, height, new_width, new_height; - php_imagick_object *intern; - MagickBooleanType status; - zend_bool bestfit = 0; - zend_bool legacy = 0; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll|bb", &width, &height, &bestfit, &legacy) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - if (!php_imagick_thumbnail_dimensions(intern->magick_wand, bestfit, width, height, &new_width, &new_height, legacy)) { - php_imagick_throw_exception(IMAGICK_CLASS, "Invalid image geometry" TSRMLS_CC); - return; - } - - status = MagickScaleImage(intern->magick_wand, new_width, new_height); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to scale image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::cropImage(int width, height, int x, int y ) - Extracts a region of the image. -*/ -PHP_METHOD(Imagick, cropImage) -{ - im_long width, height, x, y; - php_imagick_object *intern; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llll", &width, &height, &x, &y) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickCropImage(intern->magick_wand, width, height, x, y); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to crop image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::spreadImage(float radius ) - Special effects method that randomly displaces each pixel in a block defined by the radius parameter. -*/ -PHP_METHOD(Imagick, spreadImage) -{ - double radius; - php_imagick_object *intern; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &radius) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - -#if MagickLibVersion >= 0x700 - { - //TODO allow PixelInterpolateMethod be set - PixelInterpolateMethod method = BilinearInterpolatePixel; - status = MagickSpreadImage(intern->magick_wand, radius, method); - } -#else - status = MagickSpreadImage(intern->magick_wand, radius); -#endif - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to spread image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -#if MagickLibVersion >= 0x700 -/* {{{ proto bool Imagick::spreadImageWithMethod(float radius, int interpolate_method) - Special effects method that randomly displaces each pixel in a block defined by the radius parameter. -*/ -PHP_METHOD(Imagick, spreadImageWithMethod) -{ - double radius; - php_imagick_object *intern; - MagickBooleanType status; - im_long method; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dl", &radius, &method) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSpreadImage(intern->magick_wand, radius, method); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to spread image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif // MagickLibVersion >= 0x700 - -/* {{{ proto bool Imagick::swirlImage(float degrees ) - Swirls the pixels about the center of the image, where degrees indicates the sweep of the arc through which each pixel is moved. You get a more dramatic effect as the degrees move from 1 to 360. -*/ -PHP_METHOD(Imagick, swirlImage) -{ - double degrees; - php_imagick_object *intern; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", °rees) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - -#if MagickLibVersion >= 0x700 - { - //TODO allow PixelInterpolateMethod be set - PixelInterpolateMethod method = BilinearInterpolatePixel; - status = MagickSwirlImage(intern->magick_wand, degrees, method); - } -#else - status = MagickSwirlImage(intern->magick_wand, degrees); -#endif - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to swirl image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - - -#if MagickLibVersion >= 0x700 -/* {{{ proto bool Imagick::swirlImageWithMethod(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. -*/ -PHP_METHOD(Imagick, swirlImageWithMethod) -{ - double degrees; - php_imagick_object *intern; - MagickBooleanType status; - im_long method; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dl", °rees, &method) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSwirlImage(intern->magick_wand, degrees, method); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to swirl image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif //MagickLibVersion >= 0x700 - - -/* {{{ proto bool Imagick::stripImage() - Strips an image of all profiles and comments. -*/ -PHP_METHOD(Imagick, stripImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickStripImage(intern->magick_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to strip image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::trimImage(double fuzz) - Remove edges that are the background color from the image. -*/ -PHP_METHOD(Imagick, trimImage) -{ - double fuzz; - php_imagick_object *intern; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &fuzz) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickTrimImage(intern->magick_wand, fuzz); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to trim image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::chopImage(int width, int height, int x, int y) - Removes a region of an image and collapses the image to occupy the removed portion -*/ -PHP_METHOD(Imagick, chopImage) -{ - php_imagick_object *intern; - im_long width, height, x, y; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llll", &width, &height, &x, &y) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickChopImage(intern->magick_wand, width, height, x, y); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to chop image" TSRMLS_CC); - return; - } - - RETURN_TRUE; - -} -/* }}} */ - -/* {{{ proto bool Imagick::clipImage() - Clips along the first path from the 8BIM profile, if present. -*/ -PHP_METHOD(Imagick, clipImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - status = MagickClipImage(intern->magick_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to clip image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::clipPathImage(string pathname, bool inside) - Clips along the named paths from the 8BIM profile, if present. Later operations take effect inside the path. Id may be a number if preceded with #, to work on a numbered path, e.g., "#1" to use the first path. -*/ -PHP_METHOD(Imagick, clipPathImage) -{ - php_imagick_object *intern; - char *clip_path; - IM_LEN_TYPE clip_path_len; - zend_bool inside; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sb", &clip_path, &clip_path_len, &inside) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; -#if MagickLibVersion > 0x636 - status = MagickClipImagePath(intern->magick_wand, clip_path, inside); -#else - status = MagickClipPathImage(intern->magick_wand, clip_path, inside); -#endif - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to clip path image" TSRMLS_CC); - return; - } - - RETURN_TRUE; - -} -/* }}} */ - -/* {{{ proto Imagick Imagick::coalesceImages() - Composites a set of images while respecting any page offsets and disposal methods. GIF, MIFF, and MNG animation sequences typically start with an image background and each subsequent image varies in size and offset. returns a new sequence where each image in the sequence is the same size as the first and composited with the next image in the sequence. -*/ -PHP_METHOD(Imagick, coalesceImages) -{ - MagickWand *tmp_wand; - php_imagick_object *intern, *intern_return; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - tmp_wand = MagickCoalesceImages(intern->magick_wand); - - if (tmp_wand == NULL) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Coalesce image failed" TSRMLS_CC); - return; - } - - object_init_ex(return_value, php_imagick_sc_entry); - intern_return = Z_IMAGICK_P(return_value); - php_imagick_replace_magickwand(intern_return, tmp_wand); - return; - -} -/* }}} */ - -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -#if MagickLibVersion < 0x700 -/* {{{ proto bool Imagick::colorFloodfillImage(ImagickPixel fill, double fuzz, ImagickPixel bordercolor, int x, int y) - Changes the color value of any pixel that matches target and is an immediate neighbor. -*/ -PHP_METHOD(Imagick, colorFloodfillImage) -{ - php_imagick_object *intern; - zval *fill_param, *border_param; - im_long x, y; - double fuzz; - MagickBooleanType status; - PixelWand *fill_wand, *border_wand; - zend_bool fill_allocated = 0, border_allocated = 0; - - IMAGICK_METHOD_DEPRECATED("Imagick", "colorFloodFillImage"); - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zdzll", &fill_param, &fuzz, &border_param, &x, &y) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - fill_wand = php_imagick_zval_to_pixelwand (fill_param, IMAGICK_CLASS, &fill_allocated TSRMLS_CC); - if (!fill_wand) - return; - - border_wand = php_imagick_zval_to_pixelwand (border_param, IMAGICK_CLASS, &border_allocated TSRMLS_CC); - if (!border_wand) { - if (fill_allocated) - fill_wand = DestroyPixelWand (fill_wand); - return; - } - - status = MagickColorFloodfillImage(intern->magick_wand, fill_wand, fuzz, border_wand, x, y); - - if (fill_allocated) - fill_wand = DestroyPixelWand (fill_wand); - - if (border_allocated) - border_wand = DestroyPixelWand (border_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to color floodfill image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ -#endif // #if MagickLibVersion < 0x700 -#endif - -/* {{{ proto Imagick Imagick::combineImages() - Combines one or more images into a single image. The grayscale value of the pixels of each image in the sequence is assigned in order to the specified channels of the combined image. The typical ordering would be image 1 => Red, 2 => Green, 3 => Blue, etc. -*/ -PHP_METHOD(Imagick, combineImages) -{ - MagickWand *tmp_wand; - php_imagick_object *intern, *intern_return; - - // TODO - this is actuall ColorspaceType - // https://imagemagick.org/api/magick-image.php#MagickCombineImages - im_long channel_type; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &channel_type) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - tmp_wand = MagickCombineImages(intern->magick_wand, channel_type); - - if (tmp_wand == NULL) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Combine images failed" TSRMLS_CC); - return; - } - - object_init_ex(return_value, php_imagick_sc_entry); - intern_return = Z_IMAGICK_P(return_value); - php_imagick_replace_magickwand(intern_return, tmp_wand); - - return; -} -/* }}} */ - -/* {{{ proto Imagick Imagick::setImage(Imagick replace ) - Replaces the current sequence -*/ -PHP_METHOD(Imagick, setImage) -{ - zval *objvar; - MagickBooleanType status; - php_imagick_object *intern, *replace; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &objvar, php_imagick_sc_entry) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - replace = Z_IMAGICK_P(objvar); - if (php_imagick_ensure_not_empty (replace->magick_wand) == 0) - return; - - status = MagickSetImage(intern->magick_wand, replace->magick_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set the image" TSRMLS_CC); - return; - } - RETURN_TRUE; - -} -/* }}} */ - -/* {{{ proto Imagick Imagick::getImage() - Returns a new Imagick object with the current image sequence. -*/ -PHP_METHOD(Imagick, getImage) -{ - MagickWand *tmp_wand; - php_imagick_object *intern, *intern_return; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - tmp_wand = MagickGetImage(intern->magick_wand); - - if (tmp_wand == NULL) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Get image failed" TSRMLS_CC); - return; - } - - object_init_ex(return_value, php_imagick_sc_entry); - intern_return = Z_IMAGICK_P(return_value); - php_imagick_replace_magickwand(intern_return, tmp_wand); - - return; -} -/* }}} */ - -/* {{{ proto bool Imagick::addImage(Imagick source ) - Adds new image to Imagick object from the current position of the source object. -*/ -PHP_METHOD(Imagick, addImage) -{ - php_imagick_object *intern, *intern_add; - zval *add_obj; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &add_obj, php_imagick_sc_entry) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - intern_add = Z_IMAGICK_P(add_obj); - - if (php_imagick_ensure_not_empty (intern_add->magick_wand) == 0) - return; - - status = MagickAddImage(intern->magick_wand, intern_add->magick_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to add image" TSRMLS_CC); - return; - } - - MagickSetLastIterator(intern->magick_wand); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::newImage(int cols, int rows, ImagickPixel background, string format ) - Creates a new image and associates ImagickPixel value as background color -*/ -PHP_METHOD(Imagick, newImage) -{ - php_imagick_object *intern; - zval *param; - MagickBooleanType status; - im_long columns, rows; - char *format = NULL; - IM_LEN_TYPE format_len = 0; - PixelWand *color_wand; - zend_bool allocated; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llz|s", &columns, &rows, ¶m, &format, &format_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - color_wand = php_imagick_zval_to_pixelwand (param, IMAGICK_CLASS, &allocated TSRMLS_CC); - if (!color_wand) - return; - - status = MagickNewImage(intern->magick_wand, columns, rows, color_wand); - - if (allocated) - color_wand = DestroyPixelWand (color_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to create new image" TSRMLS_CC); - return; - } - - /* If the optional fourth parameter was given - set the image format here */ - if (format != NULL && format_len > 0) { - - status = MagickSetImageFormat(intern->magick_wand, format); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set the image format" TSRMLS_CC); - return; - } - } - - MagickSetLastIterator(intern->magick_wand); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::newPseudoImage(int cols, int rows, string pseudoString ) - Creates a new image using pseudo format -*/ -PHP_METHOD(Imagick, newPseudoImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - im_long columns, rows; - char *pseudo_string; - IM_LEN_TYPE pseudo_string_len; - struct php_imagick_file_t file = {0}; - php_imagick_rw_result_t rc; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lls", &columns, &rows, &pseudo_string, &pseudo_string_len) == FAILURE) { - return; - } - - if (IMAGICK_G(allow_zero_dimension_images) == 0) { - if (columns == 0) { - php_error( - E_DEPRECATED, - "Creating images with zero columns is deprecated. If you think you need to " \ - "do this, please open an issue at https://phpimagick.com/issues" - ); - } - if (rows == 0) { - php_error( - E_DEPRECATED, - "Creating images with zero rows is deprecated. If you think you need to " \ - "do this, please open an issue at https://phpimagick.com/issues" - ); - } - } - - /* Allow only pseudo formats in this method */ - if (strchr (pseudo_string, ':') == NULL) { - php_imagick_throw_exception(IMAGICK_CLASS, "Invalid pseudo format string" TSRMLS_CC); - return; - } - - intern = Z_IMAGICK_P(getThis()); - - /* Pseudo image needs a size set manually */ - status = MagickSetSize(intern->magick_wand, columns, rows); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to create new pseudo image" TSRMLS_CC); - return; - } - - if (!php_imagick_file_init(&file, pseudo_string, pseudo_string_len TSRMLS_CC)) { - php_imagick_throw_exception(IMAGICK_CLASS, "Invalid filename provided" TSRMLS_CC); - return; - } - rc = php_imagick_read_file(intern, &file, ImagickReadImage TSRMLS_CC); - php_imagick_file_deinit(&file); - - if (rc != IMAGICK_RW_OK) { - php_imagick_rw_fail_to_exception (intern->magick_wand, rc, pseudo_string TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::getImageTotalInkDensity() - Gets the image total ink density. -*/ -PHP_METHOD(Imagick, getImageTotalInkDensity) -{ - php_imagick_object *intern; - double ink_density; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - ink_density = MagickGetImageTotalInkDensity(intern->magick_wand); - RETVAL_DOUBLE(ink_density); -} -/* }}} */ - -/* {{{ proto bool Imagick::implodeImage(float radius ) - Creates a new image that is a copy of an existing one with the image pixels "implode" by the specified percentage. It allocates the memory necessary for the new Image structure and returns a pointer to the new image. -*/ -PHP_METHOD(Imagick, implodeImage) -{ - php_imagick_object *intern; - double radius; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &radius) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - -#if MagickLibVersion >= 0x700 - { - //TODO allow PixelInterpolateMethod be set - PixelInterpolateMethod method = BilinearInterpolatePixel; - status = MagickImplodeImage(intern->magick_wand, radius, method); - } -#else - status = MagickImplodeImage(intern->magick_wand, radius); -#endif - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to implode image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -#if MagickLibVersion >= 0x700 -/* {{{ proto bool Imagick::implodeImageWithMethod(float radius, int pixel_interpolate_method ) - Creates a new image that is a copy of an existing one with the image pixels "implode" by the specified percentage. It allocates the memory necessary for the new Image structure and returns a pointer to the new image. -*/ -PHP_METHOD(Imagick, implodeImageWithMethod) -{ - php_imagick_object *intern; - double radius; - im_long method; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dl", &radius, &method) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickImplodeImage(intern->magick_wand, radius, method); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to implode image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ -#endif // #if MagickLibVersion >= 0x700 - - -#if MagickLibVersion >= 0x658 -//Only stable as of 658 -//http://upstream-tracker.org/compat_reports/imagemagick/6.5.7.7_to_6.5.7.8/abi_compat_report.html - -/* {{{ proto bool Imagick::inverseFourierTransformImage(Imagick complement, bool magnitude) -*/ -PHP_METHOD(Imagick, inverseFourierTransformImage) -{ - php_imagick_object *intern, *intern_complement; - zval *complement_obj; - zend_bool magnitude; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ob", &complement_obj, php_imagick_sc_entry, &magnitude) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - intern_complement = Z_IMAGICK_P(complement_obj); - status = MagickInverseFourierTransformImage(intern->magick_wand, intern_complement->magick_wand, magnitude); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to inversefouriertransformimage image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ -#endif - -/* {{{ proto bool Imagick::levelImage(float blackPoint, float gamma, float whitePoint, int channel ) - 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. -*/ -PHP_METHOD(Imagick, levelImage) -{ - php_imagick_object *intern; - double black_point, gamma, white_point; - MagickBooleanType status; - im_long channel = IM_DEFAULT_CHANNEL; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddd|l", &black_point, &gamma, &white_point, &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickLevelImageChannel(intern->magick_wand, channel, black_point, gamma, white_point); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to level image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::magnifyImage() - Is a convenience method that scales an image proportionally to twice its original size. -*/ -PHP_METHOD(Imagick, magnifyImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickMagnifyImage(intern->magick_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to magnify image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -#if MagickLibVersion < 0x700 -/* {{{ proto bool Imagick::cycleColormapImage(Imagick map, bool dither) - Replaces the colors of an image with the closest color from a reference image. -*/ -PHP_METHOD(Imagick, mapImage) -{ - php_imagick_object *intern, *intern_map; - zval *map_obj; - zend_bool dither; - MagickBooleanType status; - - IMAGICK_METHOD_DEPRECATED ("Imagick", "mapImage"); - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ob", &map_obj, php_imagick_sc_entry, &dither) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - intern_map = Z_IMAGICK_P(map_obj); - status = MagickMapImage(intern->magick_wand, intern_map->magick_wand, dither); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to map image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ -#endif // #if MagickLibVersion < 0x700 - -#if MagickLibVersion < 0x700 -/* {{{ proto bool Imagick::matteFloodfillImage(float alpha,float fuzz,ImagickPixel bordercolor, int x, int y) - Changes the transparency value of any pixel that matches target and is an immediate neighbor -*/ -PHP_METHOD(Imagick, matteFloodfillImage) -{ - php_imagick_object *intern; - zval *param; - im_long x, y; - double alpha, fuzz; - MagickBooleanType status; - PixelWand *color_wand; - zend_bool allocated; - - IMAGICK_METHOD_DEPRECATED("Imagick", "matteFloodfillImage"); - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddzll", &alpha, &fuzz, ¶m, &x, &y) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - color_wand = php_imagick_zval_to_pixelwand (param, IMAGICK_CLASS, &allocated TSRMLS_CC); - if (!color_wand) - return; - - status = MagickMatteFloodfillImage(intern->magick_wand, alpha, fuzz, color_wand, x, y); - - if (allocated) - color_wand = DestroyPixelWand (color_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to matte floodfill image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ -#endif // #if MagickLibVersion < 0x700 -#endif - -#if MagickLibVersion < 0x700 -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -/* {{{ proto bool Imagick::medianFilterImage(float radius) - Applies a digital filter that improves the quality of a noisy image. Each pixel is replaced by the median in a set of neighboring pixels as defined by radius. -*/ -PHP_METHOD(Imagick, medianFilterImage) -{ - php_imagick_object *intern; - double radius; - MagickBooleanType status; - - IMAGICK_METHOD_DEPRECATED ("Imagick", "medianFilterImage"); - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &radius) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickMedianFilterImage(intern->magick_wand, radius); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to median filter image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ -#endif -#endif - -/* {{{ proto bool Imagick::negateImage(bool gray, int channel ) - Negates the colors in the reference image. The Grayscale option means that only grayscale values within the image are negated. -*/ -PHP_METHOD(Imagick, negateImage) -{ - php_imagick_object *intern; - zend_bool gray; - MagickBooleanType status; - im_long channel = IM_DEFAULT_CHANNEL; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b|l", &gray, &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickNegateImageChannel(intern->magick_wand, channel, gray); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to negate image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -#if MagickLibVersion < 0x700 -/* {{{ proto bool Imagick::paintOpaqueImage(ImagickPixel target, ImagickPixel fill, float fuzz, int channel) - Changes any pixel that matches color with the color defined by fill. Channel argument is supported in ImageMagick 6.2.8+. -*/ -PHP_METHOD(Imagick, paintOpaqueImage) -{ - php_imagick_object *intern; - zval *target_param, *fill_param; - double fuzz; - MagickBooleanType status; - im_long channel = DefaultChannels; - PixelWand *target_wand, *fill_wand; - zend_bool target_allocated = 0, fill_allocated = 0; - - IMAGICK_METHOD_DEPRECATED ("Imagick", "paintOpaqueImage"); - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zzd|l", &target_param, &fill_param, &fuzz, &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - target_wand = php_imagick_zval_to_pixelwand (target_param, IMAGICK_CLASS, &target_allocated TSRMLS_CC); - if (!target_wand) - return; - - fill_wand = php_imagick_zval_to_pixelwand (fill_param, IMAGICK_CLASS, &fill_allocated TSRMLS_CC); - if (!fill_wand) { - if (target_allocated) - target_wand = DestroyPixelWand (target_wand); - return; - } - -#if MagickLibVersion > 0x628 - status = MagickPaintOpaqueImageChannel(intern->magick_wand, channel, target_wand, fill_wand, fuzz); -#else - status = MagickPaintOpaqueImage(intern->magick_wand, target_wand, fill_wand, fuzz); -#endif - - if (fill_allocated) - fill_wand = DestroyPixelWand (fill_wand); - - if (target_allocated) - target_wand = DestroyPixelWand (target_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable paint opaque image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ -#endif // #if MagickLibVersion < 0x700 -#endif - -#if MagickLibVersion > 0x628 -/* {{{ proto Imagick Imagick::optimizeImageLayers() - Compares each image the GIF disposed forms of the previous image in the sequence. From this it attempts to select the smallest cropped image to replace each frame, while preserving the results of the animation. -*/ -PHP_METHOD(Imagick, optimizeImageLayers) -{ - MagickWand *tmp_wand; - php_imagick_object *intern, *intern_return; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - tmp_wand = MagickOptimizeImageLayers(intern->magick_wand); - - if (tmp_wand == NULL) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Optimize image layers failed" TSRMLS_CC); - return; - } - - object_init_ex(return_value, php_imagick_sc_entry); - intern_return = Z_IMAGICK_P(return_value); - php_imagick_replace_magickwand(intern_return, tmp_wand); - - return; -} -/* }}} */ - -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -#if MagickLibVersion < 0x700 -/* {{{ proto bool Imagick::paintTransparentImage(ImagickPixel target, float alpha, float fuzz) - Changes any pixel that matches color with the color defined by fill. -*/ -PHP_METHOD(Imagick, paintTransparentImage) -{ - php_imagick_object *intern; - zval *param; - double alpha, fuzz; - MagickBooleanType status; - PixelWand *color_wand; - zend_bool allocated; - - IMAGICK_METHOD_DEPRECATED ("Imagick", "paintTransparentImage"); - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zdd", ¶m, &alpha, &fuzz) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - color_wand = php_imagick_zval_to_pixelwand (param, IMAGICK_CLASS, &allocated TSRMLS_CC); - if (!color_wand) - return; - - status = MagickPaintTransparentImage(intern->magick_wand, color_wand, alpha, fuzz); - - if (allocated) - color_wand = DestroyPixelWand (color_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to paint transparent image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ -#endif // #if MagickLibVersion < 0x700 -#endif -#endif - -/* {{{ proto Imagick Imagick::previewImages(int preview ) - Tiles 9 thumbnails of the specified image with an image processing operation applied at varying strengths. - This is helpful to quickly pin-point an appropriate parameter for an image processing operation. -*/ -PHP_METHOD(Imagick, previewImages) -{ - php_imagick_object *intern, *intern_return; - im_long preview; - MagickWand *tmp_wand; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &preview) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - tmp_wand = MagickPreviewImages(intern->magick_wand, preview); - - if (tmp_wand == NULL) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Preview images failed" TSRMLS_CC); - return; - } - - object_init_ex(return_value, php_imagick_sc_entry); - intern_return = Z_IMAGICK_P(return_value); - php_imagick_replace_magickwand(intern_return, tmp_wand); - return; -} -/* }}} */ - -/* {{{ proto bool Imagick::profileImage(string name, string|null 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. -*/ -PHP_METHOD(Imagick, profileImage) -{ - php_imagick_object *intern; - char *name, *profile; - IM_LEN_TYPE name_len, profile_len; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss!", &name, &name_len, &profile, &profile_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickProfileImage(intern->magick_wand, name, profile, profile_len); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to profile image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::quantizeImage(int numberColors, int colorspace, int treedepth, bool dither, - bool measureError) - Analyzes the colors within a reference image -*/ -PHP_METHOD(Imagick, quantizeImage) -{ - php_imagick_object *intern; - im_long number_colors, colorspace, tree_depth; - zend_bool dither, measure_error; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lllbb", &number_colors, &colorspace, &tree_depth, &dither, &measure_error) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickQuantizeImage(intern->magick_wand, number_colors, colorspace, tree_depth, dither, measure_error); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to quantize image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::quantizeImages(int number_colors, int colorspace, int treedepth, bool dither, - bool measure_error) - Analyzes the colors within a sequence of images -*/ -PHP_METHOD(Imagick, quantizeImages) -{ - php_imagick_object *intern; - im_long number_colors, colorspace, tree_depth; - zend_bool dither, measure_error; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lllbb", &number_colors, &colorspace, &tree_depth, &dither, &measure_error) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickQuantizeImages(intern->magick_wand, number_colors, colorspace, tree_depth, dither, measure_error); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to quantize images" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -#if MagickLibVersion < 0x700 -/* {{{ proto bool Imagick::reduceNoiseImage(float radius) - Smooths the contours of an image -*/ -PHP_METHOD(Imagick, reduceNoiseImage) -{ - php_imagick_object *intern; - double radius; - MagickBooleanType status; - - IMAGICK_METHOD_DEPRECATED ("Imagick", "reduceNoiseImage"); - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &radius) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickReduceNoiseImage(intern->magick_wand, radius); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to reduce image noise" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ -#endif -#endif - -/* {{{ proto string Imagick::removeImageProfile(string name) - Removes the named image profile and returns it -*/ -PHP_METHOD(Imagick, removeImageProfile) -{ - php_imagick_object *intern; - char *name; - unsigned char *profile; - IM_LEN_TYPE name_len; -#if MagickLibVersion < 0x628 - long profile_len; -#else - size_t profile_len; -#endif - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - profile = MagickRemoveImageProfile(intern->magick_wand, name, &profile_len); - - if (!profile) { - php_imagick_throw_exception(IMAGICK_CLASS, "The image profile does not exist" TSRMLS_CC); - return; - } - - IM_ZVAL_STRING(return_value, (char *)profile); - IMAGICK_FREE_MAGICK_MEMORY(profile); - return; -} -/* }}} */ - -/* {{{ proto bool Imagick::separateImageChannel(int channel) - Separates a channel from the image -*/ -PHP_METHOD(Imagick, separateImageChannel) -{ - php_imagick_object *intern; - im_long channel; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - -#if MagickLibVersion >= 0x700 - status = MagickSeparateImage(intern->magick_wand, channel); -#else - status = MagickSeparateImageChannel(intern->magick_wand, channel); -#endif - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to separate image channel" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::sepiaToneImage(float threshold) - Applies a special effect to the image -*/ -PHP_METHOD(Imagick, sepiaToneImage) -{ - php_imagick_object *intern; - double threshold; - double c_opacity; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &threshold) == FAILURE) { - return; - } - - c_opacity = (threshold * QuantumRange) / 100; - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSepiaToneImage(intern->magick_wand, c_opacity); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to sepia tone image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -#if MagickLibVersion < 0x700 -/* {{{ proto bool Imagick::setImageBias(float bias) - Sets the image bias -*/ -static -void s_set_image_bias(INTERNAL_FUNCTION_PARAMETERS, zend_bool use_quantum) -{ - php_imagick_object *intern; - double bias; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &bias) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - if (use_quantum) { - bias *= QuantumRange; - } - - status = MagickSetImageBias(intern->magick_wand, bias); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image bias" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ -#endif // #if MagickLibVersion < 0x700 - - -/* {{{ proto bool Imagick::setImageBiasQuantum(float bias) - Sets the image bias. Bias should be scaled with 0 = no adjustment, 1 = quantum value -*/ -#if MagickLibVersion < 0x700 -PHP_METHOD(Imagick, setImageBiasQuantum) -{ - s_set_image_bias (INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -#endif -/* }}} */ - - -/* {{{ proto bool Imagick::setImageBias(float bias) - Sets the image bias. Bias should be scaled with 0 = no adjustment, 2^^x = adjust black to white - where x = the quantum depth ImageMagick was compiled with -*/ -#if MagickLibVersion < 0x700 -PHP_METHOD(Imagick, setImageBias) -{ - s_set_image_bias (INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -#endif -/* }}} */ - - - -/* {{{ proto bool Imagick::setImageBluePrimary(float x,float y) -For IM7 the prototype is -proto bool Imagick::setImageBluePrimary(float x, float y, float z) - - Sets the image chromaticity blue primary point -*/ -PHP_METHOD(Imagick, setImageBluePrimary) -{ - php_imagick_object *intern; - double x, y; -#if MagickLibVersion >= 0x700 - double z; -#endif - MagickBooleanType status; - - /* Parse parameters given to function */ -#if MagickLibVersion >= 0x700 - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddd", &x, &y, &z) == FAILURE) { -#else - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &x, &y) == FAILURE) { -#endif - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - -#if MagickLibVersion >= 0x700 - status = MagickSetImageBluePrimary(intern->magick_wand, x, y, z); -#else - status = MagickSetImageBluePrimary(intern->magick_wand, x, y); -#endif - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image blue primary" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::setImageBorderColor(ImagickPixel border) - Sets the image border color -*/ -PHP_METHOD(Imagick, setImageBorderColor) -{ - zval *param; - php_imagick_object *intern; - MagickBooleanType status; - PixelWand *color_wand; - zend_bool allocated; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", ¶m) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - color_wand = php_imagick_zval_to_pixelwand (param, IMAGICK_CLASS, &allocated TSRMLS_CC); - if (!color_wand) - return; - - status = MagickSetImageBorderColor(intern->magick_wand, color_wand); - - if (allocated) - color_wand = DestroyPixelWand (color_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image border color" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::setImageChannelDepth(int channel, int depth) - Sets the depth of a particular image channel -*/ -PHP_METHOD(Imagick, setImageChannelDepth) -{ - php_imagick_object *intern; - im_long channel_type, depth; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &channel_type, &depth) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSetImageChannelDepth(intern->magick_wand, channel_type, depth); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image channel depth" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::setImageColormapColor(int index, ImagickPixel color) - Sets the color of the specified colormap index -*/ -PHP_METHOD(Imagick, setImageColormapColor) -{ - php_imagick_object *intern; - zval *param; - im_long index; - MagickBooleanType status; - PixelWand *color_wand; - zend_bool allocated; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lz", &index, ¶m) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - color_wand = php_imagick_zval_to_pixelwand (param, IMAGICK_CLASS, &allocated TSRMLS_CC); - if (!color_wand) - return; - - status = MagickSetImageColormapColor(intern->magick_wand, index, color_wand); - - if (allocated) - color_wand = DestroyPixelWand (color_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image color map color" TSRMLS_CC); - return; - } - RETURN_TRUE; - -} -/* }}} */ - -/* {{{ proto bool Imagick::setImageColorspace(int colorspace) - Sets the image colorspace -*/ -PHP_METHOD(Imagick, setImageColorspace) -{ - php_imagick_object *intern; - im_long colorspace; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &colorspace) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSetImageColorspace(intern->magick_wand, colorspace); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image colorspace" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::setImageDispose(int dispose) - Sets the image disposal method -*/ -PHP_METHOD(Imagick, setImageDispose) -{ - php_imagick_object *intern; - im_long dispose; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &dispose) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSetImageDispose(intern->magick_wand, dispose); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image dispose" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::setImageExtent(int columns, int rows) - Sets the image size -*/ -PHP_METHOD(Imagick, setImageExtent) -{ - php_imagick_object *intern; - im_long rows, columns; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &rows, &columns) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSetImageExtent(intern->magick_wand, rows, columns); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image extent" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::setImageGreenPrimary(float x, float y) -For IM7 the prototype is -proto bool Imagick::setImageGreenPrimary(float x, float y, float z) - Sets the image chromaticity green primary point -*/ -PHP_METHOD(Imagick, setImageGreenPrimary) -{ - php_imagick_object *intern; - double x, y; -#if MagickLibVersion >= 0x700 - double z; -#endif - MagickBooleanType status; - - - /* Parse parameters given to function */ -#if MagickLibVersion >= 0x700 - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddd", &x, &y, &z) == FAILURE) { -#else - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &x, &y) == FAILURE) { -#endif - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - -#if MagickLibVersion >= 0x700 - status = MagickSetImageGreenPrimary(intern->magick_wand, x, y, z); -#else - status = MagickSetImageGreenPrimary(intern->magick_wand, x, y); -#endif - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image green primary" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::setImageInterlaceScheme(int interlace_scheme) - Sets the image interlace scheme -*/ -PHP_METHOD(Imagick, setImageInterlaceScheme) -{ - php_imagick_object *intern; - im_long interlace; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &interlace) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSetImageInterlaceScheme(intern->magick_wand, interlace); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image interlace scheme" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::setImageProfile(string name, string profile) - Adds a named profile to the Imagick object -*/ -PHP_METHOD(Imagick, setImageProfile) -{ - php_imagick_object *intern; - char *name, *profile; - IM_LEN_TYPE profile_len, name_len; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &name_len, &profile, &profile_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSetImageProfile(intern->magick_wand, name, profile, profile_len); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image profile" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::setImageRedPrimary(float x,float y) -For IM7 the prototype is -proto bool Imagick::setImageRedPrimary(float x, float y, float z) - - Sets the image chromaticity red primary point. -*/ -PHP_METHOD(Imagick, setImageRedPrimary) -{ - php_imagick_object *intern; - double x, y; -#if MagickLibVersion >= 0x700 - double z; -#endif - MagickBooleanType status; - - /* Parse parameters given to function */ -#if MagickLibVersion >= 0x700 - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddd", &x, &y, &z) == FAILURE) { -#else - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &x, &y) == FAILURE) { -#endif - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - -#if MagickLibVersion >= 0x700 - status = MagickSetImageRedPrimary(intern->magick_wand, x, y, z); -#else - status = MagickSetImageRedPrimary(intern->magick_wand, x, y); -#endif - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image red primary" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::setImageRenderingIntent(int rendering_intent) - Sets the image rendering intent. -*/ -PHP_METHOD(Imagick, setImageRenderingIntent) -{ - php_imagick_object *intern; - im_long rendering_intent; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &rendering_intent) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSetImageRenderingIntent(intern->magick_wand, rendering_intent); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image rendering intent" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::setImageVirtualPixelMethod(int method) - Sets the image virtual pixel method. -*/ -PHP_METHOD(Imagick, setImageVirtualPixelMethod) -{ - php_imagick_object *intern; - im_long virtual_pixel; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &virtual_pixel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - MagickSetImageVirtualPixelMethod(intern->magick_wand, virtual_pixel); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::setImageWhitePoint(float x, float y) - -For IM7 the prototype is -proto bool Imagick::setImageWhitePoint(float x, float y, float z) - - Sets the image chromaticity white point. -*/ -PHP_METHOD(Imagick, setImageWhitePoint) -{ - php_imagick_object *intern; - double x, y; -#if MagickLibVersion >= 0x700 - double z; -#endif - MagickBooleanType status; - - /* Parse parameters given to function */ -#if MagickLibVersion >= 0x700 - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddd", &x, &y, &z) == FAILURE) { -#else - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &x, &y) == FAILURE) { -#endif - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - -#if MagickLibVersion >= 0x700 - status = MagickSetImageWhitePoint(intern->magick_wand, x, y, z); -#else - status = MagickSetImageWhitePoint(intern->magick_wand, x, y); -#endif - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image white point" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::sigmoidalContrastImage(bool sharpen, float contrast, float midpoint, int channel) - Adjusts the contrast of an image with a non-linear sigmoidal contrast algorithm. Increase the contrast of the image using a sigmoidal transfer function without saturating highlights or shadows. Contrast indicates how much to increase the contrast (0 is none; 3 is typical; 20 is pushing it); mid-point indicates where midtones fall in the resultant image (0 is white; 50 is middle-gray; 100 is black). Set sharpen to true to increase the image contrast otherwise the contrast is reduced. -*/ -PHP_METHOD(Imagick, sigmoidalContrastImage) -{ - php_imagick_object *intern; - zend_bool sharpen; - double contrast, midpoint; - MagickBooleanType status; - im_long channel = IM_DEFAULT_CHANNEL; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "bdd|l", &sharpen, &contrast, &midpoint, &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSigmoidalContrastImageChannel(intern->magick_wand, channel, sharpen, contrast, midpoint); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to sigmoidal contrast image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::stereoImage(Imagick offset_wand) - Composites two images and produces a single image that is the composite of a left and right image of a stereo pair -*/ -PHP_METHOD(Imagick, stereoImage) -{ - MagickWand *tmp_wand; - zval *magick_object; - php_imagick_object *intern, *intern_second, *intern_return; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &magick_object, php_imagick_sc_entry) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - intern_second = Z_IMAGICK_P(magick_object); - if (php_imagick_ensure_not_empty (intern_second->magick_wand) == 0) - return; - - tmp_wand = MagickStereoImage(intern->magick_wand, intern_second->magick_wand); - - if (tmp_wand == NULL) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Stereo image failed" TSRMLS_CC); - return; - } - - object_init_ex(return_value, php_imagick_sc_entry); - intern_return = Z_IMAGICK_P(return_value); - php_imagick_replace_magickwand(intern_return, tmp_wand); - - return; -} -/* }}} */ - -/* {{{ proto Imagick Imagick::textureImage(Imagick texture_wand) - Repeatedly tiles the texture image across and down the image canvas. -*/ -PHP_METHOD(Imagick, textureImage) -{ - MagickWand *tmp_wand; - zval *magick_object; - php_imagick_object *intern, *intern_second, *intern_return; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &magick_object, php_imagick_sc_entry) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - intern_second = Z_IMAGICK_P(magick_object); - if (php_imagick_ensure_not_empty (intern_second->magick_wand) == 0) - return; - - tmp_wand = MagickTextureImage(intern->magick_wand, intern_second->magick_wand); - - if (!tmp_wand) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Texture image failed" TSRMLS_CC); - return; - } - - object_init_ex(return_value, php_imagick_sc_entry); - intern_return = Z_IMAGICK_P(return_value); - php_imagick_replace_magickwand(intern_return, tmp_wand); - - return; -} -/* }}} */ - -/* {{{ proto bool Imagick::tintImage(ImagickPixel tint, ImagickPixel opacity, bool legacy = false) - Applies a color vector to each pixel in the image. The 'opacity' color is a per channel - strength factor for how strongly the color should be applied. If legacy is true, the behaviour - of this function is incorrect, but consistent with how it behaved before Imagick version 3.4.0 -*/ -PHP_METHOD(Imagick, tintImage) -{ - php_imagick_object *intern; - zval *tint_param, *opacity_param; - MagickBooleanType status; - PixelWand *tint_wand, *opacity_wand; - zend_bool tint_allocated, opacity_allocated; - zend_bool legacy = 0; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz|b", &tint_param, &opacity_param, &legacy) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - tint_wand = php_imagick_zval_to_pixelwand (tint_param, IMAGICK_CLASS, &tint_allocated TSRMLS_CC); - if (!tint_wand) - return; - - if (legacy) { - opacity_wand = php_imagick_zval_to_opacity(opacity_param, IMAGICK_CLASS, &opacity_allocated TSRMLS_CC); - } - else { - opacity_wand = php_imagick_zval_to_pixelwand(opacity_param, IMAGICK_CLASS, &opacity_allocated TSRMLS_CC); - } - - - if (!opacity_wand) { - if (tint_allocated) - tint_wand = DestroyPixelWand (tint_wand); - return; - } - - status = MagickTintImage(intern->magick_wand, tint_wand, opacity_wand); - - if (tint_allocated) - tint_wand = DestroyPixelWand (tint_wand); - - if (opacity_allocated) - opacity_wand = DestroyPixelWand (opacity_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable tint image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::unsharpMaskImage(float radius, float sigma, float amount, float threshold, int channel) - Sharpens an image. 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 Imagick::UnsharpMaskImage() selects a suitable radius for you. -*/ -PHP_METHOD(Imagick, unsharpMaskImage) -{ - php_imagick_object *intern; - double radius, sigma, amount, threshold; - MagickBooleanType status; - im_long channel = IM_DEFAULT_CHANNEL; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddd|l", &radius, &sigma, &amount, &threshold, &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickUnsharpMaskImageChannel(intern->magick_wand, channel, radius, sigma, amount, threshold); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to unsharp mask image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - - - - -#if MagickLibVersion >= 0x700 - -/* {{{ proto bool Imagick::convolveImage(array kernel, int channel) - Applies a custom convolution kernel to the image. -*/ -PHP_METHOD(Imagick, convolveImage) -{ - zval *objvar; - php_imagick_object *intern; - php_imagickkernel_object *kernel; - MagickBooleanType status; - im_long channel = IM_DEFAULT_CHANNEL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|l", &objvar, php_imagickkernel_sc_entry, &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - kernel = Z_IMAGICKKERNEL_P(objvar); - - IMAGICK_KERNEL_NOT_NULL_EMPTY(kernel); - status = MagickConvolveImageChannel(intern->magick_wand, channel, kernel->kernel_info); - - // No magick is going to happen - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Failed to filter image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} - -#else - -/* {{{ proto bool Imagick::convolveImage(array kernel, int channel) - Applies a custom convolution kernel to the image. -*/ -PHP_METHOD(Imagick, convolveImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - zval *kernel_array; - double *kernel; - im_long channel = DefaultChannels; - unsigned long order = 0; - im_long num_elements = 0; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|l", &kernel_array, &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - kernel = php_imagick_zval_to_double_array(kernel_array, &num_elements TSRMLS_CC); - - if (!kernel) { - php_imagick_throw_exception(IMAGICK_CLASS, "Unable to read matrix array" TSRMLS_CC); - return; - } - - order = (unsigned long) sqrt(num_elements); - status = MagickConvolveImageChannel(intern->magick_wand, channel, order, kernel); - efree(kernel); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to convolve image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif - -/* {{{ proto bool Imagick::cycleColormapImage(int displace) - Displaces an image's colormap by a given number of positions. If you cycle the colormap a number of times you can produce a psychodelic effect. -*/ -PHP_METHOD(Imagick, cycleColormapImage) -{ - php_imagick_object *intern; - im_long displace; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &displace) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickCycleColormapImage(intern->magick_wand, displace); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to cycle image colormap" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto Imagick Imagick::deconstructImages() - Compares each image with the next in a sequence and returns the maximum bounding region of any pixel differences it discovers. -*/ -PHP_METHOD(Imagick, deconstructImages) -{ - MagickWand *tmp_wand; - php_imagick_object *intern, *intern_return; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - tmp_wand = MagickDeconstructImages(intern->magick_wand); - - if (tmp_wand == NULL) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Deconstruct image failed" TSRMLS_CC); - return; - } - - object_init_ex(return_value, php_imagick_sc_entry); - intern_return = Z_IMAGICK_P(return_value); - php_imagick_replace_magickwand(intern_return, tmp_wand); - - return; -} -/* }}} */ - -/* {{{ proto Imagick Imagick::getImageRegion(int width, int height, int x, int y) - Extracts a region of the image and returns it as a new image. -*/ -PHP_METHOD(Imagick, getImageRegion) -{ - MagickWand *tmp_wand; - php_imagick_object *intern, *intern_return; - im_long width, height, x, y; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llll", &width, &height, &x, &y) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - tmp_wand = MagickGetImageRegion(intern->magick_wand, width, height, x, y); - - if (tmp_wand == NULL) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Get image region failed" TSRMLS_CC); - return; - } - - object_init_ex(return_value, php_imagick_sc_entry); - intern_return = Z_IMAGICK_P(return_value); - php_imagick_replace_magickwand(intern_return, tmp_wand); - - return; - -} -/* }}} */ - -/* {{{ proto bool Imagick::despeckleImage() - Reduces the speckle noise in an image while perserving the edges of the original image. -*/ -PHP_METHOD(Imagick, despeckleImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickDespeckleImage(intern->magick_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to despeckle image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::edgeImage(float radius) - Enhance edges within the image with a convolution filter of the given radius. Use a radius of 0 and Edge() selects a suitable radius for you. -*/ -PHP_METHOD(Imagick, edgeImage) -{ - php_imagick_object *intern; - double radius; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &radius) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickEdgeImage(intern->magick_wand, radius); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to edge image" TSRMLS_CC); - return; - } - - RETURN_TRUE; - -} -/* }}} */ - -/* {{{ proto bool Imagick::embossImage(float radius, float sigma) - Returns a grayscale image with a three-dimensional effect. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, radius should be larger than sigma. Use a radius of 0 and it will choose a suitable radius for you. -*/ -PHP_METHOD(Imagick, embossImage) -{ - php_imagick_object *intern; - double radius, sigma; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &radius, &sigma) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickEmbossImage(intern->magick_wand, radius, sigma); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to emboss image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::enhanceImage() - Applies a digital filter that improves the quality of a noisy image. -*/ -PHP_METHOD(Imagick, enhanceImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickEnhanceImage(intern->magick_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to enchance image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::equalizeImage() - Equalizes the image histogram. -*/ -PHP_METHOD(Imagick, equalizeImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickEqualizeImage(intern->magick_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to equalize image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::evaluateImage(int op, float constant, int channel) - Applys an arithmetic, relational, or logical expression to an image. Use these operators to lighten or darken an image, to increase or decrease contrast in an image, or to produce the "negative" of an image. -*/ -PHP_METHOD(Imagick, evaluateImage) -{ - php_imagick_object *intern; - im_long evaluate_operator; - double constant; - MagickBooleanType status; - im_long channel = IM_DEFAULT_CHANNEL; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ld|l", &evaluate_operator, &constant, &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickEvaluateImageChannel(intern->magick_wand, channel, evaluate_operator, constant); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to evaluate image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - - -#if MagickLibVersion >= 0x687 -/* {{{ proto bool Imagick::evaluateImages(int EVALUATE_CONSTANT) - Merge multiple images of the same size together with the selected operator. -http://www.imagemagick.org/Usage/layers/#evaluate-sequence -*/ -PHP_METHOD(Imagick, evaluateImages) -{ - php_imagick_object *intern, *intern_return; - im_long evaluate_operator; - MagickBooleanType status; - MagickWand *evaluated_wand; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &evaluate_operator) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - -// MagickEvaluateImages appears to crash if index is not zero. -#if MagickLibVersion > 0x628 - /* Get the current iterator position */ - status = MagickSetIteratorIndex(intern->magick_wand, 0); -#else - status = MagickSetImageIndex(intern->magick_wand, 0); -#endif - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set iterator index" TSRMLS_CC); - return; - } - - evaluated_wand = MagickEvaluateImages(intern->magick_wand, evaluate_operator); - - object_init_ex(return_value, php_imagick_sc_entry); - intern_return = Z_IMAGICK_P(return_value); - php_imagick_replace_magickwand(intern_return, evaluated_wand); - return; -} -/* }}} */ -#endif //MagickLibVersion >= 0x687 - -#if MagickLibVersion > 0x655 - -/* {{{ proto bool Imagick::forwardfouriertransformimage(bool magnitude) - //http://www.fftw.org/ - yum install fftw-devel fftw - ./configure --enable-hdri -*/ -PHP_METHOD(Imagick, forwardFourierTransformImage) -{ - php_imagick_object *intern; - zend_bool magnitude; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &magnitude) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickForwardFourierTransformImage(intern->magick_wand, magnitude); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to forwardfouriertransformimage image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -#endif - - -/* {{{ proto array Imagick::getImageGeometry() - Returns the width and height as an associative array. -*/ -PHP_METHOD(Imagick, getImageGeometry) -{ - long width,height; - php_imagick_object *intern; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - width = MagickGetImageWidth(intern->magick_wand); - height = MagickGetImageHeight(intern->magick_wand); - - array_init(return_value); - add_assoc_long(return_value, "width", width); - add_assoc_long(return_value, "height", height); - - return; -} -/* }}} */ - -#if MagickLibVersion < 0x700 -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -/* {{{ proto ImagickPixel Imagick::getImageAttribute(string key ) - Returns a named attribute -*/ -PHP_METHOD(Imagick, getImageAttribute) -{ - php_imagick_object *intern; - char *key, *attribute; - IM_LEN_TYPE key_len; - - IMAGICK_METHOD_DEPRECATED("Imagick", "getImageAttribute"); - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &key, &key_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - attribute = MagickGetImageAttribute(intern->magick_wand, key); - - if (!attribute) { - RETURN_FALSE; - } - - IM_ZVAL_STRING(return_value, attribute); - IMAGICK_FREE_MAGICK_MEMORY(attribute); - - return; -} -/* }}} */ -#endif -#endif - -/* {{{ proto ImagickPixel Imagick::getImageBackgroundColor() - Returns the image background color. -*/ -PHP_METHOD(Imagick, getImageBackgroundColor) -{ - php_imagick_object *intern; - php_imagickpixel_object *internp; - MagickBooleanType status; - PixelWand *tmp_wand; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - tmp_wand = NewPixelWand(); - status = MagickGetImageBackgroundColor(intern->magick_wand, tmp_wand); - - if (tmp_wand == (PixelWand *)NULL) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image background color" TSRMLS_CC); - return; - } - - if (status == MagickFalse) { - tmp_wand = DestroyPixelWand(tmp_wand); - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image background color" TSRMLS_CC); - return; - } - - object_init_ex(return_value, php_imagickpixel_sc_entry); - internp = Z_IMAGICKPIXEL_P(return_value); - php_imagick_replace_pixelwand(internp, tmp_wand); - - return; -} -/* }}} */ - -/* {{{ proto array Imagick::getImageBluePrimary() - Returns the chromaticy green primary point. IM6: Returns an array with the keys "x" and "y". - IM7: Returns an array with the keys "x", "y" and "z". -*/ -PHP_METHOD(Imagick, getImageBluePrimary) -{ - php_imagick_object *intern; - MagickBooleanType status; - double x, y; -#if MagickLibVersion >= 0x700 - double z; -#endif - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - -#if MagickLibVersion >= 0x700 - status = MagickGetImageBluePrimary(intern->magick_wand, &x, &y, &z); -#else - status = MagickGetImageBluePrimary(intern->magick_wand, &x, &y); -#endif - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image blue primary" TSRMLS_CC); - return; - } - - array_init(return_value); - add_assoc_double(return_value, "x", x); - add_assoc_double(return_value, "y", y); -#if MagickLibVersion >= 0x700 - add_assoc_double(return_value, "z", z); -#endif - - return; -} -/* }}} */ - -/* {{{ proto ImagickPixel Imagick::getImageBorderColor() - Returns the image border color. -*/ -PHP_METHOD(Imagick, getImageBorderColor) -{ - php_imagick_object *intern; - php_imagickpixel_object *internp; - MagickBooleanType status; - PixelWand *tmp_wand; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - tmp_wand = NewPixelWand(); - status = MagickGetImageBorderColor(intern->magick_wand, tmp_wand); - - if (tmp_wand == (PixelWand *)NULL) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image border color" TSRMLS_CC); - return; - } - - if (status == MagickFalse) { - tmp_wand = DestroyPixelWand(tmp_wand); - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image border color" TSRMLS_CC); - return; - } - - object_init_ex(return_value, php_imagickpixel_sc_entry); - internp = Z_IMAGICKPIXEL_P(return_value); - php_imagick_replace_pixelwand(internp, tmp_wand); - - return; -} -/* }}} */ - -/* {{{ proto int Imagick::getImageChannelDepth() - Gets the depth for a particular image channel. -*/ -PHP_METHOD(Imagick, getImageChannelDepth) -{ - php_imagick_object *intern; - im_long channel_type, channel_depth; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &channel_type) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - channel_depth = MagickGetImageChannelDepth(intern->magick_wand, channel_type); - RETVAL_LONG(channel_depth); -} -/* }}} */ - -/* {{{ proto float Imagick::getImageChannelDistortion(Imagick reference, int channel, int metric) - Compares one or more image channels of an image to a reconstructed image and returns the specified distortion metric. -*/ -PHP_METHOD(Imagick, getImageChannelDistortion) -{ - zval *objvar; - php_imagick_object *intern, *intern_second; - im_long channel_type, metric_type; - double distortion; - MagickBooleanType status; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Oll", &objvar, php_imagick_sc_entry, &channel_type, &metric_type) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - intern_second = Z_IMAGICK_P(objvar); - if (php_imagick_ensure_not_empty (intern_second->magick_wand) == 0) - return; - - status = MagickGetImageChannelDistortion(intern->magick_wand, intern_second->magick_wand, channel_type, metric_type, &distortion); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image channel distortion" TSRMLS_CC); - return; - } - - RETVAL_DOUBLE(distortion); - -} -/* }}} */ - -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -#if MagickLibVersion < 0x700 -/* {{{ proto array Imagick::getImageChannelExtrema(int channel) - Gets the extrema for one or more image channels. Return value is an associative array with the keys "minima" and "maxima". -*/ -PHP_METHOD(Imagick, getImageChannelExtrema) -{ - php_imagick_object *intern; - im_long channel_type; - size_t minima, maxima; - MagickBooleanType status; - - IMAGICK_METHOD_DEPRECATED ("Imagick", "getImageChannelExtrema"); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &channel_type) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickGetImageChannelExtrema(intern->magick_wand, channel_type, &minima, &maxima); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image channel extrema" TSRMLS_CC); - return; - } - - array_init(return_value); - add_assoc_long(return_value, "minima", minima); - add_assoc_long(return_value, "maxima", maxima); - - return; -} -/* }}} */ -#endif //#if MagickLibVersion < 0x700 -#endif - -/* {{{ proto array Imagick::getImageChannelMean(int channel) - Gets the mean and standard deviation of one or more image channels. Return value is an associative array with the keys "mean" and "standardDeviation". -*/ -PHP_METHOD(Imagick, getImageChannelMean) -{ - php_imagick_object *intern; - im_long channel_type; - double mean, standard_deviation; - MagickBooleanType status; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &channel_type) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickGetImageChannelMean(intern->magick_wand, channel_type, &mean, &standard_deviation); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image channel mean" TSRMLS_CC); - return; - } - - array_init(return_value); - add_assoc_double(return_value, "mean", mean); - add_assoc_double(return_value, "standardDeviation", standard_deviation); - - return; -} -/* }}} */ - -/* {{{ proto array Imagick::getImageChannelStatistics() - Returns statistics for each channel in the image. The statistics incude the channel depth, its minima and maxima, the mean, and the standard deviation. You can access the red channel mean, for example, like this: -*/ -PHP_METHOD(Imagick, getImageChannelStatistics) -{ -#if PHP_VERSION_ID >= 70000 - zval tmp; -#else - zval *tmp; -#endif - - const long channels = { - UndefinedChannel, RedChannel, CyanChannel, - GreenChannel, MagentaChannel, BlueChannel, - YellowChannel, OpacityChannel, BlackChannel, -#if MagickLibVersion < 0x700 - MatteChannel -#endif - }; - php_imagick_object *intern; - ChannelStatistics *statistics; - unsigned int i; -#if MagickLibVersion < 0x700 - unsigned int elements = 10; -#endif // #if MagickLibVersion >= 0x700 - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - -#if MagickLibVersion >= 0x700 - statistics = MagickGetImageStatistics(intern->magick_wand); -#else - statistics = MagickGetImageChannelStatistics(intern->magick_wand); -#endif - - array_init(return_value); - -#if MagickLibVersion >= 0x700 - for (i=0; i < sizeof(channels)/sizeof(channels0); i++) { -#if PHP_VERSION_ID >= 70000 - array_init(&tmp); - add_assoc_double(&tmp, "mean", statisticsi.mean); - add_assoc_double(&tmp, "minima", statisticsi.minima); - add_assoc_double(&tmp, "maxima", statisticsi.maxima); - add_assoc_double(&tmp, "standardDeviation", statisticsi.standard_deviation); -#if MagickLibVersion < 0x635 - add_assoc_long(&tmp, "scale", statisticsi.scale); -#endif //0x635 - add_assoc_long(&tmp, "depth", statisticsi.depth); - add_index_zval(return_value, i, &tmp); -#else //not ZE3 - MAKE_STD_ZVAL(tmp); - array_init(tmp); - add_assoc_double(tmp, "mean", statisticsi.mean); - add_assoc_double(tmp, "minima", statisticsi.minima); - add_assoc_double(tmp, "maxima", statisticsi.maxima); - add_assoc_double(tmp, "standardDeviation", statisticsi.standard_deviation); -#if MagickLibVersion < 0x635 - add_assoc_long(&tmp, "scale", statisticsi.scale); -#endif //0x635 - add_assoc_long(tmp, "depth", statisticsi.depth); - add_index_zval(return_value, channelsi, tmp); -#endif //end ZE3 - } -#else //below MagickLibVersion>= 0x700 - for (i = 0; i < elements ; i++) { -#if PHP_VERSION_ID >= 70000 - array_init(&tmp); - add_assoc_double(&tmp, "mean", statisticschannelsi.mean); - add_assoc_double(&tmp, "minima", statisticschannelsi.minima); - add_assoc_double(&tmp, "maxima", statisticschannelsi.maxima); - add_assoc_double(&tmp, "standardDeviation", statisticschannelsi.standard_deviation); -#if MagickLibVersion < 0x635 - add_assoc_long(&tmp, "scale", statisticschannelsi.scale); -#endif - add_assoc_long(&tmp, "depth", statisticschannelsi.depth); - add_index_zval(return_value, channelsi, &tmp); -#else - MAKE_STD_ZVAL(tmp); - array_init(tmp); - add_assoc_double(tmp, "mean", statisticschannelsi.mean); - add_assoc_double(tmp, "minima", statisticschannelsi.minima); - add_assoc_double(tmp, "maxima", statisticschannelsi.maxima); - add_assoc_double(tmp, "standardDeviation", statisticschannelsi.standard_deviation); -#if MagickLibVersion < 0x635 - add_assoc_long(&tmp, "scale", statisticschannelsi.scale); -#endif - add_assoc_long(tmp, "depth", statisticschannelsi.depth); - add_index_zval(return_value, channelsi, tmp); -#endif - - } -#endif - -//etc. -// channel_statisticsi.sum_squared*=area; -// channel_statisticsi.sum_cubed*=area; -// channel_statisticsi.sum_fourth_power*=area; - - MagickRelinquishMemory(statistics); - return; -} -/* }}} */ - -/* {{{ proto ImagickPixel Imagick::getImageColormapColor(int index, ImagickPixel color) - Returns the color of the specified colormap index. -*/ -PHP_METHOD(Imagick, getImageColormapColor) -{ - php_imagick_object *intern; - php_imagickpixel_object *internp; - MagickBooleanType status; - PixelWand *tmp_wand; - im_long index; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &index) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - tmp_wand = NewPixelWand(); - status = MagickGetImageColormapColor(intern->magick_wand, index , tmp_wand); - - if (tmp_wand == (PixelWand *)NULL) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image colormap color" TSRMLS_CC); - return; - } - - if (status == MagickFalse) { - tmp_wand = DestroyPixelWand(tmp_wand); - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image colormap color" TSRMLS_CC); - return; - } - - object_init_ex(return_value, php_imagickpixel_sc_entry); - internp = Z_IMAGICKPIXEL_P(return_value); - php_imagick_replace_pixelwand(internp, tmp_wand); - - return; -} -/* }}} */ - -/* {{{ proto int Imagick::getImageColorspace() - Gets the image colorspace. -*/ -PHP_METHOD(Imagick, getImageColorspace) -{ - php_imagick_object *intern; - long colorSpace; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - colorSpace = MagickGetImageColorspace(intern->magick_wand); - RETVAL_LONG(colorSpace); -} -/* }}} */ - -/* {{{ proto int Imagick::getImageCompose() - Returns the composite operator associated with the image. -*/ -PHP_METHOD(Imagick, getImageCompose) -{ - php_imagick_object *intern; - long composite; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - composite = MagickGetImageCompose(intern->magick_wand); - RETVAL_LONG(composite); -} -/* }}} */ - -/* {{{ proto int Imagick::getImageDelay() - Gets the image delay. -*/ -PHP_METHOD(Imagick, getImageDelay) -{ - php_imagick_object *intern; - long delay; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - delay = MagickGetImageDelay(intern->magick_wand); - RETVAL_LONG(delay); -} -/* }}} */ - -/* {{{ proto int Imagick::getImageDepth() - Gets the image depth. -*/ -PHP_METHOD(Imagick, getImageDepth) -{ - php_imagick_object *intern; - long depth; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - depth = MagickGetImageDepth(intern->magick_wand); - RETVAL_LONG(depth); -} -/* }}} */ - -/* {{{ proto float Imagick::getImageDistortion(MagickWand reference, int metric) - Compares an image to a reconstructed image and returns the specified distortion metric. -*/ -PHP_METHOD(Imagick, getImageDistortion) -{ - zval *objvar; - php_imagick_object *intern, *intern_second; - im_long metric_type; - double distortion; - MagickBooleanType status; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ol", &objvar, php_imagick_sc_entry, &metric_type) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - intern_second = Z_IMAGICK_P(objvar); - if (php_imagick_ensure_not_empty (intern_second->magick_wand) == 0) - return; - - status = MagickGetImageDistortion(intern->magick_wand, intern_second->magick_wand, metric_type, &distortion); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image distortion" TSRMLS_CC); - return; - } - - RETVAL_DOUBLE(distortion); -} -/* }}} */ - -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -#if MagickLibVersion < 0x700 -/* {{{ proto array Imagick::getImageExtrema() - Gets the extrema for the image. Returns an associative array with the keys "min" and "max". -*/ -PHP_METHOD(Imagick, getImageExtrema) -{ - php_imagick_object *intern; - size_t min, max; - MagickBooleanType status; - - IMAGICK_METHOD_DEPRECATED ("Imagick", "getImageExtrema"); - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickGetImageExtrema(intern->magick_wand, &min, &max); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image extrema" TSRMLS_CC); - return; - } - - array_init(return_value); - add_assoc_long(return_value, "min", min); - add_assoc_long(return_value, "max", max); - - return; -} -/* }}} */ -#endif //#if MagickLibVersion < 0x700 -#endif - -/* {{{ proto long Imagick::getImageDispose() - Gets the image disposal method. -*/ -PHP_METHOD(Imagick, getImageDispose) -{ - php_imagick_object *intern; - long dispose; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - dispose = MagickGetImageDispose(intern->magick_wand); - RETVAL_LONG(dispose); -} -/* }}} */ - -/* {{{ proto float Imagick::getImageGamma() - Gets the image gamma. -*/ -PHP_METHOD(Imagick, getImageGamma) -{ - php_imagick_object *intern; - double gamma; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - gamma = MagickGetImageGamma(intern->magick_wand); - RETVAL_DOUBLE(gamma); -} -/* }}} */ - -/* {{{ proto array Imagick::getImageGreenPrimary() - Returns the chromaticy green primary point. IM6: Returns an array with the keys "x" and "y". - IM7: Returns an array with the keys "x", "y" and "z". -*/ -PHP_METHOD(Imagick, getImageGreenPrimary) -{ - php_imagick_object *intern; - double x, y; -#if MagickLibVersion >= 0x700 - double z; -#endif - MagickBooleanType status; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - -#if MagickLibVersion >= 0x700 - status = MagickGetImageGreenPrimary(intern->magick_wand, &x, &y, &z); -#else - status = MagickGetImageGreenPrimary(intern->magick_wand, &x, &y); -#endif - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image green primary" TSRMLS_CC); - return; - } - - array_init(return_value); - add_assoc_double(return_value, "x", x); - add_assoc_double(return_value, "y", y); -#if MagickLibVersion >= 0x700 - add_assoc_double(return_value, "z", z); -#endif - - return; -} -/* }}} */ - -/* {{{ proto int Imagick::getImageHeight() - Returns the image height. -*/ -PHP_METHOD(Imagick, getImageHeight) -{ - php_imagick_object *intern; - long height; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - height = MagickGetImageHeight(intern->magick_wand); - RETVAL_LONG(height); -} -/* }}} */ - -/* {{{ proto array Imagick::getImageHistogram() - Returns the image histogram as an array of ImagickPixel objects. -*/ -PHP_METHOD(Imagick, getImageHistogram) -{ - php_imagick_object *intern; - php_imagickpixel_object *internp; - PixelWand **wand_array; - size_t colors = 0; - unsigned long i; -#if PHP_VERSION_ID >= 70000 - zval tmp_pixelwand; -#else - zval *tmp_pixelwand; -#endif - - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - wand_array = MagickGetImageHistogram(intern->magick_wand, &colors); - array_init(return_value); - - for (i = 0; i < colors; i++) { - if (wand_arrayi) { -#if PHP_VERSION_ID >= 70000 - object_init_ex(&tmp_pixelwand, php_imagickpixel_sc_entry); - internp = Z_IMAGICKPIXEL_P(&tmp_pixelwand); - php_imagick_replace_pixelwand(internp, wand_arrayi); - add_next_index_zval(return_value, &tmp_pixelwand); -#else - MAKE_STD_ZVAL(tmp_pixelwand); - object_init_ex(tmp_pixelwand, php_imagickpixel_sc_entry); - internp = (php_imagickpixel_object *)zend_object_store_get_object(tmp_pixelwand TSRMLS_CC); - php_imagick_replace_pixelwand(internp, wand_arrayi); - add_next_index_zval(return_value, tmp_pixelwand); -#endif - } - } - - IMAGICK_FREE_MAGICK_MEMORY(wand_array); - return; -} -/* }}} */ - -/* {{{ proto int Imagick::getImageInterlaceScheme() - Gets the image interlace scheme. -*/ -PHP_METHOD(Imagick, getImageInterlaceScheme) -{ - php_imagick_object *intern; - long interlace; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - interlace = MagickGetImageInterlaceScheme(intern->magick_wand); - RETVAL_LONG(interlace); -} -/* }}} */ - -/* {{{ proto int Imagick::getImageIterations() - Gets the image iterations. -*/ -PHP_METHOD(Imagick, getImageIterations) -{ - php_imagick_object *intern; - long iterations; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - iterations = MagickGetImageIterations(intern->magick_wand); - RETVAL_LONG(iterations); -} -/* }}} */ - -#if MagickLibVersion < 0x700 -/* {{{ proto ImagickPixel Imagick::getImageMatteColor() - Returns the image matte color. -*/ -PHP_METHOD(Imagick, getImageMatteColor) -{ - php_imagick_object *intern; - php_imagickpixel_object *internp; - MagickBooleanType status; - PixelWand *tmp_wand; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - tmp_wand = NewPixelWand(); - status = MagickGetImageMatteColor(intern->magick_wand, tmp_wand); - - if (tmp_wand == (PixelWand *)NULL) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image matte color" TSRMLS_CC); - return; - } - - if (status == MagickFalse) { - tmp_wand = DestroyPixelWand(tmp_wand); - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable get image matter color" TSRMLS_CC); - return; - } - - object_init_ex(return_value, php_imagickpixel_sc_entry); - internp = Z_IMAGICKPIXEL_P(return_value); - php_imagick_replace_pixelwand(internp, tmp_wand); - - return; -} -/* }}} */ -#endif //#if MagickLibVersion < 0x700 - -/* {{{ proto array Imagick::getImagePage() - Returns the page geometry associated with the image in an array with the keys "width", "height", "x", and "y". -*/ -PHP_METHOD(Imagick, getImagePage) -{ - php_imagick_object *intern; - MagickBooleanType status; - size_t width, height; - ssize_t x, y; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickGetImagePage(intern->magick_wand, &width, &height, &x, &y); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image page" TSRMLS_CC); - return; - } - - array_init(return_value); - - add_assoc_long(return_value, "width", width); - add_assoc_long(return_value, "height", height); - add_assoc_long(return_value, "x", x); - add_assoc_long(return_value, "y", y); - - return; -} -/* }}} */ - -/* {{{ proto ImagickPixel Imagick::getImagePixelColor(int x, int y) - Returns the color of the specified pixel. -*/ -PHP_METHOD(Imagick, getImagePixelColor) -{ - php_imagick_object *intern; - php_imagickpixel_object *internp; - MagickBooleanType status; - PixelWand *tmp_wand; - im_long x, y; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &x, &y) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - tmp_wand = NewPixelWand(); - - if (!tmp_wand) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Failed to allocate new PixelWand" TSRMLS_CC); - return; - } - - status = MagickGetImagePixelColor(intern->magick_wand, x, y , tmp_wand); - - if (status == MagickFalse) { - tmp_wand = DestroyPixelWand(tmp_wand); - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable get image pixel color" TSRMLS_CC); - return; - } - - object_init_ex(return_value, php_imagickpixel_sc_entry); - internp = Z_IMAGICKPIXEL_P(return_value); - php_imagick_replace_pixelwand(internp, tmp_wand); - - return; -} -/* }}} */ - - -#if IM_HAVE_IMAGICK_SETIMAGEPIXELCOLOR -/* {{{ proto void setImagePixelColor(int $x, int $y, ImagickPixel|string $color) - Returns the color of the specified pixel. -*/ -PHP_METHOD(Imagick, setImagePixelColor) -{ - php_imagick_object *intern; - zval *param; - MagickBooleanType status; - im_long x, y; - PixelWand *color_wand; - zend_bool allocated; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llz", &x, &y, ¶m) == FAILURE) { - return; - } - - color_wand = php_imagick_zval_to_pixelwand (param, IMAGICK_CLASS, &allocated TSRMLS_CC); - if (!color_wand) - return; - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSetImagePixelColor(intern->magick_wand, x, y , color_wand); - - if (allocated) - color_wand = DestroyPixelWand (color_wand); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image pixel color" TSRMLS_CC); - return; - } - - RETURN_NULL(); -} -/* }}} */ -#endif - -/* {{{ proto string Imagick::getImageProfile(string name) - Returns the named image profile. -*/ -PHP_METHOD(Imagick, getImageProfile) -{ - php_imagick_object *intern; - char *profile, *name; - IM_LEN_TYPE name_len; -#if MagickLibVersion < 0x628 - long length; -#else - size_t length; -#endif - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - profile = (char *)MagickGetImageProfile(intern->magick_wand, name, &length); - - if (profile) { - IM_ZVAL_STRINGL(return_value, profile, length); - IMAGICK_FREE_MAGICK_MEMORY(profile); - return; - } - - php_imagick_throw_exception(IMAGICK_CLASS, "Can not get image profile" TSRMLS_CC); - return; -} -/* }}} */ - -/* {{{ proto array Imagick::getImageRedPrimary() - Returns the chromaticy red primary point as an array. IM6: with the keys "x" and "y". - IM7: Returns an array with the keys "x", "y" and "z". -*/ -PHP_METHOD(Imagick, getImageRedPrimary) -{ - php_imagick_object *intern; - MagickBooleanType status; - double x, y; -#if MagickLibVersion >= 0x700 - double z; -#endif - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - -#if MagickLibVersion >= 0x700 - status = MagickGetImageRedPrimary(intern->magick_wand, &x, &y, &z); -#else - status = MagickGetImageRedPrimary(intern->magick_wand, &x, &y); -#endif - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image red primary" TSRMLS_CC); - return; - } - - array_init(return_value); - add_assoc_double(return_value, "x", x); - add_assoc_double(return_value, "y", y); -#if MagickLibVersion >= 0x700 - add_assoc_double(return_value, "z", z); -#endif - - return; -} -/* }}} */ - -/* {{{ proto int Imagick::getImageRenderingIntent() - Gets the image rendering intent. -*/ -PHP_METHOD(Imagick, getImageRenderingIntent) -{ - php_imagick_object *intern; - long renderingIntent; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - renderingIntent = MagickGetImageRenderingIntent(intern->magick_wand); - RETVAL_LONG(renderingIntent); -} -/* }}} */ - -/* {{{ proto array Imagick::getImageResolution() - Gets the image X and Y resolution. -*/ -PHP_METHOD(Imagick, getImageResolution) -{ - php_imagick_object *intern; - MagickBooleanType status; - double x, y; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickGetImageResolution(intern->magick_wand, &x, &y); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image resolution" TSRMLS_CC); - return; - } - - array_init(return_value); - add_assoc_double(return_value, "x", x); - add_assoc_double(return_value, "y", y); - - return; -} -/* }}} */ - -/* {{{ proto int Imagick::getImageScene() - Gets the image scene. -*/ -PHP_METHOD(Imagick, getImageScene) -{ - php_imagick_object *intern; - unsigned long scene; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - scene = MagickGetImageScene(intern->magick_wand); - RETVAL_LONG(scene); -} -/* }}} */ - -/* {{{ proto string Imagick::getImageSignature() - Generates an SHA-256 message digest for the image pixel stream. -*/ -PHP_METHOD(Imagick, getImageSignature) -{ - php_imagick_object *intern; - char *signature; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - signature = MagickGetImageSignature(intern->magick_wand); - IM_ZVAL_STRING(return_value, signature); - IMAGICK_FREE_MAGICK_MEMORY(signature); - return; -} -/* }}} */ - -/* {{{ proto int Imagick::getImageTicksPerSecond() - Gets the image ticks-per-second. -*/ -PHP_METHOD(Imagick, getImageTicksPerSecond) -{ - php_imagick_object *intern; - unsigned long ticks; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - ticks = MagickGetImageTicksPerSecond(intern->magick_wand); - RETVAL_LONG(ticks); -} -/* }}} */ - -/* {{{ proto int Imagick::getImageType() - Gets the potential image type: -*/ -PHP_METHOD(Imagick, getImageType) -{ - php_imagick_object *intern; - long imageType; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - imageType = MagickGetImageType(intern->magick_wand); - RETVAL_LONG(imageType); -} -/* }}} */ - -/* {{{ proto int Imagick::getImageUnits() - Gets the image units of resolution. -*/ -PHP_METHOD(Imagick, getImageUnits) -{ - php_imagick_object *intern; - long resolutionType; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - resolutionType = MagickGetImageUnits(intern->magick_wand); - RETVAL_LONG(resolutionType); -} -/* }}} */ - -/* {{{ proto int Imagick::getImageVirtualPixelMethod() - Returns the virtual pixel method for the sepcified image. -*/ -PHP_METHOD(Imagick, getImageVirtualPixelMethod) -{ - php_imagick_object *intern; - long pixelMethod; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - pixelMethod = MagickGetImageVirtualPixelMethod(intern->magick_wand); - RETVAL_LONG(pixelMethod); -} -/* }}} */ - -/* {{{ proto array Imagick::getImageWhitePoint() - Returns the chromaticy white point as an associative array. IM6: with the keys "x" and "y". - IM7: with the keys "x", "y" and "z". -*/ -PHP_METHOD(Imagick, getImageWhitePoint) -{ - php_imagick_object *intern; - MagickBooleanType status; - double x, y; -#if MagickLibVersion >= 0x700 - double z; -#endif - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - -#if MagickLibVersion >= 0x700 - status = MagickGetImageWhitePoint(intern->magick_wand, &x, &y, &z); -#else - status = MagickGetImageWhitePoint(intern->magick_wand, &x, &y); -#endif - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image white point" TSRMLS_CC); - return; - } - - array_init(return_value); - add_assoc_double(return_value, "x", x); - add_assoc_double(return_value, "y", y); -#if MagickLibVersion >= 0x700 - add_assoc_double(return_value, "z", z); -#endif - - return; -} -/* }}} */ - -/* {{{ proto int Imagick::getImageWidth() - Returns the image width. -*/ -PHP_METHOD(Imagick, getImageWidth) -{ - php_imagick_object *intern; - unsigned long width; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - width = MagickGetImageWidth(intern->magick_wand); - RETVAL_LONG(width); -} -/* }}} */ - -/* {{{ proto int Imagick::getNumberImages() - Returns the number of images associated with Imagick object. -*/ -PHP_METHOD(Imagick, getNumberImages) -{ - php_imagick_object *intern; - unsigned long num_images; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - num_images = MagickGetNumberImages(intern->magick_wand); - RETVAL_LONG(num_images); -} -/* }}} */ - -/* - Resizes an image so that it is 'bestfit' for the bounding box - If the image does not fill the box completely the box is filled with - image's background color. The background color can be set using MagickSetImageBackgroundColor -*/ -#if MagickLibVersion > 0x631 -static -zend_bool s_resize_bounding_box(MagickWand *magick_wand, im_long box_width, im_long box_height, zend_bool fill, zend_bool legacy) -{ - im_long new_width, new_height; - im_long extent_x, extent_y; - - /* Calculate dimensions */ - if (!php_imagick_thumbnail_dimensions(magick_wand, 1, box_width, box_height, &new_width, &new_height, legacy)) { - return 0; - } - - /* Resize the image to the new size */ - if (MagickThumbnailImage(magick_wand, new_width, new_height) == MagickFalse) { - return 0; - } - - /* If user does not want to fill we are all done here */ - if (!fill) { - return 1; - } - - /* In case user wants to fill use extent for it rather than creating a new canvas */ - extent_x = (box_width > new_width) ? ((box_width - new_width) / 2) : 0; - extent_y = (box_height > new_height) ? ((box_height - new_height) / 2) : 0; - - if (MagickExtentImage(magick_wand, box_width, box_height, extent_x * -1, extent_y * -1) == MagickFalse) { - return 0; - } - return 1; -} -#endif - -/* {{{ proto bool Imagick::thumbnailImage(int columns, int rows, bool bestfit = false, bool fill = false, bool legacy = false) - Changes the size of an image to the given dimensions and removes any associated profiles. - If legacy is true, the calculations are done with the small rounding bug that existed in - Imagick before 3.4.0. If false, the calculations should produce the same results as - ImageMagick CLI does. -*/ -PHP_METHOD(Imagick, thumbnailImage) -{ - im_long width = 0, height = 0, new_width, new_height; - php_imagick_object *intern; - zend_bool bestfit = 0, fill = 0; - zend_bool legacy = 0; - -#if PHP_VERSION_ID < 80100 - // This uses an implicit conversion of null to 0 for longs - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll|bbb", &width, &height, &bestfit, &fill, &legacy) == FAILURE) { - return; - } -#else - // Changing longs to be nullable "l!", means that zpp - // wants to write whether they were null to a variable. - bool width_is_null = 0; - bool height_is_null = 0; - - /* Parse parameters given to function */ - if (zend_parse_parameters( - ZEND_NUM_ARGS() TSRMLS_CC, - "l!l!|bbb", - &width, &width_is_null, - &height, &height_is_null, - &bestfit, &fill, &legacy) == FAILURE) { - return; - } -#endif - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - if (bestfit && fill) { -#if MagickLibVersion > 0x631 - if (!s_resize_bounding_box(intern->magick_wand, width, height, fill, legacy)) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to resize and fill image" TSRMLS_CC); - return; - } -#else - php_imagick_throw_exception(IMAGICK_CLASS, "Fill parameter is only supported with ImageMagick 6.3.2+" TSRMLS_CC); - return; -#endif - } else { - if (!php_imagick_thumbnail_dimensions(intern->magick_wand, bestfit, width, height, &new_width, &new_height, legacy)) { - php_imagick_throw_exception(IMAGICK_CLASS, "Invalid image geometry" TSRMLS_CC); - return; - } - /* No magick is going to happen */ - if (MagickThumbnailImage(intern->magick_wand, new_width, new_height) == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to thumbnail image" TSRMLS_CC); - return; - } - } - RETURN_TRUE; -} -/* }}} */ - -/* This is not universally safe to use, but is safe enough for values that will - be encountered for image dimensions. -*/ -static inline double im_round_helper_class(double value) { - if (value >= 0.0) { - return floor(value + 0.5); - } else { - return ceil(value - 0.5); - } -} - -static -void s_calculate_crop( - im_long orig_width, im_long orig_height, - im_long desired_width, im_long desired_height, - im_long *new_width, im_long *new_height, - im_long *offset_x, im_long *offset_y, - zend_bool legacy -) { - double ratio_x, ratio_y; - long temp_new_width, temp_new_height; - - ratio_x = ((double) desired_width / (double) orig_width); - ratio_y = ((double) desired_height / (double) orig_height); - - if (ratio_x > ratio_y) { - temp_new_width = desired_width; - - if (legacy) { - temp_new_height = (long)(ratio_x * (double)orig_height); - } - else { - temp_new_height = im_round_helper_class(ratio_x * (double)orig_height); - } - } else { - temp_new_height = desired_height; - if (legacy) { - temp_new_width = (long)(ratio_y * (double)orig_width); - } - else { - temp_new_width = im_round_helper_class(ratio_y * (double)orig_width); - } - } - - *new_width = temp_new_width; - *new_height = temp_new_height; - - *offset_x = (long) ((temp_new_width - desired_width) / 2); - *offset_y = (long) ((temp_new_height - desired_height) / 2); -} - - -/* {{{ proto array Imagick::calculateCrop(long orig_width, long orig_height, long desired_width, long desired_height, bool legacy = false) - Calculates the cropping values that will be used by a crop operation. -*/ -PHP_METHOD(Imagick, calculateCrop) -{ - im_long orig_width, orig_height; - im_long desired_width, desired_height; - im_long new_width, new_height; - im_long offset_x, offset_y; - zend_bool legacy = 0; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llll|b", - &orig_width, &orig_height, &desired_width, &desired_height, &legacy) == FAILURE) { - return; - } - - if (orig_width <= 0 || orig_height <= 0 || - desired_width <= 0 || desired_height <= 0) { - php_imagick_throw_exception(IMAGICK_CLASS, "All values must be above zero." TSRMLS_CC); - } - - s_calculate_crop( - orig_width, orig_height, - desired_width, desired_height, - &new_width, &new_height, - &offset_x, &offset_y, - legacy - ); - - array_init(return_value); - add_assoc_long(return_value, "width", new_width); - add_assoc_long(return_value, "height", new_height); - - add_assoc_long(return_value, "offset_x", offset_x); - add_assoc_long(return_value, "offset_y", offset_y); - - return; -} -/* }}} */ - - -static -zend_bool s_crop_thumbnail_image(MagickWand *magick_wand, im_long desired_width, im_long desired_height, zend_bool legacy TSRMLS_DC) -{ - im_long offset_x = 0, offset_y = 0, new_width, new_height; - im_long orig_width = (im_long)MagickGetImageWidth(magick_wand); - im_long orig_height = (im_long)MagickGetImageHeight(magick_wand); - - /* Already at the size, just strip profiles */ - if ((orig_width == desired_width) && (orig_height == desired_height)) { - if (!MagickStripImage(magick_wand)) { - return 0; - } - return 1; - } - - s_calculate_crop( - orig_width, orig_height, - desired_width, desired_height, - &new_width, &new_height, - &offset_x, &offset_y, - legacy - ); - - if (MagickThumbnailImage(magick_wand, new_width, new_height) == MagickFalse) { - return 0; - } - - /* all done here */ - if ((new_width == desired_width) && (new_height == desired_height)) { - return 1; - } - - if (MagickCropImage(magick_wand, desired_width, desired_height, offset_x, offset_y) == MagickFalse) { - return 0; - } - - MagickSetImagePage(magick_wand, desired_width, desired_height, 0, 0); - return 1; -} - -// -/* {{{ proto bool Imagick::cropthumbnailImage(int columns, int rows, bool legacy = false ) - Creates a cropped thumbnail at the requested size. If legacy is true, uses the - incorrect behaviour that was present until Imagick 3.4.0. If false it uses the correct - behaviour. -*/ -PHP_METHOD(Imagick, cropThumbnailImage) -{ - im_long crop_width, crop_height; - zend_bool legacy = 0; - php_imagick_object *intern; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll|b", &crop_width, &crop_height, &legacy) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - /* The world collapses.. */ - if (!s_crop_thumbnail_image(intern->magick_wand, crop_width, crop_height, legacy TSRMLS_CC)) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to crop-thumbnail image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::resetIterator(); - Resets the iterator. Use it in conjunction with Imagick::nextImage() to iterate over all the images in a wand container. -*/ -PHP_METHOD(Imagick, resetIterator) -{ - php_imagick_object *intern; - intern = Z_IMAGICK_P(getThis()); - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - /* No magick is going to happen */ - if (intern->magick_wand == NULL) { - RETURN_FALSE; - } - intern->next_out_of_bound = 0; - MagickResetIterator(intern->magick_wand); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::setFirstIterator() - Sets the wand iterator to the first image. -*/ -PHP_METHOD(Imagick, setFirstIterator) -{ - php_imagick_object *intern; - intern = Z_IMAGICK_P(getThis()); - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - /* No magick is going to happen */ - if (intern->magick_wand == NULL) { - RETURN_FALSE; - } - intern->next_out_of_bound = 0; - MagickSetFirstIterator(intern->magick_wand); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::setLastIterator() - Sets the wand iterator to the last image. -*/ -PHP_METHOD(Imagick, setLastIterator) -{ - php_imagick_object *intern; - intern = Z_IMAGICK_P(getThis()); - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - /* No magick is going to happen */ - if (intern->magick_wand == NULL) { - RETURN_FALSE; - } - intern->next_out_of_bound = 0; - MagickSetLastIterator(intern->magick_wand); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::previousImage() - Assocates the previous image in an image list with the Imagick object. -*/ -PHP_METHOD(Imagick, previousImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - status = MagickPreviousImage(intern->magick_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - RETURN_FALSE; - } - intern->next_out_of_bound = 0; - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::nextImage() - Associates the next image in the image list with an Imagick object. -*/ -PHP_METHOD(Imagick, nextImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - status = MagickNextImage(intern->magick_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - intern->next_out_of_bound = 1; - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::hasPreviousImage() - Returns true if the wand has more images when traversing the list in the reverse direction -*/ -PHP_METHOD(Imagick, hasPreviousImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - status = MagickHasPreviousImage(intern->magick_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::hasNextImage() - Returns true if the wand has more images when traversing the list in the forward direction -*/ -PHP_METHOD(Imagick, hasNextImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - status = MagickHasNextImage(intern->magick_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int Imagick::getImageIndex() - Returns the index of the current active image, within the Imagick object. -*/ -PHP_METHOD(Imagick, getImageIndex) -{ - MagickBooleanType status; - php_imagick_object *intern; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - -#if MagickLibVersion >= 0x700 - status = MagickGetIteratorIndex(intern->magick_wand); -#else - status = MagickGetImageIndex(intern->magick_wand); -#endif - - ZVAL_LONG(return_value, (long)status); - return; -} -/* }}} */ - - -/* {{{ proto bool Imagick::setImageIndex(int index) - Returns the index of the current active image, within the Imagick object. -*/ -PHP_METHOD(Imagick, setImageIndex) -{ - im_long index; - MagickBooleanType status; - php_imagick_object *intern; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &index) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); -#if MagickLibVersion > 0x628 - /* Get the current iterator position */ - status = MagickSetIteratorIndex(intern->magick_wand, index); -#else - status = MagickSetImageIndex(intern->magick_wand, index); -#endif - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image index" TSRMLS_CC); - return; - } - intern->next_out_of_bound = 0; - RETURN_TRUE; - -} -/* }}} */ - -/* {{{ proto bool Imagick::removeImage() - Removes an image from the image list. -*/ -PHP_METHOD(Imagick, removeImage) -{ - MagickBooleanType status; - php_imagick_object *intern; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickRemoveImage(intern->magick_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to remove image" TSRMLS_CC); - return; - } - intern->next_out_of_bound = 0; - MagickSetLastIterator(intern->magick_wand); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto string Imagick::getImageFilename() - Returns the filename of a particular image in a sequence -*/ -PHP_METHOD(Imagick, getImageFilename) -{ - php_imagick_object *intern; - char *filename; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - filename = MagickGetImageFilename(intern->magick_wand); - - if (filename == (char *)NULL) { - return; - } - - IM_ZVAL_STRING(return_value, filename); - IMAGICK_FREE_MAGICK_MEMORY(filename); - return; -} -/* }}} */ - -/* {{{ proto int Imagick::getImageSize() - returns the image length in bytes -*/ -PHP_METHOD(Imagick, getImageSize) -{ - php_imagick_object *intern; -#if MagickLibVersion >= 0x700 - MagickSizeType length; - MagickBooleanType status; -#endif - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - -#if MagickLibVersion >= 0x700 - status = MagickGetImageLength(intern->magick_wand, &length); - if (status == MagickFalse) { - php_imagick_throw_exception(IMAGICK_CLASS, "Unable to acquire image length" TSRMLS_CC); - return; - } - ZVAL_LONG(return_value, (long)length); -#else - ZVAL_LONG(return_value, (long)MagickGetImageSize(intern->magick_wand)); -#endif - - return; -} -/* }}} */ - -static -zend_bool s_image_has_format (MagickWand *magick_wand) -{ - char *buffer; - zend_bool ret; - buffer = MagickGetImageFormat(magick_wand); - ret = buffer && *buffer != '\0'; - if (buffer) { - MagickRelinquishMemory (buffer); - } - return ret; -} - -/* {{{ proto string Imagick::getImageBlob() - Returns the current image sequence as a string -*/ -PHP_METHOD(Imagick, getImageBlob) -{ - php_imagick_object *intern; - unsigned char *image_contents; - size_t image_size; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - if (!s_image_has_format (intern->magick_wand)) { - php_imagick_throw_exception(IMAGICK_CLASS, "Image has no format" TSRMLS_CC); - return; - } - - image_contents = MagickGetImageBlob(intern->magick_wand, &image_size); - if (!image_contents) { - return; - } - - IM_ZVAL_STRINGL(return_value, (char *)image_contents, image_size); - IMAGICK_FREE_MAGICK_MEMORY(image_contents); - return; -} -/* }}} */ - -/* {{{ proto string Imagick::getImagesBlob() - Returns all image sequences as a string -*/ -PHP_METHOD(Imagick, getImagesBlob) -{ - php_imagick_object *intern; - unsigned char *image_contents; - size_t image_size; - int current; - MagickBooleanType status; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - -#if MagickLibVersion > 0x628 - /* Get the current iterator position */ - current = MagickGetIteratorIndex(intern->magick_wand); -#else - /* Get the current iterator position */ - current = MagickGetImageIndex(intern->magick_wand); -#endif - - /* Reset the iterator */ - MagickResetIterator(intern->magick_wand); - - /* Loop all images to make sure they have a format */ - while (MagickNextImage(intern->magick_wand)) { - if (!s_image_has_format (intern->magick_wand)) { - php_imagick_throw_exception(IMAGICK_CLASS, "Image has no format" TSRMLS_CC); - return; - } - } - -#if MagickLibVersion > 0x628 - /* Get the current iterator position */ - status = MagickSetIteratorIndex(intern->magick_wand, current); -#else - /* Get the current iterator position */ - status = MagickSetImageIndex(intern->magick_wand, current); -#endif - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set the iterator index" TSRMLS_CC); - return; - } - - image_contents = MagickGetImagesBlob(intern->magick_wand, &image_size); - if (!image_contents) { - return; - } - - IM_ZVAL_STRINGL(return_value, (char *)image_contents, image_size); - IMAGICK_FREE_MAGICK_MEMORY(image_contents); - return; -} -/* }}} */ - -/* {{{ proto string Imagick::getImageFormat() - Returns the format of a particular image in a sequence. -*/ -PHP_METHOD(Imagick, getImageFormat) -{ - php_imagick_object *intern; - char *format; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - intern = Z_IMAGICK_P(getThis()); - - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - if (!s_image_has_format (intern->magick_wand)) { - php_imagick_throw_exception(IMAGICK_CLASS, "Image has no format" TSRMLS_CC); - return; - } - - format = MagickGetImageFormat (intern->magick_wand); - IM_ZVAL_STRING(return_value, format); - IMAGICK_FREE_MAGICK_MEMORY(format); - return; -} -/* }}} */ - -/* {{{ proto string Imagick::getImageMimeType() - Returns the image mime-type -*/ -PHP_METHOD(Imagick, getImageMimeType) -{ - php_imagick_object *intern; - char *format = NULL, *mime_type = NULL; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - if (!s_image_has_format (intern->magick_wand)) { - php_imagick_throw_exception(IMAGICK_CLASS, "Image has no format" TSRMLS_CC); - return; - } - - format = MagickGetImageFormat (intern->magick_wand); - - mime_type = (char *) MagickToMime(format); - IMAGICK_FREE_MAGICK_MEMORY(format); - - if (!mime_type) { - php_imagick_throw_exception(IMAGICK_CLASS, "Unable to get image mime-type" TSRMLS_CC); - return; - } - - IM_ZVAL_STRING(return_value, mime_type); - IMAGICK_FREE_MAGICK_MEMORY(mime_type); - return; -} -/* }}} */ - - -static -void s_add_assoc_str (zval *array, const char *key, const char *value) -{ - //add_assoc_string (array, key, (char *)(value ? value : ""), copy); - IM_add_assoc_string (array, key, (char *)(value ? value : "")); - //TODO - if copy == 0 free the string? -} - -static -void s_add_named_strings (zval *array, const char *haystack TSRMLS_DC) -{ - unsigned int i, found; - char *last_ptr = NULL, *buffer; - size_t num_keys; - -#if PHP_VERSION_ID >= 70000 - zend_string *trim; - zend_string *line_string; -#else - char *trim; -#endif - - char *line; - - const char *str_keys = { - "Format: ", - "Units: ", - "Type: ", - "Colorspace: ", - "Filesize: ", - "Compression: " - }; - - const char *arr_keys = { - "format", - "units", - "type", - "colorSpace", - "fileSize", - "compression" - }; - - found = 0; - - - buffer = estrdup (haystack); - - num_keys = sizeof (str_keys) / sizeof (str_keys0); - line = php_strtok_r (buffer, "\r\n", &last_ptr); - - while ((found < num_keys) && line) { - // Break the line further into tokens - -#if PHP_VERSION_ID >= 70000 - line_string = zend_string_init(line, strlen(line), 0); - //str, what, what_len, mode - trim = php_trim(line_string, NULL, 0, 3); - for (i = 0; i < num_keys; i++) { - if (trim->val != NULL) { - if (strncmp (trim->val, str_keys i, strlen (str_keys i)) == 0) { - // This should be our line - IM_add_assoc_string (array, arr_keys i, trim->val + strlen (str_keys i)); - found++; - } - } - } - // zend_string_release(line_string); - 0 in zend_string_init means no need to free? - zend_string_release(trim); - line = php_strtok_r (NULL, "\r\n", &last_ptr); -#else - trim = php_trim(line, strlen(line), NULL, 0, NULL, 3 TSRMLS_CC); - for (i = 0; i < num_keys; i++) { - if (strncmp (trim, str_keys i, strlen (str_keys i)) == 0) { - // This should be our line - IM_add_assoc_string (array, arr_keys i, trim + strlen (str_keys i)); - found++; - } - } - efree (trim); - line = php_strtok_r (NULL, "\r\n", &last_ptr); -#endif - } - efree (buffer); -} - -/* {{{ proto array Imagick::identifyImage(bool appendRawOutput ) - Identifies an image and returns the attributes. Attributes include the image width, height, size, and others. - If true is passed as argument, then the raw output is appended to the array. -*/ -PHP_METHOD(Imagick, identifyImage) -{ - char *format, *identify, *filename, *signature; - php_imagick_object *intern; - zend_bool append_raw_string = 0; - double x, y; - -#if PHP_VERSION_ID >= 70000 - zval array; -#else - zval *array; -#endif - - zval *pArray; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &append_raw_string) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - // This is to parse some string options, ugly hack but easier than using CommandOptionToMNemonic - // or MagickOptionToMnemonic and FormatMagickSize, which have changed names and signatures between - // versions that we support - identify = MagickIdentifyImage (intern->magick_wand); - - // Actually generate the array ourselves - array_init(return_value); - - // Name of the image - filename = MagickGetImageFilename (intern->magick_wand); - s_add_assoc_str (return_value, "imageName", filename); - IMAGICK_FREE_MAGICK_MEMORY(filename); - - format = MagickGetImageFormat (intern->magick_wand); - if (format) { - char *mime_type = MagickToMime(format); - if (mime_type) { - s_add_assoc_str (return_value, "mimetype", mime_type); - IMAGICK_FREE_MAGICK_MEMORY(mime_type); - } else - s_add_assoc_str (return_value, "mimetype", "unknown"); - - IMAGICK_FREE_MAGICK_MEMORY(format); - } - else - s_add_assoc_str (return_value, "mimetype", "unknown"); - - s_add_named_strings (return_value, identify TSRMLS_CC); - - // Geometry is an associative array - -#if PHP_VERSION_ID >= 70000 - array_init(&array); - pArray = &array; -#else - MAKE_STD_ZVAL(array); - pArray = array; -#endif - - array_init(pArray); - - add_assoc_long (pArray, "width", MagickGetImageWidth (intern->magick_wand)); - add_assoc_long (pArray, "height", MagickGetImageHeight (intern->magick_wand)); - add_assoc_zval (return_value, "geometry", pArray); - - if (MagickGetImageResolution(intern->magick_wand, &x, &y) == MagickTrue) { -#if PHP_VERSION_ID >= 70000 - zval geometry_array; - array_init(&geometry_array); - add_assoc_double(&geometry_array, "x", x); - add_assoc_double(&geometry_array, "y", y); - add_assoc_zval(return_value, "resolution", &geometry_array); -#else - zval *p_geometry_array; - MAKE_STD_ZVAL(p_geometry_array); - array_init(p_geometry_array); - add_assoc_double(p_geometry_array, "x", x); - add_assoc_double(p_geometry_array, "y", y); - add_assoc_zval(return_value, "resolution", p_geometry_array); -#endif - } - - signature = MagickGetImageSignature(intern->magick_wand); - s_add_assoc_str (return_value, "signature", signature); - IMAGICK_FREE_MAGICK_MEMORY(signature); - - if (append_raw_string == 1) - IM_add_assoc_string (return_value, "rawOutput", identify); - - IMAGICK_FREE_MAGICK_MEMORY(identify); - return; -} -/* }}} */ - -#undef imagick_option_to_string - -/* {{{ proto int Imagick::getImageColors() - Gets the number of unique colors in the image. -*/ -PHP_METHOD(Imagick, getImageColors) -{ - php_imagick_object *intern; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - ZVAL_LONG(return_value, (long)MagickGetImageColors(intern->magick_wand)); - return; -} -/* }}} */ - -/* {{{ proto bool Imagick::commentImage(string comment) - Adds a comment to your image. -*/ -PHP_METHOD(Imagick, commentImage) -{ - php_imagick_object *intern; - char *comment; - IM_LEN_TYPE comment_len; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &comment, &comment_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickCommentImage(intern->magick_wand, comment); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to comment image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::setImageFilename(string filename) - Sets the filename of a particular image in a sequence. -*/ -PHP_METHOD(Imagick, setImageFilename) -{ - php_imagick_object *intern; - char *filename; - IM_LEN_TYPE filename_len; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSetImageFilename(intern->magick_wand, filename); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image filename" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -#if MagickLibVersion < 0x700 -/* PS, DEPRECATED please remove: http://www.imagemagick.org/discourse-server/viewtopic.php?f=6&t=8196 */ -PHP_METHOD(Imagick, setImageAttribute) -{ - php_imagick_object *intern; - char *key, *attribute; - IM_LEN_TYPE key_len, attribute_len; - MagickBooleanType status; - - /* Tell user that this method has been deprecated. */ - IMAGICK_METHOD_DEPRECATED("Imagick", "setImageAttribute"); - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &key, &key_len, &attribute, &attribute_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSetImageAttribute(intern->magick_wand, key, attribute); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image attribute" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -#endif // #if MagickLibVersion < 0x700 -#endif - -/* {{{ proto bool Imagick::setImageBackgroundColor(ImagickPixel background) - Sets the image background color. -*/ -PHP_METHOD(Imagick, setImageBackgroundColor) -{ - zval *param; - php_imagick_object *intern; - MagickBooleanType status; - PixelWand *color_wand; - zend_bool allocated; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", ¶m) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - color_wand = php_imagick_zval_to_pixelwand (param, IMAGICK_CLASS, &allocated TSRMLS_CC); - if (!color_wand) - return; - - status = MagickSetImageBackgroundColor(intern->magick_wand, color_wand); - - if (allocated) - color_wand = DestroyPixelWand (color_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image background color" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -#if MagickLibVersion >= 0x700 -/* {{{ proto int Imagick::setImageChannelMask(int channel) - Sets the image channel mask. Returns the previous set channel mask. -*/ -PHP_METHOD(Imagick, setImageChannelMask) -{ - php_imagick_object *intern; - im_long channel; - ChannelType previous_channel_type; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - previous_channel_type = MagickSetImageChannelMask(intern->magick_wand, channel); - - RETURN_LONG(previous_channel_type); -} -/* }}} */ -#endif - - -/* {{{ proto bool Imagick::setImageCompose(int compose) - Sets the image composite operator, useful for specifying how to composite the image thumbnail when using the Imagick::montageImage() method. -*/ -PHP_METHOD(Imagick, setImageCompose) -{ - php_imagick_object *intern; - im_long compose; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &compose) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSetImageCompose(intern->magick_wand, compose); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image composite operator" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int Imagick::getImageCompression() - Gets the image compression type -*/ -PHP_METHOD(Imagick, getImageCompression) -{ - php_imagick_object *intern; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - RETVAL_LONG(MagickGetImageCompression(intern->magick_wand)); -} -/* }}} */ - -/* {{{ proto bool Imagick::setImageCompression(int compression) - Sets the image compression. -*/ -PHP_METHOD(Imagick, setImageCompression) -{ - php_imagick_object *intern; - im_long compression; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &compression) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSetImageCompression(intern->magick_wand, compression); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image compression" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::setImageDelay(int delay) - Sets the image delay. -*/ -PHP_METHOD(Imagick, setImageDelay) -{ - php_imagick_object *intern; - im_long delay; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &delay) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSetImageDelay(intern->magick_wand, delay); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image delay" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::colorizeImage(ImagickPixel colorize, ImagickPixel opacity, bool legacy) - Blends the fill color with each pixel in the image. The 'opacity' color is a - per channel strength factor for how strongly the color should be applied. If - legacy is true, the behaviour of this function is incorrect, but consistent - with how it behaved before Imagick version 3.4.0 -*/ -PHP_METHOD(Imagick, colorizeImage) -{ - PixelWand *param_wand = NULL; - php_imagick_object *intern; - zval *color_param, *opacity_param; - MagickBooleanType status; - PixelWand *color_wand, *opacity_wand; - zend_bool color_allocated, opacity_allocated; - zend_bool legacy = 0; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz|b", &color_param, &opacity_param, &legacy) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - color_wand = php_imagick_zval_to_pixelwand (color_param, IMAGICK_CLASS, &color_allocated TSRMLS_CC); - if (!color_wand) - return; - - if (legacy) { - opacity_wand = php_imagick_zval_to_opacity (opacity_param, IMAGICK_CLASS, &opacity_allocated TSRMLS_CC); - } - else { - opacity_wand = php_imagick_zval_to_pixelwand(opacity_param, IMAGICK_CLASS, &opacity_allocated TSRMLS_CC); - } - - if (!opacity_wand) { - if (color_allocated) - color_wand = DestroyPixelWand (color_wand); - - return; - } - - if (legacy) { - /* Colorize wants both wands to be of same instance */ - param_wand = php_imagick_clone_pixelwand (color_wand); - if (!param_wand) { - php_imagick_throw_exception (IMAGICK_CLASS, "Failed to allocate" TSRMLS_CC); - return; - } -#if MagickLibVersion < 0x700 - PixelSetOpacity(param_wand, PixelGetOpacity(opacity_wand)); -#endif - PixelSetAlpha(param_wand, PixelGetAlpha(opacity_wand)); - status = MagickColorizeImage(intern->magick_wand, param_wand, param_wand); - param_wand = DestroyPixelWand(param_wand); - } else { - status = MagickColorizeImage(intern->magick_wand, color_wand, opacity_wand); - } - - if (color_allocated) - color_wand = DestroyPixelWand (color_wand); - - if (opacity_allocated) - opacity_wand = DestroyPixelWand (opacity_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to colorize image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto Imagick Imagick::compareImageChannels(Imagick reference, int channel, int metric) - Compares one or more image channels of an image to a reconstructed image and returns the difference image. -*/ -PHP_METHOD(Imagick, compareImageChannels) -{ - MagickWand *tmp_wand; - zval *objvar; - php_imagick_object *intern, *intern_second, *intern_return; - im_long channel_type, metric_type; - double distortion; -#if PHP_VERSION_ID >= 70000 - zval new_wand; -#else - zval *new_wand; -#endif - - zval *pNewWand; - - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Oll", &objvar, php_imagick_sc_entry, &channel_type, &metric_type) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - intern_second = Z_IMAGICK_P(objvar); - if (php_imagick_ensure_not_empty (intern_second->magick_wand) == 0) - return; - - tmp_wand = MagickCompareImageChannels(intern->magick_wand, intern_second->magick_wand, channel_type, metric_type, &distortion); - - if (!tmp_wand) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Compare image channels failed" TSRMLS_CC); - return; - } - -#if PHP_VERSION_ID >= 70000 - pNewWand = &new_wand; -#else - MAKE_STD_ZVAL(new_wand); - pNewWand = new_wand; -#endif - array_init(return_value); - - object_init_ex(pNewWand, php_imagick_sc_entry); - intern_return = Z_IMAGICK_P(pNewWand); - php_imagick_replace_magickwand(intern_return, tmp_wand); - - add_next_index_zval(return_value, pNewWand); - add_next_index_double(return_value, distortion); - - return; -} -/* }}} */ -#if MagickLibVersion > 0x628 -/* {{{ proto Imagick Imagick::compareImageLayers(int method) - Compares each image with the next in a sequence and returns the maximum bounding region of any pixel differences it discovers. -*/ -PHP_METHOD(Imagick, compareImageLayers) -{ - MagickWand *tmp_wand; - php_imagick_object *intern, *intern_return; - im_long compare_method; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &compare_method) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - -#if MagickLibVersion >= 0x700 - tmp_wand = (MagickWand *)MagickCompareImagesLayers(intern->magick_wand, compare_method); -#else - tmp_wand = (MagickWand *)MagickCompareImageLayers(intern->magick_wand, compare_method); -#endif - - if (tmp_wand == NULL) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Compare image layers failed" TSRMLS_CC); - return; - } - - object_init_ex(return_value, php_imagick_sc_entry); - intern_return = Z_IMAGICK_P(return_value); - php_imagick_replace_magickwand(intern_return, tmp_wand); - - return; -} -/* }}} */ -#endif - -/* {{{ proto Imagick Imagick::flattenImages() - Merges a sequence of images. This is useful for combining Photoshop layers into a single image. -*/ -PHP_METHOD(Imagick, flattenImages) -{ - php_imagick_object *intern, *intern_return; - MagickWand *tmp_wand; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - /* TODO: SHOULD THIS BE HERE? */ - (void)MagickSetFirstIterator(intern->magick_wand); - -#if MagickLibVersion >= 0x700 - tmp_wand = MagickMergeImageLayers(intern->magick_wand, FlattenLayer); -#else - tmp_wand = MagickFlattenImages(intern->magick_wand); -#endif - - if (tmp_wand == NULL) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Flatten images failed" TSRMLS_CC); - return; - } - - object_init_ex(return_value, php_imagick_sc_entry); - intern_return = Z_IMAGICK_P(return_value); - php_imagick_replace_magickwand(intern_return, tmp_wand); - - return; -} -/* }}} */ - - -/* {{{ proto bool Imagick::flipImage() - Creates a vertical mirror image by reflecting the pixels around the central x-axis. -*/ -PHP_METHOD(Imagick, flipImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickFlipImage(intern->magick_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to flip image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::flopImage() - Creates a horizontal mirror image by reflecting the pixels around the central y-axis. -*/ -PHP_METHOD(Imagick, flopImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickFlopImage(intern->magick_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to flop image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::frameImage(ImagickPixel matte_color, int width, int height, int inner_bevel, int outer_bevel) - Adds a simulated three-dimensional border around the image -*/ -PHP_METHOD(Imagick, frameImage) -{ - zval *param; - php_imagick_object *intern; - MagickBooleanType status; - im_long width, height, inner_bevel, outer_bevel; - PixelWand *color_wand; - zend_bool allocated; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zllll", ¶m, &width, &height, &inner_bevel, &outer_bevel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - color_wand = php_imagick_zval_to_pixelwand (param, IMAGICK_CLASS, &allocated TSRMLS_CC); - if (!color_wand) - return; - -#if MagickLibVersion >= 0x700 - { - status = MagickFrameImage( - intern->magick_wand, - color_wand, width, - height, - inner_bevel, - outer_bevel, - OverCompositeOp // Over is the default https://imagemagick.org/script/command-line-options.php#frame - ); - } -#else - status = MagickFrameImage(intern->magick_wand, color_wand, width, height, inner_bevel, outer_bevel); -#endif - - if (allocated) - color_wand = DestroyPixelWand (color_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to frame image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -#if MagickLibVersion >= 0x700 -/* {{{ proto bool Imagick::frameImageWithComposite(ImagickPixel matte_color, int width, int height, int inner_bevel, int outer_bevel, int composite) - Adds a simulated three-dimensional border around the image with chosen composite option -*/ -PHP_METHOD(Imagick, frameImageWithComposite) -{ - zval *param; - php_imagick_object *intern; - MagickBooleanType status; - im_long width, height, inner_bevel, outer_bevel; - PixelWand *color_wand; - zend_bool allocated; - im_long composite = OverCompositeOp; // Over is the default https://imagemagick.org/script/command-line-options.php#frame - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zlllll", ¶m, &width, &height, &inner_bevel, &outer_bevel, &composite) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - color_wand = php_imagick_zval_to_pixelwand (param, IMAGICK_CLASS, &allocated TSRMLS_CC); - if (!color_wand) - return; - -#if MagickLibVersion >= 0x700 - { - status = MagickFrameImage( - intern->magick_wand, - color_wand, width, - height, - inner_bevel, - outer_bevel, - composite - ); - } -#else - status = MagickFrameImage(intern->magick_wand, color_wand, width, height, inner_bevel, outer_bevel); -#endif - - if (allocated) - color_wand = DestroyPixelWand (color_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to frame image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ -#endif - -/* {{{ proto Imagick Imagick::fxImage(string expression, int channel) - Evaluate expression for each pixel in the image. -*/ -PHP_METHOD(Imagick, fxImage) -{ - MagickWand *tmp_wand; - php_imagick_object *intern, *intern_return; - char *expression; - IM_LEN_TYPE expression_len; - im_long channel = IM_DEFAULT_CHANNEL; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &expression, &expression_len, &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - tmp_wand = MagickFxImageChannel(intern->magick_wand, channel, expression); - - if (tmp_wand == NULL) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Fx image failed" TSRMLS_CC); - return; - } - - object_init_ex(return_value, php_imagick_sc_entry); - intern_return = Z_IMAGICK_P(return_value); - php_imagick_replace_magickwand(intern_return, tmp_wand); - - return; -} -/* }}} */ - -/* {{{ proto bool Imagick::gammaImage(float gamma, int channel) - 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. -*/ -PHP_METHOD(Imagick, gammaImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - double gamma; - im_long channel = IM_DEFAULT_CHANNEL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d|l", &gamma, &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickGammaImageChannel(intern->magick_wand, channel, gamma); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to gamma image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::gaussianBlurImage(float radius, float sigma, int channel) - Blurs an image. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, the radius should be larger than sigma. Use a radius of 0 and selects a suitable radius for you. -*/ -PHP_METHOD(Imagick, gaussianBlurImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - double radius, sigma; - im_long channel = IM_DEFAULT_CHANNEL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd|l", &radius, &sigma, &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickGaussianBlurImageChannel(intern->magick_wand, channel, radius, sigma); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to gaussian blur image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto Imagick Imagick::compareImageChannels(int metric, int distortion) - Compares one or more images and returns the difference image. -*/ -PHP_METHOD(Imagick, compareImages) -{ - MagickWand *tmp_wand; - zval *objvar; - php_imagick_object *intern, *intern_second, *intern_return; - im_long metric_type; - double distortion; -#if PHP_VERSION_ID >= 70000 - zval new_wand; -#else - zval *new_wand; -#endif - - zval *pNewWand; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ol", &objvar, php_imagick_sc_entry, &metric_type) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - intern_second = Z_IMAGICK_P(objvar); - if (php_imagick_ensure_not_empty (intern_second->magick_wand) == 0) - return; - -#if PHP_VERSION_ID >= 70000 - pNewWand = &new_wand; -#else - MAKE_STD_ZVAL(new_wand); - pNewWand = new_wand; -#endif - array_init(return_value); - - tmp_wand = MagickCompareImages(intern->magick_wand, intern_second->magick_wand, metric_type, &distortion); - - if (!tmp_wand) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Compare images failed" TSRMLS_CC); - return; - } - - object_init_ex(pNewWand, php_imagick_sc_entry); - intern_return = Z_IMAGICK_P(pNewWand); - php_imagick_replace_magickwand(intern_return, tmp_wand); - - add_next_index_zval(return_value, pNewWand); - add_next_index_double(return_value, distortion); - - return; -} -/* }}} */ - -/* {{{ proto bool Imagick::contrastImage(bool sharpen) - Enhances the intensity differences between the lighter and darker elements of the image. Set sharpen to a value other than 0 to increase the image contrast otherwise the contrast is reduced. -*/ -PHP_METHOD(Imagick, contrastImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - zend_bool contrast; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &contrast) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickContrastImage(intern->magick_wand, contrast); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to contrast image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::setImageDepth(int depth) - Sets the image depth. -*/ -PHP_METHOD(Imagick, setImageDepth) -{ - php_imagick_object *intern; - im_long depth; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &depth) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSetImageDepth(intern->magick_wand, depth); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image depth" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::setImageGamma(float gamma) - Sets the image gamma. -*/ -PHP_METHOD(Imagick, setImageGamma) -{ - php_imagick_object *intern; - double gamma; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &gamma) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSetImageGamma(intern->magick_wand, gamma); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image gamma" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::setImageIterations(int iterations) - Sets the image iterations. -*/ -PHP_METHOD(Imagick, setImageIterations) -{ - php_imagick_object *intern; - im_long iterations; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &iterations) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSetImageIterations(intern->magick_wand, iterations); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image iterations" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -#if MagickLibVersion < 0x700 || MagickLibVersion >= 0x705 -/* {{{ proto bool Imagick::setImageMatteColor(ImagickPixel matte) - Sets the image matte color. -*/ -PHP_METHOD(Imagick, setImageMatteColor) -{ - zval *param; - php_imagick_object *intern; - MagickBooleanType status; - PixelWand *color_wand; - zend_bool allocated; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", ¶m) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - color_wand = php_imagick_zval_to_pixelwand (param, IMAGICK_CLASS, &allocated TSRMLS_CC); - if (!color_wand) - return; - - status = MagickSetImageMatteColor(intern->magick_wand, color_wand); - - if (allocated) - color_wand = DestroyPixelWand (color_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image matte color" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif - -/* {{{ proto bool Imagick::setImagePage(int width, int height, int x, int y) - Sets the page geometry of the image. -*/ -PHP_METHOD(Imagick, setImagePage) -{ - php_imagick_object *intern; - im_long width, height, x, y; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llll", &width, &height, &x, &y) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSetImagePage(intern->magick_wand, width, height, x, y); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image page" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::setImageResolution(float x_resolution,const float y_resolution) - Sets the image resolution. -*/ -PHP_METHOD(Imagick, setImageResolution) -{ - php_imagick_object *intern; - double x_res, y_res; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &x_res, &y_res) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSetImageResolution(intern->magick_wand, x_res, y_res); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image resolution" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::setImageScene(int scene) - Sets the image scene. -*/ -PHP_METHOD(Imagick, setImageScene) -{ - php_imagick_object *intern; - im_long scene; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &scene) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSetImageScene(intern->magick_wand, scene); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image scene" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::setImageTicksPerSecond(int ticks_per-second) - Sets the image ticks-per-second. -*/ -PHP_METHOD(Imagick, setImageTicksPerSecond) -{ - php_imagick_object *intern; - im_long ticks_per_second; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &ticks_per_second) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSetImageTicksPerSecond(intern->magick_wand, ticks_per_second); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image ticks per second" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::setImageType(int image_type) - Sets the image type. -*/ -PHP_METHOD(Imagick, setImageType) -{ - php_imagick_object *intern; - im_long image_type; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &image_type) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSetImageType(intern->magick_wand, image_type); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image type" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::setImageUnits(int units) - Sets the image units of resolution. -*/ -PHP_METHOD(Imagick, setImageUnits) -{ - php_imagick_object *intern; - im_long units; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &units) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSetImageUnits(intern->magick_wand, units); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image units" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::setImageFormat(string format) - Sets the format of a particular image in a sequence. -*/ -PHP_METHOD(Imagick, setImageFormat) -{ - char *format; - IM_LEN_TYPE format_len; - MagickBooleanType status; - php_imagick_object *intern; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &format, &format_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSetImageFormat(intern->magick_wand, format); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image format" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::charcoalImage(float radius, float sigma) - Simulates a charcoal drawing. -*/ -PHP_METHOD(Imagick, charcoalImage) -{ - double sigma, radius; - MagickBooleanType status; - php_imagick_object *intern; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &radius, &sigma) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickCharcoalImage(intern->magick_wand, sigma, radius); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to charcoal image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::oilPaintImage(float radius) - Applies a special effect filter that simulates an oil painting. Each pixel is replaced by the most frequent color occurring in a circular region defined by radius. -*/ -PHP_METHOD(Imagick, oilPaintImage) -{ - double radius; - MagickBooleanType status; - php_imagick_object *intern; -#if MagickLibVersion >= 0x700 - double sigma = 1.0; -#endif // #if MagickLibVersion >= 0x700 - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &radius) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - -#if MagickLibVersion >= 0x700 - status = MagickOilPaintImage(intern->magick_wand, radius, sigma); -#else - status = MagickOilPaintImage(intern->magick_wand, radius); -#endif - - /* No magick is going to happen */ - if (status == MagickFalse) - { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to oilpaint image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -#if MagickLibVersion >= 0x700 -/* {{{ proto bool Imagick::oilPaintImageWithSigma(float radius, float sigma) - 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. -*/ -PHP_METHOD(Imagick, oilPaintImageWithSigma) -{ - double radius; - double sigma; - MagickBooleanType status; - php_imagick_object *intern; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &radius, &sigma) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickOilPaintImage(intern->magick_wand, radius, sigma); - - /* No magick is going to happen */ - if (status == MagickFalse) - { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to oilPaintImageWithSigma image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ -#endif // #if MagickLibVersion >= 0x700 - -/* {{{ proto bool Imagick::normalizeImage(int channel) - Enhances the contrast of a color image by adjusting the pixels color to span the entire range of colors available, Channel parameter is ignored in ImageMagick below 6.2.8 -*/ -PHP_METHOD(Imagick, normalizeImage) -{ - MagickBooleanType status; - php_imagick_object *intern; - im_long channel = IM_DEFAULT_CHANNEL; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - -#if MagickLibVersion > 0x628 - status = MagickNormalizeImageChannel(intern->magick_wand, channel); -#else - status = MagickNormalizeImage(intern->magick_wand); -#endif - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to normalize image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::labelImage(string label) - Adds a label to your image. -*/ -PHP_METHOD(Imagick, labelImage) -{ - char *label; - IM_LEN_TYPE label_len; - MagickBooleanType status; - php_imagick_object *intern; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &label, &label_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - status = MagickLabelImage(intern->magick_wand, label); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to label image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::writeImage(string filename) - Writes an image to the specified filename -*/ -PHP_METHOD(Imagick, writeImage) -{ - char *filename = NULL; - IM_LEN_TYPE filename_len = 0; - zend_bool free_filename = 0; - php_imagick_object *intern; - struct php_imagick_file_t file = {0}; - php_imagick_rw_result_t rc; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!", &filename, &filename_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - if (!filename) { - filename = MagickGetImageFilename(intern->magick_wand); - - if (!filename) { - php_imagick_throw_exception(IMAGICK_CLASS, "No image filename specified" TSRMLS_CC); - return; - } - filename_len = strlen(filename); - free_filename = 1; - } - - if (!filename_len) { - php_imagick_throw_exception(IMAGICK_CLASS, "Can not use empty string as a filename" TSRMLS_CC); - return; - } - - if (!php_imagick_file_init(&file, filename, filename_len TSRMLS_CC)) { - php_imagick_throw_exception(IMAGICK_CLASS, "Invalid filename provided" TSRMLS_CC); - return; - } - rc = php_imagick_write_file(intern, &file, ImagickWriteImage, 0 TSRMLS_CC); - php_imagick_file_deinit(&file); - - if (rc != IMAGICK_RW_OK) { - php_imagick_rw_fail_to_exception (intern->magick_wand, rc, filename TSRMLS_CC); - if (free_filename) { - IMAGICK_FREE_MAGICK_MEMORY(filename); - } - return; - } - - if (free_filename) { - IMAGICK_FREE_MAGICK_MEMORY(filename); - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::writeImages(string filename, bool adjoin) - Writes an image or image sequence. -*/ -PHP_METHOD(Imagick, writeImages) -{ - char *filename; - zend_bool adjoin; - IM_LEN_TYPE filename_len; - php_imagick_object *intern; - struct php_imagick_file_t file = {0}; - php_imagick_rw_result_t rc; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sb", &filename, &filename_len, &adjoin) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - if (!filename_len) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Can not use empty string as a filename" TSRMLS_CC); - return; - } - - if (!php_imagick_file_init(&file, filename, filename_len TSRMLS_CC)) { - php_imagick_throw_exception(IMAGICK_CLASS, "Invalid filename provided" TSRMLS_CC); - return; - } - rc = php_imagick_write_file(intern, &file, ImagickWriteImages, adjoin TSRMLS_CC); - php_imagick_file_deinit(&file); - - if (rc != IMAGICK_RW_OK) { - php_imagick_rw_fail_to_exception (intern->magick_wand, rc, filename TSRMLS_CC); - return; - } - RETURN_TRUE; - -} -/* }}} */ - -/* {{{ proto bool Imagick::drawImage(ImagickDraw drawing_wand) - Renders the ImagickDrawing object on the current image. -*/ -PHP_METHOD(Imagick, drawImage) -{ - zval *objvar; - php_imagick_object *intern; - MagickBooleanType status; - php_imagickdraw_object *internd; - char *old_locale; - - intern = Z_IMAGICK_P(getThis()); - - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &objvar, php_imagickdraw_sc_entry) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(objvar); - - old_locale = php_imagick_set_locale (TSRMLS_C); - - status = MagickDrawImage(intern->magick_wand, internd->drawing_wand); - - php_imagick_restore_locale (old_locale); - - if (old_locale) - efree (old_locale); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to draw image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::annotateImage(ImagickDraw drawing_wand, float x, float y, float angle, string text) - Annotates an image with text. -*/ -PHP_METHOD(Imagick, annotateImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - php_imagickdraw_object *internd; - double x, y, angle; - char *text; - IM_LEN_TYPE text_len; - zval *objvar; -#if MagickLibVersion < 0x632 - char *font; -#endif - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Oddds", &objvar, php_imagickdraw_sc_entry, &x, &y, &angle, &text, &text_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - internd = Z_IMAGICKDRAW_P(objvar); - -#if MagickLibVersion < 0x632 - font = DrawGetFont(internd->drawing_wand); - - /* Fixes PECL Bug #11328 */ - if (!font) { - php_imagick_throw_exception(IMAGICK_CLASS, "Font needs to be set before annotating an image" TSRMLS_CC); - return; - } -#endif - - status = MagickAnnotateImage(intern->magick_wand, internd->drawing_wand, x, y, angle, text); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to annotate image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::getImageCompressionQuality(int quality) - Gets the image compression quality -*/ -PHP_METHOD(Imagick, getImageCompressionQuality) -{ - php_imagick_object *intern; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - RETVAL_LONG(MagickGetImageCompressionQuality(intern->magick_wand)); -} -/* }}} */ - -/* {{{ proto bool Imagick::setImageCompressionQuality(int quality) - Sets the image compression quality -*/ -PHP_METHOD(Imagick, setImageCompressionQuality) -{ - im_long quality; - php_imagick_object *intern; - MagickBooleanType status; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &quality) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSetImageCompressionQuality(intern->magick_wand, quality); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image compression quality" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - - -/* {{{ proto bool Imagick::compositeImage(Imagick composite_wand, int compose, int x, int y, int channel ) - Composite one image onto another at the specified offset. Channel parameter is ignored in ImageMagick below 6.2.8 -*/ -PHP_METHOD(Imagick, compositeImage) -{ - zval *objvar; - php_imagick_object *intern; - php_imagick_object *intern_second; - im_long x, y; - im_long composite_id = 0; - im_long channel = IM_DEFAULT_CHANNEL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Olll|l", &objvar, php_imagick_sc_entry, &composite_id, &x, &y, &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - intern_second = Z_IMAGICK_P(objvar); - if (php_imagick_ensure_not_empty (intern_second->magick_wand) == 0) - return; - -#if MagickLibVersion > 0x628 - MagickCompositeImageChannel(intern->magick_wand, channel, intern_second->magick_wand, composite_id, x, y); -#else - MagickCompositeImage(intern->magick_wand, intern_second->magick_wand, composite_id, x, y); -#endif - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::modulateImage(float brightness, float saturation, float hue) - Lets you control the brightness, saturation, and hue of an image. Hue is the percentage of absolute rotation from the current position. For example 50 results in a counter-clockwise rotation of 90 degrees, 150 results in a clockwise rotation of 90 degrees, with 0 and 200 both resulting in a rotation of 180 degrees. -*/ -PHP_METHOD(Imagick, modulateImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - double brightness, saturation, hue; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddd", &brightness, &saturation, &hue) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickModulateImage(intern->magick_wand, brightness, saturation, hue); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to modulate image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::addNoiseImage(int noise_type, int channel) - Adds random noise to the image. Channel parameter is ignored in ImageMagick below 6.2.8 -*/ -PHP_METHOD(Imagick, addNoiseImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - im_long noise; - im_long channel = IM_DEFAULT_CHANNEL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l", &noise, &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - -#if MagickLibVersion > 0x628 - status = MagickAddNoiseImageChannel(intern->magick_wand, channel, noise); -#else - status = MagickAddNoiseImage(intern->magick_wand, noise); -#endif - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to add image noise" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - - -#if IM_HAVE_IMAGICK_ADD_NOISE_WITH_ATTENUATE -/* {{{ proto bool Imagick::addNoiseImageWithAttenuate(int noise_type, float attenuate, int channel) - Adds random noise to the image. -*/ -PHP_METHOD(Imagick, addNoiseImageWithAttenuate) -{ - php_imagick_object *intern; - MagickBooleanType status; - im_long noise; - im_long channel = IM_DEFAULT_CHANNEL; - double attenuate; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ld|l", &noise, &attenuate, &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - - status = MagickAddNoiseImageChannelWithAttenuate( - intern->magick_wand, - channel, - noise, - attenuate - ); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to add image noise" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif //IM_HAVE_IMAGICK_ADD_NOISE_WITH_ATTENUATE - -/* {{{ proto Imagick Imagick::montageImage(ImagickDraw drawing_wand, string tile_geometry, string thumbnail_geometry, int mode, string frame) - Creates a composite image by combining several separate images. The images are tiled on the composite image with the name of the image optionally appearing just below the individual tile. -*/ - -PHP_METHOD(Imagick, montageImage) -{ - MagickWand *tmp_wand; - zval *objvar; - php_imagick_object *intern, *intern_return; - php_imagickdraw_object *internd; - char *tile_geometry, *thumbnail_geometry, *frame; - IM_LEN_TYPE tile_geometry_len, thumbnail_geometry_len, frame_len; - im_long montage_mode = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ossls", &objvar, php_imagickdraw_sc_entry, - &tile_geometry, &tile_geometry_len, - &thumbnail_geometry, &thumbnail_geometry_len, - &montage_mode, - &frame, &frame_len) == FAILURE) - { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - internd = Z_IMAGICKDRAW_P(objvar); - - tmp_wand = MagickMontageImage(intern->magick_wand, internd->drawing_wand, tile_geometry, thumbnail_geometry, montage_mode, frame); - - if (tmp_wand == NULL) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Montage image failed" TSRMLS_CC); - return; - } - - object_init_ex(return_value, php_imagick_sc_entry); - intern_return = Z_IMAGICK_P(return_value); - php_imagick_replace_magickwand(intern_return, tmp_wand); - - return; -} -/* }}} */ - -/* {{{ proto bool Imagick::affineTransformImage(ImagickDraw drawing_wand) - Transforms an image as dictated by the affine matrix of the drawing wand. -*/ -PHP_METHOD(Imagick, affineTransformImage) -{ - zval *objvar; - php_imagick_object *intern; - php_imagickdraw_object *internd; - MagickBooleanType status; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &objvar, php_imagickdraw_sc_entry) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - internd = Z_IMAGICKDRAW_P(objvar); - status = MagickAffineTransformImage(intern->magick_wand, internd->drawing_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to affine transform image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto Imagick Imagick::averageImages() - Average a set of images. -*/ -PHP_METHOD(Imagick, averageImages) -{ - MagickWand *tmp_wand; - php_imagick_object *intern, *intern_return; -#if MagickLibVersion > 0x700 - MagickBooleanType status; -#endif - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - -#if MagickLibVersion > 0x700 - // MagickEvaluateImages appears to crash if index is not zero. - status = MagickSetIteratorIndex(intern->magick_wand, 0); - if (status == MagickFalse) { - php_imagick_convert_imagick_exception( - intern->magick_wand, - "Averaging images failed, images are empty?" TSRMLS_CC - ); - return; - } - - tmp_wand = MagickEvaluateImages(intern->magick_wand, MeanEvaluateOperator); -#else - tmp_wand = MagickAverageImages(intern->magick_wand); -#endif - - if (tmp_wand == NULL) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Averaging images failed" TSRMLS_CC); - return; - } - - object_init_ex(return_value, php_imagick_sc_entry); - intern_return = Z_IMAGICK_P(return_value); - php_imagick_replace_magickwand(intern_return, tmp_wand); - return; -} -/* }}} */ - -/* {{{ proto bool Imagick::borderImage(ImagickPixel bordercolor, int width, int height) - Surrounds the image with a border of the color defined by the bordercolor pixel wand. -*/ -PHP_METHOD(Imagick, borderImage) -{ - zval *param; - php_imagick_object *intern; - MagickBooleanType status; - im_long width, height; - PixelWand *color_wand; - zend_bool allocated; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zll", ¶m, &width, &height) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - color_wand = php_imagick_zval_to_pixelwand (param, IMAGICK_CLASS, &allocated TSRMLS_CC); - if (!color_wand) - return; - -#if MagickLibVersion >= 0x700 - status = MagickBorderImage(intern->magick_wand, color_wand, width, height, OverCompositeOp); -#else - status = MagickBorderImage(intern->magick_wand, color_wand, width, height); -#endif - - if (allocated) - color_wand = DestroyPixelWand (color_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to border image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - - -#if MagickLibVersion >= 0x700 -/* {{{ proto bool Imagick::borderImageWithComposite(ImagickPixel bordercolor, int width, int height, int composite) - Surrounds the image with a border of the color defined by the bordercolor pixel wand, or does a similar action with the composite operator supplied. - - MagickBorderImage only allows you to set the composite operator in > IM7 -*/ -PHP_METHOD(Imagick, borderImageWithComposite) -{ - zval *param; - php_imagick_object *intern; - MagickBooleanType status; - im_long width, height; - PixelWand *color_wand; - zend_bool allocated; - im_long composite; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zlll", ¶m, &width, &height, &composite) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - color_wand = php_imagick_zval_to_pixelwand (param, IMAGICK_CLASS, &allocated TSRMLS_CC); - if (!color_wand) - return; - - status = MagickBorderImage(intern->magick_wand, color_wand, width, height, composite); - - if (allocated) - color_wand = DestroyPixelWand (color_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to border image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -#endif - -/* {{{ proto bool Imagick::thresholdImage(float threshold, int channel ) - Changes the value of individual pixels based on the intensity of each pixel compared to threshold. The result is a high-contrast, two color image. -*/ -PHP_METHOD(Imagick, thresholdImage) -{ - php_imagick_object *intern; - double threshold; - MagickBooleanType status; - im_long channel = DefaultChannels; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d|l", &threshold, &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickThresholdImageChannel(intern->magick_wand, channel, threshold); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to threshold image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::adaptiveThresholdImage(int width, int height, int offset) - Selects an individual threshold for each pixel based on the range of intensity values in its local neighborhood. This allows for thresholding of an image whose global intensity histogram doesn't contain distinctive peaks. -*/ -PHP_METHOD(Imagick, adaptiveThresholdImage) -{ - php_imagick_object *intern; - im_long width, height, offset; - MagickBooleanType status; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &width, &height, &offset) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickAdaptiveThresholdImage(intern->magick_wand, width, height, offset); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to adaptive threshold image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::sharpenImage(float radius, float sigma, int channel) - Sharpens an image. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, the radius should be larger than sigma. Use a radius of 0 and selects a suitable radius for you. -*/ -PHP_METHOD(Imagick, sharpenImage) -{ - double sigma, radius; - MagickBooleanType status; - php_imagick_object *intern; - im_long channel = IM_DEFAULT_CHANNEL; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd|l", &radius, &sigma, &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSharpenImageChannel(intern->magick_wand, channel, radius, sigma); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to sharpen image" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::shaveImage(int columns, int rows) - Shaves pixels from the image edges. It allocates the memory necessary for the new Image structure and returns a pointer to the new image. -*/ -PHP_METHOD(Imagick, shaveImage) -{ - php_imagick_object *intern; - im_long columns, rows; - MagickBooleanType status; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &columns, &rows) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickShaveImage(intern->magick_wand, columns, rows); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to shave image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::shearImage(ImagickPixel background, float x_shear, float y_shear) - Slides one edge of an image along the X or Y axis -*/ -PHP_METHOD(Imagick, shearImage) -{ - zval *param; - php_imagick_object *intern; - double x_shear, y_shear; - MagickBooleanType status; - PixelWand *color_wand; - zend_bool allocated; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zdd", ¶m, &x_shear, &y_shear) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - color_wand = php_imagick_zval_to_pixelwand (param, IMAGICK_CLASS, &allocated TSRMLS_CC); - if (!color_wand) - return; - - status = MagickShearImage(intern->magick_wand, color_wand, x_shear, y_shear); - - if (allocated) - color_wand = DestroyPixelWand (color_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to shear image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::spliceImage(int width, int height, int x, int y) - Splices a solid color into the image. -*/ -PHP_METHOD(Imagick, spliceImage) -{ - im_long width, height, x, y; - php_imagick_object *intern; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llll", &width, &height, &x, &y) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSpliceImage(intern->magick_wand, width, height, x, y); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to splice image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto Imagick Imagick::steganoImage(Imagick watermark_wand, int offset) - Hides a digital watermark within the image. Recover the hidden watermark later to prove that the authenticity of an image. Offset defines the start position within the image to hide the watermark. -*/ -PHP_METHOD(Imagick, steganoImage) -{ - zval *objvar; - php_imagick_object *intern, *intern_second, *intern_return; - im_long offset; - MagickWand *tmp_wand; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ol", &objvar, php_imagick_sc_entry, &offset) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - intern_second = Z_IMAGICK_P(objvar); - if (php_imagick_ensure_not_empty (intern_second->magick_wand) == 0) - return; - - tmp_wand = MagickSteganoImage(intern->magick_wand, intern_second->magick_wand, offset); - - if (!tmp_wand) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Stegano image failed" TSRMLS_CC); - return; - } - - object_init_ex(return_value, php_imagick_sc_entry); - intern_return = Z_IMAGICK_P(return_value); - php_imagick_replace_magickwand(intern_return, tmp_wand); - return; -} -/* }}} */ - -/* {{{ proto Imagick Imagick::clone() - Makes an exact copy of the Imagick object. -*/ -PHP_METHOD(Imagick, clone) -{ - php_imagick_object *intern, *intern_return; - MagickWand *tmp_wand; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - IMAGICK_METHOD_DEPRECATED("Imagick", "clone"); - intern = Z_IMAGICK_P(getThis()); - tmp_wand = CloneMagickWand(intern->magick_wand); - - if (tmp_wand == NULL) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Cloning Imagick object failed" TSRMLS_CC); - return; - } - - object_init_ex(return_value, php_imagick_sc_entry); - intern_return = Z_IMAGICK_P(return_value); - php_imagick_replace_magickwand(intern_return, tmp_wand); - return; -} -/* }}} */ - -/* {{{ proto bool Imagick::rotateImage(ImagickPixel background, float degrees) - Rotates an image the specified number of degrees. Empty triangles left over from rotating the image are filled with the background color. -*/ -PHP_METHOD(Imagick, rotateImage) -{ - zval *param; - php_imagick_object *intern; - double degrees; - MagickBooleanType status; - PixelWand *color_wand; - zend_bool allocated; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zd", ¶m, °rees) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - color_wand = php_imagick_zval_to_pixelwand (param, IMAGICK_CLASS, &allocated TSRMLS_CC); - if (!color_wand) - return; - - status = MagickRotateImage(intern->magick_wand, color_wand, degrees); - - if (allocated) - color_wand = DestroyPixelWand (color_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to rotate image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::sampleImage(int columns, int rows) - Scales an image to the desired dimensions with pixel sampling. Unlike other scaling methods, this method does not introduce any additional color into the scaled image. -*/ -PHP_METHOD(Imagick, sampleImage) -{ - php_imagick_object *intern; - im_long columns, rows; - MagickBooleanType status; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &columns, &rows) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSampleImage(intern->magick_wand, columns, rows); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to sample image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::solarizeImage(float 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. -*/ -PHP_METHOD(Imagick, solarizeImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - im_long threshold; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &threshold) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSolarizeImage(intern->magick_wand, threshold); - - /* No magick is going to happen */ - if (status == MagickFalse) - { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to solarize image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::shadowImage(float opacity, float sigma, int x, int y) - Simulates an image shadow. -*/ -PHP_METHOD(Imagick, shadowImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - double opacity, sigma; - im_long x, y; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddll", &opacity, &sigma, &x, &y) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickShadowImage(intern->magick_wand, opacity, sigma, x, y); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to shadow image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::motionBlurImage(float radius, float sigma, float angle, int CHANNEL) - 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. -*/ -PHP_METHOD(Imagick, motionBlurImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - double radius, sigma, angle; - im_long channel = IM_DEFAULT_CHANNEL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddd|l", &radius, &sigma, &angle, &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - -#if MagickLibVersion > 0x643 - status = MagickMotionBlurImageChannel(intern->magick_wand, channel, radius, sigma, angle); -#else - status = MagickMotionBlurImage(intern->magick_wand, radius, sigma, angle); -#endif - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to motion blur image" TSRMLS_CC); - return; - } - - RETURN_TRUE; - - -} -/* }}} */ - -#if MagickLibVersion < 0x700 -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -/* {{{ proto Imagick Imagick::mosaicImages() - Inlays an image sequence to form a single coherent picture. It returns a wand with each image in the sequence composited at the location defined by the page offset of the image. -*/ -PHP_METHOD(Imagick, mosaicImages) -{ - MagickWand *tmp_wand = NULL; - php_imagick_object *intern, *intern_return; - - IMAGICK_METHOD_DEPRECATED ("Imagick", "mosaicImages"); - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - /* TODO: should this be here? */ - MagickSetFirstIterator(intern->magick_wand); - tmp_wand = MagickMosaicImages(intern->magick_wand); - - if (!tmp_wand) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Mosaic image failed" TSRMLS_CC); - return; - } - - object_init_ex(return_value, php_imagick_sc_entry); - intern_return = Z_IMAGICK_P(return_value); - php_imagick_replace_magickwand(intern_return, tmp_wand); - - return; - -} -/* }}} */ -#endif -#endif -/* {{{ proto Imagick Imagick::morphImages(int number_frames) - Method morphs a set of images. Both the image pixels and size are linearly interpolated to give the appearance of a meta-morphosis from one image to the next. -*/ -PHP_METHOD(Imagick, morphImages) -{ - MagickWand *tmp_wand; - php_imagick_object *intern, *intern_return; - im_long frames; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &frames) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - tmp_wand = MagickMorphImages(intern->magick_wand, frames); - - if (!tmp_wand) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Morphing images failed" TSRMLS_CC); - return; - } - - object_init_ex(return_value, php_imagick_sc_entry); - intern_return = Z_IMAGICK_P(return_value); - php_imagick_replace_magickwand(intern_return, tmp_wand); - - return; - -} -/* }}} */ - -/* {{{ proto bool Imagick::minifyImage() - Is a convenience method that scales an image proportionally to one-half its original size -*/ -PHP_METHOD(Imagick, minifyImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickMinifyImage(intern->magick_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to minify image" TSRMLS_CC); - return; - } - - RETURN_TRUE; - -} -/* }}} */ - -/* {{{ proto bool Imagick::posterizeImage(int levels, bool dither) - Reduces the image to a limited number of color level. -*/ -PHP_METHOD(Imagick, posterizeImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - im_long levels; - zend_bool dither; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lb", &levels, &dither) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickPosterizeImage(intern->magick_wand, levels, dither); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to posterize image" TSRMLS_CC); - return; - } - - RETURN_TRUE; - -} -/* }}} */ - -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -#if MagickLibVersion < 0x700 -/* {{{ proto bool Imagick::radialBlurImage(float angle, int channel) - Radial blurs an image. -*/ -PHP_METHOD(Imagick, radialBlurImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - double angle; - im_long channel = DefaultChannels; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d|l", &angle, &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickRadialBlurImageChannel(intern->magick_wand, channel, angle); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to radial blur image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif -#endif - -/* {{{ proto bool Imagick::raiseImage(int width, int height, int x, int y, bool raise) - Creates a simulated three-dimensional button-like effect by lightening and darkening the edges of the image. Members width and height of raise_info define the width of the vertical and horizontal edge of the effect. -*/ -PHP_METHOD(Imagick, raiseImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - im_long width, height, x, y; - zend_bool raise; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llllb", &width, &height, &x, &y, &raise) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickRaiseImage(intern->magick_wand, width, height, x, y, raise); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to raise image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::blackThresholdImage(ImagickPixel threshold) - Is like MagickThresholdImage() but forces all pixels below the threshold into black while leaving all pixels above the threshold unchanged. -*/ -PHP_METHOD(Imagick, blackThresholdImage) -{ - php_imagick_object *intern; - zval *param; - MagickBooleanType status; - PixelWand *color_wand; - zend_bool allocated; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", ¶m) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - color_wand = php_imagick_zval_to_pixelwand (param, IMAGICK_CLASS, &allocated TSRMLS_CC); - if (!color_wand) - return; - - status = MagickBlackThresholdImage(intern->magick_wand, color_wand); - - if (allocated) - color_wand = DestroyPixelWand (color_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to black threshold image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::resampleImage(float x_resolution, float y_resolution, int filter, float blur) - Resample image to desired resolution. -*/ -PHP_METHOD(Imagick, resampleImage) -{ - double xRes, yRes, blur; - im_long filter = 0; - php_imagick_object *intern; - MagickBooleanType status; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddld", &xRes, &yRes, &filter, &blur) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - -#if MagickLibVersion >= 0x700 - //TODO - allow filter to be set. - //TODO - figure out what to do about blur. - status = MagickResampleImage(intern->magick_wand, xRes, yRes, LanczosFilter); -#else - status = MagickResampleImage(intern->magick_wand, xRes, yRes, filter, blur); -#endif - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to resample image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::resizeImage(int width, int height, int filter, float blur, bool bestfit = false, bool legacy) - Scales an image to the desired dimensions with one of these filters: - If legacy is true, the calculations are done with the small rounding bug that existed in - Imagick before 3.4.0. If false, the calculations should produce the same results as - ImageMagick CLI does. -*/ -PHP_METHOD(Imagick, resizeImage) -{ - double blur; - im_long width, height, new_width, new_height, filter = 0; - php_imagick_object *intern; - MagickBooleanType status; - zend_bool bestfit = 0; - zend_bool legacy = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llld|bb", &width, &height, &filter, &blur, &bestfit, &legacy) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - if (!php_imagick_thumbnail_dimensions(intern->magick_wand, bestfit, width, height, &new_width, &new_height, legacy)) { - php_imagick_throw_exception(IMAGICK_CLASS, "Invalid image geometry" TSRMLS_CC); - return; - } - -#if MagickLibVersion >= 0x700 - //TODO - remove blur from params - status = MagickResizeImage(intern->magick_wand, new_width, new_height, filter); -#else - status = MagickResizeImage(intern->magick_wand, new_width, new_height, filter, blur); -#endif - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to resize image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::rollImage(int x, int y) - Offsets an image as defined by x and y. -*/ -PHP_METHOD(Imagick, rollImage) -{ - im_long x, y; - php_imagick_object *intern; - MagickBooleanType status; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &x, &y) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - status = MagickRollImage(intern->magick_wand, x, y); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to roll image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto Imagick Imagick::appendImages(bool stack) - Append a set of images. -*/ -PHP_METHOD(Imagick, appendImages) -{ - php_imagick_object *intern, *intern_return; - MagickWand *tmp_wand; - zend_bool stack; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &stack) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - tmp_wand = MagickAppendImages(intern->magick_wand, stack); - - if (!tmp_wand) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to append images" TSRMLS_CC); - return; - } - - object_init_ex(return_value, php_imagick_sc_entry); - intern_return = Z_IMAGICK_P(return_value); - php_imagick_replace_magickwand(intern_return, tmp_wand); - return; -} -/* }}} */ - -/* {{{ proto bool Imagick::whiteThresholdImage(ImagickPixel threshold) - Is like ThresholdImage() but force all pixels above the threshold into white while leaving all pixels below the threshold unchanged. -*/ -PHP_METHOD(Imagick, whiteThresholdImage) -{ - php_imagick_object *intern; - zval *param; - MagickBooleanType status; - PixelWand *color_wand; - zend_bool allocated; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", ¶m) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - color_wand = php_imagick_zval_to_pixelwand (param, IMAGICK_CLASS, &allocated TSRMLS_CC); - if (!color_wand) - return; - - status = MagickWhiteThresholdImage(intern->magick_wand, color_wand); - - if (allocated) - color_wand = DestroyPixelWand (color_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to white threshold image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto ImagickPixelIterator Imagick::getPixelIterator() - Returns a MagickPixelIterator. -*/ -PHP_METHOD(Imagick, getPixelIterator) -{ - PixelIterator *pixel_it; - php_imagick_object *intern; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - pixel_it = NewPixelIterator(intern->magick_wand); - - if (!pixel_it) { - php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "Can not allocate ImagickPixelIterator" TSRMLS_CC); - return; - } - - php_imagick_pixel_iterator_new (pixel_it, return_value TSRMLS_CC); - return; -} -/* }}} */ - -/* {{{ proto ImagickPixelIterator Imagick::getPixelRegionIterator(long x, long y, long columns, long rows) - Returns a subset of pixels in a MagickPixelIterator object. -*/ -PHP_METHOD(Imagick, getPixelRegionIterator) -{ - PixelIterator *pixel_it; - php_imagick_object *intern; - im_long x, y, columns, rows; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llll", &x, &y, &columns, &rows) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - pixel_it = NewPixelRegionIterator(intern->magick_wand, x, y, columns, rows); - - if (!pixel_it) { - php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "Can not allocate ImagickPixelIterator" TSRMLS_CC); - return; - } - - php_imagick_pixel_iterator_new (pixel_it, return_value TSRMLS_CC); - return; -} -/* }}} */ - -/* {{{ proto int Imagick::getCompression() - Gets the wand compression type. -*/ -PHP_METHOD(Imagick, getCompression) -{ - php_imagick_object *intern; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - RETVAL_LONG(MagickGetCompression(intern->magick_wand)); -} -/* }}} */ - -/* {{{ proto int Imagick::getCompressionQuality() - Gets the wand compression quality. -*/ -PHP_METHOD(Imagick, getCompressionQuality) -{ - php_imagick_object *intern; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - RETVAL_LONG(MagickGetCompressionQuality(intern->magick_wand)); -} -/* }}} */ - -/* {{{ proto string Imagick::getCopyright() - Returns the ImageMagick API copyright as a string constant. -*/ -PHP_METHOD(Imagick, getCopyright) -{ - char *copyright; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - copyright = (char *)MagickGetCopyright(); - IM_ZVAL_STRING(return_value, copyright); - return; -} -/* }}} */ - - -/* {{{ proto string Imagick::getConfigureOptions() - Returns any ImageMagick configure options that match the specified pattern (e.g. "*" for all). Options include NAME, VERSION, LIB_VERSION, etc. -*/ -PHP_METHOD(Imagick, getConfigureOptions) -{ - size_t number_options; - - char *pattern = "*"; - IM_LEN_TYPE pattern_len; - char **result; - char *option_value; - unsigned int i; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &pattern, &pattern_len) == FAILURE) { - return; - } - - result = MagickQueryConfigureOptions(pattern, &number_options); - - array_init(return_value); - - for (i=0; i<number_options; i++) { - option_value = MagickQueryConfigureOption(resulti); - IM_add_assoc_string(return_value, resulti, option_value); - } -} -/* }}} */ - -#if MagickLibVersion > 0x660 -/* {{{ proto string Imagick::getFeatures() - GetFeatures() returns the ImageMagick features that have been compiled into the runtime. -*/ -PHP_METHOD(Imagick, getFeatures) -{ - const char *features; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - features = GetMagickFeatures(); - - IM_ZVAL_STRING(return_value, features); -} -/* }}} */ -#endif - - - -/* {{{ proto string Imagick::getFilename() - Returns the filename associated with an image sequence. -*/ -PHP_METHOD(Imagick, getFilename) -{ - php_imagick_object *intern; - char *filename; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - filename = (char *)MagickGetFilename(intern->magick_wand); - - if (filename) { - IM_ZVAL_STRING(return_value, filename); - IMAGICK_FREE_MAGICK_MEMORY(filename); - } - return; -} -/* }}} */ - -/* {{{ proto string Imagick::getFormat() - Returns the format of the Imagick object. -*/ -PHP_METHOD(Imagick, getFormat) -{ - php_imagick_object *intern; - char *format; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - format = (char *)MagickGetFormat(intern->magick_wand); - - if (format) { - IM_ZVAL_STRING(return_value, format); - IMAGICK_FREE_MAGICK_MEMORY(format); - } - return; -} -/* }}} */ - -/* {{{ proto string Imagick::getHomeURL() - Returns the ImageMagick home URL. -*/ -PHP_METHOD(Imagick, getHomeURL) -{ - char *home_url; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - home_url = (char *)MagickGetHomeURL(); - if (home_url) { - IM_ZVAL_STRING(return_value, home_url); - IMAGICK_FREE_MAGICK_MEMORY(home_url); - } - return; -} -/* }}} */ - -/* {{{ proto int Imagick::getInterlaceScheme() - Gets the wand interlace scheme. -*/ -PHP_METHOD(Imagick, getInterlaceScheme) -{ - php_imagick_object *intern; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - RETVAL_LONG(MagickGetInterlaceScheme(intern->magick_wand)); -} -/* }}} */ - -/* {{{ proto string Imagick::getOption(string key) - Returns a value associated with a wand and the specified key. Use MagickRelinquishMemory() to free the value when you are finished with it. -*/ -PHP_METHOD(Imagick, getOption) -{ - php_imagick_object *intern; - char *key, *value; - IM_LEN_TYPE key_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &key, &key_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - value = MagickGetOption(intern->magick_wand, key); - - if (value) { - IM_ZVAL_STRING(return_value, value); - IMAGICK_FREE_MAGICK_MEMORY(value); - } - return; -} -/* }}} */ - -/* {{{ proto string Imagick::getPackageName() - Returns the ImageMagick package name as a string constant. -*/ -PHP_METHOD(Imagick, getPackageName) -{ - char *package_name; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - package_name = (char *)MagickGetPackageName(); - IM_ZVAL_STRING(return_value, package_name); - return; -} -/* }}} */ - -/* {{{ proto array Imagick::getPage() - Returns the page geometry associated with the Imagick object in an associative array with the keys "width", "height", "x", and "y". -*/ -PHP_METHOD(Imagick, getPage) -{ - php_imagick_object *intern; - MagickBooleanType status; - size_t width, height; - ssize_t x, y; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - status = MagickGetPage(intern->magick_wand, &width, &height, &x, &y); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get page" TSRMLS_CC); - return; - } - - array_init(return_value); - add_assoc_long(return_value, "width", width); - add_assoc_long(return_value, "height", height); - add_assoc_long(return_value, "x", x); - add_assoc_long(return_value, "y", y); - - return; -} -/* }}} */ - -/* {{{ proto int Imagick::getHDRIEnabled() - Returns true if Imagick was compiled against a HDRI verison of ImageMagick. -*/ -PHP_METHOD(Imagick, getHdriEnabled) -{ - if (zend_parse_parameters_none() == FAILURE) { - return; - } - -#if MAGICKCORE_HDRI_ENABLE - RETURN_TRUE; -#else - RETURN_FALSE; -#endif - return; -} -/* }}} */ - - -/* {{{ proto int Imagick::getQuantum() - Returns the ImageMagick quantum range as an integer. -*/ -PHP_METHOD(Imagick, getQuantum) -{ - size_t range; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - MagickGetQuantumRange(&range); - ZVAL_LONG(return_value, range); - -//#ifdef MAGICKCORE_HDRI_ENABLE -// RETVAL_DOUBLE(color_value); -//#else -// RETVAL_LONG(color_value); -//#endif - return; -} -/* }}} */ - - -/* {{{ proto array Imagick::getQuantumDepth() - Returns the ImageMagick quantum depth as a string constant. -*/ -PHP_METHOD(Imagick, getQuantumDepth) -{ - const char *quantum_depth; - size_t depth; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - quantum_depth = MagickGetQuantumDepth(&depth); - - array_init(return_value); - add_assoc_long(return_value, "quantumDepthLong", depth); - IM_add_assoc_string(return_value, "quantumDepthString", (char *)quantum_depth); - - return; -} -/* }}} */ - -/* {{{ proto array Imagick::getQuantumRange() - Returns the ImageMagick quantum range as a string constant. -*/ -PHP_METHOD(Imagick, getQuantumRange) -{ - const char *quantum_range; - size_t range; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - quantum_range = MagickGetQuantumRange(&range); - array_init(return_value); - - add_assoc_long(return_value, "quantumRangeLong", range); - IM_add_assoc_string(return_value, "quantumRangeString", (char *)quantum_range); - return; -} -/* }}} */ - -/* {{{ proto string Imagick::getReleaseDate() - Returns the ImageMagick release date as a string constant. -*/ -PHP_METHOD(Imagick, getReleaseDate) -{ - char *release_date; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - release_date = (char *)MagickGetReleaseDate(); - IM_ZVAL_STRING(return_value, release_date); - return; -} -/* }}} */ - -/* {{{ proto int Imagick::getResource(int type) - Returns the specified resource in megabytes. -*/ -PHP_METHOD(Imagick, getResource) -{ - im_long resource_type; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &resource_type) == FAILURE) { - return; - } - - RETVAL_LONG(MagickGetResource(resource_type)); -} -/* }}} */ - -/* {{{ proto Imagick Imagick::getResourceLimit(int type) - Returns the specified resource limit in megabytes. -*/ -PHP_METHOD(Imagick, getResourceLimit) -{ - im_long resource_type; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &resource_type) == FAILURE) { - return; - } - - RETVAL_DOUBLE(MagickGetResourceLimit(resource_type)); -} -/* }}} */ - -/* {{{ proto array Imagick::getSamplingFactors() - Gets the horizontal and vertical sampling factor. -*/ -PHP_METHOD(Imagick, getSamplingFactors) -{ - php_imagick_object *intern; - double *sampling_factors; - unsigned long i; - size_t number_factors = 0; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - sampling_factors = (double *)MagickGetSamplingFactors(intern->magick_wand, &number_factors); - - array_init(return_value); - - for (i = 0 ; i < number_factors; i++) { - add_next_index_double(return_value, sampling_factorsi); - } - - MagickRelinquishMemory(sampling_factors); - - return; -} -/* }}} */ - -/* {{{ proto array Imagick::getSize() - Returns the size associated with the Imagick object as an array with the keys "columns" and "rows". -*/ -PHP_METHOD(Imagick, getSize) -{ - php_imagick_object *intern; - size_t columns, rows; - MagickBooleanType status; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - status = MagickGetSize(intern->magick_wand, &columns, &rows); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get size" TSRMLS_CC); - return; - } - - array_init(return_value); - add_assoc_long(return_value, "columns", columns); - add_assoc_long(return_value, "rows", rows); - - return; -} -/* }}} */ - -/* {{{ proto array Imagick::getVersion() - Returns the ImageMagick API version as a string constant and as a number. -*/ -PHP_METHOD(Imagick, getVersion) -{ - char *version_string; - size_t version_number; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - version_string = (char *)MagickGetVersion(&version_number); - array_init(return_value); - - add_assoc_long(return_value, "versionNumber", (long) version_number); - IM_add_assoc_string(return_value, "versionString", version_string); - return; -} -/* }}} */ - -/* {{{ proto bool Imagick::setBackgroundColor(ImagickPixel background) - Sets the wand background color. -*/ -PHP_METHOD(Imagick, setBackgroundColor) -{ - zval *param; - php_imagick_object *intern; - MagickBooleanType status; - PixelWand *background_wand; - zend_bool allocated = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", ¶m) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - background_wand = php_imagick_zval_to_pixelwand (param, IMAGICK_CLASS, &allocated TSRMLS_CC); - if (!background_wand) - return; - - status = MagickSetBackgroundColor(intern->magick_wand, background_wand); - - if (allocated) - background_wand = DestroyPixelWand (background_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set background color" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::setCompression(COMPRESSIONTYPE compression) - Sets the wand compression type. -*/ -PHP_METHOD(Imagick, setCompression) -{ - php_imagick_object *intern; - im_long compression; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &compression) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - status = MagickSetCompression(intern->magick_wand, compression); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set compression" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::setCompressionQuality(int quality) - Sets the wand compression quality. -*/ -PHP_METHOD(Imagick, setCompressionQuality) -{ - php_imagick_object *intern; - im_long quality; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &quality) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - status = MagickSetCompressionQuality(intern->magick_wand, quality); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set compression quality" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::setFilename(string filename) - Sets the filename before you read or write an image file. -*/ -PHP_METHOD(Imagick, setFilename) -{ - php_imagick_object *intern; - char *filename; - IM_LEN_TYPE filename_len; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - status = MagickSetFilename(intern->magick_wand, filename); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set filename" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::setFormat(string format) - Sets the format of the Imagick object. -*/ -PHP_METHOD(Imagick, setFormat) -{ - php_imagick_object *intern; - char *format; - IM_LEN_TYPE format_len; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &format, &format_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - status = MagickSetFormat(intern->magick_wand, format); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set format" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::setInterlaceScheme(INTERLACETYPE interlace_scheme) - Sets the image compression. -*/ -PHP_METHOD(Imagick, setInterlaceScheme) -{ - php_imagick_object *intern; - im_long schema; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &schema) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - status = MagickSetInterlaceScheme(intern->magick_wand, schema); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set interlace scheme" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::setOption(string key, string value) - Associates one or options with the wand (.e.g MagickSetOption(wand,"jpeg:perserve","yes")). -*/ -PHP_METHOD(Imagick, setOption) -{ - php_imagick_object *intern; - MagickBooleanType status; - char *key, *value; - IM_LEN_TYPE key_len, value_len; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &key, &key_len, &value, &value_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - status = MagickSetOption(intern->magick_wand, key, value); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set option" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::setPage(int width, int height, int x, int y) - Sets the page geometry of the Imagick object. -*/ -PHP_METHOD(Imagick, setPage) -{ - php_imagick_object *intern; - MagickBooleanType status; - im_long width, height, x, y; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llll", &width, &height, &x, &y) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - status = MagickSetPage(intern->magick_wand, width, height, x, y); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set page" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -PHP_METHOD(Imagick, setImageProgressMonitor) -{ - char *filename; - IM_LEN_TYPE filename_len; - php_imagick_object *intern; - php_imagick_rw_result_t rc; - - if (!IMAGICK_G(progress_monitor)) { - php_imagick_throw_exception(IMAGICK_CLASS, "Progress monitoring is disabled in ini-settings" TSRMLS_CC); - return; - } - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - if ((rc = php_imagick_file_access_check (filename TSRMLS_CC)) != IMAGICK_RW_OK) { - php_imagick_rw_fail_to_exception (intern->magick_wand, rc, filename TSRMLS_CC); - return; - } - - if (intern->progress_monitor_name) { - efree(intern->progress_monitor_name); - } - - intern->progress_monitor_name = estrdup(filename); - MagickSetImageProgressMonitor(intern->magick_wand, php_imagick_progress_monitor, intern); - RETURN_TRUE; -} - -/* {{{ proto bool Imagick::setProgressMonitor(callable callback) - Set a callback that will be called during the processing of the Imagick image. -*/ -#if MagickLibVersion > 0x653 -PHP_METHOD(Imagick, setProgressMonitor) -{ - zval *user_callback; - - php_imagick_object *intern; - php_imagick_callback *callback; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &user_callback) == FAILURE) { - RETURN_FALSE; - } - - // Check whether the callback is valid now, rather than failing later - if (!user_callback || !zend_is_callable(user_callback, 0, NULL TSRMLS_CC)) { - php_imagick_throw_exception(IMAGICK_CLASS, "First argument to setProgressMonitor is expected to be a valid callback" TSRMLS_CC); - RETURN_FALSE; - } - - callback = (php_imagick_callback *) emalloc(sizeof(php_imagick_callback)); - - TSRMLS_SET_CTX(callback->thread_ctx); - //We can't free the previous callback as we can't guarantee that - //ImageMagick won't use it at some point. There is no 'unbind' function - //for previously set 'MagickSetImageProgressMonitor' - callback->previous_callback = IMAGICK_G(progress_callback); - - //Add a ref and store the user's callback -#if PHP_VERSION_ID >= 70000 - Z_TRY_ADDREF_P(user_callback); - ZVAL_COPY_VALUE(&callback->user_callback, user_callback); -#else - Z_ADDREF_P(user_callback); - callback->user_callback = user_callback; -#endif - - //The callback is now valid, store it in the global - IMAGICK_G(progress_callback) = callback; - intern = Z_IMAGICK_P(getThis()); - - MagickSetImageProgressMonitor(intern->magick_wand, php_imagick_progress_monitor_callable, callback); - RETURN_TRUE; -} -#endif - -/* {{{ proto bool Imagick::setResourceLimit(RESOURCETYPE type, int limit) - Sets the limit for a particular resource in megabytes. -*/ -PHP_METHOD(Imagick, setResourceLimit) -{ - MagickBooleanType status; - im_long type; - double limit; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ld", &type, &limit) == FAILURE) { - return; - } - - status = MagickSetResourceLimit(type, (MagickSizeType)limit); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_throw_exception(IMAGICK_CLASS, "Unable to set resource limit" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::setResolution(float x_resolution, float y_resolution) - Sets the image resolution. -*/ -PHP_METHOD(Imagick, setResolution) -{ - php_imagick_object *intern; - MagickBooleanType status; - double x_resolution, y_resolution; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &x_resolution, &y_resolution) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - status = MagickSetResolution(intern->magick_wand, x_resolution, y_resolution); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set resolution" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::setSamplingFactors(array factors) - Sets the image sampling factors. -*/ -PHP_METHOD(Imagick, setSamplingFactors) -{ - php_imagick_object *intern; - MagickBooleanType status; - zval *factors; - double *double_array; - im_long elements = 0; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &factors) == FAILURE) { - return; - } - - double_array = php_imagick_zval_to_double_array(factors, &elements TSRMLS_CC); - - if (!double_array) { - php_imagick_throw_exception(IMAGICK_CLASS, "Can't read array" TSRMLS_CC); - return; - } - - intern = Z_IMAGICK_P(getThis()); - - status = MagickSetSamplingFactors(intern->magick_wand, elements, double_array); - efree(double_array); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set sampling factors" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::setSize(int columns, int rows) - Sets the size of the Imagick object. Set it before you read a raw image format such as RGB, GRAY, or CMYK. -*/ -PHP_METHOD(Imagick, setSize) -{ - php_imagick_object *intern; - im_long columns, rows; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &columns, &rows) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - status = MagickSetSize(intern->magick_wand, columns, rows); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set size" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::setType(IMAGETYPE image_type) - Sets the image type attribute. -*/ -PHP_METHOD(Imagick, setType) -{ - php_imagick_object *intern; - im_long type; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &type) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - status = MagickSetType(intern->magick_wand, type); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set type" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -#if MagickLibVersion >= 0x659 -/* {{{ proto bool Imagick::brightnessContrastImage(float brigthness, float contrast, int channel) - Change the brightness and/or contrast of an image. It converts the brightness and contrast parameters into slope and intercept and calls a polynomical function to apply to the image. -*/ -PHP_METHOD(Imagick, brightnessContrastImage) -{ - php_imagick_object *intern; - double brightness, contrast; - MagickBooleanType status; - im_long channel = IM_DEFAULT_CHANNEL; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd|l", &brightness, &contrast, &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickBrightnessContrastImageChannel(intern->magick_wand, channel, brightness, contrast); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to brightnesscontrastimage" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif - - -#if MagickLibVersion > 0x661 - -static KernelInfo *php_imagick_getKernelInfo(const double *color_matrix, const size_t order) -{ - KernelInfo *kernel_info; - -#if MagickLibVersion >= 0x700 - ExceptionInfo *ex_info = NULL; - //TODO - inspect exception info - kernel_info=AcquireKernelInfo(NULL, ex_info); -#else - kernel_info=AcquireKernelInfo(NULL); -#endif - if (kernel_info == (KernelInfo *) NULL) { - return NULL; - } - - kernel_info->width = order; - kernel_info->height = order; -#if MagickLibVersion >= 0x700 - { - unsigned int i; - kernel_info->values = (MagickRealType *)AcquireAlignedMemory(order, order*sizeof(MagickRealType)); - for (i=0 ; i<order*order ; i++) { - kernel_info->valuesi = color_matrixi; - } - } -#else - kernel_info->values = (double *)AcquireAlignedMemory(order, order*sizeof(double)); - memcpy(kernel_info->values, color_matrix, order * order * sizeof(double)); -#endif - - return kernel_info; -} - - -/* {{{ proto bool Imagick::colorMatrixImage(array kernel) - apply color transformation to an image. The method permits saturation changes, hue rotation, luminance to alpha, and various other effects. Although variable-sized transformation matrices can be used, typically one uses a 5x5 matrix for an RGBA image and a 6x6 for CMYKA (or RGBA with offsets). The matrix is similar to those used by Adobe Flash except offsets are in column 6 rather than 5 (in support of CMYKA images) and offsets are normalized (divide Flash offset by 255). -*/ -PHP_METHOD(Imagick, colorMatrixImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - zval *color_matrix_array; - double *colors; - size_t order = 0; - im_long num_elements = 0; - KernelInfo *kernel_color_matrix; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &color_matrix_array) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - colors = php_imagick_zval_to_double_array(color_matrix_array, &num_elements TSRMLS_CC); - - if (!colors) { - php_imagick_throw_exception(IMAGICK_CLASS, "Unable to read color matrix array" TSRMLS_CC); - return; - } - - if (num_elements == 25) { - order = 5; - } - else if (num_elements == 36) { - order = 6; - } - else { - efree(colors); - php_imagick_throw_exception(IMAGICK_CLASS, "Color matrix array must be 5x5 or 6x6" TSRMLS_CC); - return; - } - - kernel_color_matrix = php_imagick_getKernelInfo(colors, order); - - //TODO - add check that matrix is 5x5 or 6x6? - status = MagickColorMatrixImage(intern->magick_wand, kernel_color_matrix); - - //Free the memory -#if MagickLibVersion >= 0x700 - kernel_color_matrix->values = (MagickRealType *) NULL; -#else - kernel_color_matrix->values = (double *) NULL; -#endif - kernel_color_matrix = DestroyKernelInfo(kernel_color_matrix); - efree(colors); - - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to colormatriximage" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif - -/* {{{ proto bool Imagick::selectiveBlurImage(float radius, float sigma, float threshold, int channel) - Selectively blur an image within a contrast threshold. It is similar to the unsharpen mask that sharpens everything with contrast above a certain threshold. -*/ -PHP_METHOD(Imagick, selectiveBlurImage) -{ - php_imagick_object *intern; - double brightness, contrast, threshold; - MagickBooleanType status; - im_long channel = IM_DEFAULT_CHANNEL; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddd|l", &brightness, &contrast, &threshold, &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSelectiveBlurImageChannel(intern->magick_wand, channel, brightness, contrast, threshold); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to selectiveblurimage" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - - - -#if MagickLibVersion >= 0x689 -/* {{{ proto bool Imagick::rotationalblurimage(float angle, int channel) - Rotational blurs an image. -*/ -PHP_METHOD(Imagick, rotationalBlurImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - double angle; - im_long channel = IM_DEFAULT_CHANNEL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d|l", &angle, &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickRotationalBlurImageChannel(intern->magick_wand, channel, angle); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to rotational blur image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif - -#if MagickLibVersion >= 0x683 - -//Technically, this version is available in 0x682. However there was an incompatible -//change to the methods signature in a bug release. So only expose it for stable -//versions. -// -//6.8.2.8 - MagickStatisticImage ( MagickWand* p1, enum ChannelType const p2, enum StatisticType const p3, size_t const p4, size_t const p5 ) (6) -//6.8.2.9 - MagickStatisticImage ( MagickWand* p1, enum StatisticType const p2, size_t const p3, size_t const p4 ) - - -/* {{{ proto bool Imagick::statisticImage(int type, int width, int height, int channel ) - Replace each pixel with corresponding statistic from the neighborhood of the specified width and height. -*/ -PHP_METHOD(Imagick, statisticImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - im_long type; - im_long width, height; - im_long channel = IM_DEFAULT_CHANNEL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll|l", &type, &width, &height, &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickStatisticImageChannel(intern->magick_wand, channel, type, width, height); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to statisticImage" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -#endif - -#if MagickLibVersion >= 0x652 -/* {{{ proto Imagick Imagick::subimageMatch(Imagick subimage, array &$bestMatch, float &similarity, float similarity_threshold = 0, int metric = ) - Searches for a subimage in the current image and returns a similarity image such that an exact match location is completely white and if none of the pixels match, black, otherwise some gray level in-between. - You can also pass in the optional parameters bestMatch and similarity. After calling the function similarity will be - set to the 'score' of the similarity between the subimage and the matching position in the larger image, bestMatch will - contain an associative array with elements x, y, width, height that describe the matching region. -*/ -PHP_METHOD(Imagick, subimageMatch) -{ - php_imagick_object *intern; - RectangleInfo best_match_offset; - double similarity; - double similarity_threshold = 0.0; - - zval *reference_obj; - php_imagick_object *reference_intern; - php_imagick_object *intern_return; - zval *z_similarity = NULL; - zval *z_best_match_offset = NULL; - - //http://devzone.zend.com/317/extension-writing-part-ii-parameters-arrays-and-zvals/ - MagickWand *new_wand; - - -#if MagickLibVersion >= 0x700 - im_long metric = RootMeanSquaredErrorMetric; -#else - im_long metric = 0; -#endif - -#if PHP_VERSION_ID >= 70000 - char *param_string = "O|z/z/dl"; -#else - char *param_string = "O|zzdl"; - -#endif - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, param_string, &reference_obj, php_imagick_sc_entry, &z_best_match_offset, &z_similarity, &similarity_threshold, &metric) == FAILURE) { - return; - } - reference_intern = Z_IMAGICK_P(reference_obj); - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - -#if MagickLibVersion >= 0x700 - new_wand = MagickSimilarityImage(intern->magick_wand, reference_intern->magick_wand, - metric, similarity_threshold, - &best_match_offset, &similarity); -#else - new_wand = MagickSimilarityImage(intern->magick_wand, reference_intern->magick_wand, &best_match_offset, &similarity); -#endif - - if (new_wand == NULL) { - php_imagick_convert_imagick_exception(intern->magick_wand, "subimagematch failed" TSRMLS_CC); - return; - } - - if (z_similarity) { - ZVAL_DOUBLE(z_similarity, similarity); - } - - if (z_best_match_offset) { - array_init(z_best_match_offset); - add_assoc_long(z_best_match_offset, "x", best_match_offset.x); - add_assoc_long(z_best_match_offset, "y", best_match_offset.y); - add_assoc_long(z_best_match_offset, "width", best_match_offset.width); - add_assoc_long(z_best_match_offset, "height", best_match_offset.height); - } - - object_init_ex(return_value, php_imagick_sc_entry); - intern_return = Z_IMAGICK_P(return_value); - php_imagick_replace_magickwand(intern_return, new_wand); - - return; -} -/* }}} */ -#endif - - -/* {{{ proto bool Imagick::setRegistry(string key, string value) - Sets the ImageMagick registry entry named key to value. This is most - useful for setting "temporary-path" which controls where ImageMagick - creates temporary images e.g. while processing PDFs. -*/ -PHP_METHOD(Imagick, setRegistry) -{ - MagickBooleanType status; - char *key, *value; - IM_LEN_TYPE key_len, value_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &key, &key_len, &value, &value_len) == FAILURE) { - return; - } - - status = SetImageRegistry(StringRegistryType, key, value, NULL); - - /* No magick is going to happen */ - if (status == MagickFalse) { - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - - -/* {{{ proto string|false Imagick::getRegistry(string key) - Get the StringRegistry entry for the named key or false if not set. -*/ -PHP_METHOD(Imagick, getRegistry) -{ - char *key, *value; - IM_LEN_TYPE key_len; - ExceptionInfo *ex_info; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &key, &key_len) == FAILURE) { - return; - } - - ex_info = AcquireExceptionInfo(); - - value = GetImageRegistry(StringRegistryType, key, ex_info); - - if (ex_info->severity != 0) { - zend_throw_exception_ex(php_imagick_exception_class_entry, 1 TSRMLS_CC, "Imagick::getRegistry exception (%s) ", ex_info->reason); - ex_info = DestroyExceptionInfo(ex_info); - return; - } - - ex_info = DestroyExceptionInfo(ex_info); - - if (value != NULL) { - IM_ZVAL_STRING(return_value, value); - IMAGICK_FREE_MAGICK_MEMORY(value); - return; - } - - RETURN_FALSE; -} -/* }}} */ - - -/* {{{ proto array Imagick::listRegistry() - List all the registry settings calls GetImageRegistry. returns an array of all the key/value pairs in the registry -*/ -PHP_METHOD(Imagick, listRegistry) -{ - char *registry = NULL; - char *value = NULL; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - array_init(return_value); - - ResetImageRegistryIterator(); - while ((registry = GetNextImageRegistry())) { - value = GetImageRegistry(StringRegistryType, registry, NULL); - //should this be add_assoc_string(return_value, estrdup(registry), value, 1); - IM_add_assoc_string(return_value, registry, value); - IMAGICK_FREE_MAGICK_MEMORY(value); - } - - return; -} -/* }}} */ - -#if MagickLibVersion >= 0x680 -/* {{{ proto bool Imagick::morphology(int morphologyMethod, int iterations, kernel, int CHANNEL ) - Applies a user supplied kernel to the image according to the given morphology method. - iterations - A value of -1 means loop until no change found. How this is applied may depend on the morphology method. Typically this is a value of 1. -*/ -PHP_METHOD(Imagick, morphology) -{ - zval *objvar; - php_imagick_object *intern; - php_imagickkernel_object *kernel; - im_long morphologyMethod, iterations; - MagickBooleanType status; - im_long channel = IM_DEFAULT_CHANNEL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llO|l", &morphologyMethod, &iterations, &objvar, php_imagickkernel_sc_entry, &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - kernel = Z_IMAGICKKERNEL_P(objvar); - IMAGICK_KERNEL_NOT_NULL_EMPTY(kernel); - - status = MagickMorphologyImageChannel( - intern->magick_wand, - channel, - morphologyMethod, - iterations, - kernel->kernel_info - ); - - // No magick is going to happen - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to morphology image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif //#if MagickLibVersion >= 0x680 - -#ifdef IMAGICK_WITH_KERNEL -#if MagickLibVersion < 0x700 -/* {{{ proto bool Imagick::filter(ImagickKernel kernel, int CHANNEL ) - Applies a custom convolution kernel to the image. -*/ -PHP_METHOD(Imagick, filter) -{ - zval *objvar; - php_imagick_object *intern; - php_imagickkernel_object *kernel; - MagickBooleanType status; - ChannelType channel = UndefinedChannel; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|l", &objvar, php_imagickkernel_sc_entry, &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - kernel = Z_IMAGICKKERNEL_P(objvar); - - if ((kernel->kernel_info->width % 2) != 1) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Only odd-sized, square kernels can be applied as a filter." TSRMLS_CC); - return; - } - - if (kernel->kernel_info->width != kernel->kernel_info->height) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Only odd-sized, square kernels can be applied as a filter." TSRMLS_CC); - return; - } - - if (channel == 0) { - status = MagickFilterImage(intern->magick_wand, kernel->kernel_info); - } - else { - status = MagickFilterImageChannel(intern->magick_wand, channel, kernel->kernel_info); - } - - // No magick is going to happen - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Failed to filter image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif //#if MagickLibVersion < 0x700 -#endif // #ifdef IMAGICK_WITH_KERNEL - -/* {{{ proto int Imagick::setAntiAlias(bool antialias) - Set whether antialiasing should be used for operations. On by default. -*/ -PHP_METHOD(Imagick, setAntialias) -{ - php_imagick_object *intern; - zend_bool antialias; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &antialias) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - status = MagickSetAntialias(intern->magick_wand, antialias); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to setAntiAlias" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::getAntiAlias() - get whether antialiasing would be used for operations. -*/ -PHP_METHOD(Imagick, getAntialias) -{ - php_imagick_object *intern; - MagickBooleanType antialias; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - antialias = MagickGetAntialias(intern->magick_wand); - - if (antialias == MagickTrue) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -#if MagickLibVersion > 0x676 -/* {{{ proto bool Imagick::colorDecisionListImage(string color_correction_collection) - Set whether antialiasing should be used for operations. On by default. -*/ -PHP_METHOD(Imagick, colorDecisionListImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - - char *color_correction_collection; - IM_LEN_TYPE ccc_len; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &color_correction_collection, &ccc_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - status = MagickColorDecisionListImage(intern->magick_wand, color_correction_collection); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to colorDecisionListImage" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif - -#if MagickLibVersion >= 0x687 -/* {{{ proto Imagick Imagick::optimizeimagetransparency() - Takes a frame optimized GIF animation, and compares the overlayed pixels against the disposal image resulting fr -*/ -PHP_METHOD(Imagick, optimizeImageTransparency) -{ - php_imagick_object *intern; - MagickBooleanType status; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickOptimizeImageTransparency(intern->magick_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Optimize image transparency failed" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif - -#if MagickLibVersion >= 0x660 -/* {{{ proto bool Imagick::autoGammaImage(int channel = CHANNEL_ALL) - Extracts the 'mean' from the image and adjust the image to try make set its gamma appropriately. -*/ -PHP_METHOD(Imagick, autoGammaImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - im_long channel = IM_DEFAULT_CHANNEL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &channel) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickAutoGammaImageChannel(intern->magick_wand, channel); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "autoGammaImage" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif //#if MagickLibVersion >= 0x660 - -#if MagickLibVersion >= 0x692 -/* {{{ proto bool Imagick::autoOrient() - Adjusts an image so that its orientation is suitable $ for viewing (i.e. top-left orientation). -*/ -PHP_METHOD(Imagick, autoOrient) -{ - php_imagick_object *intern; - MagickBooleanType status; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickAutoOrientImage(intern->magick_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable autoOrient image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif // #if MagickLibVersion >= 0x692 - -#if MagickLibVersion >= 0x692 -/* {{{ proto bool Imagick::compositeImageGravity(Imagick $image, int COMPOSITE_CONSTANT, int GRAVITY_CONSTANT) - Composite one image onto another using the specified gravity. -*/ -PHP_METHOD(Imagick, compositeImageGravity) -{ - zval *objvar; - php_imagick_object *intern, *image_to_composite; - MagickBooleanType status; - im_long composite, gravity; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Oll", &objvar, php_imagick_sc_entry, &composite, &gravity) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - image_to_composite = Z_IMAGICK_P(objvar); - if (php_imagick_ensure_not_empty (image_to_composite->magick_wand) == 0) - return; - - status = MagickCompositeImageGravity(intern->magick_wand, image_to_composite->magick_wand, composite, gravity); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to compositeImageGravity" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif - -#if MagickLibVersion >= 0x693 -/* {{{ proto bool Imagick::localContrastImage(float radius, float strength) -Attempts to increase the appearance of large-scale light-dark transitions. -Local contrast enhancement works similarly to sharpening with an unsharp mask, -however the mask is instead created using an image with a greater blur distance. -*/ -PHP_METHOD(Imagick, localContrastImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - double radius, strength; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &radius, &strength) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickLocalContrastImage(intern->magick_wand, radius, strength); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Failed to localContrastImage" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif // #if MagickLibVersion >= 0x693 - - -#if MagickLibVersion >= 0x700 -/* {{{ proto int Imagick::identifyImageType() - Identifies the potential image type, returns one of the Imagick::IMGTYPE_* constants -*/ -PHP_METHOD(Imagick, identifyImageType) -{ - php_imagick_object *intern; - long imageType; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - imageType = MagickIdentifyImageType(intern->magick_wand); - - RETVAL_LONG(imageType); -} -/* }}} */ -#endif // #if MagickLibVersion >= 0x700 - - -#if IM_HAVE_IMAGICK_GETSETIMAGEMASK -/* {{{ proto Imagick Imagick::getImageMask() - returns one of the Imagick::PIXELMASK_* constants -*/ -PHP_METHOD(Imagick, getImageMask) -{ - php_imagick_object *intern; - php_imagick_object *intern_return; - im_long pixelmask_type; - MagickWand *tmp_wand; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &pixelmask_type) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - tmp_wand = MagickGetImageMask(intern->magick_wand, pixelmask_type); - - /* No magick is going to happen */ - if (!tmp_wand) { - RETURN_NULL(); - -// php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image clip mask" TSRMLS_CC); -// return; - } - - object_init_ex(return_value, php_imagick_sc_entry); - intern_return = Z_IMAGICK_P(return_value); - - php_imagick_replace_magickwand(intern_return, tmp_wand); - return; -} -/* }}} */ - -/* {{{ proto void Imagick::setImageMask(Imagick $clip_mask, int $pixelmask_type) - returns one of the Imagick::PIXELMASK_* constants -*/ -PHP_METHOD(Imagick, setImageMask) -{ - php_imagick_object *intern; - php_imagick_object *clip_mask; - zval *objvar; - im_long pixelmask_type; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ol", &objvar, php_imagick_sc_entry, &pixelmask_type) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - clip_mask = Z_IMAGICK_P(objvar); - if (php_imagick_ensure_not_empty (clip_mask->magick_wand) == 0) - return; - - MagickSetImageMask( - intern->magick_wand, - pixelmask_type, - clip_mask->magick_wand - ); - - // TODO - check that - // wand->exception - // You want ei->severity. ei->error_number - // the Go Imagick library does something like: - //return &MagickWandException{ExceptionType(C.int(et)), C.GoString(csdescription)} - - RETURN_TRUE; -} -/* }}} */ -#endif // IM_HAVE_IMAGICK_GETSETIMAGEMASK - - - -#if MagickLibVersion >= 0x709 -/* {{{ proto void Imagick::cannyEdgeImage(float $radius, float $sigma, float $lower_percent, float $upper_percent -*/ -PHP_METHOD(Imagick, cannyEdgeImage) -{ - php_imagick_object *intern; - double radius, sigma, lower_percent, upper_percent; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddd", &radius, &sigma, &lower_percent, &upper_percent) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickCannyEdgeImage( - intern->magick_wand, - radius, - sigma, - lower_percent, - upper_percent - ); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to cannyEdgeImage" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif // MagickLibVersion >= 0x709 - -#if IM_HAVE_IMAGICK_SETSEED -/* {{{ proto void Imagick::setSeed(int seed) - Set the random number seed for ImageMagick -*/ -PHP_METHOD(Imagick, setSeed) -{ - im_long seed; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &seed) == FAILURE) { - return; - } - - MagickSetSeed(seed); - - RETURN_NULL(); -} -/* }}} */ -#endif // IM_HAVE_IMAGICK_SETSEED - -#if IM_HAVE_IMAGICK_WAVELETDENOISEIMAGE -/* {{{ proto bool Imagick::waveletDenoiseImage(float $threshold, float $softness -*/ -PHP_METHOD(Imagick, waveletDenoiseImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - double threshold, softness; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &threshold, &softness) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickWaveletDenoiseImage( - intern->magick_wand, - threshold, - softness - ); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to waveletDenoiseImage" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif // IM_HAVE_IMAGICK_WAVELETDENOISEIMAGE - -#if IM_HAVE_IMAGICK_MEANSHIFTIMAGE -/* {{{ proto bool Imagick::meanShiftImage(int $width, int $height, float $color_distance -*/ -PHP_METHOD(Imagick, meanShiftImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - im_long width, height; - double color_distance; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lld", &width, &height, &color_distance) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickMeanShiftImage( - intern->magick_wand, - width, - height, - color_distance - ); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to meanShiftImage" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif // IM_HAVE_IMAGICK_MEANSHIFTIMAGE - -#if IM_HAVE_IMAGICK_KMEANSIMAGE -/* {{{ proto bool Imagick::kmeansImage(int $number_colors, int $max_iterations, float $tolerance -*/ -PHP_METHOD(Imagick, kmeansImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - im_long number_colors, max_iterations; - double tolerance; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lld", &number_colors, &max_iterations, &tolerance) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickKmeansImage( - intern->magick_wand, - number_colors, - max_iterations, - tolerance - ); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to kmeansImage" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif // IM_HAVE_IMAGICK_KMEANSIMAGE - -#if IM_HAVE_IMAGICK_RANGETHRESHOLDIMAGE -/* {{{ proto void Imagick::rangeThresholdImage(float $low_black, float $low_white, float $high_white, float $high_black -*/ -PHP_METHOD(Imagick, rangeThresholdImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - double low_black, low_white, high_white, high_black; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddd", &low_black, &low_white, &high_white, &high_black) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickRangeThresholdImage( - intern->magick_wand, - low_black, - low_white, - high_white, - high_black - ); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to rangeThresholdImage" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif // IM_HAVE_IMAGICK_RANGETHRESHOLDIMAGE - -#if IM_HAVE_IMAGICK_AUTOTHRESHOLDIMAGE -/* {{{ proto bool Imagick::autoThresholdImage(int $auto_threshold_method -*/ -PHP_METHOD(Imagick, autoThresholdImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - im_long auto_threshold_method; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &auto_threshold_method) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickAutoThresholdImage( - intern->magick_wand, - auto_threshold_method - ); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to autoThresholdImage" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif // IM_HAVE_IMAGICK_AUTOTHRESHOLDIMAGE - -#if IM_HAVE_IMAGICK_BILATERALBLURIMAGE -/* {{{ proto void Imagick::bilateralBlurImage(float $radius, float $sigma, float $intensity_sigma, float $spatial_sigma -*/ -PHP_METHOD(Imagick, bilateralBlurImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - double radius, sigma, intensity_sigma, spatial_sigma; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddd", &radius, &sigma, &intensity_sigma, &spatial_sigma) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickBilateralBlurImage( - intern->magick_wand, - radius, - sigma, - intensity_sigma, - spatial_sigma - ); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to bilateralBlurImage" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif // IM_HAVE_IMAGICK_BILATERALBLURIMAGE - -#if IM_HAVE_IMAGICK_CLAHEIMAGE -/* {{{ proto void Imagick::claheImage(int $width, int $height, int $number_bins, float $clip_limit -*/ -PHP_METHOD(Imagick, claheImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - im_long width, height, number_bins; - double clip_limit; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llld", &width, &height, &number_bins, &clip_limit) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickCLAHEImage( - intern->magick_wand, - width, - height, - number_bins, - clip_limit - ); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to claheImage" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif //IM_HAVE_IMAGICK_CLAHEIMAGE - -#if IM_HAVE_IMAGICK_CHANNELFXIMAGE -/* {{{ proto bool Imagick::channelFxImage(string $expression) -*/ -PHP_METHOD(Imagick, channelFxImage) -{ - php_imagick_object *intern; - MagickWand *fx_image; - php_imagick_object *intern_return; - - char *expression; - IM_LEN_TYPE expression_len; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &expression, &expression_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - fx_image = MagickChannelFxImage(intern->magick_wand, expression); - - if (!fx_image) { - php_imagick_convert_imagick_exception(intern->magick_wand, "channelFxImage failed" TSRMLS_CC); - return; - } - - object_init_ex(return_value, php_imagick_sc_entry); - intern_return = Z_IMAGICK_P(return_value); - - php_imagick_replace_magickwand(intern_return, fx_image); - return; -} -/* }}} */ -#endif // IM_HAVE_IMAGICK_CHANNELFXIMAGE - -#if IM_HAVE_IMAGICK_COLORTHRESHOLDIMAGE -/* {{{ proto bool colorThresholdImage(ImagickPixel|string $start_color, ImagickPixel|string $stop_color): -*/ -PHP_METHOD(Imagick, colorThresholdImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - zval *start_color_param, *stop_color_param; - PixelWand *start_color_wand, *stop_color_wand; - zend_bool start_color_allocated = 0, stop_color_allocated = 0; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &start_color_param, &stop_color_param) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - start_color_wand = php_imagick_zval_to_pixelwand (start_color_param, IMAGICK_CLASS, &start_color_allocated TSRMLS_CC); - if (!start_color_wand) - return; - - stop_color_wand = php_imagick_zval_to_pixelwand (stop_color_param, IMAGICK_CLASS, &stop_color_allocated TSRMLS_CC); - if (!stop_color_wand) - return; - - status = MagickColorThresholdImage( - intern->magick_wand, - start_color_wand, - stop_color_wand - ); - - if (start_color_allocated) - start_color_wand = DestroyPixelWand (start_color_wand); - - if (stop_color_allocated) - stop_color_wand = DestroyPixelWand (stop_color_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to colorThresholdImage" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif //IM_HAVE_IMAGICK_COLORTHRESHOLDIMAGE - - -#if IM_HAVE_IMAGICK_COMPLEXIMAGES -/* {{{ proto Imagick complexImages(int $complex_operator) -*/ -PHP_METHOD(Imagick, complexImages) -{ - im_long complex_operator; - MagickBooleanType status; - php_imagick_object *intern; - MagickWand *complexed; - php_imagick_object *intern_return; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &complex_operator) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSetIteratorIndex(intern->magick_wand, 0); - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "complexImages failed to set iterator index to 0" TSRMLS_CC); - return; - } - - complexed = MagickComplexImages( - intern->magick_wand, - complex_operator - ); - - if (!complexed) { - php_imagick_convert_imagick_exception(intern->magick_wand, "complexImages failed" TSRMLS_CC); - return; - } - - object_init_ex(return_value, php_imagick_sc_entry); - intern_return = Z_IMAGICK_P(return_value); - - php_imagick_replace_magickwand(intern_return, complexed); - return; -} -/* }}} */ -#endif //IM_HAVE_IMAGICK_COMPLEXIMAGES - - -#if IM_HAVE_IMAGICK_INTERPOLATIVERESIZEIMAGE -/* {{{ proto bool interpolativeResizeImage(int $columns, int $rows, int $interpolate) -*/ -PHP_METHOD(Imagick, interpolativeResizeImage) -{ - im_long columns, rows, interpolate; - MagickBooleanType status; - php_imagick_object *intern; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &columns, &rows, &interpolate) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickInterpolativeResizeImage( - intern->magick_wand, - columns, - rows, - interpolate - ); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to interpolativeResizeImage" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif //IM_HAVE_IMAGICK_INTERPOLATIVERESIZEIMAGE - - -#if IM_HAVE_IMAGICK_LEVELIMAGECOLORS -/* {{{ proto bool levelImageColors(ImagickPixel|string $black_color,ImagickPixel|string $white_color,bool $invert): -*/ -PHP_METHOD(Imagick, levelImageColors) -{ - php_imagick_object *intern; - MagickBooleanType status; - zend_bool invert; - zval *black_color_param, *white_color_param; - PixelWand *black_color_wand, *white_color_wand; - zend_bool black_color_allocated = 0, white_color_allocated = 0; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zzb", &black_color_param, &white_color_param, &invert) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - black_color_wand = php_imagick_zval_to_pixelwand (black_color_param, IMAGICK_CLASS, &black_color_allocated TSRMLS_CC); - if (!black_color_wand) - return; - - white_color_wand = php_imagick_zval_to_pixelwand (white_color_param, IMAGICK_CLASS, &white_color_allocated TSRMLS_CC); - if (!white_color_wand) - return; - - status = MagickLevelImageColors( - intern->magick_wand, - black_color_wand, - white_color_wand, - invert - ); - - if (black_color_allocated) - black_color_wand = DestroyPixelWand (black_color_wand); - - if (white_color_allocated) - white_color_wand = DestroyPixelWand (white_color_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to levelImageColors" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif //IM_HAVE_IMAGICK_LEVELIMAGECOLORS - - - -#if IM_HAVE_IMAGICK_LEVELIZEIMAGE -/* {{{ proto bool Imagick::levelizeImage(float $black_point, float $gamma, float $white_point) -*/ -PHP_METHOD(Imagick, levelizeImage) -{ - double black_point, gamma, white_point; - MagickBooleanType status; - php_imagick_object *intern; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddd", &black_point, &gamma, &white_point) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickLevelizeImage( - intern->magick_wand, - black_point, - gamma, - white_point - ); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to levelizeImage" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif //IM_HAVE_IMAGICK_LEVELIZEIMAGE - - -#if IM_HAVE_IMAGICK_ORDEREDDITHERIMAGE -/* {{{ proto void Imagick::orderedDitherImage(string $dither_format) -*/ -PHP_METHOD(Imagick, orderedDitherImage) -{ - char *dither_format; - IM_LEN_TYPE dither_format_len; - MagickBooleanType status; - php_imagick_object *intern; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &dither_format, &dither_format_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickOrderedDitherImage( - intern->magick_wand, - dither_format - ); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to orderedDitherImage" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif //IM_HAVE_IMAGICK_ORDEREDDITHERIMAGE - -#if IM_HAVE_IMAGICK_WHITEBALANCEIMAGE -/* {{{ proto bool Imagick::whiteBalanceImage() -*/ -PHP_METHOD(Imagick, whiteBalanceImage) -{ - php_imagick_object *intern; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - RETURN_BOOL(MagickWhiteBalanceImage(intern->magick_wand)); - -} -/* }}} */ -#endif //IM_HAVE_IMAGICK_WHITEBALANCEIMAGE - - -#if IM_HAVE_IMAGICK_DELETE_OPTION -/* {{{ proto boolean Imagick::deleteOption(string $option) -*/ -PHP_METHOD(Imagick, deleteOption) -{ - php_imagick_object *intern; - MagickBooleanType status; - char *option; - IM_LEN_TYPE option_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &option, &option_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickDeleteOption(intern->magick_wand, option); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to deleteOption" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif - -#if IM_HAVE_IMAGICK_GET_BACKGROUND_COLOR -/* {{{ proto int Imagick::getBackgroundColor() -*/ -PHP_METHOD(Imagick, getBackgroundColor) -{ - php_imagick_object *intern; - php_imagickpixel_object *imagickpixel_object; - PixelWand *pixel_wand; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - pixel_wand = MagickGetBackgroundColor(intern->magick_wand); - - if (pixel_wand == NULL) { - php_imagick_convert_imagick_exception(intern->magick_wand, "getBackgroundColor" TSRMLS_CC); - return; - } - - object_init_ex(return_value, php_imagickpixel_sc_entry); - imagickpixel_object = Z_IMAGICKPIXEL_P(return_value); - php_imagick_replace_pixelwand(imagickpixel_object, pixel_wand); - - return; -} -/* }}} */ -#endif - -#if IM_HAVE_IMAGICK_GET_IMAGE_ARTIFACTS -/* {{{ proto array Imagick::getImageArtifacts(string $pattern = "*") -*/ -PHP_METHOD(Imagick, getImageArtifacts) -{ - php_imagick_object *intern; - size_t number_artifacts; - char *pattern = "*"; - IM_LEN_TYPE pattern_len; - char **artifacts; - char *artifact_value; - unsigned int i; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &pattern, &pattern_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - artifacts = MagickGetImageArtifacts( - intern->magick_wand, - pattern, - &number_artifacts - ); - - array_init(return_value); - for (i=0; i<number_artifacts; i++) { - artifact_value = MagickGetImageArtifact(intern->magick_wand, artifactsi); - if (artifact_value == NULL) { - add_assoc_null(return_value, artifactsi); - } - else { - IM_add_assoc_string(return_value, artifactsi, artifact_value); - MagickRelinquishMemory(artifact_value); - } - } -} -/* }}} */ -#endif - - -#if IM_HAVE_IMAGICK_GET_IMAGE_DISTORTIONS - -#endif - -#if IM_HAVE_IMAGICK_GET_IMAGE_KURTOSIS -/* {{{ proto int Imagick::getImageKurtosis() - kurtosis: float, skewness: float -*/ -PHP_METHOD(Imagick, getImageKurtosis) -{ - php_imagick_object *intern; - - MagickBooleanType status; - double kurtosis; - double skewness; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - status = MagickGetImageKurtosis(intern->magick_wand, &kurtosis, &skewness); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to getImageKurtosis" TSRMLS_CC); - return; - } - - array_init(return_value); - add_assoc_double(return_value, "kurtosis", kurtosis); - add_assoc_double(return_value, "skewness", skewness); - - return; -} -/* }}} */ -#endif - -#if IM_HAVE_IMAGICK_GET_IMAGE_MEAN -/* {{{ proto int Imagick::getImageMean() - mean: float, standard_deviation: float -*/ -PHP_METHOD(Imagick, getImageMean) -{ - php_imagick_object *intern; - - MagickBooleanType status; - double mean; - double standard_deviation; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - status = MagickGetImageMean(intern->magick_wand, &mean, &standard_deviation); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to getImageMean" TSRMLS_CC); - return; - } - - array_init(return_value); - add_assoc_double(return_value, "mean", mean); - add_assoc_double(return_value, "standard_deviation", standard_deviation); - - return; -} -/* }}} */ -#endif - -#if IM_HAVE_IMAGICK_GET_IMAGE_RANGE -/* {{{ proto int Imagick::getImageRange() - minima: float, maxima: float -*/ -PHP_METHOD(Imagick, getImageRange) -{ - php_imagick_object *intern; - MagickBooleanType status; - double minima; - double maxima; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - status = MagickGetImageRange(intern->magick_wand, &minima, &maxima); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to getImageRange" TSRMLS_CC); - return; - } - - array_init(return_value); - add_assoc_double(return_value, "minima", minima); - add_assoc_double(return_value, "maxima", maxima); - - return; -} -/* }}} */ -#endif - -#if IM_HAVE_IMAGICK_GET_INTERPOLATE_METHOD -/* {{{ proto int Imagick::getInterpolateMethod() -*/ -PHP_METHOD(Imagick, getInterpolateMethod) -{ - php_imagick_object *intern; - PixelInterpolateMethod pixelInterpolateMethod; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - pixelInterpolateMethod = MagickGetInterpolateMethod(intern->magick_wand); - - RETVAL_LONG(pixelInterpolateMethod); -} -/* }}} */ -#endif - - -#if IM_HAVE_IMAGICK_GET_OPTIONS -/* {{{ proto array Imagick::getOptions(string $pattern = "*") -*/ -PHP_METHOD(Imagick, getOptions) -{ - php_imagick_object *intern; - size_t number_options; - char *pattern = "*"; - IM_LEN_TYPE pattern_len; - char **options; - char *option_value; - unsigned int i; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &pattern, &pattern_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - options = MagickGetOptions( - intern->magick_wand, - pattern, - &number_options - ); - - array_init(return_value); - - for (i=0; i<number_options; i++) { - option_value = MagickGetOption(intern->magick_wand, optionsi); - IM_add_assoc_string(return_value, optionsi, option_value); - MagickRelinquishMemory(option_value); - } - - return; -} -/* }}} */ -#endif - - -#if IM_HAVE_IMAGICK_GET_ORIENTATION -/* {{{ proto int Imagick::getOrientation() -*/ -PHP_METHOD(Imagick, getOrientation) -{ - php_imagick_object *intern; - OrientationType orientation; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - orientation = MagickGetOrientation(intern->magick_wand); - - RETVAL_LONG(orientation); -} -/* }}} */ -#endif - -#if IM_HAVE_IMAGICK_GET_RESOLUTION -/* {{{ proto int Imagick::getSizeOffset() - x: float, y: float -*/ -PHP_METHOD(Imagick, getResolution) -{ - php_imagick_object *intern; - - MagickBooleanType status; - double x; - double y; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - status = MagickGetResolution(intern->magick_wand, &x, &y); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to getResolution" TSRMLS_CC); - return; - } - - array_init(return_value); - add_assoc_double(return_value, "x", x); - add_assoc_double(return_value, "y", y); - - return; -} -/* }}} */ -#endif - -#if IM_HAVE_IMAGICK_GET_TYPE -/* {{{ proto int Imagick::getType() -*/ -PHP_METHOD(Imagick, getType) -{ - php_imagick_object *intern; - ImageType type; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - type = MagickGetType(intern->magick_wand); - - RETVAL_LONG(type); -} -/* }}} */ -#endif - -#if IM_HAVE_IMAGICK_POLYNOMIAL_IMAGE -/* {{{ proto Imagick Imagick::polynomialImage(array $terms) - number_terms: the number of terms in the list. The actual list length - //% is 2 x number_terms + 1 (the constant). -*/ -PHP_METHOD(Imagick, polynomialImage) -{ - php_imagick_object *intern; - zval *terms; - double *terms_double_array; - MagickBooleanType status; - im_long terms_count = 0; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &terms) == FAILURE) { - return; - } - - terms_double_array = php_imagick_zval_to_double_array(terms, &terms_count TSRMLS_CC); - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSetIteratorIndex(intern->magick_wand, 0); - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to polynomialImage, failed to set iterator to zero" TSRMLS_CC); - return; - } - - // TODO - sanity check terms_count - - status = MagickPolynomialImage( - intern->magick_wand, - terms_count, - terms_double_array - ); - - efree(terms_double_array); - - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to polynomialImage" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif - -#if IM_HAVE_IMAGICK_SET_DEPTH -/* {{{ proto bool Imagick::setDepth(int depth) - Sets the depth -*/ -PHP_METHOD(Imagick, setDepth) -{ - php_imagick_object *intern; - im_long depth; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &depth) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - - status = MagickSetDepth(intern->magick_wand, depth); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to setDepth" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ -#endif - - -#if IM_HAVE_IMAGICK_SET_EXTRACT -/* {{{ proto bool Imagick::setExtract(string $geometry) - Use it for inline cropping (e.g. 200x200+0+0) -*/ -PHP_METHOD(Imagick, setExtract) -{ - char *geometry_string; - IM_LEN_TYPE geometry_string_len; - MagickBooleanType status; - php_imagick_object *intern; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &geometry_string, &geometry_string_len) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); -// if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) -// return; - - status = MagickSetExtract(intern->magick_wand, geometry_string); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to setExtract" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ -#endif - -#if IM_HAVE_IMAGICK_SET_INTERPOLATE_METHOD -/* {{{ proto bool Imagick::setInterpolateMethod(int method) - Sets the interpolate pixel method. -*/ -PHP_METHOD(Imagick, setInterpolateMethod) -{ - php_imagick_object *intern; - im_long interpolate; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &interpolate) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); -// if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) -// return; - - status = MagickSetInterpolateMethod(intern->magick_wand, interpolate); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to setInterpolateMethod" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ -#endif - -#if IM_HAVE_IMAGICK_SET_ORIENTATION -/* {{{ proto bool Imagick::setOrientation(int orientation) -*/ -PHP_METHOD(Imagick, setOrientation) -{ - php_imagick_object *intern; - MagickBooleanType status; - im_long orientation_type; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &orientation_type) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickSetOrientation(intern->magick_wand, orientation_type); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to setOrientation" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ -#endif - -/* end of Imagick */
View file
imagick-3.7.0.tgz/imagick-3.7.0/imagick_file.c
Deleted
@@ -1,369 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 / Imagick | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 Mikko Koppanen, Scott MacVicar | - | ImageMagick (c) ImageMagick Studio LLC | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Mikko Kopppanen <mkoppanen@php.net> | - | Scott MacVicar <scottmac@php.net> | - +----------------------------------------------------------------------+ -*/ - -#include "php_imagick.h" -#include "php_imagick_file.h" -#include "php_imagick_macros.h" -#include "php_imagick_defs.h" - -#if ZEND_MODULE_API_NO > 20060613 -# define IMAGICK_INIT_ERROR_HANDLING zend_error_handling error_handling -# define IMAGICK_SET_ERROR_HANDLING_THROW zend_replace_error_handling(EH_THROW, php_imagick_exception_class_entry, &error_handling TSRMLS_CC) -# define IMAGICK_RESTORE_ERROR_HANDLING zend_restore_error_handling(&error_handling TSRMLS_CC) -#else -# define IMAGICK_INIT_ERROR_HANDLING -# define IMAGICK_SET_ERROR_HANDLING_THROW php_set_error_handling(EH_THROW, php_imagick_exception_class_entry TSRMLS_CC) -# define IMAGICK_RESTORE_ERROR_HANDLING php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC) -#endif - -#ifndef S_ISDIR -# define S_ISDIR(mode) (((mode)&S_IFMT) == S_IFDIR) -#endif - -static -zend_bool php_imagick_is_virtual_format(const char *format) -{ - int i, elements; - - const char *virtual_fmt = { - "CANVAS", - "CAPTION", - "CLIPBOARD", - "FRACTAL", - "GRADIENT", - "GRANITE", - "HALD", // Identity Hald CLUT Image Select levels like this: hald:8 for level 8. - "INLINE", // Base64-encoded inline image - "LABEL", - "LOGO", - "MAGICK", - "MAP", // Colormap intensities and indices Set -depth to set the sample size of the intensities; indices are 16-bit if colors > 256. - "MASK", // Image mask - "MATTE", - "NETSCAPE", - "NULL", - "PANGO", // Image caption - "PLASMA", - "PRINT", - "RADIAL-GRADIENT", - "RADIAL_GRADIENT", - "ROSE" - "SCAN", - "SCANX", - "TILE", // Tiled image - "UNIQUE", - "WIN", -#ifndef PHP_WIN32 - "X", -#endif - "XC", - }; - - elements = sizeof (virtual_fmt) / sizeof (virtual_fmt 0); - - for (i = 0; i < elements; i++) { - if (strcasecmp(format, virtual_fmti) == 0) { - return 1; - } - } - return 0; -} - -static -zend_bool php_imagick_is_url(const char *filename TSRMLS_DC) -{ - const char *path_for_open; - - if (php_stream_locate_url_wrapper(filename, &path_for_open, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC)) { - return 1; - } - return 0; -} - -zend_bool php_imagick_file_init(struct php_imagick_file_t *file, const char *filename, size_t filename_len TSRMLS_DC) -{ - char magick_pathMaxTextExtent, head_pathMaxTextExtent, tail_pathMaxTextExtent, bufferMaxTextExtent; - - if (!filename_len) { - return 0; - } - - /* Undefined for now */ - file->type = ImagickUndefinedType; - - if (filename_len >= MaxTextExtent) { - return 0; - } - - /* Take a copy of the original string */ - strlcpy(file->filename, filename, MaxTextExtent); - file->filename_len = filename_len; - - /* Break the path into pieces */ - memset(magick_path, 0, MaxTextExtent); - GetPathComponent(file->filename, MagickPath, magick_path); - - /* The path has a format identifier, check for url and virtual format */ - if (strlen(magick_path) > 0) { - /* Virtual format? */ - if (php_imagick_is_virtual_format(magick_path)) { - file->type = ImagickVirtualFormat; - file->absolute_path = estrdup(""); - return 1; - } - /* Is it an url? */ - else if (php_imagick_is_url(filename TSRMLS_CC)) { - file->type = ImagickUri; - file->absolute_path = estrdup(""); - return 1; - } - } - - /* This is a normal file path */ - file->type = ImagickFile; - - memset(head_path, 0, MaxTextExtent); - memset(tail_path, 0, MaxTextExtent); - - GetPathComponent(file->filename, HeadPath, head_path); - GetPathComponent(file->filename, TailPath, tail_path); - - (void) snprintf(buffer, MaxTextExtent, "%s/%s", head_path, tail_path); - - /* The full path to the file */ - file->absolute_path = expand_filepath(buffer, NULL TSRMLS_CC); - - /* Failed to resolve absolute path */ - if (!file->absolute_path) { - file->absolute_path = estrdup(""); - } - return 1; -} - -void php_imagick_file_deinit(struct php_imagick_file_t *file) -{ - if (file->absolute_path) { - efree(file->absolute_path); - file->absolute_path = NULL; - } -} - -static -int php_imagick_read_image_using_imagemagick(php_imagick_object *intern, struct php_imagick_file_t *file, ImagickOperationType type TSRMLS_DC) -{ - -#if PHP_VERSION_ID < 70000 -#if PHP_VERSION_ID >= 50600 -#ifdef ZTS - // This suppresses an 'unused parameter' warning. - (void)tsrm_ls; -#endif -#endif -#endif - - if (type == ImagickReadImage) { - if (MagickReadImage(intern->magick_wand, file->filename) == MagickFalse) { - -#if PHP_VERSION_ID >= 70000 - zend_stat_t st; -#else - struct stat st; -#endif - - /* Resolved to a filename. Check that it's not a dir */ - if (php_sys_stat(file->absolute_path, &st) == 0 && S_ISDIR(st.st_mode)) { - return IMAGICK_RW_PATH_IS_DIR; - } - return IMAGICK_RW_UNDERLYING_LIBRARY; - } - } else if (type == ImagickPingImage){ - if (MagickPingImage(intern->magick_wand, file->filename) == MagickFalse) { - return IMAGICK_RW_UNDERLYING_LIBRARY; - } - } else { - return IMAGICK_RW_UNDERLYING_LIBRARY; - } - - MagickSetImageFilename(intern->magick_wand, file->absolute_path); - MagickSetLastIterator(intern->magick_wand); - return IMAGICK_RW_OK; -} - -static -int php_imagick_read_image_using_php_streams(php_imagick_object *intern, struct php_imagick_file_t *file, ImagickOperationType type TSRMLS_DC) -{ - php_stream *stream; - MagickBooleanType status; - FILE *fp; - IMAGICK_INIT_ERROR_HANDLING; - IMAGICK_SET_ERROR_HANDLING_THROW; - -#if PHP_VERSION_ID >= 70000 - stream = php_stream_open_wrapper(file->filename, "rb", (IGNORE_PATH) & ~REPORT_ERRORS, NULL); -#else - stream = php_stream_open_wrapper(file->filename, "rb", (ENFORCE_SAFE_MODE|IGNORE_PATH) & ~REPORT_ERRORS, NULL); -#endif - - if (!stream) { - IMAGICK_RESTORE_ERROR_HANDLING; - return IMAGICK_RW_UNDERLYING_LIBRARY; - } - - if (php_stream_can_cast(stream, PHP_STREAM_AS_STDIO|PHP_STREAM_CAST_INTERNAL) == FAILURE || - php_stream_cast(stream, PHP_STREAM_AS_STDIO|PHP_STREAM_CAST_INTERNAL, (void*)&fp, 0) == FAILURE) { - - php_stream_close(stream); - IMAGICK_RESTORE_ERROR_HANDLING; - return IMAGICK_RW_UNDERLYING_LIBRARY; - } - - IMAGICK_RESTORE_ERROR_HANDLING; - - if (type == ImagickReadImage) { - status = MagickReadImageFile(intern->magick_wand, fp); - } else if (type == ImagickPingImage){ - status = MagickPingImageFile(intern->magick_wand, fp); - } else { - php_stream_close(stream); - return IMAGICK_RW_UNDERLYING_LIBRARY; - } - - if (status == MagickFalse) { - php_stream_close(stream); - return IMAGICK_RW_UNDERLYING_LIBRARY; - } - - MagickSetImageFilename(intern->magick_wand, file->absolute_path); - php_stream_close(stream); - - if (status == MagickFalse) { - return IMAGICK_RW_UNDERLYING_LIBRARY; - } - - MagickSetLastIterator(intern->magick_wand); - return IMAGICK_RW_OK; -} - -int php_imagick_safe_mode_check(const char *filename TSRMLS_DC) -{ -#if defined(CHECKUID_CHECK_FILE_AND_DIR) - if (PG(safe_mode) && (!php_checkuid_ex(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR, CHECKUID_NO_ERRORS))) { - return IMAGICK_RW_SAFE_MODE_ERROR; - } -#endif - if (PG(open_basedir) && php_check_open_basedir_ex(filename, 0 TSRMLS_CC)) { - return IMAGICK_RW_OPEN_BASEDIR_ERROR; - } - - return IMAGICK_RW_OK; -} - -php_imagick_rw_result_t php_imagick_read_file(php_imagick_object *intern, struct php_imagick_file_t *file, ImagickOperationType type TSRMLS_DC) -{ - php_imagick_rw_result_t rc; - - if (file->type == ImagickFile) { - rc = php_imagick_safe_mode_check(file->absolute_path TSRMLS_CC); - - if (rc != IMAGICK_RW_OK) { - return rc; - } - } - - if (file->type == ImagickUri) { - return php_imagick_read_image_using_php_streams(intern, file, type TSRMLS_CC); - } else { - return php_imagick_read_image_using_imagemagick(intern, file, type TSRMLS_CC); - } -} - -php_imagick_rw_result_t php_imagick_write_file(php_imagick_object *intern, struct php_imagick_file_t *file, ImagickOperationType type, zend_bool adjoin TSRMLS_DC) -{ - php_imagick_rw_result_t rc; - MagickBooleanType status = MagickFalse; - - if (file->type == ImagickFile) { - rc = php_imagick_safe_mode_check(file->absolute_path TSRMLS_CC); - if (rc != IMAGICK_RW_OK) { - return rc; - } - } - if (type == ImagickWriteImage) { - status = MagickWriteImage(intern->magick_wand, file->filename); - } else if (type == ImagickWriteImages) { - status = MagickWriteImages(intern->magick_wand, file->filename, adjoin); - } - - /* Write succeded ? */ - if (status == MagickFalse) { - return IMAGICK_RW_UNDERLYING_LIBRARY; - } - /* All went well it seems */ - return IMAGICK_RW_OK; -} - -zend_bool php_imagick_stream_handler(php_imagick_object *intern, php_stream *stream, ImagickOperationType type TSRMLS_DC) -{ - FILE *fp; - MagickBooleanType status = MagickFalse; - - IMAGICK_INIT_ERROR_HANDLING; - IMAGICK_SET_ERROR_HANDLING_THROW; - - if (php_stream_can_cast(stream, PHP_STREAM_AS_STDIO | PHP_STREAM_CAST_INTERNAL) == FAILURE || - php_stream_cast(stream, PHP_STREAM_AS_STDIO | PHP_STREAM_CAST_INTERNAL, (void **)&fp, 0) == FAILURE) { - IMAGICK_RESTORE_ERROR_HANDLING; - return 0; - } - - IMAGICK_RESTORE_ERROR_HANDLING; - - /* php_stream_cast returns warning on some streams but still does not return FAILURE */ - if (EG(exception)) { - return 0; - } - - switch (type) { - case ImagickWriteImageFile: - status = MagickWriteImageFile(intern->magick_wand, fp); - break; - - case ImagickWriteImagesFile: - status = MagickWriteImagesFile(intern->magick_wand, fp); - break; - - case ImagickReadImageFile: - status = MagickReadImageFile(intern->magick_wand, fp); - break; - - case ImagickPingImageFile: - status = MagickPingImageFile(intern->magick_wand, fp); - break; - - default: - return 0; - break; - } - if (status == MagickFalse) { - return 0; - } - return 1; -} -
View file
imagick-3.7.0.tgz/imagick-3.7.0/imagick_helpers.c
Deleted
@@ -1,2017 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 / Imagick | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 Mikko Koppanen, Scott MacVicar | - | ImageMagick (c) ImageMagick Studio LLC | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Mikko Kopppanen <mkoppanen@php.net> | - | Scott MacVicar <scottmac@php.net> | - +----------------------------------------------------------------------+ -*/ - -#include "php_imagick.h" -#include "php_imagick_defs.h" -#include "php_imagick_macros.h" -#include "php_imagick_helpers.h" - -MagickBooleanType php_imagick_progress_monitor(const char *text, const MagickOffsetType offset, const MagickSizeType span, void *client_data) -{ - FILE *fp; - php_imagick_object *intern = (php_imagick_object *)client_data; - - if (!intern) { - return MagickFalse; - } - - if (!intern->progress_monitor_name) { - return MagickFalse; - } - - fp = fopen(intern->progress_monitor_name, "a+"); - - if (!fp) { - return MagickFalse; - } - - fprintf(fp, "text: %s, offset: %lld, span: %lld\n", text, offset, span); - fclose(fp); - return MagickTrue; -} - -void php_imagick_cleanup_progress_callback(php_imagick_callback* progress_callback TSRMLS_DC) { - - if (progress_callback) { - if (progress_callback->previous_callback) { - php_imagick_cleanup_progress_callback(progress_callback->previous_callback TSRMLS_CC); - efree(progress_callback->previous_callback); - } - -#if PHP_VERSION_ID >= 70000 - zval_ptr_dtor(&progress_callback->user_callback); -#else - zval_ptr_dtor(&progress_callback->user_callback); -#endif - } -} - -MagickBooleanType php_imagick_progress_monitor_callable(const char *text, const MagickOffsetType offset, const MagickSizeType span, void *userData) -{ - int error; - zend_fcall_info fci; - zend_fcall_info_cache fci_cache; - -#if PHP_VERSION_ID >= 70000 - zval zargs2; - zval retval; -#else - zval **zargs2; - zval *retval_ptr; -#endif - - //We can get the data both via the passed param and via - //IMAGICK_G(progress_callback) - this should be quicker - php_imagick_callback *callback = (php_imagick_callback*)userData; - - // This suppresses an 'unused parameter' warning. - // We could maybe use text. - (void)text; - -#if PHP_VERSION_ID >= 70000 && defined(ZTS) - if( NULL == tsrm_get_ls_cache() ) { - return MagickTrue; - } -#endif - -#if PHP_VERSION_ID < 70000 - TSRMLS_FETCH_FROM_CTX(callback->thread_ctx); -#endif - fci_cache = empty_fcall_info_cache; - - fci = empty_fcall_info; - fci.size = sizeof(fci); - -#if PHP_VERSION_ID < 70100 - fci.function_table = EG(function_table); -#endif -#if PHP_VERSION_ID >= 70000 - //fci.function_name = *callback->user_callback; - ZVAL_COPY_VALUE(&fci.function_name, &callback->user_callback); - fci.retval = &retval; -#else - retval_ptr = NULL; - fci.function_name = callback->user_callback; - fci.retval_ptr_ptr = &retval_ptr; -#endif - fci.param_count = 2; - fci.params = zargs; - -#if PHP_VERSION_ID >= 70000 - ZVAL_LONG(&zargs0, offset); - ZVAL_LONG(&zargs1, span); -#else - zargs0 = emalloc(sizeof(zval *)); - MAKE_STD_ZVAL(*zargs0); - ZVAL_LONG(*zargs0, offset); - - zargs1 = emalloc(sizeof(zval *)); - MAKE_STD_ZVAL(*zargs1); - ZVAL_LONG(*zargs1, span); -#endif - - error = zend_call_function(&fci, &fci_cache TSRMLS_CC); - - if (error == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred while invoking the callback"); - //Abort processing as user callback is no longer callable - return MagickFalse; - } -#if PHP_VERSION_ID >= 70000 - if (Z_TYPE(retval) == IS_FALSE) { - //User returned false - tell Imagick to abort processing. - return MagickFalse; - } -#else - zval_ptr_dtor(zargs0); - zval_ptr_dtor(zargs1); - - if (retval_ptr) { - if (Z_TYPE_P(retval_ptr) == IS_BOOL) { - if (Z_LVAL_P(retval_ptr) == 0) { - //User returned false - tell Imagick to abort processing. - return MagickFalse; - } - } - } -#endif - - return MagickTrue; -} - -/* This is not universally safe to use, but is safe enough for values that will - be encountered for image dimensions. -*/ -static inline double im_round_helper(double value) { - if (value >= 0.0) { - // Prevent zero width/height images - if (value < 1) { - return 1; - } - return floor(value + 0.5); - } else { - return ceil(value - 0.5); - } -} - - -zend_bool php_imagick_thumbnail_dimensions(MagickWand *magick_wand, zend_bool bestfit, im_long desired_width, im_long desired_height, im_long *new_width, im_long *new_height, zend_bool legacy) -{ - im_long orig_width, orig_height; - - orig_width = MagickGetImageWidth(magick_wand); - orig_height = MagickGetImageHeight(magick_wand); - - if ((orig_width == desired_width) && (orig_height == desired_height)) { - *new_width = desired_width; - *new_height = desired_height; - return 1; - } - - if (bestfit) { - double ratio_x, ratio_y; - - if (desired_width <= 0 || desired_height <= 0) { - return 0; - } - - ratio_x = (double) desired_width / (double) orig_width; - ratio_y = (double) desired_height / (double) orig_height; - - //in the case of square images there should be no rounding error - if (ratio_x == ratio_y) { - *new_width = desired_width; - *new_height = desired_height; - } else if (ratio_x < ratio_y) { - *new_width = desired_width; - if (legacy) { - *new_height = ratio_x * ((double) orig_height); - } - else { - *new_height = im_round_helper(ratio_x * ((double) orig_height)); - } - } else { - *new_height = desired_height; - if (legacy) { - *new_width = ratio_y * ((double) orig_width); - } - else { - *new_width = im_round_helper(ratio_y * ((double) orig_width)); - } - } - *new_width = (*new_width < 1) ? 1 : *new_width; - *new_height = (*new_height < 1) ? 1 : *new_height; - - } else { - double ratio; - - if (desired_width <= 0 && desired_height <= 0) { - return 0; - } - - if (desired_width <= 0 || desired_height <= 0) { - if (desired_width <= 0) { - ratio = (double) orig_height / (double) desired_height; - if (legacy) { - *new_width = ((double) orig_width) / ratio; - } - else { - *new_width = im_round_helper(((double) orig_width) / ratio); - } - *new_height = desired_height; - } else { - ratio = (double) orig_width / (double) desired_width; - if (legacy) { - *new_height = ((double) orig_height) / ratio; - } - else { - *new_height = im_round_helper(((double) orig_height) / ratio); - } - *new_width = desired_width; - } - } else { - *new_width = desired_width; - *new_height = desired_height; - } - } - return 1; -} - -zend_bool php_imagick_validate_map(const char *map TSRMLS_DC) -{ - zend_bool match; - const char *p = map; - char allow_map = { 'R', 'G', 'B', - 'A', 'O', 'C', - 'Y', 'M', 'K', - 'I', 'P' }; - - while (*p != '\0') { - char *it = allow_map; - match = 0; - while(*it != '\0') { - if (*(it++) == *p) { - match = 1; - break; - } - } - if (!match) { - return 0; - } - p++; - } - return 1; -} - -double *php_imagick_zval_to_double_array(zval *param_array, im_long *num_elements TSRMLS_DC) -{ - double *double_array; - long i = 0; - -#if PHP_VERSION_ID >= 70000 - zval *pzvalue; -#else - zval **ppzval; -#endif - - *num_elements = zend_hash_num_elements(Z_ARRVAL_P(param_array)); - - if (*num_elements == 0) { - return NULL; - } - - double_array = ecalloc(*num_elements, sizeof(double)); - -#if PHP_VERSION_ID >= 70000 - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(param_array), pzvalue) { - ZVAL_DEREF(pzvalue); - double_arrayi = zval_get_double(pzvalue); - i++; - } ZEND_HASH_FOREACH_END(); -#else - for (zend_hash_internal_pointer_reset(Z_ARRVAL_P(param_array)); - zend_hash_get_current_data(Z_ARRVAL_P(param_array), (void **) &ppzval) == SUCCESS; - zend_hash_move_forward(Z_ARRVAL_P(param_array)), i++) - { - zval tmp_zval, *tmp_pzval; - double value = 0.0; - - if (Z_TYPE_PP(ppzval) == IS_DOUBLE) { - value = Z_DVAL_PP(ppzval); - } - else { - tmp_zval = **ppzval; - zval_copy_ctor(&tmp_zval); - tmp_pzval = &tmp_zval; - convert_to_double(tmp_pzval); - - value = Z_DVAL_P(tmp_pzval); - zval_dtor (tmp_pzval); - } - double_arrayi = value; - } -#endif - return double_array; -} - -im_long *php_imagick_zval_to_long_array(zval *param_array, im_long *num_elements TSRMLS_DC) -{ - im_long *long_array; - im_long i = 0; - -#if PHP_VERSION_ID >= 70000 - zval *pzvalue; -#else - zval **ppzval; -#endif - - *num_elements = zend_hash_num_elements(Z_ARRVAL_P(param_array)); - - if (*num_elements == 0) { - return NULL; - } - - long_array = ecalloc(*num_elements, sizeof(im_long)); - -#if PHP_VERSION_ID >= 70000 - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(param_array), pzvalue) { - ZVAL_DEREF(pzvalue); - long_arrayi = zval_get_long(pzvalue); - i++; - } ZEND_HASH_FOREACH_END(); -#else - for (zend_hash_internal_pointer_reset(Z_ARRVAL_P(param_array)); - zend_hash_get_current_data(Z_ARRVAL_P(param_array), (void **) &ppzval) == SUCCESS; - zend_hash_move_forward(Z_ARRVAL_P(param_array)), i++) - { - zval tmp_zval, *tmp_pzval; - im_long value = 0; - - if (Z_TYPE_PP(ppzval) == IS_DOUBLE) { - value = Z_LVAL_PP(ppzval); - } - else { - tmp_zval = **ppzval; - zval_copy_ctor(&tmp_zval); - tmp_pzval = &tmp_zval; - convert_to_long(tmp_pzval); - - value = Z_LVAL_P(tmp_pzval); - zval_dtor (tmp_pzval); - } - long_arrayi = value; - } -#endif - - return long_array; -} - -unsigned char *php_imagick_zval_to_char_array(zval *param_array, im_long *num_elements TSRMLS_DC) -{ - unsigned char *char_array; - im_long i = 0; - -#if PHP_VERSION_ID >= 70000 - zval *pzvalue; -#else - zval **ppzval; -#endif - - *num_elements = zend_hash_num_elements(Z_ARRVAL_P(param_array)); - - if (*num_elements == 0) { - return NULL; - } - - char_array = ecalloc(*num_elements, sizeof(unsigned char)); - -#if PHP_VERSION_ID >= 70000 - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(param_array), pzvalue) { - ZVAL_DEREF(pzvalue); - char_arrayi = zval_get_long(pzvalue); - i++; - } ZEND_HASH_FOREACH_END(); -#else - for (zend_hash_internal_pointer_reset(Z_ARRVAL_P(param_array)); - zend_hash_get_current_data(Z_ARRVAL_P(param_array), (void **) &ppzval) == SUCCESS; - zend_hash_move_forward(Z_ARRVAL_P(param_array)), i++) - { - zval tmp_zval, *tmp_pzval; - im_long value = 0; - if (Z_TYPE_PP(ppzval) == IS_DOUBLE) { - value = Z_LVAL_PP(ppzval); - } - else { - tmp_zval = **ppzval; - zval_copy_ctor(&tmp_zval); - tmp_pzval = &tmp_zval; - convert_to_long(tmp_pzval); - - value = Z_LVAL_P(tmp_pzval); - zval_dtor (tmp_pzval); - } - char_arrayi = value; - } -#endif - - return char_array; -} - -zend_bool php_imagick_check_font(char *font, int font_len TSRMLS_DC) -{ - zend_bool retval = 0; - char **fonts; - unsigned long i = 0; - size_t num_fonts = 0; - - /* Check that user is only able to set a proper font */ - fonts = MagickQueryFonts("*", &num_fonts); - - for(i = 0 ; i < num_fonts ; i++) { - /* Let's see if the font is among configured fonts */ - if (strncasecmp(fontsi, font, font_len) == 0) { - retval = 1; - break; - } - } - - IMAGICK_FREE_MAGICK_MEMORY(fonts); - return retval; -} - -php_imagick_rw_result_t php_imagick_file_access_check (const char *filename TSRMLS_DC) -{ - if (strlen(filename) >= MAXPATHLEN) - return IMAGICK_RW_FILENAME_TOO_LONG; - -#if defined(CHECKUID_CHECK_FILE_AND_DIR) - if (PG(safe_mode) && (!php_checkuid_ex(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR, CHECKUID_NO_ERRORS))) - return IMAGICK_RW_SAFE_MODE_ERROR; -#endif - - if (php_check_open_basedir_ex(filename, 0 TSRMLS_CC)) - return IMAGICK_RW_OPEN_BASEDIR_ERROR; - - if (VCWD_ACCESS(filename, F_OK) != 0) - return IMAGICK_RW_PATH_DOES_NOT_EXIST; - - if (VCWD_ACCESS(filename, R_OK) != 0) - return IMAGICK_RW_PERMISSION_DENIED; - - return IMAGICK_RW_OK; -} - -static -void s_rw_fail_to_exception (php_imagick_rw_result_t rc, const char *filename TSRMLS_DC) -{ - switch (rc) { - - case IMAGICK_RW_SAFE_MODE_ERROR: - zend_throw_exception_ex(php_imagick_exception_class_entry, 1 TSRMLS_CC, "Safe mode restricts user to read the file: %s", filename); - break; - - case IMAGICK_RW_OPEN_BASEDIR_ERROR: - zend_throw_exception_ex(php_imagick_exception_class_entry, 1 TSRMLS_CC, "open_basedir restriction in effect. File(%s) is not within the allowed path(s)", filename); - break; - - case IMAGICK_RW_PERMISSION_DENIED: - zend_throw_exception_ex(php_imagick_exception_class_entry, 1 TSRMLS_CC, "Permission denied to: %s", filename); - break; - - case IMAGICK_RW_FILENAME_TOO_LONG: - zend_throw_exception_ex(php_imagick_exception_class_entry, 1 TSRMLS_CC, "Filename too long: %s", filename); - break; - - case IMAGICK_RW_PATH_DOES_NOT_EXIST: - zend_throw_exception_ex(php_imagick_exception_class_entry, 1 TSRMLS_CC, "The path does not exist: %s", filename); - break; - - case IMAGICK_RW_PATH_IS_DIR: - zend_throw_exception_ex(php_imagick_exception_class_entry, 1 TSRMLS_CC, "The path is a directory: %s", filename); - break; - - default: - zend_throw_exception_ex(php_imagick_exception_class_entry, 1 TSRMLS_CC, "Unknown error"); - break; - } -} - -void php_imagick_rw_fail_to_exception (MagickWand *magick_wand, php_imagick_rw_result_t rc, const char *filename TSRMLS_DC) -{ - if (rc == IMAGICK_RW_UNDERLYING_LIBRARY) { - php_imagick_convert_imagick_exception (magick_wand, "Failed to read the file" TSRMLS_CC); - return; - } - s_rw_fail_to_exception (rc, filename TSRMLS_CC); -} - -void php_imagick_imagickdraw_rw_fail_to_exception (DrawingWand *drawing_wand, php_imagick_rw_result_t rc, const char *filename TSRMLS_DC) -{ - if (rc == IMAGICK_RW_UNDERLYING_LIBRARY) { - php_imagick_convert_imagickdraw_exception (drawing_wand, "Failed to read the file" TSRMLS_CC); - return; - } - s_rw_fail_to_exception (rc, filename TSRMLS_CC); -} - - -PointInfo *php_imagick_zval_to_pointinfo_array(zval *coordinate_array, int *num_elements TSRMLS_DC) -{ - PointInfo *coordinates; - long elements, sub_elements, i; - HashTable *sub_array; - -#if PHP_VERSION_ID >= 70000 - zval *pzvalue; -#else - HashTable *coords; - zval **ppzval; -#endif - - i = 0; - - elements = zend_hash_num_elements(Z_ARRVAL_P(coordinate_array)); - - if (elements < 1) { - coordinates = (PointInfo *)NULL; - *num_elements = 0; - return coordinates; - } - - *num_elements = elements; - coordinates = emalloc(sizeof(PointInfo) * elements); - -#if PHP_VERSION_ID >= 70000 - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(coordinate_array), pzvalue) { - zval *pz_x, *pz_y; - ZVAL_DEREF(pzvalue); - - /* If its something than array lets error here */ - if(Z_TYPE_P(pzvalue) != IS_ARRAY) { - efree(coordinates); - *num_elements = 0; - return NULL; - } - - /* Subarray should have two elements. X and Y */ - sub_elements = zend_hash_num_elements(Z_ARRVAL_P(pzvalue)); - - /* Exactly two elements */ - if (sub_elements != 2) { - efree(coordinates); - *num_elements = 0; - return NULL; - } - - /* Subarray values */ - sub_array = Z_ARRVAL_P(pzvalue); - - /* Get X */ - if ((pz_x = zend_hash_str_find(sub_array, "x", sizeof("x")-1)) == NULL) { - efree(coordinates); - *num_elements = 0; - return NULL; - } - - /* Get Y */ - if ((pz_y = zend_hash_str_find(sub_array, "y", sizeof("y")-1)) == NULL) { - efree(coordinates); - *num_elements = 0; - return NULL; - } - - /* Assign X and Y */ - coordinatesi.x = zval_get_double(pz_x); - coordinatesi.y = zval_get_double(pz_y); - i++; - } ZEND_HASH_FOREACH_END(); - -#else - coords = Z_ARRVAL_P(coordinate_array); - zend_hash_internal_pointer_reset_ex(coords, (HashPosition *) 0); - - for (i = 0, zend_hash_internal_pointer_reset(coords); - zend_hash_get_current_data(coords, (void **) &ppzval) == SUCCESS; - zend_hash_move_forward(coords), i++ - ) { - zval **ppz_x, **ppz_y; - zval tmp_zx, *tmp_pzx, tmp_zy, *tmp_pzy; - - /* If its something than array lets error here */ - if(Z_TYPE_PP(ppzval) != IS_ARRAY) { - efree(coordinates); - *num_elements = 0; - return NULL; - } - - /* Subarray should have two elements. X and Y */ - sub_elements = zend_hash_num_elements(Z_ARRVAL_PP(ppzval)); - - /* Exactly two elements */ - if (sub_elements != 2) { - efree(coordinates); - *num_elements = 0; - return NULL; - } - - /* Subarray values */ - sub_array = Z_ARRVAL_PP(ppzval); - - /* Get X */ - if (zend_hash_find(sub_array, "x", sizeof("x"), (void**)&ppz_x) == FAILURE) { - efree(coordinates); - *num_elements = 0; - return NULL; - } - - tmp_zx = **ppz_x; - zval_copy_ctor(&tmp_zx); - tmp_pzx = &tmp_zx; - convert_to_double(tmp_pzx); - - /* Get Y */ - if (zend_hash_find(sub_array, "y", sizeof("y"), (void**)&ppz_y) == FAILURE) { - efree(coordinates); - *num_elements = 0; - return NULL; - } - - tmp_zy = **ppz_y; - zval_copy_ctor(&tmp_zy); - tmp_pzy = &tmp_zy; - convert_to_double(tmp_pzy); - - /* Assign X and Y */ - coordinatesi.x = Z_DVAL(tmp_zx); - coordinatesi.y = Z_DVAL(tmp_zy); - } -#endif - - return coordinates; -} - -void php_imagick_throw_exception (php_imagick_class_type_t type, const char *description TSRMLS_DC) -{ - int code; - zend_class_entry *ce = NULL; - - switch (type) { - case IMAGICK_CLASS: - default: - ce = php_imagick_exception_class_entry; - code = 1; - break; - - case IMAGICKDRAW_CLASS: - ce = php_imagickdraw_exception_class_entry; - code = 2; - break; - - case IMAGICKPIXELITERATOR_CLASS: - ce = php_imagickpixeliterator_exception_class_entry; - code = 3; - break; - - case IMAGICKPIXEL_CLASS: - ce = php_imagickpixel_exception_class_entry; - code = 4; - break; -#ifdef IMAGICK_WITH_KERNEL - case IMAGICKKERNEL_CLASS: - ce = php_imagickkernel_exception_class_entry; - code = 5; - break; -#endif - } - zend_throw_exception(ce, description, code TSRMLS_CC); -} - -static -void s_convert_exception (char *description, const char *default_message, long severity, int code TSRMLS_DC) -{ - // No description provided or empty one - if (!description || (strlen (description) == 0)) { - if (description) { - description = MagickRelinquishMemory (description); - } - zend_throw_exception(php_imagick_exception_class_entry, default_message, code TSRMLS_CC); - return; - } - zend_throw_exception(php_imagick_exception_class_entry, description, severity TSRMLS_CC); - MagickRelinquishMemory (description); -} - -/** - Convert ImageMagick MagickWand exception to PHP exception -*/ -void php_imagick_convert_imagick_exception (MagickWand *magick_wand, const char *default_message TSRMLS_DC) -{ - ExceptionType severity; - char *description; - - description = MagickGetException(magick_wand, &severity); - MagickClearException (magick_wand); - - s_convert_exception (description, default_message, severity, 1 TSRMLS_CC); -} - -void php_imagick_convert_imagickdraw_exception (DrawingWand *drawing_wand, const char *default_message TSRMLS_DC) -{ - ExceptionType severity; - char *description; - - description = DrawGetException(drawing_wand, &severity); - DrawClearException (drawing_wand); - - s_convert_exception (description, default_message, severity, 2 TSRMLS_CC); -} - -void php_imagick_convert_imagickpixeliterator_exception (PixelIterator *pixel_iterator, const char *default_message TSRMLS_DC) -{ - ExceptionType severity; - char *description; - - description = PixelGetIteratorException(pixel_iterator, &severity); - PixelClearIteratorException (pixel_iterator); - - s_convert_exception (description, default_message, severity, 3 TSRMLS_CC); -} - -void php_imagick_convert_imagickpixel_exception (PixelWand *pixel_wand, const char *default_message TSRMLS_DC) -{ - ExceptionType severity; - char *description; - - description = PixelGetException(pixel_wand, &severity); - PixelClearException (pixel_wand); - - s_convert_exception (description, default_message, severity, 4 TSRMLS_CC); -} - -PixelWand *php_imagick_zval_to_pixelwand (zval *param, php_imagick_class_type_t caller, zend_bool *allocated TSRMLS_DC) -{ - PixelWand *pixel_wand = NULL; - *allocated = 0; - -#if PHP_VERSION_ID >= 70000 - ZVAL_DEREF(param); -#endif - if (Z_TYPE_P (param) == IS_LONG || Z_TYPE_P (param) == IS_DOUBLE) { - zval var; - var = *param; - - zval_copy_ctor(&var); - convert_to_string(&var); - param = &var; - } - - switch (Z_TYPE_P(param)) { - case IS_STRING: - { - pixel_wand = NewPixelWand(); - if (!pixel_wand) { - zend_error(E_ERROR, "Failed to allocate PixelWand structure"); - } - *allocated = 1; - - if (PixelSetColor (pixel_wand, Z_STRVAL_P(param)) == MagickFalse) { - pixel_wand = DestroyPixelWand(pixel_wand); - php_imagick_throw_exception (caller, "Unrecognized color string" TSRMLS_CC); - return NULL; - } - } - break; - - case IS_OBJECT: - if (instanceof_function(Z_OBJCE_P(param), php_imagickpixel_sc_entry TSRMLS_CC)) { - php_imagickpixel_object *intern = Z_IMAGICKPIXEL_P(param); - pixel_wand = intern->pixel_wand; - } else - php_imagick_throw_exception(caller, "The parameter must be an instance of ImagickPixel or a string" TSRMLS_CC); - break; - - default: - php_imagick_throw_exception(caller, "Invalid color parameter provided" TSRMLS_CC); - } - return pixel_wand; -} - -PixelWand *php_imagick_zval_to_opacity (zval *param, php_imagick_class_type_t caller, zend_bool *allocated TSRMLS_DC) -{ - PixelWand *pixel_wand = NULL; - *allocated = 0; - -#if PHP_VERSION_ID >= 70000 - ZVAL_DEREF(param); -#endif - if (Z_TYPE_P (param) == IS_STRING) { - zval var; - var = *param; - - zval_copy_ctor(&var); - convert_to_double(&var); - param = &var; - } - - switch (Z_TYPE_P(param)) { - case IS_LONG: - case IS_DOUBLE: - { - pixel_wand = NewPixelWand(); - if (!pixel_wand) { - zend_error(E_ERROR, "Failed to allocate PixelWand structure"); - } -#if MagickLibVersion >= 0x700 - //TOOD - this should be one minus? Or should we just make a BC break - // and make users do it in user land? - PixelSetAlpha(pixel_wand, Z_DVAL_P(param)); -#else - PixelSetOpacity(pixel_wand, Z_DVAL_P(param)); -#endif - *allocated = 1; - } - break; - - case IS_OBJECT: - if (instanceof_function(Z_OBJCE_P(param), php_imagickpixel_sc_entry TSRMLS_CC)) { - php_imagickpixel_object *intern = Z_IMAGICKPIXEL_P(param); - pixel_wand = intern->pixel_wand; - } else - php_imagick_throw_exception(caller, "The parameter must be an instance of ImagickPixel or a string" TSRMLS_CC); - break; - - default: - php_imagick_throw_exception(caller, "Invalid color parameter provided" TSRMLS_CC); - } - return pixel_wand; -} - -/** - * Changes the locale to IMAGICK_LC_NUMERIC_LOCALE if imagick.locale_fix is on - * and returns the locale set before calling this function. - * If locale is not changed, NULL is returned - * - */ -char *php_imagick_set_locale (TSRMLS_D) -{ - char *current_locale; - - if (!IMAGICK_G(locale_fix)) - return NULL; - - current_locale = setlocale(LC_NUMERIC, NULL); - if (current_locale != NULL) { - if (strcmp (current_locale, IMAGICK_LC_NUMERIC_LOCALE) != 0) { - setlocale (LC_NUMERIC, IMAGICK_LC_NUMERIC_LOCALE); - return estrdup (current_locale); - } - } - return NULL; -} - -void php_imagick_restore_locale (const char *old_locale) -{ - if (!old_locale) - return; - - if (strcmp (old_locale, IMAGICK_LC_NUMERIC_LOCALE) != 0) - setlocale (LC_NUMERIC, old_locale); -} - -PixelWand *php_imagick_clone_pixelwand (PixelWand *source) -{ -#if MagickLibVersion >= 0x635 - return ClonePixelWand(source); -#else - PixelWand *target = NewPixelWand (); - if (!target) - return NULL; - - PixelSetColorCount (target, PixelGetColorCount (source)); - PixelSetRed (target, PixelGetRed (source)); - PixelSetGreen (target, PixelGetGreen (source)); - PixelSetBlue (target, PixelGetBlue (source)); - PixelSetOpacity (target, PixelGetOpacity (source)); - PixelSetAlpha (target, PixelGetAlpha (source)); - - return target; -#endif -} - -void php_imagick_replace_magickwand (php_imagick_object *obj, MagickWand *new_wand) -{ - if (!obj->magick_wand) - obj->magick_wand = new_wand; - else { - obj->magick_wand = DestroyMagickWand(obj->magick_wand); - obj->magick_wand = new_wand; - } -} - -void php_imagick_replace_drawingwand (php_imagickdraw_object *obj, DrawingWand *new_wand) -{ - if (!obj->drawing_wand) - obj->drawing_wand = new_wand; - else { - obj->drawing_wand = DestroyDrawingWand(obj->drawing_wand); - obj->drawing_wand = new_wand; - } -} - -void php_imagick_replace_pixelwand (php_imagickpixel_object *obj, PixelWand *new_wand) -{ - if (obj->pixel_wand && obj->initialized_via_iterator != 1) { - obj->pixel_wand = DestroyPixelWand(obj->pixel_wand); - obj->pixel_wand = new_wand; - } else - obj->pixel_wand = new_wand; -} - -zend_bool php_imagick_ensure_not_empty (MagickWand *magick_wand) -{ - if (MagickGetNumberImages(magick_wand) == 0) { - TSRMLS_FETCH (); - php_imagick_throw_exception (IMAGICK_CLASS, "Can not process empty Imagick object" TSRMLS_CC); - return 0; - } - return 1; -} - -zend_bool php_imagickpixel_ensure_not_null(PixelWand *pixel_wand) -{ - if (pixel_wand == NULL) { - TSRMLS_FETCH (); - php_imagick_throw_exception (IMAGICKPIXEL_CLASS, "Can not process empty ImagickPixel object" TSRMLS_CC); - return 0; - } - return 1; -} - -void php_imagick_initialize_constants(TSRMLS_D) -{ -#define IMAGICK_REGISTER_CONST_LONG(const_name, value)\ - zend_declare_class_constant_long(php_imagick_sc_entry, const_name, sizeof(const_name)-1, (long)value TSRMLS_CC); - -#define IMAGICK_REGISTER_CONST_STRING(const_name, value)\ - zend_declare_class_constant_string(php_imagick_sc_entry, const_name, sizeof(const_name)-1, value TSRMLS_CC); - - /* Constants defined in php_imagick.h */ - IMAGICK_REGISTER_CONST_LONG("COLOR_BLACK", PHP_IMAGICK_COLOR_BLACK); - IMAGICK_REGISTER_CONST_LONG("COLOR_BLUE", PHP_IMAGICK_COLOR_BLUE); - IMAGICK_REGISTER_CONST_LONG("COLOR_CYAN", PHP_IMAGICK_COLOR_CYAN); - IMAGICK_REGISTER_CONST_LONG("COLOR_GREEN", PHP_IMAGICK_COLOR_GREEN); - IMAGICK_REGISTER_CONST_LONG("COLOR_RED", PHP_IMAGICK_COLOR_RED); - IMAGICK_REGISTER_CONST_LONG("COLOR_YELLOW", PHP_IMAGICK_COLOR_YELLOW); - IMAGICK_REGISTER_CONST_LONG("COLOR_MAGENTA", PHP_IMAGICK_COLOR_MAGENTA); -#if MagickLibVersion < 0x700 - IMAGICK_REGISTER_CONST_LONG("COLOR_OPACITY", PHP_IMAGICK_COLOR_OPACITY); -#endif - IMAGICK_REGISTER_CONST_LONG("COLOR_ALPHA", PHP_IMAGICK_COLOR_ALPHA); - IMAGICK_REGISTER_CONST_LONG("COLOR_FUZZ", PHP_IMAGICK_COLOR_FUZZ); - - /* Returning the version as a constant string */ - IMAGICK_REGISTER_CONST_LONG("IMAGICK_EXTNUM", PHP_IMAGICK_EXTNUM); - IMAGICK_REGISTER_CONST_STRING("IMAGICK_EXTVER", PHP_IMAGICK_VERSION); - -#if defined(MagickQuantumRange) - IMAGICK_REGISTER_CONST_LONG("QUANTUM_RANGE", atoi (MagickQuantumRange)); -#endif - - /* Are we using PHP allocations */ -#ifdef PHP_IMAGICK_ZEND_MM - IMAGICK_REGISTER_CONST_LONG("USE_ZEND_MM", 1); -#else - IMAGICK_REGISTER_CONST_LONG("USE_ZEND_MM", 0); -#endif - - /* ImageMagick defined constants */ - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_DEFAULT", OverCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_UNDEFINED", UndefinedCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_NO", NoCompositeOp); -#if MagickLibVersion < 0x700 - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_ADD", AddCompositeOp); -#endif - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_ATOP", AtopCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_BLEND", BlendCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_BUMPMAP", BumpmapCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_CLEAR", ClearCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_COLORBURN", ColorBurnCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_COLORDODGE", ColorDodgeCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_COLORIZE", ColorizeCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_COPYBLACK", CopyBlackCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_COPYBLUE", CopyBlueCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_COPY", CopyCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_COPYCYAN", CopyCyanCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_COPYGREEN", CopyGreenCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_COPYMAGENTA", CopyMagentaCompositeOp); -#if MagickLibVersion >= 0x700 - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_COPYALPHA", CopyAlphaCompositeOp); - //TOOD - is this semantically correct? - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_COPYOPACITY", CopyAlphaCompositeOp); -#else - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_COPYOPACITY", CopyOpacityCompositeOp); -#endif - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_COPYRED", CopyRedCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_COPYYELLOW", CopyYellowCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_DARKEN", DarkenCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_DSTATOP", DstAtopCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_DST", DstCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_DSTIN", DstInCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_DSTOUT", DstOutCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_DSTOVER", DstOverCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_DIFFERENCE", DifferenceCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_DISPLACE", DisplaceCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_DISSOLVE", DissolveCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_EXCLUSION", ExclusionCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_HARDLIGHT", HardLightCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_HUE", HueCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_IN", InCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_LIGHTEN", LightenCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_LUMINIZE", LuminizeCompositeOp); -#if MagickLibVersion < 0x700 - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_MINUS", MinusCompositeOp); -#endif - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_MODULATE", ModulateCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_MULTIPLY", MultiplyCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_OUT", OutCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_OVER", OverCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_OVERLAY", OverlayCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_PLUS", PlusCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_REPLACE", ReplaceCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_SATURATE", SaturateCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_SCREEN", ScreenCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_SOFTLIGHT", SoftLightCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_SRCATOP", SrcAtopCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_SRC", SrcCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_SRCIN", SrcInCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_SRCOUT", SrcOutCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_SRCOVER", SrcOverCompositeOp); -#if MagickLibVersion < 0x700 - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_SUBTRACT", SubtractCompositeOp); -#endif - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_THRESHOLD", ThresholdCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_XOR", XorCompositeOp); -#if MagickLibVersion >= 0x634 - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_CHANGEMASK", ChangeMaskCompositeOp); -#endif -#if MagickLibVersion >= 0x636 - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_LINEARLIGHT", LinearLightCompositeOp); -#if MagickLibVersion < 0x700 - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_DIVIDE", DivideCompositeOp); -#endif -#endif -#if MagickLibVersion >= 0x654 - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_DISTORT", DistortCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_BLUR", BlurCompositeOp); -#endif -#if MagickLibVersion >= 0x655 - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_PEGTOPLIGHT", PegtopLightCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_VIVIDLIGHT", VividLightCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_PINLIGHT", PinLightCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_LINEARDODGE", LinearDodgeCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_LINEARBURN", LinearBurnCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_MATHEMATICS", MathematicsCompositeOp); -#endif -#if MagickLibVersion >= 0x662 - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_MODULUSADD", ModulusAddCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_MODULUSSUBTRACT", ModulusSubtractCompositeOp); -#endif -#if MagickLibVersion >= 0x670 - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_MINUSDST", MinusDstCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_DIVIDEDST", DivideDstCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_DIVIDESRC", DivideSrcCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_MINUSSRC", MinusSrcCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_DARKENINTENSITY", DarkenIntensityCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_LIGHTENINTENSITY", LightenIntensityCompositeOp); -#endif -#if MagickLibVersion >= 0x690 - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_HARDMIX", HardMixCompositeOp); -#endif - -#if (MagickLibVersion >= 0x700 && MagickLibVersion >= 0x708) || (MagickLibVersion < 0x700 && MagickLibVersion >= 0x69A) - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_STEREO", StereoCompositeOp); -#endif - -#if MagickLibVersion >= 0x70A - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_FREEZE", FreezeCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_INTERPOLATE", InterpolateCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_NEGATE", NegateCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_REFLECT", ReflectCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_SOFTBURN", SoftBurnCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_SOFTDODGE", SoftDodgeCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_STAMP", StampCompositeOp); -#endif - -#if MagickLibVersion >= 0x70B - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_RMSE", RMSECompositeOp); -#endif - -#if MagickLibVersion >= 0x711 - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_SALIENCY_BLEND", SaliencyBlendCompositeOp); - IMAGICK_REGISTER_CONST_LONG("COMPOSITE_SEAMLESS_BLEND", SeamlessBlendCompositeOp); -#endif - - IMAGICK_REGISTER_CONST_LONG("MONTAGEMODE_FRAME", FrameMode); - IMAGICK_REGISTER_CONST_LONG("MONTAGEMODE_UNFRAME", UnframeMode); - IMAGICK_REGISTER_CONST_LONG("MONTAGEMODE_CONCATENATE", ConcatenateMode); - IMAGICK_REGISTER_CONST_LONG("STYLE_NORMAL", NormalStyle); - IMAGICK_REGISTER_CONST_LONG("STYLE_ITALIC", ItalicStyle); - IMAGICK_REGISTER_CONST_LONG("STYLE_OBLIQUE", ObliqueStyle); - IMAGICK_REGISTER_CONST_LONG("STYLE_ANY", AnyStyle); -#if (MagickLibVersion >= 0x700 && MagickLibVersion >= 0x709) || (MagickLibVersion < 0x700 && MagickLibVersion >= 0x69B) - IMAGICK_REGISTER_CONST_LONG("STYLE_BOLD", BoldStyle); -#endif - - IMAGICK_REGISTER_CONST_LONG("FILTER_UNDEFINED", UndefinedFilter); - IMAGICK_REGISTER_CONST_LONG("FILTER_POINT", PointFilter); - IMAGICK_REGISTER_CONST_LONG("FILTER_BOX", BoxFilter); - IMAGICK_REGISTER_CONST_LONG("FILTER_TRIANGLE", TriangleFilter); - IMAGICK_REGISTER_CONST_LONG("FILTER_HERMITE", HermiteFilter); -#if MagickLibVersion >= 0x701 - IMAGICK_REGISTER_CONST_LONG("FILTER_HANNING", HannFilter); - IMAGICK_REGISTER_CONST_LONG("FILTER_HANN", HannFilter); -#else - IMAGICK_REGISTER_CONST_LONG("FILTER_HANNING", HanningFilter); -#endif - IMAGICK_REGISTER_CONST_LONG("FILTER_HAMMING", HammingFilter); - IMAGICK_REGISTER_CONST_LONG("FILTER_BLACKMAN", BlackmanFilter); - IMAGICK_REGISTER_CONST_LONG("FILTER_GAUSSIAN", GaussianFilter); - IMAGICK_REGISTER_CONST_LONG("FILTER_QUADRATIC", QuadraticFilter); - IMAGICK_REGISTER_CONST_LONG("FILTER_CUBIC", CubicFilter); - IMAGICK_REGISTER_CONST_LONG("FILTER_CATROM", CatromFilter); - IMAGICK_REGISTER_CONST_LONG("FILTER_MITCHELL", MitchellFilter); - IMAGICK_REGISTER_CONST_LONG("FILTER_LANCZOS", LanczosFilter); - IMAGICK_REGISTER_CONST_LONG("FILTER_BESSEL", BesselFilter); - IMAGICK_REGISTER_CONST_LONG("FILTER_SINC", SincFilter); -#if MagickLibVersion >= 0x637 - IMAGICK_REGISTER_CONST_LONG("FILTER_KAISER", KaiserFilter); -#if MagickLibVersion >= 0x701 - IMAGICK_REGISTER_CONST_LONG("FILTER_WELSH", WelshFilter); - IMAGICK_REGISTER_CONST_LONG("FILTER_WELCH", WelchFilter); -#else - IMAGICK_REGISTER_CONST_LONG("FILTER_WELSH", WelshFilter); -#endif - IMAGICK_REGISTER_CONST_LONG("FILTER_PARZEN", ParzenFilter); - IMAGICK_REGISTER_CONST_LONG("FILTER_LAGRANGE", LagrangeFilter); - IMAGICK_REGISTER_CONST_LONG("FILTER_SENTINEL", SentinelFilter); -#endif -#if MagickLibVersion >= 0x638 - IMAGICK_REGISTER_CONST_LONG("FILTER_BOHMAN", BohmanFilter); - IMAGICK_REGISTER_CONST_LONG("FILTER_BARTLETT", BartlettFilter); -#endif -#if MagickLibVersion >= 0x666 - IMAGICK_REGISTER_CONST_LONG("FILTER_JINC", JincFilter); - IMAGICK_REGISTER_CONST_LONG("FILTER_SINCFAST", SincFastFilter); - IMAGICK_REGISTER_CONST_LONG("FILTER_ROBIDOUX", RobidouxFilter); - IMAGICK_REGISTER_CONST_LONG("FILTER_LANCZOSSHARP", LanczosSharpFilter); - IMAGICK_REGISTER_CONST_LONG("FILTER_LANCZOS2", Lanczos2Filter); - IMAGICK_REGISTER_CONST_LONG("FILTER_LANCZOS2SHARP", Lanczos2SharpFilter); -#endif -#if MagickLibVersion >= 0x677 - IMAGICK_REGISTER_CONST_LONG("FILTER_ROBIDOUXSHARP", RobidouxSharpFilter); - IMAGICK_REGISTER_CONST_LONG("FILTER_COSINE", CosineFilter); -#endif -#if MagickLibVersion >= 0x678 - IMAGICK_REGISTER_CONST_LONG("FILTER_SPLINE", SplineFilter); -#endif -#if MagickLibVersion >= 0x681 - IMAGICK_REGISTER_CONST_LONG("FILTER_LANCZOSRADIUS", LanczosRadiusFilter); -#endif -#if MagickLibVersion >= 0x707 - IMAGICK_REGISTER_CONST_LONG("FILTER_CUBIC_SPLINE", CubicSplineFilter); -#endif - IMAGICK_REGISTER_CONST_LONG("IMGTYPE_UNDEFINED", UndefinedType); - IMAGICK_REGISTER_CONST_LONG("IMGTYPE_BILEVEL", BilevelType); - IMAGICK_REGISTER_CONST_LONG("IMGTYPE_GRAYSCALE", GrayscaleType); -#if MagickLibVersion < 0x700 - IMAGICK_REGISTER_CONST_LONG("IMGTYPE_GRAYSCALEMATTE", GrayscaleMatteType); -#else - IMAGICK_REGISTER_CONST_LONG("IMGTYPE_GRAYSCALEALPHA", GrayscaleAlphaType); - //@TODO - this is only here for legacy support - IMAGICK_REGISTER_CONST_LONG("IMGTYPE_GRAYSCALEMATTE", GrayscaleAlphaType); -#endif - IMAGICK_REGISTER_CONST_LONG("IMGTYPE_PALETTE", PaletteType); -#if MagickLibVersion < 0x700 - IMAGICK_REGISTER_CONST_LONG("IMGTYPE_PALETTEMATTE", PaletteMatteType); -#else - IMAGICK_REGISTER_CONST_LONG("IMGTYPE_PALETTEMATTE", PaletteAlphaType); - //@TODO - this is only here for legacy support - IMAGICK_REGISTER_CONST_LONG("IMGTYPE_PALETTEALPHA", PaletteAlphaType); -#endif - IMAGICK_REGISTER_CONST_LONG("IMGTYPE_TRUECOLOR", TrueColorType); -#if MagickLibVersion < 0x700 - IMAGICK_REGISTER_CONST_LONG("IMGTYPE_TRUECOLORMATTE", TrueColorMatteType); -#else - IMAGICK_REGISTER_CONST_LONG("IMGTYPE_TRUECOLORALPHA", TrueColorAlphaType); - //@TODO - this is only here for legacy support - IMAGICK_REGISTER_CONST_LONG("IMGTYPE_TRUECOLORMATTE", TrueColorAlphaType); - -#endif - IMAGICK_REGISTER_CONST_LONG("IMGTYPE_COLORSEPARATION", ColorSeparationType); -#if MagickLibVersion < 0x700 - IMAGICK_REGISTER_CONST_LONG("IMGTYPE_COLORSEPARATIONMATTE", ColorSeparationMatteType); -#else - IMAGICK_REGISTER_CONST_LONG("IMGTYPE_COLORSEPARATIONALPHA", ColorSeparationAlphaType); - //@TODO - this is only here for legacy support - IMAGICK_REGISTER_CONST_LONG("IMGTYPE_COLORSEPARATIONMATTE", ColorSeparationAlphaType); -#endif - IMAGICK_REGISTER_CONST_LONG("IMGTYPE_OPTIMIZE", OptimizeType); -#if MagickLibVersion < 0x700 - IMAGICK_REGISTER_CONST_LONG("IMGTYPE_PALETTEBILEVELMATTE", PaletteBilevelMatteType); -#else - IMAGICK_REGISTER_CONST_LONG("IMGTYPE_PALETTEBILEVELALPHA", PaletteBilevelAlphaType); - //@TODO - this is only here for legacy support - IMAGICK_REGISTER_CONST_LONG("IMGTYPE_PALETTEBILEVELMATTE", PaletteBilevelAlphaType); -#endif - IMAGICK_REGISTER_CONST_LONG("RESOLUTION_UNDEFINED", UndefinedResolution); - IMAGICK_REGISTER_CONST_LONG("RESOLUTION_PIXELSPERINCH", PixelsPerInchResolution); - IMAGICK_REGISTER_CONST_LONG("RESOLUTION_PIXELSPERCENTIMETER", PixelsPerCentimeterResolution); - IMAGICK_REGISTER_CONST_LONG("COMPRESSION_UNDEFINED", UndefinedCompression); - IMAGICK_REGISTER_CONST_LONG("COMPRESSION_NO", NoCompression); - IMAGICK_REGISTER_CONST_LONG("COMPRESSION_BZIP", BZipCompression); - IMAGICK_REGISTER_CONST_LONG("COMPRESSION_FAX", FaxCompression); - IMAGICK_REGISTER_CONST_LONG("COMPRESSION_GROUP4", Group4Compression); - IMAGICK_REGISTER_CONST_LONG("COMPRESSION_JPEG", JPEGCompression); - IMAGICK_REGISTER_CONST_LONG("COMPRESSION_JPEG2000", JPEG2000Compression); - IMAGICK_REGISTER_CONST_LONG("COMPRESSION_LOSSLESSJPEG", LosslessJPEGCompression); - IMAGICK_REGISTER_CONST_LONG("COMPRESSION_LZW", LZWCompression); - IMAGICK_REGISTER_CONST_LONG("COMPRESSION_RLE", RLECompression); - IMAGICK_REGISTER_CONST_LONG("COMPRESSION_ZIP", ZipCompression); -#if MagickLibVersion > 0x639 - IMAGICK_REGISTER_CONST_LONG("COMPRESSION_DXT1", DXT1Compression); - IMAGICK_REGISTER_CONST_LONG("COMPRESSION_DXT3", DXT3Compression); - IMAGICK_REGISTER_CONST_LONG("COMPRESSION_DXT5", DXT5Compression); -#endif -#if MagickLibVersion >= 0x656 - IMAGICK_REGISTER_CONST_LONG("COMPRESSION_ZIPS", ZipSCompression); - IMAGICK_REGISTER_CONST_LONG("COMPRESSION_PIZ", PizCompression); - IMAGICK_REGISTER_CONST_LONG("COMPRESSION_PXR24", Pxr24Compression); - IMAGICK_REGISTER_CONST_LONG("COMPRESSION_B44", B44Compression); - IMAGICK_REGISTER_CONST_LONG("COMPRESSION_B44A", B44ACompression); -#endif -#if MagickLibVersion >= 0x667 - IMAGICK_REGISTER_CONST_LONG("COMPRESSION_LZMA", LZMACompression); -#endif -#if MagickLibVersion >= 0x670 - IMAGICK_REGISTER_CONST_LONG("COMPRESSION_JBIG1", JBIG1Compression); - IMAGICK_REGISTER_CONST_LONG("COMPRESSION_JBIG2", JBIG2Compression); -#endif - -#if MagickLibVersion >= 0x709 - IMAGICK_REGISTER_CONST_LONG("COMPRESSION_ZSTD", ZstdCompression); - IMAGICK_REGISTER_CONST_LONG("COMPRESSION_WEBP", WebPCompression); -#endif - -#if MagickLibVersion >= 0x70C - IMAGICK_REGISTER_CONST_LONG("COMPRESSION_DWAA", DWAACompression); - IMAGICK_REGISTER_CONST_LONG("COMPRESSION_DWAB", DWABCompression); -#endif - -#if MagickLibVersion >= 0x711 - // Technically >= 7.1.0-13 but we still don't have a mechanism for - // detecting patch versions. - IMAGICK_REGISTER_CONST_LONG("COMPRESSION_BC7", BC7Compression); -#endif - - IMAGICK_REGISTER_CONST_LONG("PAINT_POINT", PointMethod); - IMAGICK_REGISTER_CONST_LONG("PAINT_REPLACE", ReplaceMethod); - IMAGICK_REGISTER_CONST_LONG("PAINT_FLOODFILL", FloodfillMethod); - IMAGICK_REGISTER_CONST_LONG("PAINT_FILLTOBORDER", FillToBorderMethod); - IMAGICK_REGISTER_CONST_LONG("PAINT_RESET", ResetMethod); - IMAGICK_REGISTER_CONST_LONG("GRAVITY_NORTHWEST", NorthWestGravity); - IMAGICK_REGISTER_CONST_LONG("GRAVITY_NORTH", NorthGravity); - IMAGICK_REGISTER_CONST_LONG("GRAVITY_NORTHEAST", NorthEastGravity); - IMAGICK_REGISTER_CONST_LONG("GRAVITY_WEST", WestGravity); - IMAGICK_REGISTER_CONST_LONG("GRAVITY_CENTER", CenterGravity); - IMAGICK_REGISTER_CONST_LONG("GRAVITY_EAST", EastGravity); - IMAGICK_REGISTER_CONST_LONG("GRAVITY_SOUTHWEST", SouthWestGravity); - IMAGICK_REGISTER_CONST_LONG("GRAVITY_SOUTH", SouthGravity); - IMAGICK_REGISTER_CONST_LONG("GRAVITY_SOUTHEAST", SouthEastGravity); - IMAGICK_REGISTER_CONST_LONG("GRAVITY_FORGET", ForgetGravity); -#if MagickLibVersion < 0x700 - IMAGICK_REGISTER_CONST_LONG("GRAVITY_STATIC", StaticGravity); -#endif - - IMAGICK_REGISTER_CONST_LONG("STRETCH_NORMAL", NormalStretch); - IMAGICK_REGISTER_CONST_LONG("STRETCH_ULTRACONDENSED", UltraCondensedStretch); - IMAGICK_REGISTER_CONST_LONG("STRETCH_EXTRACONDENSED", ExtraCondensedStretch); - IMAGICK_REGISTER_CONST_LONG("STRETCH_CONDENSED", CondensedStretch); - IMAGICK_REGISTER_CONST_LONG("STRETCH_SEMICONDENSED", SemiCondensedStretch); - IMAGICK_REGISTER_CONST_LONG("STRETCH_SEMIEXPANDED", SemiExpandedStretch); - IMAGICK_REGISTER_CONST_LONG("STRETCH_EXPANDED", ExpandedStretch); - IMAGICK_REGISTER_CONST_LONG("STRETCH_EXTRAEXPANDED", ExtraExpandedStretch); - IMAGICK_REGISTER_CONST_LONG("STRETCH_ULTRAEXPANDED", UltraExpandedStretch); - IMAGICK_REGISTER_CONST_LONG("STRETCH_ANY", AnyStretch); - IMAGICK_REGISTER_CONST_LONG("ALIGN_UNDEFINED", UndefinedAlign); - IMAGICK_REGISTER_CONST_LONG("ALIGN_LEFT", LeftAlign); - IMAGICK_REGISTER_CONST_LONG("ALIGN_CENTER", CenterAlign); - IMAGICK_REGISTER_CONST_LONG("ALIGN_RIGHT", RightAlign); - IMAGICK_REGISTER_CONST_LONG("DECORATION_NO", NoDecoration); - IMAGICK_REGISTER_CONST_LONG("DECORATION_UNDERLINE", UnderlineDecoration); - IMAGICK_REGISTER_CONST_LONG("DECORATION_OVERLINE", OverlineDecoration); - IMAGICK_REGISTER_CONST_LONG("DECORATION_LINETROUGH", LineThroughDecoration); //TODO remove? - IMAGICK_REGISTER_CONST_LONG("DECORATION_LINETHROUGH", LineThroughDecoration); - IMAGICK_REGISTER_CONST_LONG("NOISE_UNIFORM", UniformNoise); - IMAGICK_REGISTER_CONST_LONG("NOISE_GAUSSIAN", GaussianNoise); - IMAGICK_REGISTER_CONST_LONG("NOISE_MULTIPLICATIVEGAUSSIAN", MultiplicativeGaussianNoise); - IMAGICK_REGISTER_CONST_LONG("NOISE_IMPULSE", ImpulseNoise); - IMAGICK_REGISTER_CONST_LONG("NOISE_LAPLACIAN", LaplacianNoise); - IMAGICK_REGISTER_CONST_LONG("NOISE_POISSON", PoissonNoise); -#if MagickLibVersion > 0x635 - IMAGICK_REGISTER_CONST_LONG("NOISE_RANDOM", RandomNoise); -#endif - IMAGICK_REGISTER_CONST_LONG("CHANNEL_UNDEFINED", UndefinedChannel); - IMAGICK_REGISTER_CONST_LONG("CHANNEL_RED", RedChannel); - IMAGICK_REGISTER_CONST_LONG("CHANNEL_GRAY", GrayChannel); - IMAGICK_REGISTER_CONST_LONG("CHANNEL_CYAN", CyanChannel); - IMAGICK_REGISTER_CONST_LONG("CHANNEL_GREEN", GreenChannel); - IMAGICK_REGISTER_CONST_LONG("CHANNEL_MAGENTA", MagentaChannel); - IMAGICK_REGISTER_CONST_LONG("CHANNEL_BLUE", BlueChannel); - IMAGICK_REGISTER_CONST_LONG("CHANNEL_YELLOW", YellowChannel); - IMAGICK_REGISTER_CONST_LONG("CHANNEL_ALPHA", AlphaChannel); - IMAGICK_REGISTER_CONST_LONG("CHANNEL_OPACITY", OpacityChannel); -#if MagickLibVersion < 0x700 - IMAGICK_REGISTER_CONST_LONG("CHANNEL_MATTE", MatteChannel); /* deprecated, needs to throw E_STRICT if used */ -#endif - IMAGICK_REGISTER_CONST_LONG("CHANNEL_BLACK", BlackChannel); - IMAGICK_REGISTER_CONST_LONG("CHANNEL_INDEX", IndexChannel); - IMAGICK_REGISTER_CONST_LONG("CHANNEL_ALL", AllChannels); - IMAGICK_REGISTER_CONST_LONG("CHANNEL_DEFAULT", DefaultChannels); - IMAGICK_REGISTER_CONST_LONG("CHANNEL_RGBA", RedChannel | GreenChannel | BlueChannel | AlphaChannel); -#if MagickLibVersion >= 0x644 - IMAGICK_REGISTER_CONST_LONG("CHANNEL_TRUEALPHA", TrueAlphaChannel); - IMAGICK_REGISTER_CONST_LONG("CHANNEL_RGBS", RGBChannels); -#endif -#if MagickLibVersion >= 0x655 - IMAGICK_REGISTER_CONST_LONG("CHANNEL_GRAY_CHANNELS", GrayChannels); -#endif -#if MagickLibVersion >= 0x656 - IMAGICK_REGISTER_CONST_LONG("CHANNEL_SYNC", SyncChannels); -#endif - -#if MagickLibVersion >= 0x700 - IMAGICK_REGISTER_CONST_LONG("CHANNEL_READ_MASK", ReadMaskChannel); /* Pixel is Not Readable? */ - IMAGICK_REGISTER_CONST_LONG("CHANNEL_WRITE_MASK", WriteMaskChannel); /* Pixel is Write Protected? */ - IMAGICK_REGISTER_CONST_LONG("CHANNEL_META", MetaChannel); /* ???? */ -#endif - -#if MagickLibVersion >= 0x708 - IMAGICK_REGISTER_CONST_LONG("CHANNEL_COMPOSITE_MASK", CompositeMaskChannel); /* SVG mask */ -#endif - -#if MagickLibVersion >= 0x670 - IMAGICK_REGISTER_CONST_LONG("CHANNEL_COMPOSITES", CompositeChannels); -#endif -#if MagickLibVersion < 0x700 - IMAGICK_REGISTER_CONST_LONG("METRIC_UNDEFINED", UndefinedMetric); -#endif - IMAGICK_REGISTER_CONST_LONG("METRIC_ABSOLUTEERRORMETRIC", AbsoluteErrorMetric); - IMAGICK_REGISTER_CONST_LONG("METRIC_MEANABSOLUTEERROR", MeanAbsoluteErrorMetric); -#if MagickLibVersion < 0x700 - IMAGICK_REGISTER_CONST_LONG("METRIC_MEANERRORPERPIXELMETRIC", MeanErrorPerPixelMetric); -#else - IMAGICK_REGISTER_CONST_LONG("METRIC_MEANERRORPERPIXELMETRIC", MeanErrorPerPixelErrorMetric); -#endif - - IMAGICK_REGISTER_CONST_LONG("METRIC_MEANSQUAREERROR", MeanSquaredErrorMetric); - IMAGICK_REGISTER_CONST_LONG("METRIC_PEAKABSOLUTEERROR", PeakAbsoluteErrorMetric); -#if MagickLibVersion < 0x700 - IMAGICK_REGISTER_CONST_LONG("METRIC_PEAKSIGNALTONOISERATIO", PeakSignalToNoiseRatioMetric); -#else - IMAGICK_REGISTER_CONST_LONG("METRIC_PEAKSIGNALTONOISERATIO", PeakSignalToNoiseRatioErrorMetric); -#endif - IMAGICK_REGISTER_CONST_LONG("METRIC_ROOTMEANSQUAREDERROR", RootMeanSquaredErrorMetric); -#if MagickLibVersion >= 0x687 - IMAGICK_REGISTER_CONST_LONG("METRIC_NORMALIZEDCROSSCORRELATIONERRORMETRIC", NormalizedCrossCorrelationErrorMetric); - IMAGICK_REGISTER_CONST_LONG("METRIC_FUZZERROR", FuzzErrorMetric); -#endif -#if MagickLibVersion >= 0x690 - IMAGICK_REGISTER_CONST_LONG("METRIC_PERCEPTUALHASH_ERROR", PerceptualHashErrorMetric); -#endif - -#if MagickLibVersion >= 0x707 - IMAGICK_REGISTER_CONST_LONG("METRIC_STRUCTURAL_SIMILARITY_ERROR", StructuralSimilarityErrorMetric); - IMAGICK_REGISTER_CONST_LONG("METRIC_STRUCTURAL_DISSIMILARITY_ERROR", StructuralDissimilarityErrorMetric); -#endif - - IMAGICK_REGISTER_CONST_LONG("PIXEL_CHAR", CharPixel); - IMAGICK_REGISTER_CONST_LONG("PIXELSTORAGE_CHAR", CharPixel); - IMAGICK_REGISTER_CONST_LONG("PIXEL_DOUBLE", DoublePixel); - IMAGICK_REGISTER_CONST_LONG("PIXELSTORAGE_DOUBLE", DoublePixel); - IMAGICK_REGISTER_CONST_LONG("PIXEL_FLOAT", FloatPixel); - IMAGICK_REGISTER_CONST_LONG("PIXELSTORAGE_FLOAT", FloatPixel); -#if MagickLibVersion < 0x700 - IMAGICK_REGISTER_CONST_LONG("PIXEL_INTEGER", IntegerPixel); - IMAGICK_REGISTER_CONST_LONG("PIXELSTORAGE_INTEGER", IntegerPixel); -#endif - IMAGICK_REGISTER_CONST_LONG("PIXEL_LONG", LongPixel); - IMAGICK_REGISTER_CONST_LONG("PIXELSTORAGE_LONG", LongPixel); - IMAGICK_REGISTER_CONST_LONG("PIXEL_QUANTUM", QuantumPixel); - IMAGICK_REGISTER_CONST_LONG("PIXELSTORAGE_QUANTUM", QuantumPixel); - IMAGICK_REGISTER_CONST_LONG("PIXEL_SHORT", ShortPixel); - IMAGICK_REGISTER_CONST_LONG("PIXELSTORAGE_SHORT", ShortPixel); - //For now we deliberately DO NOT support the longlong pixel type. - //64 bit integers and PHP do not play nicely. - //IMAGICK_REGISTER_CONST_LONG("PIXEL_LONGLONG", ..); - //IMAGICK_REGISTER_CONST_LONG("PIXELSTORAGE_LONGLONG", ..); - - IMAGICK_REGISTER_CONST_LONG("EVALUATE_UNDEFINED", UndefinedEvaluateOperator); - IMAGICK_REGISTER_CONST_LONG("EVALUATE_ADD", AddEvaluateOperator); - IMAGICK_REGISTER_CONST_LONG("EVALUATE_AND", AndEvaluateOperator); - IMAGICK_REGISTER_CONST_LONG("EVALUATE_DIVIDE", DivideEvaluateOperator); - IMAGICK_REGISTER_CONST_LONG("EVALUATE_LEFTSHIFT", LeftShiftEvaluateOperator); - IMAGICK_REGISTER_CONST_LONG("EVALUATE_MAX", MaxEvaluateOperator); - IMAGICK_REGISTER_CONST_LONG("EVALUATE_MIN", MinEvaluateOperator); - IMAGICK_REGISTER_CONST_LONG("EVALUATE_MULTIPLY", MultiplyEvaluateOperator); - IMAGICK_REGISTER_CONST_LONG("EVALUATE_OR", OrEvaluateOperator); - IMAGICK_REGISTER_CONST_LONG("EVALUATE_RIGHTSHIFT", RightShiftEvaluateOperator); - IMAGICK_REGISTER_CONST_LONG("EVALUATE_SET", SetEvaluateOperator); - IMAGICK_REGISTER_CONST_LONG("EVALUATE_SUBTRACT", SubtractEvaluateOperator); - IMAGICK_REGISTER_CONST_LONG("EVALUATE_XOR", XorEvaluateOperator); -#if MagickLibVersion > 0x643 - IMAGICK_REGISTER_CONST_LONG("EVALUATE_POW", PowEvaluateOperator); - IMAGICK_REGISTER_CONST_LONG("EVALUATE_LOG", LogEvaluateOperator); - IMAGICK_REGISTER_CONST_LONG("EVALUATE_THRESHOLD", ThresholdEvaluateOperator); - IMAGICK_REGISTER_CONST_LONG("EVALUATE_THRESHOLDBLACK", ThresholdBlackEvaluateOperator); - IMAGICK_REGISTER_CONST_LONG("EVALUATE_THRESHOLDWHITE", ThresholdWhiteEvaluateOperator); - IMAGICK_REGISTER_CONST_LONG("EVALUATE_GAUSSIANNOISE", GaussianNoiseEvaluateOperator); - IMAGICK_REGISTER_CONST_LONG("EVALUATE_IMPULSENOISE", ImpulseNoiseEvaluateOperator); - IMAGICK_REGISTER_CONST_LONG("EVALUATE_LAPLACIANNOISE", LaplacianNoiseEvaluateOperator); - IMAGICK_REGISTER_CONST_LONG("EVALUATE_MULTIPLICATIVENOISE", MultiplicativeNoiseEvaluateOperator); - IMAGICK_REGISTER_CONST_LONG("EVALUATE_POISSONNOISE", PoissonNoiseEvaluateOperator); - IMAGICK_REGISTER_CONST_LONG("EVALUATE_UNIFORMNOISE", UniformNoiseEvaluateOperator); -#endif -#if MagickLibVersion > 0x648 - IMAGICK_REGISTER_CONST_LONG("EVALUATE_COSINE", CosineEvaluateOperator); - IMAGICK_REGISTER_CONST_LONG("EVALUATE_SINE", SineEvaluateOperator); - IMAGICK_REGISTER_CONST_LONG("EVALUATE_ADDMODULUS", AddModulusEvaluateOperator); -#endif -#if MagickLibVersion >= 0x661 - IMAGICK_REGISTER_CONST_LONG("EVALUATE_MEAN", MeanEvaluateOperator); -#endif -#if MagickLibVersion >= 0x664 - IMAGICK_REGISTER_CONST_LONG("EVALUATE_ABS", AbsEvaluateOperator); -#endif -#if MagickLibVersion >= 0x666 - IMAGICK_REGISTER_CONST_LONG("EVALUATE_EXPONENTIAL", ExponentialEvaluateOperator); - IMAGICK_REGISTER_CONST_LONG("EVALUATE_MEDIAN", MedianEvaluateOperator); -#endif -#if MagickLibVersion >= 0x676 - IMAGICK_REGISTER_CONST_LONG("EVALUATE_SUM", SumEvaluateOperator); -#endif -#if MagickLibVersion >= 0x690 - IMAGICK_REGISTER_CONST_LONG("EVALUATE_ROOT_MEAN_SQUARE", RootMeanSquareEvaluateOperator); -#endif - -#if MagickLibVersion >= 0x70B - IMAGICK_REGISTER_CONST_LONG("EVALUATE_INVERSE_LOG", InverseLogEvaluateOperator); -#endif - - IMAGICK_REGISTER_CONST_LONG("COLORSPACE_UNDEFINED", UndefinedColorspace); - IMAGICK_REGISTER_CONST_LONG("COLORSPACE_RGB", RGBColorspace); - IMAGICK_REGISTER_CONST_LONG("COLORSPACE_GRAY", GRAYColorspace); - IMAGICK_REGISTER_CONST_LONG("COLORSPACE_TRANSPARENT", TransparentColorspace); - IMAGICK_REGISTER_CONST_LONG("COLORSPACE_OHTA", OHTAColorspace); -#if MagickLibVersion < 0x700 -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) - IMAGICK_REGISTER_CONST_LONG("COLORSPACE_LAB", LABColorspace); -#endif -#endif - IMAGICK_REGISTER_CONST_LONG("COLORSPACE_XYZ", XYZColorspace); - IMAGICK_REGISTER_CONST_LONG("COLORSPACE_YCBCR", YCbCrColorspace); - IMAGICK_REGISTER_CONST_LONG("COLORSPACE_YCC", YCCColorspace); - IMAGICK_REGISTER_CONST_LONG("COLORSPACE_YIQ", YIQColorspace); - IMAGICK_REGISTER_CONST_LONG("COLORSPACE_YPBPR", YPbPrColorspace); - IMAGICK_REGISTER_CONST_LONG("COLORSPACE_YUV", YUVColorspace); - IMAGICK_REGISTER_CONST_LONG("COLORSPACE_CMYK", CMYKColorspace); - IMAGICK_REGISTER_CONST_LONG("COLORSPACE_SRGB", sRGBColorspace); - IMAGICK_REGISTER_CONST_LONG("COLORSPACE_HSB", HSBColorspace); - IMAGICK_REGISTER_CONST_LONG("COLORSPACE_HSL", HSLColorspace); - IMAGICK_REGISTER_CONST_LONG("COLORSPACE_HWB", HWBColorspace); -#if MagickLibVersion < 0x700 - IMAGICK_REGISTER_CONST_LONG("COLORSPACE_REC601LUMA", Rec601LumaColorspace); - IMAGICK_REGISTER_CONST_LONG("COLORSPACE_REC709LUMA", Rec709LumaColorspace); -#endif - IMAGICK_REGISTER_CONST_LONG("COLORSPACE_LOG", LogColorspace); -#if MagickLibVersion >= 0x642 - IMAGICK_REGISTER_CONST_LONG("COLORSPACE_CMY", CMYColorspace); -#endif -#if MagickLibVersion >= 0X679 - IMAGICK_REGISTER_CONST_LONG("COLORSPACE_LUV", LuvColorspace); - IMAGICK_REGISTER_CONST_LONG("COLORSPACE_HCL", HCLColorspace); -#endif -#if MagickLibVersion >= 0x680 - IMAGICK_REGISTER_CONST_LONG("COLORSPACE_LCH", LCHColorspace); - IMAGICK_REGISTER_CONST_LONG("COLORSPACE_LMS", LMSColorspace); -#endif -#if MagickLibVersion >= 0x686 - IMAGICK_REGISTER_CONST_LONG("COLORSPACE_LCHAB", LCHabColorspace); - IMAGICK_REGISTER_CONST_LONG("COLORSPACE_LCHUV", LCHuvColorspace); - IMAGICK_REGISTER_CONST_LONG("COLORSPACE_SCRGB", scRGBColorspace); - IMAGICK_REGISTER_CONST_LONG("COLORSPACE_HSI", HSIColorspace); - IMAGICK_REGISTER_CONST_LONG("COLORSPACE_HSV", HSVColorspace); - IMAGICK_REGISTER_CONST_LONG("COLORSPACE_HCLP", HCLpColorspace); - IMAGICK_REGISTER_CONST_LONG("COLORSPACE_YDBDR", YDbDrColorspace); -#endif - - IMAGICK_REGISTER_CONST_LONG("COLORSPACE_REC601YCBCR", Rec601YCbCrColorspace); - IMAGICK_REGISTER_CONST_LONG("COLORSPACE_REC709YCBCR", Rec709YCbCrColorspace); -#if MagickLibVersion >= 0x690 - IMAGICK_REGISTER_CONST_LONG("COLORSPACE_XYY", xyYColorspace); -#endif - - -#if (MagickLibVersion >= 0x700 && MagickLibVersion >= 0x708) || (MagickLibVersion < 0x700 && MagickLibVersion >= 0x699) - IMAGICK_REGISTER_CONST_LONG("COLORSPACE_LINEARGRAY", LinearGRAYColorspace); -#endif - -#if MagickLibVersion >= 0x70B - IMAGICK_REGISTER_CONST_LONG("COLORSPACE_DISPLAYP3", DisplayP3Colorspace); - IMAGICK_REGISTER_CONST_LONG("COLORSPACE_ADOBE98", Adobe98Colorspace); - IMAGICK_REGISTER_CONST_LONG("COLORSPACE_PROPHOTO", ProPhotoColorspace); -#endif - -#if MagickLibVersion >= 0x70A - IMAGICK_REGISTER_CONST_LONG("COLORSPACE_JZAZBZ", JzazbzColorspace); -#endif - - IMAGICK_REGISTER_CONST_LONG("VIRTUALPIXELMETHOD_UNDEFINED", UndefinedVirtualPixelMethod); - IMAGICK_REGISTER_CONST_LONG("VIRTUALPIXELMETHOD_BACKGROUND", BackgroundVirtualPixelMethod); -#if MagickLibVersion < 0x700 - IMAGICK_REGISTER_CONST_LONG("VIRTUALPIXELMETHOD_CONSTANT", ConstantVirtualPixelMethod); /* deprecated */ -#endif - IMAGICK_REGISTER_CONST_LONG("VIRTUALPIXELMETHOD_EDGE", EdgeVirtualPixelMethod); - IMAGICK_REGISTER_CONST_LONG("VIRTUALPIXELMETHOD_MIRROR", MirrorVirtualPixelMethod); - IMAGICK_REGISTER_CONST_LONG("VIRTUALPIXELMETHOD_TILE", TileVirtualPixelMethod); - IMAGICK_REGISTER_CONST_LONG("VIRTUALPIXELMETHOD_TRANSPARENT", TransparentVirtualPixelMethod); -#if MagickLibVersion > 0x641 - IMAGICK_REGISTER_CONST_LONG("VIRTUALPIXELMETHOD_MASK", MaskVirtualPixelMethod); - IMAGICK_REGISTER_CONST_LONG("VIRTUALPIXELMETHOD_BLACK", BlackVirtualPixelMethod); - IMAGICK_REGISTER_CONST_LONG("VIRTUALPIXELMETHOD_GRAY", GrayVirtualPixelMethod); - IMAGICK_REGISTER_CONST_LONG("VIRTUALPIXELMETHOD_WHITE", WhiteVirtualPixelMethod); -#endif -#if MagickLibVersion > 0x642 - IMAGICK_REGISTER_CONST_LONG("VIRTUALPIXELMETHOD_HORIZONTALTILE", HorizontalTileVirtualPixelMethod); - IMAGICK_REGISTER_CONST_LONG("VIRTUALPIXELMETHOD_VERTICALTILE", VerticalTileVirtualPixelMethod); -#endif -#if MagickLibVersion >= 0x651 - IMAGICK_REGISTER_CONST_LONG("VIRTUALPIXELMETHOD_HORIZONTALTILEEDGE", HorizontalTileEdgeVirtualPixelMethod); - IMAGICK_REGISTER_CONST_LONG("VIRTUALPIXELMETHOD_VERTICALTILEEDGE", VerticalTileEdgeVirtualPixelMethod); - IMAGICK_REGISTER_CONST_LONG("VIRTUALPIXELMETHOD_CHECKERTILE", CheckerTileVirtualPixelMethod); -#endif - - // These were missed, but have been present for 12 years, so assuming - // they are going to be available in all version of ImageMagick people - // are using. - IMAGICK_REGISTER_CONST_LONG("VIRTUALPIXELMETHOD_DITHER", DitherVirtualPixelMethod); - IMAGICK_REGISTER_CONST_LONG("VIRTUALPIXELMETHOD_RANDOM", RandomVirtualPixelMethod); - - IMAGICK_REGISTER_CONST_LONG("PREVIEW_UNDEFINED", UndefinedPreview); - IMAGICK_REGISTER_CONST_LONG("PREVIEW_ROTATE", RotatePreview); - IMAGICK_REGISTER_CONST_LONG("PREVIEW_SHEAR", ShearPreview); - IMAGICK_REGISTER_CONST_LONG("PREVIEW_ROLL", RollPreview); - IMAGICK_REGISTER_CONST_LONG("PREVIEW_HUE", HuePreview); - IMAGICK_REGISTER_CONST_LONG("PREVIEW_SATURATION", SaturationPreview); - IMAGICK_REGISTER_CONST_LONG("PREVIEW_BRIGHTNESS", BrightnessPreview); - IMAGICK_REGISTER_CONST_LONG("PREVIEW_GAMMA", GammaPreview); - IMAGICK_REGISTER_CONST_LONG("PREVIEW_SPIFF", SpiffPreview); - IMAGICK_REGISTER_CONST_LONG("PREVIEW_DULL", DullPreview); - IMAGICK_REGISTER_CONST_LONG("PREVIEW_GRAYSCALE", GrayscalePreview); - IMAGICK_REGISTER_CONST_LONG("PREVIEW_QUANTIZE", QuantizePreview); - IMAGICK_REGISTER_CONST_LONG("PREVIEW_DESPECKLE", DespecklePreview); - IMAGICK_REGISTER_CONST_LONG("PREVIEW_REDUCENOISE", ReduceNoisePreview); - IMAGICK_REGISTER_CONST_LONG("PREVIEW_ADDNOISE", AddNoisePreview); - IMAGICK_REGISTER_CONST_LONG("PREVIEW_SHARPEN", SharpenPreview); - IMAGICK_REGISTER_CONST_LONG("PREVIEW_BLUR", BlurPreview); - IMAGICK_REGISTER_CONST_LONG("PREVIEW_THRESHOLD", ThresholdPreview); - IMAGICK_REGISTER_CONST_LONG("PREVIEW_EDGEDETECT", EdgeDetectPreview); - IMAGICK_REGISTER_CONST_LONG("PREVIEW_SPREAD", SpreadPreview); - IMAGICK_REGISTER_CONST_LONG("PREVIEW_SOLARIZE", SolarizePreview); - IMAGICK_REGISTER_CONST_LONG("PREVIEW_SHADE", ShadePreview); - IMAGICK_REGISTER_CONST_LONG("PREVIEW_RAISE", RaisePreview); - IMAGICK_REGISTER_CONST_LONG("PREVIEW_SEGMENT", SegmentPreview); - IMAGICK_REGISTER_CONST_LONG("PREVIEW_SWIRL", SwirlPreview); - IMAGICK_REGISTER_CONST_LONG("PREVIEW_IMPLODE", ImplodePreview); - IMAGICK_REGISTER_CONST_LONG("PREVIEW_WAVE", WavePreview); - IMAGICK_REGISTER_CONST_LONG("PREVIEW_OILPAINT", OilPaintPreview); - IMAGICK_REGISTER_CONST_LONG("PREVIEW_CHARCOALDRAWING", CharcoalDrawingPreview); - IMAGICK_REGISTER_CONST_LONG("PREVIEW_JPEG", JPEGPreview); - IMAGICK_REGISTER_CONST_LONG("RENDERINGINTENT_UNDEFINED", UndefinedIntent); - IMAGICK_REGISTER_CONST_LONG("RENDERINGINTENT_SATURATION", SaturationIntent); - IMAGICK_REGISTER_CONST_LONG("RENDERINGINTENT_PERCEPTUAL", PerceptualIntent); - IMAGICK_REGISTER_CONST_LONG("RENDERINGINTENT_ABSOLUTE", AbsoluteIntent); - IMAGICK_REGISTER_CONST_LONG("RENDERINGINTENT_RELATIVE", RelativeIntent); - IMAGICK_REGISTER_CONST_LONG("INTERLACE_UNDEFINED", UndefinedInterlace); - IMAGICK_REGISTER_CONST_LONG("INTERLACE_NO", NoInterlace); - IMAGICK_REGISTER_CONST_LONG("INTERLACE_LINE", LineInterlace); - IMAGICK_REGISTER_CONST_LONG("INTERLACE_PLANE", PlaneInterlace); - IMAGICK_REGISTER_CONST_LONG("INTERLACE_PARTITION", PartitionInterlace); -#if MagickLibVersion > 0x633 - IMAGICK_REGISTER_CONST_LONG("INTERLACE_GIF", GIFInterlace); - IMAGICK_REGISTER_CONST_LONG("INTERLACE_JPEG", JPEGInterlace); - IMAGICK_REGISTER_CONST_LONG("INTERLACE_PNG", PNGInterlace); -#endif - IMAGICK_REGISTER_CONST_LONG("FILLRULE_UNDEFINED", UndefinedRule); - IMAGICK_REGISTER_CONST_LONG("FILLRULE_EVENODD", EvenOddRule); - IMAGICK_REGISTER_CONST_LONG("FILLRULE_NONZERO", NonZeroRule); - IMAGICK_REGISTER_CONST_LONG("PATHUNITS_UNDEFINED", UndefinedPathUnits); - IMAGICK_REGISTER_CONST_LONG("PATHUNITS_USERSPACE", UserSpace); - IMAGICK_REGISTER_CONST_LONG("PATHUNITS_USERSPACEONUSE", UserSpaceOnUse); - IMAGICK_REGISTER_CONST_LONG("PATHUNITS_OBJECTBOUNDINGBOX", ObjectBoundingBox); - IMAGICK_REGISTER_CONST_LONG("LINECAP_UNDEFINED", UndefinedCap); - IMAGICK_REGISTER_CONST_LONG("LINECAP_BUTT", ButtCap); - IMAGICK_REGISTER_CONST_LONG("LINECAP_ROUND", RoundCap); - IMAGICK_REGISTER_CONST_LONG("LINECAP_SQUARE", SquareCap); - IMAGICK_REGISTER_CONST_LONG("LINEJOIN_UNDEFINED", UndefinedJoin); - IMAGICK_REGISTER_CONST_LONG("LINEJOIN_MITER", MiterJoin); - IMAGICK_REGISTER_CONST_LONG("LINEJOIN_ROUND", RoundJoin); - IMAGICK_REGISTER_CONST_LONG("LINEJOIN_BEVEL", BevelJoin); - IMAGICK_REGISTER_CONST_LONG("RESOURCETYPE_UNDEFINED", UndefinedResource); - IMAGICK_REGISTER_CONST_LONG("RESOURCETYPE_AREA", AreaResource); - IMAGICK_REGISTER_CONST_LONG("RESOURCETYPE_DISK", DiskResource); - IMAGICK_REGISTER_CONST_LONG("RESOURCETYPE_FILE", FileResource); - IMAGICK_REGISTER_CONST_LONG("RESOURCETYPE_MAP", MapResource); - IMAGICK_REGISTER_CONST_LONG("RESOURCETYPE_MEMORY", MemoryResource); -#if MagickLibVersion >= 0x675 - IMAGICK_REGISTER_CONST_LONG("RESOURCETYPE_TIME", TimeResource); - IMAGICK_REGISTER_CONST_LONG("RESOURCETYPE_THROTTLE", ThrottleResource); -#endif -#if MagickLibVersion > 0x678 - IMAGICK_REGISTER_CONST_LONG("RESOURCETYPE_THREAD", ThreadResource); -#endif -#if MagickLibVersion > 0x691 - IMAGICK_REGISTER_CONST_LONG("RESOURCETYPE_WIDTH", WidthResource); - IMAGICK_REGISTER_CONST_LONG("RESOURCETYPE_HEIGHT", HeightResource); -#endif - -#if (MagickLibVersion >= 0x700 && MagickLibVersion >= 0x708) || (MagickLibVersion < 0x700 && MagickLibVersion >= 0x69A) - IMAGICK_REGISTER_CONST_LONG("RESOURCETYPE_LISTLENGTH", ListLengthResource); -#endif - - IMAGICK_REGISTER_CONST_LONG("DISPOSE_UNRECOGNIZED", UnrecognizedDispose); - IMAGICK_REGISTER_CONST_LONG("DISPOSE_UNDEFINED", UndefinedDispose); - IMAGICK_REGISTER_CONST_LONG("DISPOSE_NONE", NoneDispose); - IMAGICK_REGISTER_CONST_LONG("DISPOSE_BACKGROUND", BackgroundDispose); - IMAGICK_REGISTER_CONST_LONG("DISPOSE_PREVIOUS", PreviousDispose); -#if MagickLibVersion > 0x631 - IMAGICK_REGISTER_CONST_LONG("INTERPOLATE_UNDEFINED", UndefinedInterpolatePixel); - - IMAGICK_REGISTER_CONST_LONG("INTERPOLATE_AVERAGE", AverageInterpolatePixel); /* Average 4 nearest neighbours */ -#if MagickLibVersion < 0x700 - IMAGICK_REGISTER_CONST_LONG("INTERPOLATE_BICUBIC", BicubicInterpolatePixel); /* Catmull-Rom interpolation */ -#endif - IMAGICK_REGISTER_CONST_LONG("INTERPOLATE_BILINEAR", BilinearInterpolatePixel); /* Triangular filter interpolation */ -#if MagickLibVersion < 0x700 - IMAGICK_REGISTER_CONST_LONG("INTERPOLATE_FILTER", FilterInterpolatePixel); /* Use resize filter - (very slow) */ -#endif - IMAGICK_REGISTER_CONST_LONG("INTERPOLATE_INTEGER", IntegerInterpolatePixel); /* Integer (floor) interpolation */ - IMAGICK_REGISTER_CONST_LONG("INTERPOLATE_MESH", MeshInterpolatePixel); /* Triangular mesh interpolation */ -#if MagickLibVersion < 0x700 - IMAGICK_REGISTER_CONST_LONG("INTERPOLATE_NEARESTNEIGHBOR", NearestNeighborInterpolatePixel); -#endif -#endif -#if MagickLibVersion > 0x634 - IMAGICK_REGISTER_CONST_LONG("INTERPOLATE_SPLINE", SplineInterpolatePixel); /* Cubic Spline (blurred) interpolation */ -#endif -#if MagickLibVersion > 0x690 - IMAGICK_REGISTER_CONST_LONG("INTERPOLATE_AVERAGE_9", Average9InterpolatePixel); /* Average 9 nearest neighbours */ - IMAGICK_REGISTER_CONST_LONG("INTERPOLATE_AVERAGE_16", Average16InterpolatePixel); /* Average 16 nearest neighbours */ - IMAGICK_REGISTER_CONST_LONG("INTERPOLATE_BLEND", BlendInterpolatePixel); /* blend of nearest 1, 2 or 4 pixels */ - IMAGICK_REGISTER_CONST_LONG("INTERPOLATE_BACKGROUND_COLOR", BackgroundInterpolatePixel); /* just return background color */ -#if MagickLibVersion >= 0x687 - IMAGICK_REGISTER_CONST_LONG("INTERPOLATE_CATROM", CatromInterpolatePixel); /* Catmull-Rom interpolation */ -#endif -#endif - -#if MagickLibVersion >= 0x701 - IMAGICK_REGISTER_CONST_LONG("INTERPOLATE_NEAREST_PIXEL", NearestInterpolatePixel); /* NearestInterpolatePixel */ -#endif - -#if MagickLibVersion > 0x628 - IMAGICK_REGISTER_CONST_LONG("LAYERMETHOD_UNDEFINED", UndefinedLayer); - IMAGICK_REGISTER_CONST_LONG("LAYERMETHOD_COALESCE", CoalesceLayer); - IMAGICK_REGISTER_CONST_LONG("LAYERMETHOD_COMPAREANY", CompareAnyLayer); - IMAGICK_REGISTER_CONST_LONG("LAYERMETHOD_COMPARECLEAR", CompareClearLayer); - IMAGICK_REGISTER_CONST_LONG("LAYERMETHOD_COMPAREOVERLAY", CompareOverlayLayer); - IMAGICK_REGISTER_CONST_LONG("LAYERMETHOD_DISPOSE", DisposeLayer); - IMAGICK_REGISTER_CONST_LONG("LAYERMETHOD_OPTIMIZE", OptimizeLayer); - IMAGICK_REGISTER_CONST_LONG("LAYERMETHOD_OPTIMIZEPLUS", OptimizePlusLayer); -#endif -#if MagickLibVersion > 0x632 - IMAGICK_REGISTER_CONST_LONG("LAYERMETHOD_OPTIMIZETRANS", OptimizeTransLayer); - IMAGICK_REGISTER_CONST_LONG("LAYERMETHOD_COMPOSITE", CompositeLayer); - IMAGICK_REGISTER_CONST_LONG("LAYERMETHOD_OPTIMIZEIMAGE", OptimizeImageLayer); - IMAGICK_REGISTER_CONST_LONG("LAYERMETHOD_REMOVEDUPS", RemoveDupsLayer); - IMAGICK_REGISTER_CONST_LONG("LAYERMETHOD_REMOVEZERO", RemoveZeroLayer); -#endif -#if MagickLibVersion >= 0x644 - IMAGICK_REGISTER_CONST_LONG("LAYERMETHOD_TRIMBOUNDS", TrimBoundsLayer); -#endif -#if MagickLibVersion > 0x629 - IMAGICK_REGISTER_CONST_LONG("ORIENTATION_UNDEFINED", UndefinedOrientation); - IMAGICK_REGISTER_CONST_LONG("ORIENTATION_TOPLEFT", TopLeftOrientation); - IMAGICK_REGISTER_CONST_LONG("ORIENTATION_TOPRIGHT", TopRightOrientation); - IMAGICK_REGISTER_CONST_LONG("ORIENTATION_BOTTOMRIGHT", BottomRightOrientation); - IMAGICK_REGISTER_CONST_LONG("ORIENTATION_BOTTOMLEFT", BottomLeftOrientation); - IMAGICK_REGISTER_CONST_LONG("ORIENTATION_LEFTTOP", LeftTopOrientation); - IMAGICK_REGISTER_CONST_LONG("ORIENTATION_RIGHTTOP", RightTopOrientation); - IMAGICK_REGISTER_CONST_LONG("ORIENTATION_RIGHTBOTTOM", RightBottomOrientation); - IMAGICK_REGISTER_CONST_LONG("ORIENTATION_LEFTBOTTOM", LeftBottomOrientation); -#endif -#if MagickLibVersion > 0x635 - IMAGICK_REGISTER_CONST_LONG("DISTORTION_UNDEFINED", UndefinedDistortion); - IMAGICK_REGISTER_CONST_LONG("DISTORTION_AFFINE", AffineDistortion); - IMAGICK_REGISTER_CONST_LONG("DISTORTION_AFFINEPROJECTION", AffineProjectionDistortion); - IMAGICK_REGISTER_CONST_LONG("DISTORTION_ARC", ArcDistortion); - IMAGICK_REGISTER_CONST_LONG("DISTORTION_BILINEAR", BilinearDistortion); - IMAGICK_REGISTER_CONST_LONG("DISTORTION_PERSPECTIVE", PerspectiveDistortion); - IMAGICK_REGISTER_CONST_LONG("DISTORTION_PERSPECTIVEPROJECTION", PerspectiveProjectionDistortion); - IMAGICK_REGISTER_CONST_LONG("DISTORTION_SCALEROTATETRANSLATE", ScaleRotateTranslateDistortion); -#endif -#if MagickLibVersion > 0x645 - IMAGICK_REGISTER_CONST_LONG("DISTORTION_POLYNOMIAL", PolynomialDistortion); - IMAGICK_REGISTER_CONST_LONG("DISTORTION_POLAR", PolarDistortion); - IMAGICK_REGISTER_CONST_LONG("DISTORTION_DEPOLAR", DePolarDistortion); - IMAGICK_REGISTER_CONST_LONG("DISTORTION_BARREL", BarrelDistortion); - IMAGICK_REGISTER_CONST_LONG("DISTORTION_SHEPARDS", ShepardsDistortion); - - // SentinelDistortion is not a real distortion type. It is a guard value - // that shouldn't have been exposed in Imagick. TODO remove at next - // minor version. - IMAGICK_REGISTER_CONST_LONG("DISTORTION_SENTINEL", SentinelDistortion); -#endif - -#if MagickLibVersion >= 0x70B - IMAGICK_REGISTER_CONST_LONG("DISTORTION_RIGID_AFFINE", RigidAffineDistortion); -#endif - -#if MagickLibVersion >= 0x644 - IMAGICK_REGISTER_CONST_LONG("DISTORTION_BARRELINVERSE", BarrelInverseDistortion); -#endif -#if MagickLibVersion >= 0x654 - IMAGICK_REGISTER_CONST_LONG("DISTORTION_BILINEARFORWARD", BilinearForwardDistortion); - IMAGICK_REGISTER_CONST_LONG("DISTORTION_BILINEARREVERSE", BilinearReverseDistortion); -#endif -#if MagickLibVersion >= 0x670 - IMAGICK_REGISTER_CONST_LONG("DISTORTION_RESIZE", ResizeDistortion); -#endif -#if MagickLibVersion >= 0x671 - IMAGICK_REGISTER_CONST_LONG("DISTORTION_CYLINDER2PLANE", Cylinder2PlaneDistortion); - IMAGICK_REGISTER_CONST_LONG("DISTORTION_PLANE2CYLINDER", Plane2CylinderDistortion); -#endif -#if MagickLibVersion > 0x636 - IMAGICK_REGISTER_CONST_LONG("LAYERMETHOD_MERGE", MergeLayer); - IMAGICK_REGISTER_CONST_LONG("LAYERMETHOD_FLATTEN", FlattenLayer); - IMAGICK_REGISTER_CONST_LONG("LAYERMETHOD_MOSAIC", MosaicLayer); -#endif -#if MagickLibVersion > 0x637 - IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_ACTIVATE", ActivateAlphaChannel); -#if MagickLibVersion >= 0x700 - IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_ON", OnAlphaChannel); -#else - IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_RESET", ResetAlphaChannel); -#endif - IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_SET", SetAlphaChannel); -#endif -#if MagickLibVersion > 0x645 - IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_UNDEFINED", UndefinedAlphaChannel); -#if MagickLibVersion >= 0x700 - IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_DISCRETE", DiscreteAlphaChannel); -#endif - IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_COPY", CopyAlphaChannel); - IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_DEACTIVATE", DeactivateAlphaChannel); - IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_EXTRACT", ExtractAlphaChannel); -#if MagickLibVersion >= 0x700 - IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_OFF", OffAlphaChannel); -#endif - IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_OPAQUE", OpaqueAlphaChannel); - IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_SHAPE", ShapeAlphaChannel); - IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_TRANSPARENT", TransparentAlphaChannel); -#if MagickLibVersion >= 0x690 - IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_ASSOCIATE", AssociateAlphaChannel); - IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_DISSOCIATE", DisassociateAlphaChannel); -#endif - /* - DiscreteAlphaChannel, CopyAlphaChannel, - DisassociateAlphaChannel, DeactivateAlphaChannel, - ExtractAlphaChannel, ExtractAlphaChannel, - OffAlphaChannel, OpaqueAlphaChannel, - OnAlphaChannel, ResetAlphaChannel, // deprecated - */ - - IMAGICK_REGISTER_CONST_LONG("SPARSECOLORMETHOD_UNDEFINED", UndefinedColorInterpolate); - IMAGICK_REGISTER_CONST_LONG("SPARSECOLORMETHOD_BARYCENTRIC", BarycentricColorInterpolate); - IMAGICK_REGISTER_CONST_LONG("SPARSECOLORMETHOD_BILINEAR", BilinearColorInterpolate); - IMAGICK_REGISTER_CONST_LONG("SPARSECOLORMETHOD_POLYNOMIAL", PolynomialColorInterpolate); - IMAGICK_REGISTER_CONST_LONG("SPARSECOLORMETHOD_SPEPARDS", ShepardsColorInterpolate); - IMAGICK_REGISTER_CONST_LONG("SPARSECOLORMETHOD_VORONOI", VoronoiColorInterpolate); -#if MagickLibVersion >= 0x687 - IMAGICK_REGISTER_CONST_LONG("SPARSECOLORMETHOD_INVERSE", InverseColorInterpolate); -#endif -#if MagickLibVersion >= 0x693 - IMAGICK_REGISTER_CONST_LONG("SPARSECOLORMETHOD_MANHATTAN", ManhattanColorInterpolate); -#endif - IMAGICK_REGISTER_CONST_LONG("DITHERMETHOD_UNDEFINED", UndefinedDitherMethod); - IMAGICK_REGISTER_CONST_LONG("DITHERMETHOD_NO", NoDitherMethod); - IMAGICK_REGISTER_CONST_LONG("DITHERMETHOD_RIEMERSMA", RiemersmaDitherMethod); - IMAGICK_REGISTER_CONST_LONG("DITHERMETHOD_FLOYDSTEINBERG", FloydSteinbergDitherMethod); -#endif -#if MagickLibVersion > 0x648 - IMAGICK_REGISTER_CONST_LONG("FUNCTION_UNDEFINED", UndefinedFunction); - IMAGICK_REGISTER_CONST_LONG("FUNCTION_POLYNOMIAL", PolynomialFunction); - IMAGICK_REGISTER_CONST_LONG("FUNCTION_SINUSOID", SinusoidFunction); -#endif -#if MagickLibVersion >= 0x653 - IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_BACKGROUND", BackgroundAlphaChannel); - IMAGICK_REGISTER_CONST_LONG("FUNCTION_ARCSIN", ArcsinFunction); - IMAGICK_REGISTER_CONST_LONG("FUNCTION_ARCTAN", ArctanFunction); -#endif -#if MagickLibVersion >= 0x678 -#if MagickLibVersion < 0x700 - IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_FLATTEN", FlattenAlphaChannel); -#endif - IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_REMOVE", RemoveAlphaChannel); -#endif - -#if MagickLibVersion > 0x683 - IMAGICK_REGISTER_CONST_LONG("STATISTIC_GRADIENT", GradientStatistic); - IMAGICK_REGISTER_CONST_LONG("STATISTIC_MAXIMUM", MaximumStatistic); - IMAGICK_REGISTER_CONST_LONG("STATISTIC_MEAN", MeanStatistic); - IMAGICK_REGISTER_CONST_LONG("STATISTIC_MEDIAN", MedianStatistic); - IMAGICK_REGISTER_CONST_LONG("STATISTIC_MINIMUM", MinimumStatistic); - IMAGICK_REGISTER_CONST_LONG("STATISTIC_MODE", ModeStatistic); - IMAGICK_REGISTER_CONST_LONG("STATISTIC_NONPEAK", NonpeakStatistic); - IMAGICK_REGISTER_CONST_LONG("STATISTIC_STANDARD_DEVIATION", StandardDeviationStatistic); -#endif -#if MagickLibVersion >= 0x690 - IMAGICK_REGISTER_CONST_LONG("STATISTIC_ROOT_MEAN_SQUARE", RootMeanSquareStatistic); -#endif - -#if MagickLibVersion >= 0x70C - IMAGICK_REGISTER_CONST_LONG("STATISTIC_CONTRAST", ContrastStatistic); -#endif - -#ifdef IMAGICK_WITH_KERNEL -/* Convolve / Correlate weighted sums */ -IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_CONVOLVE", ConvolveMorphology); /* Weighted Sum with reflected kernel */ -IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_CORRELATE", CorrelateMorphology); /* Weighted Sum using a sliding window */ -/* Low-level Morphology methods */ -IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_ERODE", ErodeMorphology); /* Minimum Value in Neighbourhood */ -IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_DILATE", DilateMorphology); /* Maximum Value in Neighbourhood */ -IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_ERODE_INTENSITY", ErodeIntensityMorphology); /* Pixel Pick using GreyScale Erode */ -IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_DILATE_INTENSITY", DilateIntensityMorphology); /* Pixel Pick using GreyScale Dialate */ -IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_DISTANCE", DistanceMorphology); /* Add Kernel Value, take Minimum */ -/* Second-level Morphology methods */ -IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_OPEN", OpenMorphology); /* Dilate then Erode */ -IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_CLOSE", CloseMorphology); /* Erode then Dilate */ -IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_OPEN_INTENSITY", OpenIntensityMorphology); /* Pixel Pick using GreyScale Open */ -IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_CLOSE_INTENSITY", CloseIntensityMorphology); /* Pixel Pick using GreyScale Close */ -IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_SMOOTH", SmoothMorphology); /* Open then Close */ -/* Difference Morphology methods */ -IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_EDGE_IN", EdgeInMorphology); /* Dilate difference from Original */ -IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_EDGE_OUT", EdgeOutMorphology); /* Erode difference from Original */ -IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_EDGE", EdgeMorphology); /* Dilate difference with Erode */ -IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_TOP_HAT", TopHatMorphology); /* Close difference from Original */ -IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_BOTTOM_HAT", BottomHatMorphology); /* Open difference from Original */ -/* Recursive Morphology methods */ -IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_HIT_AND_MISS", HitAndMissMorphology); /* Foreground/Background pattern matching */ -IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_THINNING", ThinningMorphology); /* Remove matching pixels from image */ -IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_THICKEN", ThickenMorphology); /* Add matching pixels from image */ -/* Experimental Morphology methods */ -IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_VORONOI", VoronoiMorphology); /* distance matte channel copy nearest color */ -IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_ITERATIVE", IterativeDistanceMorphology); /* Add Kernel Value, take Minimum */ - - -/* The no-op or 'original image' kernel */ -IMAGICK_REGISTER_CONST_LONG("KERNEL_UNITY", UnityKernel); -/* Convolution Kernels, Gaussian Based */ -IMAGICK_REGISTER_CONST_LONG("KERNEL_GAUSSIAN", GaussianKernel); -IMAGICK_REGISTER_CONST_LONG("KERNEL_DIFFERENCE_OF_GAUSSIANS", DoGKernel); -IMAGICK_REGISTER_CONST_LONG("KERNEL_LAPLACIAN_OF_GAUSSIANS", LoGKernel); -IMAGICK_REGISTER_CONST_LONG("KERNEL_BLUR", BlurKernel); -IMAGICK_REGISTER_CONST_LONG("KERNEL_COMET", CometKernel); -/* Convolution Kernels, by Name */ -IMAGICK_REGISTER_CONST_LONG("KERNEL_LAPLACIAN", LaplacianKernel); -IMAGICK_REGISTER_CONST_LONG("KERNEL_SOBEL", SobelKernel); -IMAGICK_REGISTER_CONST_LONG("KERNEL_FREI_CHEN", FreiChenKernel); -IMAGICK_REGISTER_CONST_LONG("KERNEL_ROBERTS", RobertsKernel); -IMAGICK_REGISTER_CONST_LONG("KERNEL_PREWITT", PrewittKernel); -IMAGICK_REGISTER_CONST_LONG("KERNEL_COMPASS", CompassKernel); -IMAGICK_REGISTER_CONST_LONG("KERNEL_KIRSCH", KirschKernel); -/* Shape Kernels */ -IMAGICK_REGISTER_CONST_LONG("KERNEL_DIAMOND", DiamondKernel); -IMAGICK_REGISTER_CONST_LONG("KERNEL_SQUARE", SquareKernel); -IMAGICK_REGISTER_CONST_LONG("KERNEL_RECTANGLE", RectangleKernel); -IMAGICK_REGISTER_CONST_LONG("KERNEL_OCTAGON", OctagonKernel); -IMAGICK_REGISTER_CONST_LONG("KERNEL_DISK", DiskKernel); -IMAGICK_REGISTER_CONST_LONG("KERNEL_PLUS", PlusKernel); -IMAGICK_REGISTER_CONST_LONG("KERNEL_CROSS", CrossKernel); -IMAGICK_REGISTER_CONST_LONG("KERNEL_RING", RingKernel); -/* Hit And Miss Kernels */ -IMAGICK_REGISTER_CONST_LONG("KERNEL_PEAKS", PeaksKernel); -IMAGICK_REGISTER_CONST_LONG("KERNEL_EDGES", EdgesKernel); -IMAGICK_REGISTER_CONST_LONG("KERNEL_CORNERS", CornersKernel); -IMAGICK_REGISTER_CONST_LONG("KERNEL_DIAGONALS", DiagonalsKernel); -IMAGICK_REGISTER_CONST_LONG("KERNEL_LINE_ENDS", LineEndsKernel); -IMAGICK_REGISTER_CONST_LONG("KERNEL_LINE_JUNCTIONS", LineJunctionsKernel); -IMAGICK_REGISTER_CONST_LONG("KERNEL_RIDGES", RidgesKernel); -IMAGICK_REGISTER_CONST_LONG("KERNEL_CONVEX_HULL", ConvexHullKernel); -IMAGICK_REGISTER_CONST_LONG("KERNEL_THIN_SE", ThinSEKernel); -IMAGICK_REGISTER_CONST_LONG("KERNEL_SKELETON", SkeletonKernel); -/* Distance Measuring Kernels */ -IMAGICK_REGISTER_CONST_LONG("KERNEL_CHEBYSHEV", ChebyshevKernel); -IMAGICK_REGISTER_CONST_LONG("KERNEL_MANHATTAN", ManhattanKernel); -IMAGICK_REGISTER_CONST_LONG("KERNEL_OCTAGONAL", OctagonalKernel); -IMAGICK_REGISTER_CONST_LONG("KERNEL_EUCLIDEAN", EuclideanKernel); -/* User Specified Kernel Array */ -IMAGICK_REGISTER_CONST_LONG("KERNEL_USER_DEFINED", UserDefinedKernel); -IMAGICK_REGISTER_CONST_LONG("KERNEL_BINOMIAL", BinomialKernel); - -/* Draw directions */ -IMAGICK_REGISTER_CONST_LONG("DIRECTION_LEFT_TO_RIGHT", LeftToRightDirection); -IMAGICK_REGISTER_CONST_LONG("DIRECTION_RIGHT_TO_LEFT", RightToLeftDirection); - -// The kernel is scaled directly using given scaling factor without change. -IMAGICK_REGISTER_CONST_LONG("NORMALIZE_KERNEL_NONE", 0); -// Kernel normalization ('normalize_flags' given) is designed to ensure -// that any use of the kernel scaling factor with 'Convolve' or 'Correlate' -// morphology methods will fall into -1.0 to +1.0 range. -IMAGICK_REGISTER_CONST_LONG("NORMALIZE_KERNEL_VALUE", NormalizeValue); -// For special kernels designed for locating shapes using 'Correlate', (often -// only containing +1 and -1 values, representing foreground/brackground -// matching) a special normalization method is provided to scale the positive -// values separately to those of the negative values, so the kernel will be -// forced to become a zero-sum kernel better suited to such searches. -IMAGICK_REGISTER_CONST_LONG("NORMALIZE_KERNEL_CORRELATE", CorrelateNormalizeValue); -// Scale the kernel by a percent. -IMAGICK_REGISTER_CONST_LONG("NORMALIZE_KERNEL_PERCENT", PercentValue); -#endif - - -#if IM_HAVE_IMAGICK_GETSETIMAGEMASK -IMAGICK_REGISTER_CONST_LONG("PIXELMASK_READ", ReadPixelMask); -IMAGICK_REGISTER_CONST_LONG("PIXELMASK_WRITE", WritePixelMask); -#endif - - -#if MagickLibVersion >= 0x708 -IMAGICK_REGISTER_CONST_LONG("PIXELMASK_COMPOSITE", CompositePixelMask); -#endif - - -#if MagickLibVersion >= 0x707 -// AutoThresholdMethod -IMAGICK_REGISTER_CONST_LONG("AUTO_THRESHOLD_KAPUR", KapurThresholdMethod); -IMAGICK_REGISTER_CONST_LONG("AUTO_THRESHOLD_OTSU", OTSUThresholdMethod); -IMAGICK_REGISTER_CONST_LONG("AUTO_THRESHOLD_TRIANGLE", TriangleThresholdMethod); -#endif - -#if MagickLibVersion >= 0x702 -// ComplexOperator -IMAGICK_REGISTER_CONST_LONG("COMPLEX_OPERATOR_ADD", AddComplexOperator); -IMAGICK_REGISTER_CONST_LONG("COMPLEX_OPERATOR_CONJUGATE", ConjugateComplexOperator); -IMAGICK_REGISTER_CONST_LONG("COMPLEX_OPERATOR_DIVIDE", DivideComplexOperator); -IMAGICK_REGISTER_CONST_LONG("COMPLEX_OPERATOR_MAGNITUDEPHASE", MagnitudePhaseComplexOperator); -IMAGICK_REGISTER_CONST_LONG("COMPLEX_OPERATOR_MULTIPLY", MultiplyComplexOperator); -IMAGICK_REGISTER_CONST_LONG("COMPLEX_OPERATOR_REALIMAGINARY", RealImaginaryComplexOperator); -IMAGICK_REGISTER_CONST_LONG("COMPLEX_OPERATOR_SUBTRACT", SubtractComplexOperator); -#endif - -#if MagickLibVersion >= 0x702 -// ImageType -IMAGICK_REGISTER_CONST_LONG("IMAGE_TYPE_BILEVEL", BilevelType); -IMAGICK_REGISTER_CONST_LONG("IMAGE_TYPE_GRAYSCALE", GrayscaleType); -IMAGICK_REGISTER_CONST_LONG("IMAGE_TYPE_GRAYSCALE_ALPHA", GrayscaleAlphaType); -IMAGICK_REGISTER_CONST_LONG("IMAGE_TYPE_PALETTE", PaletteType); -IMAGICK_REGISTER_CONST_LONG("IMAGE_TYPE_PALETTE_ALPHA", PaletteAlphaType); -IMAGICK_REGISTER_CONST_LONG("IMAGE_TYPE_TRUE_COLOR", TrueColorType); -IMAGICK_REGISTER_CONST_LONG("IMAGE_TYPE_TRUE_COLOR_ALPHA", TrueColorAlphaType); -IMAGICK_REGISTER_CONST_LONG("IMAGE_TYPE_COLOR_SEPARATION", ColorSeparationType); -IMAGICK_REGISTER_CONST_LONG("IMAGE_TYPE_COLOR_SEPARATION_ALPHA", ColorSeparationAlphaType); -IMAGICK_REGISTER_CONST_LONG("IMAGE_TYPE_OPTIMIZE", OptimizeType); -IMAGICK_REGISTER_CONST_LONG("IMAGE_TYPE_PALETTE_BILEVEL_ALPHA", PaletteBilevelAlphaType); - -#endif - - - -#undef IMAGICK_REGISTER_CONST_LONG -#undef IMAGICK_REGISTER_CONST_STRING -}
View file
imagick-3.7.0.tgz/imagick-3.7.0/imagickdraw_class.c
Deleted
@@ -1,3087 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 / Imagick | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 Mikko Koppanen, Scott MacVicar | - | ImageMagick (c) ImageMagick Studio LLC | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Mikko Kopppanen <mkoppanen@php.net> | - | Scott MacVicar <scottmac@php.net> | - +----------------------------------------------------------------------+ -*/ - -#include "php_imagick.h" -#include "php_imagick_defs.h" -#include "php_imagick_macros.h" -#include "php_imagick_helpers.h" - -#if MagickLibVersion > 0x628 -/* {{{ proto bool ImagickDraw::resetvectorgraphics() - Resets the vector graphics -*/ -PHP_METHOD(ImagickDraw, resetVectorGraphics) -{ - php_imagickdraw_object *internd; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - DrawResetVectorGraphics(internd->drawing_wand); - RETURN_TRUE; -} -/* }}} */ -#endif - -#if MagickLibVersion > 0x649 -/* {{{ proto bool ImagickDraw::getTextKerning() - Gets the text kerning -*/ -PHP_METHOD(ImagickDraw, getTextKerning) -{ - php_imagickdraw_object *internd; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - RETURN_DOUBLE(DrawGetTextKerning(internd->drawing_wand)); -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::setTextKerning(float kerning) - Sets the text kerning -*/ -PHP_METHOD(ImagickDraw, setTextKerning) -{ - php_imagickdraw_object *internd; - double kerning; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &kerning) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - DrawSetTextKerning(internd->drawing_wand, kerning); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::getTextInterwordSpacing() - Gets the text interword spacing -*/ -PHP_METHOD(ImagickDraw, getTextInterwordSpacing) -{ - php_imagickdraw_object *internd; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - RETURN_DOUBLE(DrawGetTextInterwordSpacing(internd->drawing_wand)); -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::setTextInterwordSpacing(float spacing) - Sets the text interword spacing -*/ -PHP_METHOD(ImagickDraw, setTextInterwordSpacing) -{ - php_imagickdraw_object *internd; - double spacing; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &spacing) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - DrawSetTextInterwordSpacing(internd->drawing_wand, spacing); - RETURN_TRUE; -} -/* }}} */ -#endif - -#if MagickLibVersion > 0x655 -/* {{{ proto bool ImagickDraw::getTextInterlineSpacing() - Gets the text interword spacing -*/ -PHP_METHOD(ImagickDraw, getTextInterlineSpacing) -{ - php_imagickdraw_object *internd; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - RETURN_DOUBLE(DrawGetTextInterlineSpacing(internd->drawing_wand)); -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::setTextInterlineSpacing(float spacing) - Sets the text interword spacing -*/ -PHP_METHOD(ImagickDraw, setTextInterlineSpacing) -{ - php_imagickdraw_object *internd; - double spacing; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &spacing) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - DrawSetTextInterlineSpacing(internd->drawing_wand, spacing); - RETURN_TRUE; -} -/* }}} */ -#endif - -/* {{{ proto ImagickDraw ImagickDraw::__construct() - The ImagickDraw constructor -*/ -PHP_METHOD(ImagickDraw, __construct) -{ - /* Empty constructor for possible future uses */ - -#if PHP_VERSION_ID >= 70000 - // This suppresses an 'unused parameter' warning. - (void)execute_data; - (void)return_value; -#endif -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::circle(float ox, float oy, float px, float py) - Draws a circle on the image. -*/ -PHP_METHOD(ImagickDraw, circle) -{ - double ox, oy, px, py; - php_imagickdraw_object *internd; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddd", &ox, &oy, &px, &py) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - - DrawCircle(internd->drawing_wand, ox, oy, px, py); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::rectangle(float x1, float y1, float x2, float y2) - Draws a rectangle given two coordinates and using the current stroke, stroke width, and fill settings. -*/ -PHP_METHOD(ImagickDraw, rectangle) -{ - double x1, y1, x2, y2; - php_imagickdraw_object *internd; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddd", &x1, &y1, &x2, &y2) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - DrawRectangle(internd->drawing_wand, x1, y1, x2, y2); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::roundRectangle(float x1, float y1, float x2, float y2, float rx, float ry) - Draws a rounted rectangle given two coordinates, x & y corner radiuses and using the current stroke, stroke width, and fill settings. -*/ -PHP_METHOD(ImagickDraw, roundRectangle) -{ - double x1, y1, x2, y2, rx, ry; - php_imagickdraw_object *internd; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddddd", &x1, &y1, &x2, &y2, &rx, &ry) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - - DrawRoundRectangle(internd->drawing_wand, x1, y1, x2, y2, rx, ry); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::ellipse(float ox, float oy, float rx, float ry, float start, float end) - Draws an ellipse on the image. -*/ -PHP_METHOD(ImagickDraw, ellipse) -{ - double ox, oy, rx, ry, start, end; - php_imagickdraw_object *internd; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddddd", &ox, &oy, &rx, &ry, &start, &end) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - - DrawEllipse(internd->drawing_wand, ox, oy, rx, ry, start, end); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::skewX(float degrees) - Skews the current coordinate system in the horizontal direction. -*/ -PHP_METHOD(ImagickDraw, skewX) -{ - double degrees; - php_imagickdraw_object *internd; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", °rees) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - - DrawSkewX(internd->drawing_wand, degrees); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::skewY(float degrees) - Skews the current coordinate system in the vertical direction. -*/ -PHP_METHOD(ImagickDraw, skewY) -{ - double degrees; - php_imagickdraw_object *internd; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", °rees) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - - DrawSkewY(internd->drawing_wand, degrees); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::translate(float x, float y) - Applies a translation to the current coordinate system which moves the coordinate system origin to the specified coordinate. -*/ -PHP_METHOD(ImagickDraw, translate) -{ - double x, y; - php_imagickdraw_object *internd; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &x, &y) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - - DrawTranslate(internd->drawing_wand, x, y); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::setFillColor(PixelWand fill_wand) - Sets the fill color to be used for drawing filled objects. -*/ -PHP_METHOD(ImagickDraw, setFillColor) -{ - zval *param; - php_imagickdraw_object *internd; - PixelWand *color_wand; - zend_bool allocated; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", ¶m) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - - color_wand = php_imagick_zval_to_pixelwand(param, IMAGICKDRAW_CLASS, &allocated TSRMLS_CC); - if (!color_wand) - return; - - DrawSetFillColor(internd->drawing_wand, color_wand); - if (allocated) - color_wand = DestroyPixelWand (color_wand); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::setResolution(float x, float y) - Sets the resolution -*/ -PHP_METHOD(ImagickDraw, setResolution) -{ - char *density, *buf = NULL; - double x, y; - php_imagickdraw_object *internd; - DrawInfo *draw_info; - DrawingWand *d_wand; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &x, &y) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - - spprintf(&buf, 512, "%fx%f", x, y); - density = AcquireString(buf); - efree (buf); - - if (!density) { - php_imagick_throw_exception(IMAGICKDRAW_CLASS, "Failed to allocate memory" TSRMLS_CC); - return; - } - - draw_info = PeekDrawingWand(internd->drawing_wand); - draw_info->density = density; - - -#if MagickLibVersion >= 0x693 - d_wand = AcquireDrawingWand(draw_info, NULL); -#else - d_wand = (DrawingWand *) DrawAllocateWand(draw_info, NULL); -#endif - - if (!d_wand) { - php_imagick_throw_exception(IMAGICKDRAW_CLASS, "Failed to allocate new DrawingWand structure" TSRMLS_CC); - return; - } - - php_imagick_replace_drawingwand(internd, d_wand); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::setStrokeColor(PixelWand stroke_wand) - Sets the color used for stroking object outlines. -*/ -PHP_METHOD(ImagickDraw, setStrokeColor) -{ - zval *param; - php_imagickdraw_object *internd; - PixelWand *color_wand; - zend_bool allocated; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", ¶m) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - - color_wand = php_imagick_zval_to_pixelwand (param, IMAGICKDRAW_CLASS, &allocated TSRMLS_CC); - if (!color_wand) - return; - - DrawSetStrokeColor(internd->drawing_wand, color_wand); - if (allocated) - color_wand = DestroyPixelWand (color_wand); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::setFillAlpha(float opacity) - Sets the opacity to use when drawing using the fill color or fill texture. Fully opaque is 1.0. -*/ -PHP_METHOD(ImagickDraw, setFillAlpha) -{ - php_imagickdraw_object *internd; - double opacity; - - IMAGICK_METHOD_DEPRECATED("ImagickDraw", "setFillAlpha"); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &opacity) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - -#if MagickLibVersion >= 0x635 - DrawSetFillOpacity(internd->drawing_wand, opacity); -#else - DrawSetFillAlpha(internd->drawing_wand, opacity); -#endif - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::settextantialias() - Returns the antialias property associated with the wand. -*/ -PHP_METHOD(ImagickDraw, setTextAntialias) -{ - php_imagickdraw_object *internd; - zend_bool antialias; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &antialias) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - - DrawSetTextAntialias(internd->drawing_wand, antialias); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::setTextEncoding(string encoding) - Specifies 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. -*/ -PHP_METHOD(ImagickDraw, setTextEncoding) -{ - php_imagickdraw_object *internd; - char *encoding; - IM_LEN_TYPE encoding_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &encoding, &encoding_len) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - - DrawSetTextEncoding(internd->drawing_wand, encoding); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::setStrokeAlpha(float opacity) - Specifies the opacity of stroked object outlines. -*/ -PHP_METHOD(ImagickDraw, setStrokeAlpha) -{ - php_imagickdraw_object *internd; - double opacity; - - IMAGICK_METHOD_DEPRECATED("ImagickDraw", "setStrokeAlpha"); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &opacity) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - -#if MagickLibVersion >= 0x635 - DrawSetStrokeOpacity(internd->drawing_wand, opacity); -#else - DrawSetStrokeAlpha(internd->drawing_wand, opacity); -#endif - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::setStrokeWidth(float stroke_width) - Sets the width of the stroke used to draw object outlines. -*/ -PHP_METHOD(ImagickDraw, setStrokeWidth) -{ - php_imagickdraw_object *internd; - double width; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &width) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - - DrawSetStrokeWidth(internd->drawing_wand, width); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::setFont(string font_name) - Sets the fully-sepecified font to use when annotating with text. -*/ -PHP_METHOD(ImagickDraw, setFont) -{ - php_imagickdraw_object *internd; - char *font, *absolute; - IM_LEN_TYPE font_len; - MagickBooleanType status; - php_imagick_rw_result_t rc; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &font, &font_len) == FAILURE) { - return; - } - - /* Check that no empty string is passed */ - if (font_len == 0) { - php_imagick_throw_exception (IMAGICKDRAW_CLASS, "Can not set empty font" TSRMLS_CC); - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - - /* And if it wasn't */ - if (!php_imagick_check_font(font, font_len TSRMLS_CC)) { - - if ((absolute = expand_filepath(font, NULL TSRMLS_CC)) == NULL) { - php_imagick_throw_exception (IMAGICKDRAW_CLASS, "Unable to set font, file path expansion failed" TSRMLS_CC); - return; - } - - /* Do an access check for the font */ - if ((rc = php_imagick_file_access_check (absolute TSRMLS_CC)) != IMAGICK_RW_OK) { - // Failed - php_imagick_imagickdraw_rw_fail_to_exception (internd->drawing_wand, rc, absolute TSRMLS_CC); - efree(absolute); - return; - } - status = DrawSetFont(internd->drawing_wand, absolute); - efree(absolute); - - } else { - status = DrawSetFont(internd->drawing_wand, font); - } - - if (status == MagickFalse) { - php_imagick_convert_imagickdraw_exception (internd->drawing_wand, "Unable to set font" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::setFontFamily(string font_family) - Sets the font family to use when annotating with text. -*/ -PHP_METHOD(ImagickDraw, setFontFamily) -{ - php_imagickdraw_object *internd; - char *font_family; - IM_LEN_TYPE font_family_len; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &font_family, &font_family_len) == FAILURE) { - return; - } - - /* Check that no empty string is passed */ - if (font_family_len == 0) { - php_imagick_throw_exception(IMAGICKDRAW_CLASS, "Can not set empty font family" TSRMLS_CC); - return; - } - - if (!php_imagick_check_font(font_family, font_family_len TSRMLS_CC )) { - php_imagick_throw_exception(IMAGICKDRAW_CLASS, "Unable to set font family; parameter not found in the list of configured fonts" TSRMLS_CC); - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - status = DrawSetFontFamily(internd->drawing_wand, font_family); - - if (status == MagickFalse) { - php_imagick_convert_imagickdraw_exception (internd->drawing_wand, "Unable to set font family" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::setFontSize(float pointsize) - Sets the font pointsize to use when annotating with text. -*/ -PHP_METHOD(ImagickDraw, setFontSize) -{ - php_imagickdraw_object *internd; - double font_size; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &font_size) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - - DrawSetFontSize(internd->drawing_wand, font_size); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::setFontStyle(int style) - Sets the font style to use when annotating with text. The AnyStyle enumeration acts as a wild-card "don't care" option. -*/ -PHP_METHOD(ImagickDraw, setFontStyle) -{ - php_imagickdraw_object *internd; - im_long style_id = AnyStyle; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &style_id) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - - DrawSetFontStyle(internd->drawing_wand, style_id); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::setFontWeight(int font_weight) - Sets the font weight to use when annotating with text. -*/ -PHP_METHOD(ImagickDraw, setFontWeight) -{ - php_imagickdraw_object *internd; - im_long weight; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &weight) == FAILURE) { - return; - } - - if (weight >= 100 && weight <= 900) { - internd = Z_IMAGICKDRAW_P(getThis());; - DrawSetFontWeight(internd->drawing_wand, weight); - RETURN_TRUE; - } - php_imagick_throw_exception(IMAGICKDRAW_CLASS, "Font weight valid range is 100-900" TSRMLS_CC); - return; -} -/* }}} */ - -/* {{{ proto int ImagickDraw::getFontStretch(int fontStretch) - Gets the font stretch to use when annotating with text -*/ -PHP_METHOD(ImagickDraw, getFontStretch) -{ - php_imagickdraw_object *internd; - - internd = Z_IMAGICKDRAW_P(getThis());; - RETVAL_LONG(DrawGetFontStretch(internd->drawing_wand)); -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::setFontStretch(int fontStretch) - Sets the font stretch to use when annotating with text. The AnyStretch enumeration acts as a wild-card "don't care" option. -*/ -PHP_METHOD(ImagickDraw, setFontStretch) -{ - php_imagickdraw_object *internd; - im_long stretch; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &stretch) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - - DrawSetFontStretch(internd->drawing_wand, stretch); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::setStrokeAntialias(bool stroke_antialias) - Controls whether stroked outlines are antialiased. Stroked outlines are antialiased by default. When antialiasing is disabled stroked pixels are thresholded to determine if the stroke color or underlying canvas color should be used. -*/ -PHP_METHOD(ImagickDraw, setStrokeAntialias) -{ - php_imagickdraw_object *internd; - zend_bool antialias; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &antialias) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - - DrawSetStrokeAntialias(internd->drawing_wand, antialias); - RETURN_TRUE; - -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::setTextAlignment(int alignment) - Specifies a text alignment to be applied when annotating with text. -*/ -PHP_METHOD(ImagickDraw, setTextAlignment) -{ - php_imagickdraw_object *internd; - im_long align; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &align) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - - DrawSetTextAlignment(internd->drawing_wand, align); - RETURN_TRUE; - -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::setTextDecoration(int decoration) - Specifies a decoration to be applied when annotating with text. -*/ -PHP_METHOD(ImagickDraw, setTextDecoration) -{ - php_imagickdraw_object *internd; - im_long decoration; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &decoration) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - - DrawSetTextDecoration(internd->drawing_wand, decoration); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::setTextUnderColor(PixelWand under_wand) - Specifies the color of a background rectangle to place under text annotations. -*/ -PHP_METHOD(ImagickDraw, setTextUnderColor) -{ - zval *param; - php_imagickdraw_object *internd; - PixelWand *color_wand; - zend_bool allocated; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", ¶m) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - - color_wand = php_imagick_zval_to_pixelwand (param, IMAGICKDRAW_CLASS, &allocated TSRMLS_CC); - if (!color_wand) - return; - - DrawSetTextUnderColor(internd->drawing_wand, color_wand); - if (allocated) - color_wand = DestroyPixelWand (color_wand); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::setViewbox(float x1, float y1, float x2, float y2 ) - Sets the overall canvas size to be recorded with the drawing vector data. Usually this will be specified using the same size as the canvas image. When the vector data is saved to SVG or MVG formats, the viewbox is use to specify the size of the canvas image that a viewer will render the vector data on. -*/ -PHP_METHOD(ImagickDraw, setViewbox) -{ - php_imagickdraw_object *internd; - im_long x1, y1, x2, y2; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llll", &x1, &y1, &x2, &y2) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - - DrawSetViewbox(internd->drawing_wand, x1, y1, x2, y2); - RETURN_TRUE; -} - -/* {{{ proto string ImagickDraw::getFont() - Returns a string specifying the font used when annotating with text -*/ -PHP_METHOD(ImagickDraw, getFont) -{ - php_imagickdraw_object *internd; - char *font; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - - font = DrawGetFont(internd->drawing_wand); - - if (!font) { - RETURN_FALSE; - } else { - IM_ZVAL_STRING(return_value, font); - IMAGICK_FREE_MAGICK_MEMORY(font); - return; - } -} -/* }}} */ - -/* {{{ proto string ImagickDraw::getFontFamily() - Returns the font family to use when annotating with text. The value returned must be freed by the user when it is no longer needed. -*/ -PHP_METHOD(ImagickDraw, getFontFamily) -{ - php_imagickdraw_object *internd; - char *font_family; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - - font_family = DrawGetFontFamily(internd->drawing_wand); - if (!font_family) { - RETURN_FALSE; - } else { - IM_ZVAL_STRING(return_value, font_family); - IMAGICK_FREE_MAGICK_MEMORY(font_family); - return; - } -} -/* }}} */ - -/* {{{ proto float ImagickDraw::getFontSize() - Returns the font pointsize used when annotating with text. -*/ -PHP_METHOD(ImagickDraw, getFontSize) -{ - php_imagickdraw_object *internd; - double font_size; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - - font_size = DrawGetFontSize(internd->drawing_wand); - ZVAL_DOUBLE(return_value, font_size); - return; -} -/* }}} */ - -/* {{{ proto int ImagickDraw::getFontStyle() - Returns the font style used when annotating with text. -*/ -PHP_METHOD(ImagickDraw, getFontStyle) -{ - php_imagickdraw_object *internd; - long font_style; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - - font_style = DrawGetFontStyle(internd->drawing_wand); - ZVAL_LONG(return_value, font_style); - return; -} -/* }}} */ - -/* {{{ proto int ImagickDraw::getFontWeight() - Returns the font weight used when annotating with text. -*/ -PHP_METHOD(ImagickDraw, getFontWeight) -{ - php_imagickdraw_object *internd; - long weight; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - - weight = DrawGetFontWeight(internd->drawing_wand); - ZVAL_LONG(return_value, weight); - return; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::clear() - Clears a DrawingWand resource of any accumulated commands, and resets the settings it contains to their defaults. -*/ -PHP_METHOD(ImagickDraw, clear) -{ - php_imagickdraw_object *internd; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - ClearDrawingWand(internd->drawing_wand); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int ImagickDraw::getTextDecoration() - Returns the decoration applied when annotating with text. -*/ -PHP_METHOD(ImagickDraw, getTextDecoration) -{ - php_imagickdraw_object *internd; - long decoration; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - - decoration = DrawGetTextDecoration(internd->drawing_wand); - ZVAL_LONG(return_value, decoration); - return; -} -/* }}} */ - -/* {{{ proto string ImagickDraw::getTextEncoding() - Returns a null-terminated string which specifies the code set used for text annotations. The string must be freed by the user once it is no longer required. -*/ -PHP_METHOD(ImagickDraw, getTextEncoding) -{ - php_imagickdraw_object *internd; - char *encoding; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - encoding = DrawGetTextEncoding(internd->drawing_wand); - - if (!encoding) { - RETURN_FALSE; - } else { - IM_ZVAL_STRING(return_value, encoding); - IMAGICK_FREE_MAGICK_MEMORY(encoding); - return; - } -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::annotation(float x, float y, string *text) - Draws text on the image. -*/ -PHP_METHOD(ImagickDraw, annotation) -{ - php_imagickdraw_object *internd; - double x, y; - unsigned char *text; - IM_LEN_TYPE text_len; -#if MagickLibVersion < 0x632 - char *font; -#endif - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dds", &x, &y, &text, &text_len) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; -#if MagickLibVersion < 0x632 - font = DrawGetFont(internd->drawing_wand); - - /* Fixes PECL Bug #11328 */ - if (!font) { - php_imagick_throw_exception(IMAGICKDRAW_CLASS, "Font needs to be set before annotating an image" TSRMLS_CC); - return; - } -#endif - - DrawAnnotation(internd->drawing_wand, x, y, text); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::arc(float sx, float sy, float ex, float ey, float sd, float ed) - Draws an arc falling within a specified bounding rectangle on the image. -*/ -PHP_METHOD(ImagickDraw, arc) -{ - double sx, sy, ex, ey, sd, ed; - php_imagickdraw_object *internd; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddddd", &sx, &sy, &ex, &ey, &sd, &ed) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - - DrawArc(internd->drawing_wand, sx, sy, ex, ey, sd, ed); - RETURN_TRUE; -} -/* }}} */ - - -#if MagickLibVersion < 0x700 -/* {{{ proto bool ImagickDraw::matte(float x, float y, int paintMethod) - Paints on the image's opacity channel in order to set effected pixels to transparent. to influence the opacity of pixels. The available paint methods are: -*/ -PHP_METHOD(ImagickDraw, matte) -{ - double x, y; - php_imagickdraw_object *internd; - im_long paint_method; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddl", &x, &y, &paint_method) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - - DrawMatte(internd->drawing_wand, x, y, paint_method); - RETURN_TRUE; -} -/* }}} */ - -#else - -/* {{{ proto bool ImagickDraw::alpha(float x, float y, int paintMethod) - Paints on the image's alpha channel in order to set effected pixels to transparent. to influence the alpha of pixels. The available paint methods are: - PointMethod: Select the target pixel - ReplaceMethod: Select any pixel that matches the target pixel. - FloodfillMethod: Select the target pixel and matching neighbors. - FillToBorderMethod: Select the target pixel and neighbors not matching -border color. - ResetMethod: Select all pixels. -*/ -PHP_METHOD(ImagickDraw, alpha) -{ - double x, y; - php_imagickdraw_object *internd; - im_long paint_method; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddl", &x, &y, &paint_method) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - - DrawAlpha(internd->drawing_wand, x, y, paint_method); - RETURN_TRUE; -} -/* }}} */ - -#endif - - -/* {{{ proto bool ImagickDraw::polygon(array coordinates) - Draws a polygon using the current stroke, stroke width, and fill color or texture, using the specified array of coordinates. -*/ -PHP_METHOD(ImagickDraw, polygon) -{ - zval *coordinate_array; - php_imagickdraw_object *internd; - PointInfo *coordinates; - int num_elements = 0; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &coordinate_array) == FAILURE) { - return; - } - - coordinates = php_imagick_zval_to_pointinfo_array(coordinate_array, &num_elements TSRMLS_CC); - - if (!coordinates) { - php_imagick_throw_exception(IMAGICKDRAW_CLASS, "Unable to read coordinate array" TSRMLS_CC); - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - DrawPolygon(internd->drawing_wand, num_elements, coordinates); - - efree(coordinates); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::bezier(array coordinates) - Draws a bezier curve through a set of points on the image. -*/ -PHP_METHOD(ImagickDraw, bezier) -{ - zval *coordinate_array; - php_imagickdraw_object *internd; - PointInfo *coordinates; - int num_elements = 0; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &coordinate_array) == FAILURE) { - return; - } - - coordinates = php_imagick_zval_to_pointinfo_array(coordinate_array, &num_elements TSRMLS_CC); - - if (!coordinates) { - php_imagick_throw_exception(IMAGICKDRAW_CLASS, "Unable to read coordinate array" TSRMLS_CC); - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - DrawBezier(internd->drawing_wand, num_elements, coordinates); - - efree(coordinates); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::point(float x, float y) - Draws a point using the current stroke color and stroke thickness at the specified coordinates. -*/ -PHP_METHOD(ImagickDraw, point) -{ - php_imagickdraw_object *internd; - double x, y; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &x, &y) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - DrawPoint(internd->drawing_wand, x, y); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::line(float sx, float sy, float ex, float ey) - Draws a line on the image using the current stroke color, stroke opacity, and stroke width. -*/ -PHP_METHOD(ImagickDraw, line) -{ - php_imagickdraw_object *internd; - double sx, sy, ex, ey; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddd", &sx, &sy, &ex, &ey) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - - DrawLine(internd->drawing_wand, sx, sy, ex, ey); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto ImagickDraw ImagickDraw::clone() - Makes an exact copy of the specified wand. -*/ -PHP_METHOD(ImagickDraw, clone) -{ - php_imagickdraw_object *internd, *intern_return; - DrawingWand *tmp_wand; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - IMAGICK_METHOD_DEPRECATED("ImagickDraw", "clone"); - - internd = Z_IMAGICKDRAW_P(getThis());; - tmp_wand = CloneDrawingWand(internd->drawing_wand); - - if (!tmp_wand) { - php_imagick_throw_exception (IMAGICK_CLASS, "Failed to allocate DrawingWand structure" TSRMLS_CC); - return; - } - - object_init_ex(return_value, php_imagickdraw_sc_entry); - intern_return = Z_IMAGICKDRAW_P(return_value); - php_imagick_replace_drawingwand(intern_return, tmp_wand); - - return; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::affine(array affine) - Adjusts the current affine transformation matrix with the specified affine transformation matrix. Note that the current affine transform is adjusted rather than replaced. -*/ -PHP_METHOD(ImagickDraw, affine) -{ - php_imagickdraw_object *internd; - zval *affine_matrix; - -#if PHP_VERSION_ID >= 70000 - zval *pzval; -#else - HashTable *affine; - zval **ppzval; -#endif - char *matrix_elements = { "sx", "rx", "ry", - "sy", "tx", "ty" }; - int i; - double value; - AffineMatrix matrix; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &affine_matrix) == FAILURE) { - return; - } - -#if PHP_VERSION_ID < 70000 - affine = Z_ARRVAL_P(affine_matrix); - zend_hash_internal_pointer_reset_ex(affine, (HashPosition *) 0); -#endif - - - for (i = 0; i < 6 ; i++) { -#if PHP_VERSION_ID >= 70000 - pzval = zend_hash_str_find(HASH_OF(affine_matrix), matrix_elementsi, 2); - ZVAL_DEREF(pzval); - if (pzval == NULL) { - php_imagick_throw_exception(IMAGICKDRAW_CLASS, "AffineMatrix must contain keys: sx, rx, ry, sy, tx and ty" TSRMLS_CC); - return; -#else - if (zend_hash_find(affine, matrix_elementsi, 3, (void**)&ppzval) == FAILURE) { - php_imagick_throw_exception(IMAGICKDRAW_CLASS, "AffineMatrix must contain keys: sx, rx, ry, sy, tx and ty" TSRMLS_CC); - return; -#endif - } else { - -#if PHP_VERSION_ID >= 70000 - value = zval_get_double(pzval); -#else - zval tmp_zval, *tmp_pzval; - - tmp_zval = **ppzval; - zval_copy_ctor(&tmp_zval); - tmp_pzval = &tmp_zval; - convert_to_double(tmp_pzval); - value = Z_DVAL(tmp_zval); -#endif - if (strcmp(matrix_elementsi, "sx") == 0) { - matrix.sx = value; - } else if (strcmp(matrix_elementsi, "rx") == 0) { - matrix.rx = value; - } else if (strcmp(matrix_elementsi, "ry") == 0) { - matrix.ry = value; - } else if (strcmp(matrix_elementsi, "sy") == 0) { - matrix.sy = value; - } else if (strcmp(matrix_elementsi, "tx") == 0) { - matrix.tx = value; - } else if (strcmp(matrix_elementsi, "ty") == 0) { - matrix.ty = value; - } - } - } - - internd = Z_IMAGICKDRAW_P(getThis()); - - DrawAffine(internd->drawing_wand, &matrix); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::composite(int compose, float x, float y, float width, float height, MagickWand magick_wand) - Composites an image onto the current image, using the specified composition operator, specified position, and at the specified size. -*/ -PHP_METHOD(ImagickDraw, composite) -{ - php_imagickdraw_object *internd; - php_imagick_object *intern; - zval *magick_obj; - im_long compose; - double x, y, width, height; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lddddO", &compose, &x, &y, &width, &height, &magick_obj, php_imagick_sc_entry) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(magick_obj); - - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - internd = Z_IMAGICKDRAW_P(getThis()); - status = DrawComposite(internd->drawing_wand, compose, x, y, width, height, intern->magick_wand); - - if (status == MagickFalse) { - php_imagick_convert_imagickdraw_exception (internd->drawing_wand, "Compositing image failed" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::color(float x, float y, int paintMethod) - Draws color on image using the current fill color, starting at specified position, and using specified paint method. The available paint methods are: -*/ -PHP_METHOD(ImagickDraw, color) -{ - php_imagickdraw_object *internd; - double x, y; - im_long paint_method; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddl", &x, &y, &paint_method) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - - DrawColor(internd->drawing_wand, x, y, paint_method); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::comment(string comment) - Adds a comment to a vector output stream. -*/ -PHP_METHOD(ImagickDraw, comment) -{ - php_imagickdraw_object *internd; - char *comment; - IM_LEN_TYPE comment_len; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &comment, &comment_len) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - - DrawComment(internd->drawing_wand, comment); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto string ImagickDraw::getClipPath() - Obtains the current clipping path ID. The value returned must be deallocated by the user when it is no longer needed. -*/ -PHP_METHOD(ImagickDraw, getClipPath) -{ - php_imagickdraw_object *internd; - char *clip_path; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - clip_path = DrawGetClipPath(internd->drawing_wand); - - if (!clip_path) { - RETURN_FALSE; - } else { - IM_ZVAL_STRING(return_value, clip_path); - IMAGICK_FREE_MAGICK_MEMORY(clip_path); - return; - } -} -/* }}} */ - -/* {{{ proto int ImagickDraw::getClipRule() - Returns the current polygon fill rule to be used by the clipping path. -*/ -PHP_METHOD(ImagickDraw, getClipRule) -{ - php_imagickdraw_object *internd; - long clip_rule; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - clip_rule = DrawGetClipRule(internd->drawing_wand); - - RETVAL_LONG(clip_rule); -} -/* }}} */ - -/* {{{ proto int ImagickDraw::getClipUnits() - Returns the interpretation of clip path units. -*/ -PHP_METHOD(ImagickDraw, getClipUnits) -{ - php_imagickdraw_object *internd; - long units; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - units = DrawGetClipUnits(internd->drawing_wand); - - RETVAL_LONG(units); -} -/* }}} */ - -/* {{{ proto ImagickPixel ImagickDraw::getFillColor() - Returns the fill color used for drawing filled objects. -*/ -PHP_METHOD(ImagickDraw, getFillColor) -{ - php_imagickpixel_object *internp; - php_imagickdraw_object *internd; - PixelWand *tmp_wand; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - - tmp_wand = NewPixelWand(); - DrawGetFillColor(internd->drawing_wand, tmp_wand); - - object_init_ex(return_value, php_imagickpixel_sc_entry); - internp = Z_IMAGICKPIXEL_P(return_value); - php_imagick_replace_pixelwand(internp, tmp_wand); - - return; -} -/* }}} */ - -/* {{{ proto float ImagickDraw::getFillOpacity() - Returns the opacity used when drawing using the fill color or fill texture. Fully opaque is 1.0. -*/ -PHP_METHOD(ImagickDraw, getFillOpacity) -{ - php_imagickdraw_object *internd; - double opacity; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - opacity = DrawGetFillOpacity(internd->drawing_wand); - - RETVAL_DOUBLE(opacity); -} -/* }}} */ - -/* {{{ proto int ImagickDraw::getFillRule(const DrawingWand *wand) - Returns the fill rule used while drawing polygons. -*/ -PHP_METHOD(ImagickDraw, getFillRule) -{ - php_imagickdraw_object *internd; - long fill_rule; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - fill_rule = DrawGetFillRule(internd->drawing_wand); - - RETVAL_LONG(fill_rule); -} -/* }}} */ - -/* {{{ proto int ImagickDraw::getGravity() - Returns the text placement gravity used when annotating with text. -*/ -PHP_METHOD(ImagickDraw, getGravity) -{ - php_imagickdraw_object *internd; - long gravity; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - gravity = DrawGetGravity(internd->drawing_wand); - - RETVAL_LONG(gravity); -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::getStrokeAntialias() - Returns the current stroke antialias setting. Stroked outlines are antialiased by default. When antialiasing is disabled stroked pixels are thresholded to determine if the stroke color or underlying canvas color should be used. -*/ -PHP_METHOD(ImagickDraw, getStrokeAntialias) -{ - php_imagickdraw_object *internd; - MagickBooleanType status; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - status = DrawGetStrokeAntialias(internd->drawing_wand); - - if (status == MagickFalse) { - RETURN_FALSE; - } else { - RETURN_TRUE; - } -} -/* }}} */ - -/* {{{ proto ImagickPixel ImagickDraw::getStrokeColor(PixelWand stroke_color) - Returns the color used for stroking object outlines. -*/ -PHP_METHOD(ImagickDraw, getStrokeColor) -{ - php_imagickpixel_object *internp; - php_imagickdraw_object *internd; - PixelWand *tmp_wand; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - - tmp_wand = NewPixelWand(); - DrawGetStrokeColor(internd->drawing_wand, tmp_wand); - - object_init_ex(return_value, php_imagickpixel_sc_entry); - internp = Z_IMAGICKPIXEL_P(return_value); - php_imagick_replace_pixelwand(internp, tmp_wand); - - return; -} -/* }}} */ - -/* {{{ proto array ImagickDraw::getStrokeDashArray() - Returns an array representing the pattern of dashes and gaps used to stroke paths (see DrawSetStrokeDashArray). The array must be freed once it is no longer required by the user. -*/ -PHP_METHOD(ImagickDraw, getStrokeDashArray) -{ - php_imagickdraw_object *internd; - double *stroke_array; - unsigned long i; - size_t num_elements; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - - stroke_array = DrawGetStrokeDashArray(internd->drawing_wand, &num_elements); - array_init(return_value); - - for (i = 0; i < num_elements ; i++) { - add_next_index_double(return_value, stroke_arrayi); - } - - IMAGICK_FREE_MAGICK_MEMORY(stroke_array); - return; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::setStrokeDashArray(array dashArray) - Specifies the pattern of dashes and gaps used to stroke paths. The strokeDashArray represents an array of numbers that specify the lengths of alternating dashes and gaps in pixels. If an odd number of values is provided, then the list of values is repeated to yield an even number of values. To remove an existing dash array, pass a zero number_elements argument and null dash_array. A typical strokeDashArray_ array might contain the members 5 3 2. -*/ -PHP_METHOD(ImagickDraw, setStrokeDashArray) -{ - zval *param_array; - double *double_array; - im_long elements; - php_imagickdraw_object *internd; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", ¶m_array) == FAILURE) { - return; - } - - double_array = php_imagick_zval_to_double_array(param_array, &elements TSRMLS_CC); - - if (!double_array) { - php_imagick_throw_exception(IMAGICKDRAW_CLASS, "Cannot read stroke dash array parameter" TSRMLS_CC); - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - - DrawSetStrokeDashArray(internd->drawing_wand, elements, double_array); - efree(double_array); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto float ImagickDraw::getStrokeDashOffset() - Returns the offset into the dash pattern to start the dash. -*/ -PHP_METHOD(ImagickDraw, getStrokeDashOffset) -{ - php_imagickdraw_object *internd; - double offset; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - offset = DrawGetStrokeDashOffset(internd->drawing_wand); - - RETVAL_DOUBLE(offset); -} -/* }}} */ - -/* {{{ proto int ImagickDraw::getStrokeLineCap() - Returns the shape to be used at the end of open subpaths when they are stroked. Values of LineCap are UndefinedCap, ButtCap, RoundCap, and SquareCap. -*/ -PHP_METHOD(ImagickDraw, getStrokeLineCap) -{ - php_imagickdraw_object *internd; - long line_cap; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - line_cap = DrawGetStrokeLineCap(internd->drawing_wand); - - RETVAL_LONG(line_cap); -} -/* }}} */ - -/* {{{ proto int ImagickDraw::getStrokeLineJoin() - Returns the shape to be used at the corners of paths (or other vector shapes) when they are stroked. Values of LineJoin are UndefinedJoin, MiterJoin, RoundJoin, and BevelJoin. -*/ -PHP_METHOD(ImagickDraw, getStrokeLineJoin) -{ - php_imagickdraw_object *internd; - long line_join; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - line_join = DrawGetStrokeLineJoin(internd->drawing_wand); - - RETVAL_LONG(line_join); -} -/* }}} */ - -/* {{{ proto int ImagickDraw::getStrokeMiterLimit() - Returns the miter limit. When two line segments meet at a sharp angle and miter joins have been specified for 'lineJoin', it is possible for the miter to extend far beyond the thickness of the line stroking the path. The miterLimit' imposes a limit on the ratio of the miter length to the 'lineWidth'. -*/ -PHP_METHOD(ImagickDraw, getStrokeMiterLimit) -{ - php_imagickdraw_object *internd; - unsigned long miter_limit; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - miter_limit = DrawGetStrokeMiterLimit(internd->drawing_wand); - - RETVAL_LONG(miter_limit); -} -/* }}} */ - -/* {{{ proto float ImagickDraw::getStrokeOpacity() - Returns the opacity of stroked object outlines. -*/ -PHP_METHOD(ImagickDraw, getStrokeOpacity) -{ - php_imagickdraw_object *internd; - double opacity; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - opacity = DrawGetStrokeOpacity(internd->drawing_wand); - - RETVAL_DOUBLE(opacity); -} -/* }}} */ - -/* {{{ proto float ImagickDraw::getStrokeWidth() - Returns the width of the stroke used to draw object outlines. -*/ -PHP_METHOD(ImagickDraw, getStrokeWidth) -{ - php_imagickdraw_object *internd; - double width; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - width = DrawGetStrokeWidth(internd->drawing_wand); - - RETVAL_DOUBLE(width); -} -/* }}} */ - -/* {{{ proto int ImagickDraw::getTextAlignment() - Returns the alignment applied when annotating with text. -*/ -PHP_METHOD(ImagickDraw, getTextAlignment) -{ - php_imagickdraw_object *internd; - long align_type; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - align_type = DrawGetTextAlignment(internd->drawing_wand); - - RETVAL_LONG(align_type); -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::getTextAntialias() - Returns the current text antialias setting, which determines whether text is antialiased. Text is antialiased by default. -*/ -PHP_METHOD(ImagickDraw, getTextAntialias) -{ - php_imagickdraw_object *internd; - MagickBooleanType status; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - status = DrawGetTextAntialias(internd->drawing_wand); - - if (status == MagickFalse) { - RETURN_FALSE; - } else { - RETURN_TRUE; - } -} -/* }}} */ - -/* {{{ proto string ImagickDraw::getVectorGraphics() - Returns a null-terminated string which specifies the vector graphics generated by any graphics calls made since the wand was instantiated. The string must be freed by the user once it is no longer required. -*/ -PHP_METHOD(ImagickDraw, getVectorGraphics) -{ - php_imagickdraw_object *internd; - char *vector; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - vector = DrawGetVectorGraphics(internd->drawing_wand); - - IM_ZVAL_STRING(return_value, vector); - IMAGICK_FREE_MAGICK_MEMORY(vector); - - return; -} -/* }}} */ - -/* {{{ proto ImagickPixel ImagickDraw::getTextUnderColor(PixelWand under_color) - Returns the color of a background rectangle to place under text annotations. -*/ -PHP_METHOD(ImagickDraw, getTextUnderColor) -{ - php_imagickpixel_object *internp; - php_imagickdraw_object *internd; - PixelWand *tmp_wand; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - tmp_wand = NewPixelWand(); - - if (!tmp_wand) { - php_imagick_throw_exception(IMAGICKDRAW_CLASS, "Failed to allocate space for new PixelWand" TSRMLS_CC); - return; - } - - DrawGetTextUnderColor(internd->drawing_wand, tmp_wand); - - object_init_ex(return_value, php_imagickpixel_sc_entry); - internp = Z_IMAGICKPIXEL_P(return_value); - php_imagick_replace_pixelwand(internp, tmp_wand); - - return; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::pathClose() - Adds a path element to the current path which closes the current subpath by drawing a straight line from the current point to the current subpath's most recent starting point (usually, the most recent moveto point). -*/ -PHP_METHOD(ImagickDraw, pathClose) -{ - php_imagickdraw_object *internd; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - DrawPathClose(internd->drawing_wand); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::pathCurveToAbsolute(float x1, float y1, float x2, float y2, float x, float y) - Draws a cubic Bezier curve from the current point to (x,y) using (x1,y1) as the control point at the beginning of the curve and (x2,y2) as the control point at the end of the curve using absolute coordinates. At the end of the command, the new current point becomes the final (x,y) coordinate pair used in the polybezier. -*/ -PHP_METHOD(ImagickDraw, pathCurveToAbsolute) -{ - php_imagickdraw_object *internd; - double x1, y1, x2, y2, x, y; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddddd", &x1, &y1, &x2, &y2, &x, &y) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - - DrawPathCurveToAbsolute(internd->drawing_wand, x1, y1, x2, y2, x, y); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::pathCurveToRelative(float x1, float y1, float x2, float y2, float x, float y) - Draws a cubic Bezier curve from the current point to (x,y) using (x1,y1) as the control point at the beginning of the curve and (x2,y2) as the control point at the end of the curve using relative coordinates. At the end of the command, the new current point becomes the final (x,y) coordinate pair used in the polybezier. -*/ -PHP_METHOD(ImagickDraw, pathCurveToRelative) -{ - php_imagickdraw_object *internd; - double x1, y1, x2, y2, x, y; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddddd", &x1, &y1, &x2, &y2, &x, &y) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - - DrawPathCurveToRelative(internd->drawing_wand, x1, y1, x2, y2, x, y); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::pathCurveToQuadraticBezierAbsolute(float x1, float y1, float x, float y) - Draws a quadratic Bezier curve from the current point to (x,y) using (x1,y1) as the control point using absolute coordinates. At the end of the command, the new current point becomes the final (x,y) coordinate pair used in the polybezier. -*/ -PHP_METHOD(ImagickDraw, pathCurveToQuadraticBezierAbsolute) -{ - php_imagickdraw_object *internd; - double x1, y1, x, y; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddd", &x1, &y1, &x, &y) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - - DrawPathCurveToQuadraticBezierAbsolute(internd->drawing_wand, x1, y1, x, y); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::pathCurveToQuadraticBezierRelative(float x1, float y1, float x, float y) - Draws a quadratic Bezier curve from the current point to (x,y) using (x1,y1) as the control point using relative coordinates. At the end of the command, the new current point becomes the final (x,y) coordinate pair used in the polybezier. -*/ -PHP_METHOD(ImagickDraw, pathCurveToQuadraticBezierRelative) -{ - php_imagickdraw_object *internd; - double x1, y1, x, y; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddd", &x1, &y1, &x, &y) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - - DrawPathCurveToQuadraticBezierRelative(internd->drawing_wand, x1, y1, x, y); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::pathCurveToQuadraticBezierSmoothAbsolute(float x, float y) - Draws a quadratic Bezier curve (using relative coordinates) from the current point to (x,y). The control point is assumed to be the reflection of the control point on the previous command relative to the current point. (If there is no previous command or if the previous command was not a DrawPathCurveToQuadraticBezierAbsolute, DrawPathCurveToQuadraticBezierRelative, DrawPathCurveToQuadraticBezierSmoothAbsolut or DrawPathCurveToQuadraticBezierSmoothRelative, assume the control point is coincident with the current point.). At the end of the command, the new current point becomes the final (x,y) coordinate pair used in the polybezier. -*/ -PHP_METHOD(ImagickDraw, pathCurveToQuadraticBezierSmoothAbsolute) -{ - php_imagickdraw_object *internd; - double x, y; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &x, &y) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - - DrawPathCurveToQuadraticBezierSmoothAbsolute(internd->drawing_wand, x, y); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::pathCurveToQuadraticBezierSmoothRelative(float x, float y) - Draws a quadratic Bezier curve (using relative coordinates) from the current point to (x, y). The control point is assumed to be the reflection of the control point on the previous command relative to the current point. (If there is no previous command or if the previous command was not a DrawPathCurveToQuadraticBezierAbsolute, DrawPathCurveToQuadraticBezierRelative, DrawPathCurveToQuadraticBezierSmoothAbsolut or DrawPathCurveToQuadraticBezierSmoothRelative, assume the control point is coincident with the current point). At the end of the command, the new current point becomes the final (x, y) coordinate pair used in the polybezier. -*/ -PHP_METHOD(ImagickDraw, pathCurveToQuadraticBezierSmoothRelative) -{ - php_imagickdraw_object *internd; - double x, y; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &x, &y) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - - DrawPathCurveToQuadraticBezierSmoothRelative(internd->drawing_wand, x, y); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::pathCurveToSmoothAbsolute(float x2, float y2, float x, float y) - Draws a cubic Bezier curve from the current point to (x,y) using absolute coordinates. The first control point is assumed to be the reflection of the second control point on the previous command relative to the current point. (If there is no previous command or if the previous command was not an DrawPathCurveToAbsolute, DrawPathCurveToRelative, DrawPathCurveToSmoothAbsolute or DrawPathCurveToSmoothRelative, assume the first control point is coincident with the current point.) (x2,y2) is the second control point (i.e., the control point at the end of the curve). At the end of the command, the new current point becomes the final (x,y) coordinate pair used in the polybezier. -*/ -PHP_METHOD(ImagickDraw, pathCurveToSmoothAbsolute) -{ - php_imagickdraw_object *internd; - double x1, y1, x, y; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddd", &x1, &y1, &x, &y) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - - DrawPathCurveToSmoothAbsolute(internd->drawing_wand, x1, y1, x, y); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::pathCurveToSmoothRelative(float x2, float y2, float x, float y) - Draws a cubic Bezier curve from the current point to (x,y) using relative coordinates. The first control point is assumed to be the reflection of the second control point on the previous command relative to the current point. (If there is no previous command or if the previous command was not an DrawPathCurveToAbsolute, DrawPathCurveToRelative, DrawPathCurveToSmoothAbsolute or DrawPathCurveToSmoothRelative, assume the first control point is coincident with the current point.) (x2,y2) is the second control point (i.e., the control point at the end of the curve). At the end of the command, the new current point becomes the final (x,y) coordinate pair used in the polybezier. -*/ -PHP_METHOD(ImagickDraw, pathCurveToSmoothRelative) -{ - php_imagickdraw_object *internd; - double x1, y1, x, y; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddd", &x1, &y1, &x, &y) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - - DrawPathCurveToSmoothRelative(internd->drawing_wand, x1, y1, x, y); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::pathEllipticArcAbsolute(float rx, float ry, float x_axis_rotation, bool large_arc_flag, bool sweep_flag, float x, float y) - Draws an elliptical arc from the current point to (x, y) using absolute coordinates. The size and orientation of the ellipse are defined by two radii (rx, ry) and an xAxisRotation, which indicates how the ellipse as a whole is rotated relative to the current coordinate system. The center (cx, cy) of the ellipse is calculated automatically to satisfy the constraints imposed by the other parameters. largeArcFlag and sweepFlag contribute to the automatic calculations and help determine how the arc is drawn. If largeArcFlag is true then draw the larger of the available arcs. If sweepFlag is true, then draw the arc matching a clock-wise rotation. -*/ -PHP_METHOD(ImagickDraw, pathEllipticArcAbsolute) -{ - php_imagickdraw_object *internd; - double rx, ry, x_axis_rotation, x, y; - zend_bool large_arc, sweep; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddbbdd", &rx, &ry, &x_axis_rotation, &large_arc, &sweep, &x, &y) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - DrawPathEllipticArcAbsolute(internd->drawing_wand, rx, ry, x_axis_rotation, large_arc, sweep, x, y); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::pathEllipticArcRelative(float rx, float ry, float x_axis_rotation, bool large_arc_flag, bool sweep_flag, float x, float y) - Draws an elliptical arc from the current point to (x, y) using relative coordinates. The size and orientation of the ellipse are defined by two radii (rx, ry) and an xAxisRotation, which indicates how the ellipse as a whole is rotated relative to the current coordinate system. The center (cx, cy) of the ellipse is calculated automatically to satisfy the constraints imposed by the other parameters. largeArcFlag and sweepFlag contribute to the automatic calculations and help determine how the arc is drawn. If largeArcFlag is true then draw the larger of the available arcs. If sweepFlag is true, then draw the arc matching a clock-wise rotation. -*/ -PHP_METHOD(ImagickDraw, pathEllipticArcRelative) -{ - php_imagickdraw_object *internd; - double rx, ry, x_axis_rotation, x, y; - zend_bool large_arc, sweep; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddbbdd", &rx, &ry, &x_axis_rotation, &large_arc, &sweep, &x, &y) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - DrawPathEllipticArcRelative(internd->drawing_wand, rx, ry, x_axis_rotation, large_arc, sweep, x, y); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::pathFinish() - Terminates the current path. -*/ -PHP_METHOD(ImagickDraw, pathFinish) -{ - php_imagickdraw_object *internd; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - DrawPathFinish(internd->drawing_wand); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::pathLineToAbsolute(float x, float y) - Draws a line path from the current point to the given coordinate using absolute coordinates. The coordinate then becomes the new current point. -*/ -PHP_METHOD(ImagickDraw, pathLineToAbsolute) -{ - php_imagickdraw_object *internd; - double x, y; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &x, &y) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - - DrawPathLineToAbsolute(internd->drawing_wand, x, y); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::pathLineToRelative(float x, float y) - Draws a line path from the current point to the given coordinate using relative coordinates. The coordinate then becomes the new current point. -*/ -PHP_METHOD(ImagickDraw, pathLineToRelative) -{ - php_imagickdraw_object *internd; - double x, y; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &x, &y) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - - DrawPathLineToRelative(internd->drawing_wand, x, y); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::pathLineToHorizontalAbsolute(float x) - Draws a horizontal line path from the current point to the target point using absolute coordinates. The target point then becomes the new current point. -*/ -PHP_METHOD(ImagickDraw, pathLineToHorizontalAbsolute) -{ - php_imagickdraw_object *internd; - double y; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &y) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - - DrawPathLineToHorizontalAbsolute(internd->drawing_wand, y); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::pathLineToHorizontalRelative(float x) - Draws a horizontal line path from the current point to the target point using relative coordinates. The target point then becomes the new current point. -*/ -PHP_METHOD(ImagickDraw, pathLineToHorizontalRelative) -{ - php_imagickdraw_object *internd; - double x; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &x) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - - DrawPathLineToHorizontalRelative(internd->drawing_wand, x); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::pathLineToVerticalAbsolute(float y) - Draws a vertical line path from the current point to the target point using absolute coordinates. The target point then becomes the new current point. -*/ -PHP_METHOD(ImagickDraw, pathLineToVerticalAbsolute) -{ - php_imagickdraw_object *internd; - double y; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &y) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - - DrawPathLineToVerticalAbsolute(internd->drawing_wand, y); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::pathLineToVerticalRelative(float y) - Draws a vertical line path from the current point to the target point using relative coordinates. The target point then becomes the new current point. -*/ -PHP_METHOD(ImagickDraw, pathLineToVerticalRelative) -{ - php_imagickdraw_object *internd; - double y; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &y) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - - DrawPathLineToVerticalRelative(internd->drawing_wand, y); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::pathMoveToAbsolute(float x, float y) - Starts a new sub-path at the given coordinate using absolute coordinates. The current point then becomes the specified coordinate. -*/ -PHP_METHOD(ImagickDraw, pathMoveToAbsolute) -{ - php_imagickdraw_object *internd; - double x, y; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &x, &y) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - - DrawPathMoveToAbsolute(internd->drawing_wand, x, y); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::pathMoveToRelative(float x, float y) - Starts a new sub-path at the given coordinate using relative coordinates. The current point then becomes the specified coordinate. -*/ -PHP_METHOD(ImagickDraw, pathMoveToRelative) -{ - php_imagickdraw_object *internd; - double x, y; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &x, &y) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - - DrawPathMoveToRelative(internd->drawing_wand, x, y); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::pathStart() - Declares the start of a path drawing list which is terminated by a matching DrawPathFinish() command. All other DrawPath commands must be enclosed between a and a DrawPathFinish() command. This is because path drawing commands are subordinate commands and they do not function by themselves. -*/ -PHP_METHOD(ImagickDraw, pathStart) -{ - php_imagickdraw_object *internd; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - DrawPathStart(internd->drawing_wand); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::polyline(array coordinates) - Draws a polyline using the current stroke, stroke width, and fill color or texture, using the specified array of coordinates. -*/ -PHP_METHOD(ImagickDraw, polyline) -{ - zval *coordinate_array; - php_imagickdraw_object *internd; - PointInfo *coordinates; - int num_elements = 0; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &coordinate_array) == FAILURE) { - return; - } - - coordinates = php_imagick_zval_to_pointinfo_array(coordinate_array, &num_elements TSRMLS_CC); - - if (!coordinates) { - php_imagick_throw_exception(IMAGICKDRAW_CLASS, "Unable to read coordinate array" TSRMLS_CC); - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - DrawPolyline(internd->drawing_wand, num_elements, coordinates); - - efree(coordinates); - RETURN_TRUE; - -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::popClipPath() - Terminates a clip path definition. -*/ -PHP_METHOD(ImagickDraw, popClipPath) -{ - php_imagickdraw_object *internd; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - DrawPopClipPath(internd->drawing_wand); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::popDefs() - Terminates a definition list -*/ -PHP_METHOD(ImagickDraw, popDefs) -{ - php_imagickdraw_object *internd; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - DrawPopDefs(internd->drawing_wand); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::popPattern() - Terminates a pattern definition. -*/ -PHP_METHOD(ImagickDraw, popPattern) -{ - php_imagickdraw_object *internd; - MagickBooleanType status; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - internd = Z_IMAGICKDRAW_P(getThis());; - status = DrawPopPattern(internd->drawing_wand); - - if (status == MagickFalse) { - php_imagick_convert_imagickdraw_exception (internd->drawing_wand, "Unable to terminate the pattern definition" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::pushClipPath(string clip_mask_id) - Starts a clip path definition which is comprized of any number of drawing commands and terminated by a DrawPopClipPath() command. -*/ -PHP_METHOD(ImagickDraw, pushClipPath) -{ - php_imagickdraw_object *internd; - char *clip_mask; - IM_LEN_TYPE clip_mask_len; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &clip_mask, &clip_mask_len) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - - DrawPushClipPath(internd->drawing_wand, clip_mask); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::pushDefs() - Indicates that commands up to a terminating DrawPopDefs() command create named elements (e.g. clip-paths, textures, etc.) which may safely be processed earlier for the sake of efficiency. -*/ -PHP_METHOD(ImagickDraw, pushDefs) -{ - php_imagickdraw_object *internd; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - DrawPushDefs(internd->drawing_wand); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::pushPattern(string pattern_id, float x, float y, float width, float height) - Indicates that subsequent commands up to a DrawPopPattern() command comprise the definition of a named pattern. The pattern space is assigned top left corner coordinates, a width and height, and becomes its own drawing space. Anything which can be drawn may be used in a pattern definition. Named patterns may be used as stroke or brush definitions. -*/ -PHP_METHOD(ImagickDraw, pushPattern) -{ - php_imagickdraw_object *internd; - char *pattern_id; - IM_LEN_TYPE pattern_id_len; - double x, y, width, height; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sdddd", &pattern_id, &pattern_id_len, &x, &y, &width, &height) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - - DrawPushPattern(internd->drawing_wand, pattern_id, x, y, width, height); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::render() - Renders all preceding drawing commands. -*/ -PHP_METHOD(ImagickDraw, render) -{ - php_imagickdraw_object *internd; - MagickBooleanType status; - char *old_locale; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - - old_locale = php_imagick_set_locale (TSRMLS_C); - - status = DrawRender(internd->drawing_wand); - - php_imagick_restore_locale (old_locale); - - if (old_locale) - efree (old_locale); - - if (status == MagickFalse) { - php_imagick_convert_imagickdraw_exception (internd->drawing_wand, "Unable to render the drawing commands" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::rotate(float degrees) - Applies the specified rotation to the current coordinate space. -*/ -PHP_METHOD(ImagickDraw, rotate) -{ - php_imagickdraw_object *internd; - double degrees; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", °rees) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - - DrawRotate(internd->drawing_wand, degrees); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::scale(float x, float y) - Adjusts the scaling factor to apply in the horizontal and vertical directions to the current coordinate space. -*/ -PHP_METHOD(ImagickDraw, scale) -{ - php_imagickdraw_object *internd; - double x, y; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &x, &y) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - - DrawScale(internd->drawing_wand, x, y); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::setClipPath(string clip_mask) - Associates a named clipping path with the image. Only the areas drawn on by the clipping path will be modified as long as it remains in effect. -*/ -PHP_METHOD(ImagickDraw, setClipPath) -{ - php_imagickdraw_object *internd; - char *clip_mask; - IM_LEN_TYPE clip_mask_len; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &clip_mask, &clip_mask_len) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - status = DrawSetClipPath(internd->drawing_wand, clip_mask); - - if (status == MagickFalse) { - php_imagick_convert_imagickdraw_exception (internd->drawing_wand, "Unable to set clipping path" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::setClipRule(int fill_rule) - Set the polygon fill rule to be used by the clipping path. -*/ -PHP_METHOD(ImagickDraw, setClipRule) -{ - php_imagickdraw_object *internd; - im_long fill_rule; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &fill_rule) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - - DrawSetClipRule(internd->drawing_wand, fill_rule); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::setClipUnits(int clip_units) - Sets the interpretation of clip path units. -*/ -PHP_METHOD(ImagickDraw, setClipUnits) -{ - php_imagickdraw_object *internd; - im_long units; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &units) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - - DrawSetClipUnits(internd->drawing_wand, units); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::setFillOpacity(float fillOpacity) - Sets the opacity to use when drawing using the fill color or fill texture. Fully opaque is 1.0. -*/ -PHP_METHOD(ImagickDraw, setFillOpacity) -{ - php_imagickdraw_object *internd; - double fillOpacity; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &fillOpacity) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - - DrawSetFillOpacity(internd->drawing_wand, fillOpacity); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::setFillPatternUrl(string fill_url) - Sets the URL to use as a fill pattern for filling objects. Only local URLs ("#identifier") are supported at this time. - These local URLs are normally created by defining a named fill pattern with DrawPushPattern/DrawPopPattern. -*/ -PHP_METHOD(ImagickDraw, setFillPatternUrl) -{ - php_imagickdraw_object *internd; - char *url; - IM_LEN_TYPE url_len; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &url, &url_len) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - status = DrawSetFillPatternURL(internd->drawing_wand, url); - - if (status == MagickFalse) { - php_imagick_convert_imagickdraw_exception (internd->drawing_wand, "Unable to set fill pattern URL" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::setFillRule(int fill_rule) - Sets the fill rule to use while drawing polygons. -*/ -PHP_METHOD(ImagickDraw, setFillRule) -{ - php_imagickdraw_object *internd; - im_long fill_rule; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &fill_rule) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - - DrawSetFillRule(internd->drawing_wand, fill_rule); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::setGravity(int gravity) - Sets the text placement gravity to use when annotating with text. -*/ -PHP_METHOD(ImagickDraw, setGravity) -{ - php_imagickdraw_object *internd; - im_long gravity; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &gravity) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - - DrawSetGravity(internd->drawing_wand, gravity); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::setStrokePatternUrl(string stroke_url) - Sets the pattern used for stroking object outlines. -*/ -PHP_METHOD(ImagickDraw, setStrokePatternUrl) -{ - php_imagickdraw_object *internd; - char *url; - IM_LEN_TYPE url_len; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &url, &url_len) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - status = DrawSetStrokePatternURL(internd->drawing_wand, url); - - if (status == MagickFalse) { - php_imagick_convert_imagickdraw_exception (internd->drawing_wand, "Unable to set stroke pattern URL" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::setStrokeDashOffset(float dash_offset) - Specifies the offset into the dash pattern to start the dash. -*/ -PHP_METHOD(ImagickDraw, setStrokeDashOffset) -{ - php_imagickdraw_object *internd; - double offset; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &offset) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - - DrawSetStrokeDashOffset(internd->drawing_wand, offset); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::setStrokeLineCap(int linecap) - Specifies the shape to be used at the end of open subpaths when they are stroked. Values of LineCap are UndefinedCap, ButtCap, RoundCap, and SquareCap. -*/ -PHP_METHOD(ImagickDraw, setStrokeLineCap) -{ - php_imagickdraw_object *internd; - im_long line_cap; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &line_cap) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - - DrawSetStrokeLineCap(internd->drawing_wand, line_cap); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::setStrokeLineJoin(int linejoin) - Specifies the shape to be used at the corners of paths (or other vector shapes) when they are stroked. Values of LineJoin are UndefinedJoin, MiterJoin, RoundJoin, and BevelJoin. -*/ -PHP_METHOD(ImagickDraw, setStrokeLineJoin) -{ - php_imagickdraw_object *internd; - im_long line_join; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &line_join) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - - DrawSetStrokeLineJoin(internd->drawing_wand, line_join); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::setStrokeMiterLimit(int miterlimit) - Specifies the miter limit. When two line segments meet at a sharp angle and miter joins have been specified for 'lineJoin', it is possible for the miter to extend far beyond the thickness of the line stroking the path. The miterLimit' imposes a limit on the ratio of the miter length to the 'lineWidth'. -*/ -PHP_METHOD(ImagickDraw, setStrokeMiterLimit) -{ - php_imagickdraw_object *internd; - im_long miter_limit; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &miter_limit) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - - DrawSetStrokeMiterLimit(internd->drawing_wand, miter_limit); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::setStrokeOpacity(float stroke_opacity) - Specifies the opacity of stroked object outlines. -*/ -PHP_METHOD(ImagickDraw, setStrokeOpacity) -{ - php_imagickdraw_object *internd; - double opacity; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &opacity) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - - DrawSetStrokeOpacity(internd->drawing_wand, opacity); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::setVectorGraphics(string xml) - Sets the vector graphics associated with the specified wand. Use this method with DrawGetVectorGraphics() as a method to persist the vector graphics state. -*/ -PHP_METHOD(ImagickDraw, setVectorGraphics) -{ - php_imagickdraw_object *internd; - char *vector; - IM_LEN_TYPE vector_len; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &vector, &vector_len) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - status = DrawSetVectorGraphics(internd->drawing_wand, vector); - - if (status == MagickFalse) { - php_imagick_convert_imagickdraw_exception (internd->drawing_wand, "Unable to set the vector graphics" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::pop() - Destroys the current DrawingWand in the stack, and returns to the previously pushed DrawingWand. Multiple DrawingWands may exist. It is an error to attempt to pop more DrawingWands than have been pushed, and it is proper form to pop all DrawingWands which have been pushed. -*/ -PHP_METHOD(ImagickDraw, pop) -{ - php_imagickdraw_object *internd; - MagickBooleanType status; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - status = PopDrawingWand(internd->drawing_wand); - - if (status == MagickFalse) { - php_imagick_convert_imagickdraw_exception (internd->drawing_wand, "Unable to pop the current ImagickDraw object" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::push() - Clones the current DrawingWand to create a new DrawingWand, which is then added to the DrawingWand stack. The original drawing DrawingWand(s) may be returned to by invoking PopDrawingWand(). The DrawingWands are stored on a DrawingWand stack. For every Pop there must have already been an equivalent Push. -*/ -PHP_METHOD(ImagickDraw, push) -{ - php_imagickdraw_object *internd; - MagickBooleanType status; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - status = PushDrawingWand(internd->drawing_wand); - - if (status == MagickFalse) { - php_imagick_convert_imagickdraw_exception (internd->drawing_wand, "Unable to push the current ImagickDraw object" TSRMLS_CC); - return; - } - RETURN_TRUE; -} -/* }}} */ - -#if MagickLibVersion >= 0x693 -/* {{{ proto float ImagickDraw::getOpacity() - Returns the opacity used when drawing with the fill or stroke color or texture. Fully opaque is 1.0. -*/ -PHP_METHOD(ImagickDraw, getOpacity) -{ - php_imagickdraw_object *internd; - double opacity; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - opacity = DrawGetOpacity(internd->drawing_wand); - - RETURN_DOUBLE(opacity); -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::setOpacity(float opacity) - Sets the opacity to use when drawing using the fill or stroke color or texture. Fully opaque is 1.0. -*/ -PHP_METHOD(ImagickDraw, setOpacity) -{ - php_imagickdraw_object *internd; - double opacity; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &opacity) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - DrawSetOpacity(internd->drawing_wand, opacity); - - RETURN_TRUE; -} -/* }}} */ -#endif //#if MagickLibVersion >= 0x693 - -#if MagickLibVersion >= 0x675 -/* {{{ proto array ImagickDraw::getFontResolution() - Gets the image X and Y resolution. -*/ -PHP_METHOD(ImagickDraw, getFontResolution) -{ - php_imagickdraw_object *internd; - double x, y; - MagickBooleanType status; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - status = DrawGetFontResolution(internd->drawing_wand, &x, &y); - - if (status == MagickFalse) { - php_imagick_convert_imagickdraw_exception (internd->drawing_wand, "Unable to push the current ImagickDraw object" TSRMLS_CC); - return; - } - - array_init(return_value); - add_assoc_double(return_value, "x", x); - add_assoc_double(return_value, "y", y); - - return; -} -/* }}} */ -#endif //#if MagickLibVersion >= 0x675 - - -#if MagickLibVersion >= 0x675 -/* {{{ proto bool ImagickDraw::setFontResolution(float x, float y) - Sets the image font resolution. -*/ -PHP_METHOD(ImagickDraw, setFontResolution) -{ - php_imagickdraw_object *internd; - double x, y; - - MagickBooleanType status; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &x, &y) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - status = DrawSetFontResolution(internd->drawing_wand, x, y); - if (status == MagickFalse) { - php_imagick_convert_imagickdraw_exception (internd->drawing_wand, "Unable to push the current ImagickDraw object" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ -#endif //#if MagickLibVersion >= 0x675 - - -#if MagickLibVersion >= 0x675 -/* {{{ proto ImagickPixel ImagickDraw::getBorderColor() - Returns the border color used for drawing bordered objects. -*/ -PHP_METHOD(ImagickDraw, getBorderColor) -{ - php_imagickpixel_object *internp; - php_imagickdraw_object *internd; - PixelWand *tmp_wand; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - - tmp_wand = NewPixelWand(); - DrawGetBorderColor(internd->drawing_wand, tmp_wand); - - object_init_ex(return_value, php_imagickpixel_sc_entry); - internp = Z_IMAGICKPIXEL_P(return_value); - php_imagick_replace_pixelwand(internp, tmp_wand); - return; -} -/* }}} */ -#endif //#if MagickLibVersion >= 0x675 - - - -#if MagickLibVersion >= 0x675 -/* {{{ proto bool ImagickDraw::setBorderColor(ImagickPixel color) - Sets the border color to be used for drawing bordered objects. -*/ -PHP_METHOD(ImagickDraw, setBorderColor) -{ - zval *param; - php_imagickdraw_object *internd; - PixelWand *color_wand; - zend_bool allocated; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", ¶m) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - - color_wand = php_imagick_zval_to_pixelwand(param, IMAGICKDRAW_CLASS, &allocated TSRMLS_CC); - if (!color_wand) - return; - - DrawSetBorderColor(internd->drawing_wand, color_wand); - if (allocated) - color_wand = DestroyPixelWand (color_wand); - - RETURN_TRUE; -} -/* }}} */ -#endif //#if MagickLibVersion >= 0x675 - -#if MagickLibVersion >= 0x692 -/* {{{ proto integer ImagickDraw::getTextDirection() - Returns the direction that will be used when annotating with text. -*/ -PHP_METHOD(ImagickDraw, getTextDirection) -{ - php_imagickdraw_object *internd; - im_long direction; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - direction = DrawGetTextDirection(internd->drawing_wand); - - RETURN_LONG(direction); -} - -/* }}} */ - - -/* {{{ proto bool ImagickDraw::setTextDirection(int direction) - Sets the font style to use when annotating with text. The AnyStyle enumeration acts as a wild-card "don't care" option. -*/ -PHP_METHOD(ImagickDraw, setTextDirection) -{ - php_imagickdraw_object *internd; - im_long direction; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &direction) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - - DrawSetTextDirection(internd->drawing_wand, direction); - RETURN_TRUE; -} -/* }}} */ -#endif //#if MagickLibVersion >= 0x692 - -#if MagickLibVersion >= 0x692 -/* {{{ proto bool ImagickDraw::setDensity(string density_string) - Sets the vertical and horizontal resolution. -*/ -PHP_METHOD(ImagickDraw, setDensity) -{ - php_imagickdraw_object *internd; - char *density; - IM_LEN_TYPE density_len; - MagickBooleanType status; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &density, &density_len) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - status = DrawSetDensity(internd->drawing_wand, density); - - if (status == MagickFalse) { - php_imagick_convert_imagickdraw_exception (internd->drawing_wand, "Unable to setdensity for ImagickDraw object" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - - -/* {{{ proto string|null ImagickDraw::getDensity() - Obtains the vertical and horizontal resolution. -*/ -PHP_METHOD(ImagickDraw, getDensity) -{ - php_imagickdraw_object *internd; - char *density; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - density = DrawGetDensity(internd->drawing_wand); - - if (density == NULL) { - RETURN_NULL(); - } - else { - IM_RETURN_STRING(density); - } -} -/* }}} */ -#endif// #if MagickLibVersion >= 0x692 - - -/* END OF DRAWINGWAND METHODS */
View file
imagick-3.7.0.tgz/imagick-3.7.0/imagickkernel_class.c
Deleted
@@ -1,864 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 / Imagick | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Dan Ackroyd <danack@php.net> | - +----------------------------------------------------------------------+ -*/ - -#include "php_imagick.h" -#include "php_imagick_defs.h" -#include "php_imagick_macros.h" -#include "php_imagick_helpers.h" - -#ifdef IMAGICK_WITH_KERNEL - -#if MagickLibVersion < 0x691 -// These function defines are required currently as the functions are -// currently not available in the public ImageMagick header files -// This is being fixed for the next version of ImageMagick. -Image - *MorphologyApply(const Image *,const ChannelType,const MorphologyMethod, - const ssize_t,const KernelInfo *,const CompositeOperator,const double, - ExceptionInfo *); - -void - ScaleKernelInfo(KernelInfo *,const double,const GeometryFlags), - UnityAddKernelInfo(KernelInfo *,const double), - ZeroKernelNans(KernelInfo *); -#endif - - -static void php_imagickkernelvalues_to_zval(zval *zv, KernelInfo *kernel_info) { - int count; - double value; - unsigned int x, y; -#if PHP_VERSION_ID >= 70000 - zval row; -#else - zval *row; -#endif - - zval *p_row; - - count = 0; - - for (y=0; y<kernel_info->height ; y++) { -#if PHP_VERSION_ID >= 70000 - p_row = &row; -#else - MAKE_STD_ZVAL(row); - p_row = row; -#endif - - array_init(p_row); - for (x=0; x<kernel_info->width ; x++) { - value = kernel_info->valuescount; - count++; - - //nan is not equal to itself - if (value != value) { - //this will be broken by some compilers - need to investigate more... - add_next_index_bool(p_row, 0); - } - else { - add_next_index_double(p_row, value); - } - } - - add_next_index_zval(zv, p_row); - } -} - - -#if PHP_VERSION_ID >= 80000 -HashTable* php_imagickkernel_get_debug_info(zend_object *obj, int *is_temp TSRMLS_DC) /* {{{ */ -#else -HashTable* php_imagickkernel_get_debug_info(zval *obj, int *is_temp TSRMLS_DC) /* {{{ */ -#endif -{ - php_imagickkernel_object *internp; - HashTable *debug_info; - KernelInfo *kernel_info; -#if PHP_VERSION_ID >= 70000 - zval matrix; -#else - zval *matrix; -#endif - - *is_temp = 1; //var_dump will destroy the hashtable - -#if PHP_VERSION_ID >= 80000 - internp = php_imagickkernel_fetch_object(obj); -#else - internp = Z_IMAGICKKERNEL_P(obj); -#endif - kernel_info = internp->kernel_info; - - ALLOC_HASHTABLE(debug_info); - ZEND_INIT_SYMTABLE_EX(debug_info, 1, 0); - - while (kernel_info != NULL) { -#if PHP_VERSION_ID >= 70000 - array_init(&matrix); - php_imagickkernelvalues_to_zval(&matrix, kernel_info); - zend_hash_next_index_insert(debug_info, &matrix); -#else - MAKE_STD_ZVAL(matrix); - array_init(matrix); - php_imagickkernelvalues_to_zval(matrix, kernel_info); - zend_hash_next_index_insert(debug_info, &matrix, sizeof(zval *), NULL); -#endif - kernel_info = kernel_info->next; - } - - return debug_info; -} - - -static void im_CalcKernelMetaData(KernelInfo *kernel) { - size_t i; - - kernel->minimum = kernel->maximum = 0.0; - kernel->negative_range = kernel->positive_range = 0.0; - - for (i=0; i < (kernel->width*kernel->height); i++) { - if (fabs(kernel->valuesi) < MagickEpsilon) { - kernel->valuesi = 0.0; - } - if (kernel->valuesi < 0) { - kernel->negative_range += kernel->valuesi; - } - else { - kernel->positive_range += kernel->valuesi; - } - if (kernel->valuesi < kernel->minimum) { - kernel->minimum = kernel->valuesi; - } - - if (kernel->valuesi > kernel->maximum) { - kernel->maximum = kernel->valuesi; - } - } - - return; -} - - -#if MagickLibVersion > 0x661 -static KernelInfo *imagick_createKernel(KernelValueType *values, size_t width, size_t height, size_t origin_x, size_t origin_y) -{ - KernelInfo *kernel_info; - -#if MagickLibVersion >= 0x700 - unsigned int i; - ExceptionInfo *_exception_info = (ExceptionInfo *) NULL; - //TODO - inspect exception info - kernel_info=AcquireKernelInfo(NULL, _exception_info); -#else - kernel_info=AcquireKernelInfo(NULL); -#endif - if (kernel_info == (KernelInfo *) NULL) { - return NULL; - } - - kernel_info->width = width; - kernel_info->height = height; - - kernel_info->x = origin_x; - kernel_info->y = origin_y; - - //Need to free old values? - if (kernel_info->values != NULL) { - RelinquishAlignedMemory(kernel_info->values); - } - -#if MagickLibVersion >= 0x700 - kernel_info->values = (MagickRealType *)AcquireAlignedMemory(width*height, sizeof(MagickRealType)); - - for (i=0; i<width*height;i++) { - kernel_info->valuesi = (MagickRealType)valuesi; - } - -#else - kernel_info->values = values; -#endif - - im_CalcKernelMetaData(kernel_info); - - return kernel_info; -} -#endif - -static void createKernelZval(zval *pzval, KernelInfo *kernel_info TSRMLS_DC) { - php_imagickkernel_object *intern_return; - - object_init_ex(pzval, php_imagickkernel_sc_entry); - intern_return = Z_IMAGICKKERNEL_P(pzval); - intern_return->kernel_info = kernel_info; -} - - -/* {{{ proto ImagickKernel ImagickKernel::__construct() - The ImagickKernel constructor -*/ -PHP_METHOD(ImagickKernel, __construct) -{ - // This suppresses an 'unused parameter' warning. - (void)return_value; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - // this method is private. -} -/* }}} */ - -#define MATRIX_ERROR_EMPTY "Cannot create kernel, matrix is empty." -#define MATRIX_ERROR_UNEVEN "Values must be matrix, with the same number of columns in each row." -#define MATRIX_ERROR_BAD_VALUE "Only numbers or false are valid values in a kernel matrix." -#define MATRIX_ORIGIN_REQUIRED "For kernels with even numbered rows or columns, the origin position must be specified." - -/* {{{ proto ImagickKernel ImagickKernel::fromMatrix(array matrix, array origin) - Create a kernel from an 2d matrix of values. Each value should either be a float - (if the element should be used) or 'false' if the element should be skipped. For - matrixes that are odd sizes in both dimensions the the origin pixel will default - to the centre of the kernel. For all other kernel sizes the origin pixel must be specified. -*/ -#if PHP_VERSION_ID >= 70000 -PHP_METHOD(ImagickKernel, fromMatrix) - -{ - zval *kernel_array; - zval *origin_array; - HashTable *inner_array; - KernelInfo *kernel_info; - unsigned long num_rows, num_columns = 0; - unsigned int previous_num_columns = (unsigned int)-1; - unsigned int row, column; - - zval *pzval_outer; - zval *pzval_inner; - - int count = 0; - size_t origin_x, origin_y; - zval *tmp; - - KernelValueType *values = NULL; - double notanumber = sqrt((double)-1.0); /* Special Value : Not A Number */ - - count = 0; - row = 0; - origin_array = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|a", &kernel_array, &origin_array) == FAILURE) { - return; - } - - num_rows = zend_hash_num_elements(Z_ARRVAL_P(kernel_array)); - - if (num_rows == 0) { - //error - array has zero elements. - php_imagick_throw_exception(IMAGICKKERNEL_CLASS, MATRIX_ERROR_EMPTY TSRMLS_CC); - return; - } - - - for (row=0 ; row<num_rows ; row++) { - pzval_outer = zend_hash_index_find(Z_ARRVAL_P(kernel_array), row); - if (pzval_outer == NULL) { - php_imagick_throw_exception(IMAGICKKERNEL_CLASS, MATRIX_ERROR_UNEVEN TSRMLS_CC); - goto cleanup; - } - ZVAL_DEREF(pzval_outer); - - column = 0; - - if (Z_TYPE_P(pzval_outer) == IS_ARRAY ) { - inner_array = Z_ARRVAL_P(pzval_outer); - num_columns = zend_hash_num_elements(inner_array); - - if (num_columns == 0) { - php_imagick_throw_exception(IMAGICKKERNEL_CLASS, MATRIX_ERROR_EMPTY TSRMLS_CC); - goto cleanup; - } - - if (values == NULL) { - values = (KernelValueType *)AcquireAlignedMemory(num_columns, num_rows*sizeof(KernelValueType)); - } - - if (previous_num_columns != ((unsigned int)-1)) { - if (previous_num_columns != num_columns) { - php_imagick_throw_exception(IMAGICKKERNEL_CLASS, MATRIX_ERROR_UNEVEN TSRMLS_CC); - goto cleanup; - } - } - - previous_num_columns = num_columns; - - for (column=0; column<num_columns ; column++) { - pzval_inner = zend_hash_index_find(inner_array, column); - if (pzval_inner == NULL) { - php_imagick_throw_exception(IMAGICKKERNEL_CLASS, MATRIX_ERROR_UNEVEN TSRMLS_CC); - goto cleanup; - } - - ZVAL_DEREF(pzval_inner); - if (Z_TYPE_P(pzval_inner) == IS_DOUBLE) { - //It's a float lets use it. - valuescount = Z_DVAL_P(pzval_inner); - } - else if (Z_TYPE_P(pzval_inner) == IS_LONG) { - //It's a long lets use it. - valuescount = (float)Z_LVAL_P(pzval_inner); - } - else if (Z_TYPE_P(pzval_inner) == IS_FALSE) { - //It's false, use nan - valuescount = notanumber; - } - else { - php_imagick_throw_exception(IMAGICKKERNEL_CLASS, MATRIX_ERROR_BAD_VALUE TSRMLS_CC); - goto cleanup; - } - count++; - } - } - else { - php_imagick_throw_exception(IMAGICKKERNEL_CLASS, MATRIX_ERROR_UNEVEN TSRMLS_CC); - goto cleanup; - } - } - - if (origin_array == NULL) { - if (((num_columns%2) == 0) || ((num_rows%2) == 0)) { - php_imagick_throw_exception(IMAGICKKERNEL_CLASS, MATRIX_ORIGIN_REQUIRED TSRMLS_CC); - goto cleanup; - } - origin_x = (num_columns - 1) >> 1; - origin_y = (num_rows - 1) >> 1; - } - else { - HashTable *origin_array_ht; - origin_array_ht = Z_ARRVAL_P(origin_array); - - // parse the origin_x - tmp = zend_hash_index_find(origin_array_ht, 0); - if (tmp != NULL) { - ZVAL_DEREF(tmp); - origin_x = Z_LVAL_P(tmp); - } - else { - php_imagick_throw_exception(IMAGICKKERNEL_CLASS, MATRIX_ORIGIN_REQUIRED TSRMLS_CC); - goto cleanup; - } - // origin_x is unsigned, so checking for > num_columns, also - // checks for < 0 - if (origin_x>=num_columns) { - zend_throw_exception_ex( - php_imagickkernel_exception_class_entry, - 5 TSRMLS_CC, - "origin_x for matrix is outside bounds of columns: " ZEND_LONG_FMT, - origin_x - ); - goto cleanup; - } - - // parse the origin_y - tmp = zend_hash_index_find(origin_array_ht, 1); - if (tmp != NULL) { - ZVAL_DEREF(tmp); - origin_y = Z_LVAL_P(tmp); - } - else { - php_imagick_throw_exception(IMAGICKKERNEL_CLASS, MATRIX_ORIGIN_REQUIRED TSRMLS_CC); - goto cleanup; - } - // origin_y is unsigned, so checking for > num_rows, also - // checks for < 0 - if (origin_y>=num_rows) { - zend_throw_exception_ex( - php_imagickkernel_exception_class_entry, - 5 TSRMLS_CC, - "origin_y for matrix is outside bounds of rows: " ZEND_LONG_FMT, - origin_x - ); - goto cleanup; - } - } - - kernel_info = imagick_createKernel(values, num_columns, num_rows, origin_x, origin_y); - createKernelZval(return_value, kernel_info TSRMLS_CC); - - return; - -cleanup: - if (values != NULL) { - RelinquishAlignedMemory(values); - } -} - -#else // PHP 5 - - -PHP_METHOD(ImagickKernel, fromMatrix) -{ - zval *kernel_array; - zval *origin_array; - HashTable *inner_array; - KernelInfo *kernel_info; - unsigned long num_rows, num_columns = 0; - unsigned int previous_num_columns = (unsigned int)-1; - unsigned int row, column; - - HashTable *origin_array_ht; - zval **ppzval_outer; - zval **ppzval_inner; - - int count = 0; - size_t origin_x, origin_y; - zval **tmp; - - KernelValueType *values = NULL; - double notanumber = sqrt((double)-1.0); /* Special Value : Not A Number */ - - previous_num_columns = -1; - count = 0; - row = 0; - origin_array = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|a", &kernel_array, &origin_array) == FAILURE) { - return; - } - - num_rows = zend_hash_num_elements(Z_ARRVAL_P(kernel_array)); - - if (num_rows == 0) { - //error - array has zero elements. - php_imagick_throw_exception(IMAGICKKERNEL_CLASS, MATRIX_ERROR_EMPTY TSRMLS_CC); - return; - } - - for (row=0 ; row<num_rows ; row++) { - if (zend_hash_index_find(Z_ARRVAL_P(kernel_array), row, (void **) &ppzval_outer) != SUCCESS) { - php_imagick_throw_exception(IMAGICKKERNEL_CLASS, MATRIX_ERROR_UNEVEN TSRMLS_CC); - goto cleanup; - } - - column = 0; - - if (Z_TYPE_PP(ppzval_outer) == IS_ARRAY ) { - //parse this row - inner_array = Z_ARRVAL_PP(ppzval_outer); - num_columns = zend_hash_num_elements(inner_array); - - if (num_columns == 0) { - php_imagick_throw_exception(IMAGICKKERNEL_CLASS, MATRIX_ERROR_EMPTY TSRMLS_CC); - goto cleanup; - } - - if (values == NULL) { - values = (KernelValueType *)AcquireAlignedMemory(num_columns, num_rows*sizeof(KernelValueType)); - } - - if (previous_num_columns != ((unsigned int)-1)) { - if (previous_num_columns != num_columns) { - php_imagick_throw_exception(IMAGICKKERNEL_CLASS, MATRIX_ERROR_UNEVEN TSRMLS_CC); - goto cleanup; - } - } - - previous_num_columns = num_columns; - - for (column=0; column<num_columns ; column++) { - if (zend_hash_index_find(inner_array, column, (void **) &ppzval_inner) != SUCCESS) { - php_imagick_throw_exception(IMAGICKKERNEL_CLASS, MATRIX_ERROR_UNEVEN TSRMLS_CC); - goto cleanup; - } - - if (Z_TYPE_PP(ppzval_inner) == IS_DOUBLE) { - //It's a float lets use it. - valuescount = Z_DVAL_PP(ppzval_inner); - } - else if (Z_TYPE_PP(ppzval_inner) == IS_LONG) { - //It's a long lets use it. - valuescount = (float)Z_LVAL_PP(ppzval_inner); - } - else if (Z_TYPE_PP(ppzval_inner) == IS_BOOL && Z_BVAL_PP(ppzval_inner) == 0) { - //It's false, use nan - valuescount = notanumber; - } - else { - php_imagick_throw_exception(IMAGICKKERNEL_CLASS, MATRIX_ERROR_BAD_VALUE TSRMLS_CC); - goto cleanup; - } - count++; - } - } - else { - php_imagick_throw_exception(IMAGICKKERNEL_CLASS, MATRIX_ERROR_UNEVEN TSRMLS_CC); - goto cleanup; - } - } - - if (origin_array == NULL) { - if (((num_columns%2) == 0) || ((num_rows%2) == 0)) { - php_imagick_throw_exception(IMAGICKKERNEL_CLASS, MATRIX_ORIGIN_REQUIRED TSRMLS_CC); - goto cleanup; - } - origin_x = (num_columns - 1) >> 1; - origin_y = (num_rows - 1) >> 1; - } - else { - origin_array_ht = Z_ARRVAL_P(origin_array); - - // parse and check the origin_x - if (zend_hash_index_find(origin_array_ht, 0, (void**)&tmp) == SUCCESS) { - origin_x = Z_LVAL_PP(tmp); - } - else { - php_imagick_throw_exception(IMAGICKKERNEL_CLASS, MATRIX_ORIGIN_REQUIRED TSRMLS_CC); - goto cleanup; - } - - // origin_x is unsigned, so checking for > num_columns, also - // checks for < 0 - if (origin_x>=num_columns) { - zend_throw_exception_ex( - php_imagickkernel_exception_class_entry, - 5 TSRMLS_CC, - "origin_x for matrix is outside bounds of columns: %d", - origin_x - ); - goto cleanup; - } - - // parse and check the origin_y - if (zend_hash_index_find(origin_array_ht, 1, (void**)&tmp) == SUCCESS) { - origin_y = Z_LVAL_PP(tmp); - } - else { - php_imagick_throw_exception(IMAGICKKERNEL_CLASS, MATRIX_ORIGIN_REQUIRED TSRMLS_CC); - goto cleanup; - } - - // origin_y is unsigned, so checking for > num_rows, also - // checks for < 0 - if (origin_y>=num_rows) { - zend_throw_exception_ex( - php_imagickkernel_exception_class_entry, - 5 TSRMLS_CC, - "origin_y for matrix is outside bounds of rows: %d", - origin_y - ); - goto cleanup; - } - } - - kernel_info = imagick_createKernel(values, num_columns, num_rows, origin_x, origin_y); - createKernelZval(return_value, kernel_info TSRMLS_CC); - - return; - -cleanup: - if (values != NULL) { - RelinquishAlignedMemory(values); - } -} -#endif //end of zend_engine_3 -/* }}} */ - -static void imagick_fiddle_with_geometry_info(ssize_t type, GeometryFlags flags, GeometryInfo *geometry_info) { - - /* special handling of missing values in input string */ - switch( type ) { - /* Shape Kernel Defaults */ - case UnityKernel: { - if ((flags & WidthValue) == 0) - geometry_info->rho = 1.0; /* Default scale = 1.0, zero is valid */ - break; - } - case SquareKernel: - case DiamondKernel: - case OctagonKernel: - case DiskKernel: - case PlusKernel: - case CrossKernel: { - if ( (flags & HeightValue) == 0 ) { - geometry_info->sigma = 1.0; /* Default scale = 1.0, zero is valid */ - } - break; - } - case RingKernel: { - if ((flags & XValue) == 0) { - geometry_info->xi = 1.0; /* Default scale = 1.0, zero is valid */ - } - break; - } - case RectangleKernel: { /* Rectangle - set size defaults */ - if ((flags & WidthValue) == 0) { /* if no width then */ - geometry_info->rho = geometry_info->sigma; /* then width = height */ - } - if (geometry_info->rho < 1.0) { /* if width too small */ - geometry_info->rho = 3; /* then width = 3 */ - } - if (geometry_info->sigma < 1.0) { /* if height too small */ - geometry_info->sigma = geometry_info->rho; /* then height = width */ - } - if ((flags & XValue) == 0) { /* center offset if not defined */ - geometry_info->xi = (double)(((ssize_t)geometry_info->rho-1)/2); - } - if ((flags & YValue) == 0) { - geometry_info->psi = (double)(((ssize_t)geometry_info->sigma-1)/2); - } - break; - } - /* Distance Kernel Defaults */ - case ChebyshevKernel: - case ManhattanKernel: - case OctagonalKernel: - case EuclideanKernel: { - if ((flags & HeightValue) == 0) { /* no distance scale */ - geometry_info->sigma = 100.0; /* default distance scaling */ - } - else if ((flags & AspectValue ) != 0) { /* '!' flag */ - geometry_info->sigma = QuantumRange/(geometry_info->sigma+1); /* maximum pixel distance */ - } - else if ((flags & PercentValue ) != 0) { /* '%' flag */ - geometry_info->sigma *= QuantumRange/100.0; /* percentage of color range */ - } - break; - } - default: { - break; - } - } -} - -/* {{{ proto ImagickKernel ImagickKernel::fromBuiltin(type, string) - Create a kernel from a builtin in kernel. See http://www.imagemagick.org/Usage/morphology/#kernel for examples. Currently the 'rotation' symbols are not supported. Example: - $diamondKernel = ImagickKernel::fromBuiltIn(\Imagick::KERNEL_DIAMOND, "2"); -*/ -PHP_METHOD(ImagickKernel, fromBuiltin) -{ - im_long kernel_type; - GeometryInfo geometry_info = { - 0, //rho, - 0, //sigma, - 0, //xi, - 0, //psi, - 0, //chi; - }; - KernelInfo *kernel_info; - char *string; - IM_LEN_TYPE string_len; - GeometryFlags flags; -#if MagickLibVersion >= 0x700 - ExceptionInfo *_exception_info = NULL; -#endif - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &kernel_type, &string, &string_len) == FAILURE) { - return; - } - - flags = ParseGeometry(string, &geometry_info); - imagick_fiddle_with_geometry_info(kernel_type, flags, &geometry_info); - -#if MagickLibVersion >= 0x700 - //TODO - inspect exception info - kernel_info = AcquireKernelBuiltIn(kernel_type, &geometry_info, _exception_info); -#else - kernel_info = AcquireKernelBuiltIn(kernel_type, &geometry_info); -#endif - createKernelZval(return_value, kernel_info TSRMLS_CC); - - return; -} - -/* }}} */ - - -/* {{{ proto void ImagickKernel::addKernel(ImagickKernel kernel) - Attach another kernel to this kernel to allow them to both be applied in a single morphology or filter function. Returns the new combined kernel. -*/ -PHP_METHOD(ImagickKernel, addKernel) -{ - zval *objvar; - KernelInfo *kernel_info_add_clone; - - KernelInfo *kernel_info; - KernelInfo *kernel_info_target; - - php_imagickkernel_object *kernel; - php_imagickkernel_object *internp; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &objvar, php_imagickkernel_sc_entry) == FAILURE) { - return; - } - - kernel = Z_IMAGICKKERNEL_P(objvar); - internp = Z_IMAGICKKERNEL_P(getThis()); - - if (kernel->kernel_info == NULL) { - zend_throw_exception(php_imagickkernel_exception_class_entry, "ImagickKernel is empty, cannot be used", (long)0 TSRMLS_CC); - RETURN_NULL(); - } - - kernel_info = internp->kernel_info; - do { - kernel_info_target = kernel_info; - kernel_info = kernel_info->next; - } while (kernel_info != NULL); - - kernel_info_add_clone = CloneKernelInfo(kernel->kernel_info); - kernel_info_target->next = kernel_info_add_clone; - - return; -} -/* }}} */ - - -/* {{{ proto ImagickKernel ImagickKernel::separate(void) - Separates a linked set of kernels and returns an array of ImagickKernels. -*/ -PHP_METHOD(ImagickKernel, separate) -{ - php_imagickkernel_object *internp; - KernelInfo *kernel_info; - KernelInfo *kernel_info_copy; - int number_values; - KernelValueType * values_copy; - -#if PHP_VERSION_ID >= 70000 - zval separate_object; -#else - zval *separate_object; -#endif - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internp = Z_IMAGICKKERNEL_P(getThis()); - IMAGICK_KERNEL_NOT_NULL_EMPTY(internp); - kernel_info = internp->kernel_info; - - array_init(return_value); - - while (kernel_info != NULL) { - number_values = kernel_info->width * kernel_info->height; - values_copy = (KernelValueType *)AcquireAlignedMemory(kernel_info->width, kernel_info->height*sizeof(KernelValueType)); - memcpy(values_copy, kernel_info->values, number_values * sizeof(KernelValueType)); - - kernel_info_copy = imagick_createKernel( - values_copy, - kernel_info->width, - kernel_info->height, - kernel_info->x, - kernel_info->y - ); - -#if PHP_VERSION_ID >= 70000 - createKernelZval(&separate_object, kernel_info_copy TSRMLS_CC); - add_next_index_zval(return_value, &separate_object); -#else - MAKE_STD_ZVAL(separate_object); - createKernelZval(separate_object, kernel_info_copy TSRMLS_CC); - add_next_index_zval(return_value, separate_object); -#endif - kernel_info = kernel_info->next; - } - - return; -} -/* }}} */ - - -/* {{{ proto ImagickKernel::getMatrix(void) - Get the 2d matrix of values used in this kernel. The elements are either - float for elements that are used or 'false' if the element should be skipped. -*/ -PHP_METHOD(ImagickKernel, getMatrix) -{ - php_imagickkernel_object *internp; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internp = Z_IMAGICKKERNEL_P(getThis()); - IMAGICK_KERNEL_NOT_NULL_EMPTY(internp); - - array_init(return_value); - php_imagickkernelvalues_to_zval(return_value, internp->kernel_info); - - return; -} -/* }}} */ - - - - - -/* {{{ proto ImagickKernel::scale(float scaling_factor, int NORMALIZE_KERNEL_FLAG) - ScaleKernelInfo() scales the given kernel list by the given amount, with or without - normalization of the sum of the kernel values (as per given flags). - - The exact behaviour of this function depends on the normalization type being used - please see http://www.imagemagick.org/api/morphology.php#ScaleKernelInfo for details. - - Flag should be one of NORMALIZE_KERNEL_VALUE, NORMALIZE_KERNEL_CORRELATE, - NORMALIZE_KERNEL_PERCENT or not set. -*/ -PHP_METHOD(ImagickKernel, scale) -{ - php_imagickkernel_object *internp; - double scale; - im_long normalize_flag = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d|l", &scale, &normalize_flag) == FAILURE) { - return; - } - - internp = Z_IMAGICKKERNEL_P(getThis()); - IMAGICK_KERNEL_NOT_NULL_EMPTY(internp); - ScaleKernelInfo(internp->kernel_info, scale, normalize_flag); - - return; -} -/* }}} */ - - - - -/* {{{ proto ImagickKernel::addUnityKernel(float scale) - Adds a given amount of the 'Unity' Convolution Kernel to the given pre-scaled - and normalized Kernel. This in effect adds that amount of the original image - into the resulting convolution kernel. The resulting effect is to convert the - defined kernels into blended soft-blurs, unsharp kernels or into sharpening kernels. -*/ -PHP_METHOD(ImagickKernel, addUnityKernel) -{ - php_imagickkernel_object *internp; - double scale; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &scale) == FAILURE) { - return; - } - - internp = Z_IMAGICKKERNEL_P(getThis()); - IMAGICK_KERNEL_NOT_NULL_EMPTY(internp); - UnityAddKernelInfo(internp->kernel_info, scale); - - return; -} -/* }}} */ - -#endif
View file
imagick-3.7.0.tgz/imagick-3.7.0/imagickpixel_class.c
Deleted
@@ -1,841 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 / Imagick | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 Mikko Koppanen, Scott MacVicar | - | ImageMagick (c) ImageMagick Studio LLC | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Mikko Kopppanen <mkoppanen@php.net> | - | Scott MacVicar <scottmac@php.net> | - +----------------------------------------------------------------------+ -*/ - -#include "php_imagick.h" -#include "php_imagick_defs.h" -#include "php_imagick_macros.h" -#include "php_imagick_helpers.h" - -#if MagickLibVersion > 0x628 -/* {{{ proto array ImagickPixel::getHSL() - Returns the normalized HSL color of the pixel wand in an array with the keys "hue", "saturation", and "luminosity". -*/ -PHP_METHOD(ImagickPixel, getHSL) -{ - php_imagickpixel_object *internp; - double hue, saturation, luminosity; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internp = Z_IMAGICKPIXEL_P(getThis()); - if (php_imagickpixel_ensure_not_null(internp->pixel_wand) == 0) { - return; - } - - PixelGetHSL(internp->pixel_wand, &hue, &saturation, &luminosity); - - array_init(return_value); - add_assoc_double(return_value, "hue", hue); - add_assoc_double(return_value, "saturation", saturation); - add_assoc_double(return_value, "luminosity", luminosity); - return; -} -/* }}} */ - -/* {{{ proto bool ImagickPixel::setHSL(float hue, float saturation, float luminosity) - Sets the normalized HSL color of the pixel wand. -*/ -PHP_METHOD(ImagickPixel, setHSL) -{ - php_imagickpixel_object *internp; - double hue, saturation, luminosity; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddd", &hue, &saturation, &luminosity) == FAILURE) { - return; - } - - internp = Z_IMAGICKPIXEL_P(getThis()); - if (php_imagickpixel_ensure_not_null(internp->pixel_wand) == 0) { - return; - } - - PixelSetHSL(internp->pixel_wand, hue, saturation, luminosity); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto Quantum ImagickPixel::getColorValueQuantum(int color) - Gets the quantum value of a color in the ImagickPixel. Quantum is a float if ImageMagick was compiled with HDRI - otherwise an integer. -*/ -PHP_METHOD(ImagickPixel, getColorValueQuantum) -{ - php_imagickpixel_object *internp; - im_long color; - Quantum color_value; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &color) == FAILURE) { - return; - } - - internp = Z_IMAGICKPIXEL_P(getThis()); - if (php_imagickpixel_ensure_not_null(internp->pixel_wand) == 0) { - return; - } - - switch (color) { - - case PHP_IMAGICK_COLOR_BLACK: - color_value = PixelGetBlackQuantum(internp->pixel_wand); - break; - - case PHP_IMAGICK_COLOR_BLUE: - color_value = PixelGetBlueQuantum(internp->pixel_wand); - break; - - case PHP_IMAGICK_COLOR_CYAN: - color_value = PixelGetCyanQuantum(internp->pixel_wand); - break; - - case PHP_IMAGICK_COLOR_GREEN: - color_value = PixelGetGreenQuantum(internp->pixel_wand); - break; - - case PHP_IMAGICK_COLOR_RED: - color_value = PixelGetRedQuantum(internp->pixel_wand); - break; - - case PHP_IMAGICK_COLOR_YELLOW: - color_value = PixelGetYellowQuantum(internp->pixel_wand); - break; - - case PHP_IMAGICK_COLOR_MAGENTA: - color_value = PixelGetMagentaQuantum(internp->pixel_wand); - break; - -#if MagickLibVersion < 0x700 - case PHP_IMAGICK_COLOR_OPACITY: - color_value = PixelGetOpacityQuantum(internp->pixel_wand); - break; -#endif - - case PHP_IMAGICK_COLOR_ALPHA: - color_value = PixelGetAlphaQuantum(internp->pixel_wand); - break; - - default: - php_imagick_throw_exception (IMAGICKPIXEL_CLASS, "Unknown color type" TSRMLS_CC); - return; - break; - } - -#if MAGICKCORE_HDRI_ENABLE - RETVAL_DOUBLE(color_value); -#else - RETVAL_LONG(color_value); -#endif -} -/* }}} */ - -/* {{{ proto bool ImagickPixel::setColorValueQuantum(int color, float value) - Sets the quantum color of the ImagickPixel. -*/ -PHP_METHOD(ImagickPixel, setColorValueQuantum) -{ - php_imagickpixel_object *internp; - im_long color; - -#if MAGICKCORE_HDRI_ENABLE - double color_value; - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ld", &color, &color_value) == FAILURE) { - return; - } -#else - im_long color_value; - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &color, &color_value) == FAILURE) { - return; - } -#endif - - internp = Z_IMAGICKPIXEL_P(getThis()); - if (php_imagickpixel_ensure_not_null(internp->pixel_wand) == 0) { - return; - } - - switch (color) { - - case PHP_IMAGICK_COLOR_BLACK: - PixelSetBlackQuantum(internp->pixel_wand, color_value); - break; - - case PHP_IMAGICK_COLOR_BLUE: - PixelSetBlueQuantum(internp->pixel_wand, color_value); - break; - - case PHP_IMAGICK_COLOR_CYAN: - PixelSetCyanQuantum(internp->pixel_wand, color_value); - break; - - case PHP_IMAGICK_COLOR_GREEN: - PixelSetGreenQuantum(internp->pixel_wand, color_value); - break; - - case PHP_IMAGICK_COLOR_RED: - PixelSetRedQuantum(internp->pixel_wand, color_value); - break; - - case PHP_IMAGICK_COLOR_YELLOW: - PixelSetYellowQuantum(internp->pixel_wand, color_value); - break; - - case PHP_IMAGICK_COLOR_MAGENTA: - PixelSetMagentaQuantum(internp->pixel_wand, color_value); - break; - -#if MagickLibVersion < 0x700 - case PHP_IMAGICK_COLOR_OPACITY: - PixelSetOpacityQuantum(internp->pixel_wand, color_value); - break; -#endif - - case PHP_IMAGICK_COLOR_ALPHA: - PixelSetAlphaQuantum(internp->pixel_wand, color_value); - break; - - default: - php_imagick_throw_exception (IMAGICKPIXEL_CLASS, "Unknown color type" TSRMLS_CC); - return; - break; - } - RETVAL_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickPixel::getIndex() - Gets the colormap index of the pixel wand -*/ -PHP_METHOD(ImagickPixel, getIndex) -{ - php_imagickpixel_object *internp; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internp = Z_IMAGICKPIXEL_P(getThis()); - if (php_imagickpixel_ensure_not_null(internp->pixel_wand) == 0) { - return; - } - - RETVAL_LONG(PixelGetIndex(internp->pixel_wand)); -} -/* }}} */ - -/* {{{ proto bool ImagickPixel::setIndex(int pixel_packet) - Sets the colormap index of the pixel wand -*/ -PHP_METHOD(ImagickPixel, setIndex) -{ - php_imagickpixel_object *internp; -#if MAGICKCORE_HDRI_ENABLE - double index; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &index) == FAILURE) { -#else - im_long index; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &index) == FAILURE) { -#endif - return; - } - - internp = Z_IMAGICKPIXEL_P(getThis()); - if (php_imagickpixel_ensure_not_null(internp->pixel_wand) == 0) { - return; - } - - PixelSetIndex(internp->pixel_wand, index); - RETURN_TRUE; -} -/* }}} */ -#endif - -/* {{{ proto ImagickPixel ImagickPixel::__construct(string color ) - The ImagickPixel constructor -*/ -PHP_METHOD(ImagickPixel, __construct) -{ - php_imagickpixel_object *internp; - char *color_name = NULL; - IM_LEN_TYPE color_name_len = 0; - - // This suppresses an 'unused parameter' warning. - (void)return_value; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &color_name, &color_name_len) == FAILURE) { - return; - } - - internp = Z_IMAGICKPIXEL_P(getThis()); - - if (internp->pixel_wand != NULL) { - DestroyPixelWand(internp->pixel_wand); - } - - internp->pixel_wand = NewPixelWand(); - - if (!internp->pixel_wand) { - php_imagick_throw_exception (IMAGICKPIXEL_CLASS, "Failed to allocate PixelWand structure" TSRMLS_CC); - return; - } - - /* If color was given as parameter, set it here.*/ - if (color_name && color_name_len) { - if (PixelSetColor(internp->pixel_wand, color_name) == MagickFalse) { - php_imagick_throw_exception (IMAGICKPIXEL_CLASS, "Unable to construct ImagickPixel" TSRMLS_CC); - return; - } - } -} -/* }}} */ - -/* {{{ proto bool ImagickPixel::setColor(string color) - Sets the color of the pixel wand with a string (e.g. "blue", "#0000ff", "rgb(0,0,255)", "cmyk(100,100,100,10)", etc.). -*/ -PHP_METHOD(ImagickPixel, setColor) -{ - char *color_name; - IM_LEN_TYPE color_name_len; - - php_imagickpixel_object *internp; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &color_name, &color_name_len) == FAILURE) { - return; - } - - internp = Z_IMAGICKPIXEL_P(getThis()); - if (php_imagickpixel_ensure_not_null(internp->pixel_wand) == 0) { - return; - } - - status = PixelSetColor(internp->pixel_wand, color_name); - - if (status == MagickFalse) { - php_imagick_convert_imagickpixel_exception (internp->pixel_wand, "Unable to set ImagickPixel color" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickPixel::clear() - Clears resources associated with the wand. -*/ -PHP_METHOD(ImagickPixel, clear) -{ - php_imagickpixel_object *internp; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internp = Z_IMAGICKPIXEL_P(getThis()); - if (php_imagickpixel_ensure_not_null(internp->pixel_wand) == 0) { - return; - } - - ClearPixelWand(internp->pixel_wand); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickPixel::isSimilar(float fuzz) - Returns true if the distance between two colors is less than the specified distance. -*/ -static -void s_is_pixelwand_similar(INTERNAL_FUNCTION_PARAMETERS, zend_bool use_quantum) -{ - zval *param; - double fuzz; - php_imagickpixel_object *internp; - MagickBooleanType status; - PixelWand *color_wand; - zend_bool allocated; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zd", ¶m, &fuzz) == FAILURE) { - return; - } - - internp = Z_IMAGICKPIXEL_P(getThis()); - if (php_imagickpixel_ensure_not_null(internp->pixel_wand) == 0) { - return; - } - - color_wand = php_imagick_zval_to_pixelwand (param, IMAGICKPIXEL_CLASS, &allocated TSRMLS_CC); - if (!color_wand) - return; - - status = IsPixelWandSimilar(internp->pixel_wand, color_wand, (use_quantum ? (QuantumRange * fuzz) : fuzz)); - if (allocated) - color_wand = DestroyPixelWand (color_wand); - - if (status == MagickFalse) { - RETURN_FALSE; - } - - RETURN_TRUE; -} - - -/* {{{ proto bool ImagickPixel::isPixelSimilarQuantum(ImagickPixel pixel, float fuzz) - Returns true if the distance between two colors is less than the specified distance. - The fuzz value should be in the range 0-QuantumRange. - The maximum value represents the longest possible distance in the colorspace. - e.g. from RGB(0, 0, 0) to RGB(255, 255, 255) for the RGB colorspace -*/ -PHP_METHOD(ImagickPixel, isPixelSimilarQuantum) -{ - s_is_pixelwand_similar (INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto bool ImagickPixel::isPixelSimilar(ImagickPixel pixel, float fuzz) - Returns true if the distance between two colors is less than the specified distance. - The fuzz value should be in the range 0-1. - The maximum value represents the longest possible distance in the colorspace. - e.g. from RGB(0, 0, 0) to RGB(255, 255, 255) for the RGB colorspace -*/ -PHP_METHOD(ImagickPixel, isPixelSimilar) -{ - s_is_pixelwand_similar (INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto float ImagickPixel::getColorValue(int color) - Gets the normalized value of a color in the ImagickPixel. -*/ -PHP_METHOD(ImagickPixel, getColorValue) -{ - php_imagick_color_t color_enum; - php_imagickpixel_object *internp; - im_long color; - double color_value = 0; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &color) == FAILURE) { - return; - } - - internp = Z_IMAGICKPIXEL_P(getThis()); - if (php_imagickpixel_ensure_not_null(internp->pixel_wand) == 0) { - return; - } - - if (color <= PHP_IMAGICK_COLOR_MIN || color >= PHP_IMAGICK_COLOR_MAX) { - php_imagick_throw_exception (IMAGICKPIXEL_CLASS, "Unknown color type" TSRMLS_CC); - return; - } - - color_enum = color; - - switch (color_enum) { - - case PHP_IMAGICK_COLOR_BLACK: - color_value = PixelGetBlack(internp->pixel_wand); - break; - - case PHP_IMAGICK_COLOR_BLUE: - color_value = PixelGetBlue(internp->pixel_wand); - break; - - case PHP_IMAGICK_COLOR_CYAN: - color_value = PixelGetCyan(internp->pixel_wand); - break; - - case PHP_IMAGICK_COLOR_GREEN: - color_value = PixelGetGreen(internp->pixel_wand); - break; - - case PHP_IMAGICK_COLOR_RED: - color_value = PixelGetRed(internp->pixel_wand); - break; - - case PHP_IMAGICK_COLOR_YELLOW: - color_value = PixelGetYellow(internp->pixel_wand); - break; - - case PHP_IMAGICK_COLOR_MAGENTA: - color_value = PixelGetMagenta(internp->pixel_wand); - break; - -#if MagickLibVersion < 0x700 - case PHP_IMAGICK_COLOR_OPACITY: - color_value = PixelGetOpacity(internp->pixel_wand); - break; -#endif - - case PHP_IMAGICK_COLOR_ALPHA: - color_value = PixelGetAlpha(internp->pixel_wand); - break; - -#if MagickLibVersion > 0x628 - case PHP_IMAGICK_COLOR_FUZZ: - color_value = PixelGetFuzz(internp->pixel_wand); - break; -#endif - - default: - php_imagick_throw_exception (IMAGICKPIXEL_CLASS, "Unknown color type" TSRMLS_CC); - return; - break; - } - RETVAL_DOUBLE(color_value); -} -/* }}} */ - -/* {{{ proto float ImagickPixel::setColorValue(int color, float value ) - Sets the normalized color of the ImagickPixel. -*/ -PHP_METHOD(ImagickPixel, setColorValue) -{ - php_imagick_color_t color_enum; - php_imagickpixel_object *internp; - im_long color; - double color_value; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ld", &color, &color_value) == FAILURE) { - return; - } - - internp = Z_IMAGICKPIXEL_P(getThis()); - if (php_imagickpixel_ensure_not_null(internp->pixel_wand) == 0) { - return; - } - - if (color <= PHP_IMAGICK_COLOR_MIN || color >= PHP_IMAGICK_COLOR_MAX) { - php_imagick_throw_exception (IMAGICKPIXEL_CLASS, "Unknown color type" TSRMLS_CC); - return; - } - - color_enum = color; - - switch (color_enum) { - - case PHP_IMAGICK_COLOR_BLACK: - PixelSetBlack(internp->pixel_wand, color_value); - break; - - case PHP_IMAGICK_COLOR_BLUE: - PixelSetBlue(internp->pixel_wand, color_value); - break; - - case PHP_IMAGICK_COLOR_CYAN: - PixelSetCyan(internp->pixel_wand, color_value); - break; - - case PHP_IMAGICK_COLOR_GREEN: - PixelSetGreen(internp->pixel_wand, color_value); - break; - - case PHP_IMAGICK_COLOR_RED: - PixelSetRed(internp->pixel_wand, color_value); - break; - - case PHP_IMAGICK_COLOR_YELLOW: - PixelSetYellow(internp->pixel_wand, color_value); - break; - - case PHP_IMAGICK_COLOR_MAGENTA: - PixelSetMagenta(internp->pixel_wand, color_value); - break; - -#if MagickLibVersion < 0x700 - case PHP_IMAGICK_COLOR_OPACITY: - PixelSetOpacity(internp->pixel_wand, color_value); - break; -#endif - - case PHP_IMAGICK_COLOR_ALPHA: - PixelSetAlpha(internp->pixel_wand, color_value); - break; - -#if MagickLibVersion > 0x628 - case PHP_IMAGICK_COLOR_FUZZ: - PixelSetFuzz(internp->pixel_wand, color_value); - break; -#endif - - default: - php_imagick_throw_exception (IMAGICKPIXEL_CLASS, "Unknown color type" TSRMLS_CC); - return; - break; - } - RETVAL_TRUE; -} -/* }}} */ - -/* {{{ proto array ImagickPixel::getColor(int normalization) - Returns the color of the pixel in an array - normalization - 0 - values returned in the range 0,255 and will be ints, except - for legacy reasons alpha which is 0-1 - normalization - 1 - values returned in the range 0,1 and will be floats - normalization - 2 - values returned in the range 0,255 and will be ints including alpha - values i.e. float if ImageMagick was compiled with HDRI, or integers normally. -*/ -PHP_METHOD(ImagickPixel, getColor) -{ - php_imagickpixel_object *internp; - im_long normalization = 0; - double red, green, blue, alpha; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &normalization) == FAILURE) { - return; - } - - internp = Z_IMAGICKPIXEL_P(getThis()); - if (php_imagickpixel_ensure_not_null(internp->pixel_wand) == 0) { - return; - } - array_init(return_value); - - red = PixelGetRed(internp->pixel_wand); - green = PixelGetGreen(internp->pixel_wand); - blue = PixelGetBlue(internp->pixel_wand); - alpha = PixelGetAlpha(internp->pixel_wand); - - switch (normalization){ - //values returned in the range 0,255 and will be ints - case(0): { - //Leave like this for legacy code - //TODO fix the alpha not being normalised at next major/minor verysion - red *= 255; - green *= 255; - blue *= 255; - - //values are always >=0, so the rounding below may not be necessary - add_assoc_long(return_value, "r", (long) (red > 0.0 ? red + 0.5 : red - 0.5)); - add_assoc_long(return_value, "g", (long) (green > 0.0 ? green + 0.5 : green - 0.5)); - add_assoc_long(return_value, "b", (long) (blue > 0.0 ? blue + 0.5 : blue - 0.5)); - add_assoc_long(return_value, "a", alpha); - break; - } - - //values returned in the range 0,1 and will be floats - case(1): { - add_assoc_double(return_value, "r", red); - add_assoc_double(return_value, "g", green); - add_assoc_double(return_value, "b", blue); - add_assoc_double(return_value, "a", alpha); - break; - } - - case(2): { - red *= 255; - green *= 255; - blue *= 255; - alpha *= 255; - - //values are always >=0, so the rounding below may not be necessary - add_assoc_long(return_value, "r", (long) (red > 0.0 ? red + 0.5 : red - 0.5)); - add_assoc_long(return_value, "g", (long) (green > 0.0 ? green + 0.5 : green - 0.5)); - add_assoc_long(return_value, "b", (long) (blue > 0.0 ? blue + 0.5 : blue - 0.5)); - add_assoc_long(return_value, "a", (long) (alpha > 0.0 ? alpha + 0.5 : alpha - 0.5)); - break; - } - } - - return; -} -/* }}} */ - - -/* {{{ proto array ImagickPixel::getColorQuantum() - Returns the color of the pixel in an array as Quantum values. If ImageMagick was compiled - as HDRI these will be floats, otherwise they will be integers -*/ -PHP_METHOD(ImagickPixel, getColorQuantum) -{ - php_imagickpixel_object *internp; - Quantum red, green, blue, alpha; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internp = Z_IMAGICKPIXEL_P(getThis()); - if (php_imagickpixel_ensure_not_null(internp->pixel_wand) == 0) { - return; - } - array_init(return_value); - - red = PixelGetRedQuantum(internp->pixel_wand); - green = PixelGetGreenQuantum(internp->pixel_wand); - blue = PixelGetBlueQuantum(internp->pixel_wand) ; - alpha = PixelGetAlphaQuantum(internp->pixel_wand); - - -#if MAGICKCORE_HDRI_ENABLE - add_assoc_double(return_value, "r", red); - add_assoc_double(return_value, "g", green); - add_assoc_double(return_value, "b", blue); - add_assoc_double(return_value, "a", alpha); -#else - add_assoc_long(return_value, "r", (long)red); - add_assoc_long(return_value, "g", (long)green); - add_assoc_long(return_value, "b", (long)blue); - add_assoc_long(return_value, "a", (long)alpha); -#endif - - return; -} -/* }}} */ - -/* {{{ proto array ImagickPixel::getColorAsString(void ) - Returns the color as a string -*/ -PHP_METHOD(ImagickPixel, getColorAsString) -{ - php_imagickpixel_object *internp; - char *color_string; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internp = Z_IMAGICKPIXEL_P(getThis()); - if (php_imagickpixel_ensure_not_null(internp->pixel_wand) == 0) { - return; - } - - color_string = PixelGetColorAsString(internp->pixel_wand); - IM_ZVAL_STRING(return_value, color_string); - - IMAGICK_FREE_MAGICK_MEMORY(color_string); - return; -} -/* }}} */ - -/* {{{ proto ImagickPixel ImagickPixel::clone(void) - Clones the ImagickPixel -*/ -PHP_METHOD(ImagickPixel, clone) -{ - php_imagickpixel_object *internp; - php_imagickpixel_object *intern_return; - PixelWand *pixel_wand; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - IMAGICK_METHOD_DEPRECATED("ImagickPixel", "clone"); - - internp = Z_IMAGICKPIXEL_P(getThis()); - - pixel_wand = php_imagick_clone_pixelwand (internp->pixel_wand); - if (!pixel_wand) { - php_imagick_throw_exception (IMAGICKPIXEL_CLASS, "Failed to allocate" TSRMLS_CC); - return; - } - - object_init_ex(return_value, php_imagickpixel_sc_entry); - intern_return = Z_IMAGICKPIXEL_P(return_value); - - php_imagick_replace_pixelwand(intern_return, pixel_wand); - return; -} -/* }}} */ - -/* {{{ proto int ImagickPixel::getColorCount() - Returns the color count associated with this color. -*/ -PHP_METHOD(ImagickPixel, getColorCount) -{ - php_imagickpixel_object *internp; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internp = Z_IMAGICKPIXEL_P(getThis()); - if (php_imagickpixel_ensure_not_null(internp->pixel_wand) == 0) { - return; - } - - RETVAL_LONG(PixelGetColorCount(internp->pixel_wand)); -} -/* }}} */ - -/* {{{ proto int ImagickPixel::setColorCount(int colorCount) - Sets the color count associated with this color. -*/ -PHP_METHOD(ImagickPixel, setColorCount) -{ - php_imagickpixel_object *internp; - im_long color_count; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &color_count) == FAILURE) { - return; - } - - internp = Z_IMAGICKPIXEL_P(getThis()); - if (php_imagickpixel_ensure_not_null(internp->pixel_wand) == 0) { - return; - } - - PixelSetColorCount(internp->pixel_wand, color_count); - RETVAL_TRUE; -} -/* }}} */ - -#if MagickLibVersion >= 0x693 -/* {{{ proto bool ImagickPixel::setColorFromPixel(ImagickPixel $srcPixel) - Sets the color count associated with this color from another ImagickPixel object. -*/ -PHP_METHOD(ImagickPixel, setColorFromPixel) -{ - php_imagickpixel_object *internp, *src_pixel; - zval *objvar; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &objvar, php_imagickpixel_sc_entry) == FAILURE) { - return; - } - - internp = Z_IMAGICKPIXEL_P(getThis()); - if (php_imagickpixel_ensure_not_null(internp->pixel_wand) == 0) { - return; - } - src_pixel = Z_IMAGICKPIXEL_P(objvar); - if (php_imagickpixel_ensure_not_null(src_pixel->pixel_wand) == 0) { - return; - } - - PixelSetColorFromWand(internp->pixel_wand, src_pixel->pixel_wand); - - RETVAL_TRUE; -} -/* }}} */ - -#endif //#if MagickLibVersion >= 0x693
View file
imagick-3.7.0.tgz/imagick-3.7.0/imagickpixeliterator_class.c
Deleted
@@ -1,635 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 / Imagick | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 Mikko Koppanen, Scott MacVicar | - | ImageMagick (c) ImageMagick Studio LLC | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Mikko Kopppanen <mkoppanen@php.net> | - | Scott MacVicar <scottmac@php.net> | - +----------------------------------------------------------------------+ -*/ - -#include "php_imagick.h" -#include "php_imagick_defs.h" -#include "php_imagick_macros.h" -#include "php_imagick_helpers.h" - -#if MagickLibVersion <= 0x628 -static -long s_count_pixeliterator_rows(php_imagickpixeliterator_object *internpix) -{ - long rows = 0, tmp; - PixelWand **row; - PixelResetIterator(internpix->pixel_iterator); - - while ((row = PixelGetNextIteratorRow(internpix->pixel_iterator, &tmp)) != NULL) - rows++; - - return rows; -} -#endif - -void php_imagick_pixel_iterator_new (PixelIterator *pixel_it, zval *return_value TSRMLS_DC) -{ - php_imagickpixeliterator_object *internpix; - - object_init_ex(return_value, php_imagickpixeliterator_sc_entry); - internpix = Z_IMAGICKPIXELITERATOR_P(return_value); - - internpix->pixel_iterator = pixel_it; - internpix->initialized = 1; - -#if MagickLibVersion <= 0x628 - internpix->rows = s_count_pixeliterator_rows (internpix); -#endif -} - -/* {{{ proto ImagickPixelIterator ImagickPixelIterator::__construct(Imagick source) - The ImagickPixelIterator constructor -*/ -PHP_METHOD(ImagickPixelIterator, __construct) -{ - zval *magick_object; - php_imagickpixeliterator_object *internpix; - php_imagick_object *intern; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|llll", &magick_object, php_imagick_sc_entry) == FAILURE) { - return; - } - - internpix = Z_IMAGICKPIXELITERATOR_P(getThis()); - intern = Z_IMAGICK_P(magick_object); - - if (!intern->magick_wand) { - php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "Invalid Imagick object passed" TSRMLS_CC); - return; - } - - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - internpix->pixel_iterator = NewPixelIterator(intern->magick_wand); - - if (!internpix->pixel_iterator) { - php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "Can not allocate ImagickPixelIterator" TSRMLS_CC); - return; - } - -#if MagickLibVersion <= 0x628 - internpix->rows = s_count_pixeliterator_rows (internpix); -#endif - - internpix->initialized = 1; - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickPixelIterator::resetIterator() - Resets the pixel iterator. Use it in conjunction with PixelGetNextIteratorRow() to iterate over all the pixels in a pixel container. -*/ -PHP_METHOD(ImagickPixelIterator, resetIterator) -{ - php_imagickpixeliterator_object *internpix; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internpix = Z_IMAGICKPIXELITERATOR_P(getThis()); - - if (!internpix->initialized) { - php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "ImagickPixelIterator is not initialized correctly" TSRMLS_CC); - return; - } - - PixelResetIterator(internpix->pixel_iterator); -#if MagickLibVersion <= 0x628 - internpix->iterator_position = 0; -#endif - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickPixelIterator::syncIterator() - Syncs the pixel iterator. -*/ -PHP_METHOD(ImagickPixelIterator, syncIterator) -{ - php_imagickpixeliterator_object *internpix; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internpix = Z_IMAGICKPIXELITERATOR_P(getThis()); - - if (!internpix->initialized) { - php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "ImagickPixelIterator is not initialized correctly" TSRMLS_CC); - return; - } - - PixelSyncIterator(internpix->pixel_iterator); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickPixelIterator::setIteratorFirstRow() - Sets the pixel iterator to the first pixel row. -*/ -PHP_METHOD(ImagickPixelIterator, setIteratorFirstRow) -{ - php_imagickpixeliterator_object *internpix; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internpix = Z_IMAGICKPIXELITERATOR_P(getThis()); - - if (!internpix->initialized) { - php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "ImagickPixelIterator is not initialized correctly" TSRMLS_CC); - return; - } - - PixelSetFirstIteratorRow(internpix->pixel_iterator); -#if MagickLibVersion <= 0x628 - internpix->iterator_position = 0; -#endif - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickPixelIterator::setIteratorLastRow() - Sets the pixel iterator to the last pixel row. -*/ -PHP_METHOD(ImagickPixelIterator, setIteratorLastRow) -{ - php_imagickpixeliterator_object *internpix; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internpix = Z_IMAGICKPIXELITERATOR_P(getThis()); - - if (!internpix->initialized) { - php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "ImagickPixelIterator is not initialized correctly" TSRMLS_CC); - return; - } - - PixelSetLastIteratorRow(internpix->pixel_iterator); -#if MagickLibVersion <= 0x628 - internpix->iterator_position = (internpix->rows - 1); -#endif - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto ImagickPixelIterator ImagickPixelIterator::getPixelIterator(Imagick source) - Returns a new pixel iterator, static method. This is equivalent to Imagick::getPixelIterator - which probably ought to be used in preference to this method. -*/ -PHP_METHOD(ImagickPixelIterator, getPixelIterator) -{ - PixelIterator *pixel_it; - zval *magick_object; - php_imagick_object *intern; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &magick_object, php_imagick_sc_entry) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(magick_object); - - if (!intern->magick_wand) { - php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "Invalid Imagick object passed" TSRMLS_CC); - return; - } - - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - pixel_it = NewPixelIterator (intern->magick_wand); - if (!pixel_it) { - php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "Can not allocate ImagickPixelIterator" TSRMLS_CC); - return; - } - - php_imagick_pixel_iterator_new (pixel_it, return_value TSRMLS_CC); - return; -} -/* }}} */ - -/* {{{ proto ImagickPixelIterator ImagickPixelIterator::newPixelIterator(Imagick source) - Returns a new pixel iterator. -*/ -PHP_METHOD(ImagickPixelIterator, newPixelIterator) -{ - PixelIterator *pixel_it; - zval *magick_object; - php_imagickpixeliterator_object *internpix; - php_imagick_object *intern; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &magick_object, php_imagick_sc_entry) == FAILURE) { - return; - } - - IMAGICK_METHOD_DEPRECATED_USE_INSTEAD("ImagickPixelIterator", "newPixelIterator", "ImagickPixelIterator", "getPixelIterator"); - - internpix = Z_IMAGICKPIXELITERATOR_P(getThis() ); - intern = Z_IMAGICK_P(magick_object); - - if (!intern->magick_wand) { - php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "Invalid Imagick object passed" TSRMLS_CC); - return; - } - - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - pixel_it = NewPixelIterator(intern->magick_wand); - - if (!pixel_it) { - php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "Can not allocate ImagickPixelIterator" TSRMLS_CC); - return; - } - - if (internpix->initialized && internpix->pixel_iterator) - DestroyPixelIterator (internpix->pixel_iterator); - - internpix->pixel_iterator = pixel_it; -#if MagickLibVersion <= 0x628 - internpix->rows = s_count_pixeliterator_rows (internpix); -#endif - - internpix->initialized = 1; - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto ImagickPixelIterator ImagickPixelIterator::getPixelRegionIterator(Imagick source, int x, int y, int columns, int rows) - Returns a new pixel region iterator, static method. This is equivalent to the non-static - Imagick::getPixelRegionIterator which ought to be used in preference to this method. -*/ -PHP_METHOD(ImagickPixelIterator, getPixelRegionIterator) -{ - PixelIterator *pixel_it; - zval *magick_object; - php_imagick_object *intern; - long x, y, columns, rows; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ollll", &magick_object, php_imagick_sc_entry, &x, &y, &columns, &rows) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(magick_object); - - if (!intern->magick_wand) { - php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "Invalid Imagick object passed" TSRMLS_CC); - return; - } - - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - pixel_it = NewPixelRegionIterator(intern->magick_wand, x, y, columns, rows); - if (!pixel_it) { - php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "Can not allocate ImagickPixelIterator" TSRMLS_CC); - return; - } - - php_imagick_pixel_iterator_new (pixel_it, return_value TSRMLS_CC); - return; -} -/* }}} */ - -/* {{{ proto bool ImagickPixelIterator::newPixelRegionIterator(Imagick source, int x, int y, int columns, int rows) - Returns a new pixel iterator. -*/ -PHP_METHOD(ImagickPixelIterator, newPixelRegionIterator) -{ - PixelIterator *pixel_it; - zval *magick_object; - php_imagickpixeliterator_object *internpix; - php_imagick_object *intern; - long x, y, columns, rows; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ollll", &magick_object, php_imagick_sc_entry, &x, &y, &columns, &rows) == FAILURE) { - return; - } - - IMAGICK_METHOD_DEPRECATED_USE_INSTEAD("ImagickPixelIterator", "newPixelRegionIterator", "ImagickPixelIterator", "getPixelRegionIterator"); - - internpix = Z_IMAGICKPIXELITERATOR_P(getThis()); - intern = Z_IMAGICK_P(magick_object); - - if (!intern->magick_wand) { - php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "Invalid Imagick object passed" TSRMLS_CC); - return; - } - - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - pixel_it = NewPixelRegionIterator(intern->magick_wand, x, y, columns, rows); - - if (!pixel_it) { - php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "Can not allocate ImagickPixelIterator" TSRMLS_CC); - return; - } - - if (internpix->initialized && internpix->pixel_iterator) - DestroyPixelIterator (internpix->pixel_iterator); - - internpix->pixel_iterator = pixel_it; - -#if MagickLibVersion <= 0x628 - internpix->rows = s_count_pixeliterator_rows (internpix); -#endif - internpix->initialized = 1; - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int ImagickPixelIterator::getIteratorRow() - Returns the crurent pixel iterator row. -*/ -PHP_METHOD(ImagickPixelIterator, getIteratorRow) -{ - php_imagickpixeliterator_object *internpix; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - internpix = Z_IMAGICKPIXELITERATOR_P(getThis()); - - if (!internpix->initialized) { - php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "ImagickPixelIterator is not initialized correctly" TSRMLS_CC); - return; - } - -#if MagickLibVersion <= 0x628 - ZVAL_LONG(return_value, internpix->iterator_position); -#else - ZVAL_LONG(return_value, (long) PixelGetIteratorRow(internpix->pixel_iterator)); -#endif - return; -} -/* }}} */ - -/* {{{ proto bool ImagickPixelIterator::setIteratorRow(int row) - Set the pixel iterator row. -*/ -PHP_METHOD(ImagickPixelIterator, setIteratorRow) -{ - php_imagickpixeliterator_object *internpix; - MagickBooleanType status; - im_long row; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &row) == FAILURE) { - return; - } - - internpix = Z_IMAGICKPIXELITERATOR_P(getThis()); - - if (!internpix->initialized) { - php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "ImagickPixelIterator is not initialized correctly" TSRMLS_CC); - return; - } - - status = PixelSetIteratorRow(internpix->pixel_iterator, row); - - if (status == MagickFalse) { - php_imagick_convert_imagickpixeliterator_exception(internpix->pixel_iterator, "Unable to set iterator row" TSRMLS_CC); - return; - } -#if MagickLibVersion <= 0x628 - internpix->iterator_position = row; -#endif - RETURN_TRUE; -} -/* }}} */ - -static -void s_pixelwands_to_zval (PixelWand **wand_array, unsigned long num_wands, zval *return_value TSRMLS_DC) -{ - php_imagickpixel_object *internp; -#if PHP_VERSION_ID >= 70000 - zval obj; -#else - zval *obj; -#endif - - unsigned long i; - - array_init(return_value); - - for (i = 0; i < num_wands; i++) { -#if PHP_VERSION_ID >= 70000 - object_init_ex(&obj, php_imagickpixel_sc_entry); - internp = Z_IMAGICKPIXEL_P(&obj); -#else - MAKE_STD_ZVAL(obj); - object_init_ex(obj, php_imagickpixel_sc_entry); - internp = Z_IMAGICKPIXEL_P(obj); -#endif - - internp->initialized_via_iterator = 1; - - php_imagick_replace_pixelwand(internp, wand_arrayi); -#if PHP_VERSION_ID >= 70000 - add_next_index_zval(return_value, &obj); -#else - add_next_index_zval(return_value, obj); -#endif - } - -} - -/* {{{ proto array ImagickPixelIterator::getPreviousIteratorRow() - Returns the previous row as an array of pixel wands from the pixel iterator. -*/ -PHP_METHOD(ImagickPixelIterator, getPreviousIteratorRow) -{ - php_imagickpixeliterator_object *internpix; - PixelWand **wand_array; - size_t num_wands; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internpix = Z_IMAGICKPIXELITERATOR_P(getThis()); - - if (!internpix->initialized) { - php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "ImagickPixelIterator is not initialized correctly" TSRMLS_CC); - return; - } - - wand_array = PixelGetPreviousIteratorRow(internpix->pixel_iterator, &num_wands); - -#if MagickLibVersion <= 0x628 - if (internpix->iterator_position > 0) { - internpix->iterator_position--; - } -#endif - - if (!wand_array) { - RETURN_NULL(); - } - - s_pixelwands_to_zval (wand_array, num_wands, return_value TSRMLS_CC); - return; -} -/* }}} */ - - -/* {{{ proto array ImagickPixelIterator::getCurrentIteratorRow() - Returns the current row as an array of pixel wands from the pixel iterator. -*/ -PHP_METHOD(ImagickPixelIterator, getCurrentIteratorRow) -{ - php_imagickpixeliterator_object *internpix; - PixelWand **wand_array; - size_t num_wands; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internpix = Z_IMAGICKPIXELITERATOR_P(getThis()); - - if (!internpix->initialized) { - php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "ImagickPixelIterator is not initialized correctly" TSRMLS_CC); - return; - } - -#if MagickLibVersion <= 0x628 - if (internpix->iterator_position >= internpix->rows) { - RETURN_NULL(); - } else if (internpix->iterator_position != 0) { - long tmp; - (void)PixelGetPreviousIteratorRow(internpix->pixel_iterator, &tmp); - } - wand_array = PixelGetNextIteratorRow(internpix->pixel_iterator, &num_wands); -#else - wand_array = PixelGetCurrentIteratorRow(internpix->pixel_iterator, &num_wands); -#endif - - if (!wand_array) { - RETURN_NULL(); - } - - s_pixelwands_to_zval (wand_array, num_wands, return_value TSRMLS_CC); - return; -} -/* }}} */ - -/* {{{ proto array ImagickPixelIterator::getNextIteratorRow() - Returns the next row as an array of pixel wands from the pixel iterator. -*/ -PHP_METHOD(ImagickPixelIterator, getNextIteratorRow) -{ - php_imagickpixeliterator_object *internpix; - PixelWand **wand_array; - size_t num_wands; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internpix = Z_IMAGICKPIXELITERATOR_P(getThis()); - - if (!internpix->initialized) { - php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "ImagickPixelIterator is not initialized correctly" TSRMLS_CC); - return; - } - - wand_array = PixelGetNextIteratorRow(internpix->pixel_iterator, &num_wands); - -#if MagickLibVersion <= 0x628 - internpix->iterator_position++; -#endif - - if (!wand_array) { - RETURN_NULL(); - } - - s_pixelwands_to_zval (wand_array, num_wands, return_value TSRMLS_CC); - return; -} -/* }}} */ - -/* {{{ proto bool ImagickPixelIterator::clear() - Clear resources associated with a PixelIterator. -*/ -PHP_METHOD(ImagickPixelIterator, clear) -{ - php_imagickpixeliterator_object *internpix; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - internpix = Z_IMAGICKPIXELITERATOR_P(getThis()); - - if (!internpix->initialized) { - php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "ImagickPixelIterator is not initialized correctly" TSRMLS_CC); - return; - } -/* Assertion failure with earlier versions */ -#if MagickLibVersion <= 0x628 - RETURN_TRUE; -#else - ClearPixelIterator(internpix->pixel_iterator); - RETURN_TRUE; -#endif -} -/* }}} */ - -/* {{{ proto bool ImagickPixelIterator::valid() - The if the current iterator row is valid -*/ -PHP_METHOD(ImagickPixelIterator, valid) -{ - php_imagickpixeliterator_object *internpix; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internpix = Z_IMAGICKPIXELITERATOR_P(getThis()); - - if (!internpix->initialized) { - php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "ImagickPixelIterator is not initialized correctly" TSRMLS_CC); - return; - } -#if MagickLibVersion <= 0x628 - if (internpix->iterator_position < internpix->rows) { - RETURN_TRUE; - } -#else - /* Test if the current row is valid */ - if (PixelSetIteratorRow(internpix->pixel_iterator, PixelGetIteratorRow(internpix->pixel_iterator))) { - RETURN_TRUE; - } -#endif - RETURN_FALSE; -} -/* }}} */ - -/* END OF PIXELITERATOR */
View file
imagick-3.7.0.tgz/imagick-3.7.0/php_imagemagick_version_defs.h
Deleted
@@ -1,225 +0,0 @@ - -#ifndef PHP_IMAGEMAGICK_VERSION_DEFS_H -# define PHP_IMAGEMAGICK_VERSION_DEFS_H - -// Q) Why are the defines done in this file? -// -// A) Checking whether an ImageMagick function is available _and_ usable is -// annoyingly difficult. It's pretty common for new functions to be introduced -// in patch releases, (e.g. 6.5.4-8) rather than in minor releases (6.5.5-0). -// -// Additionally, the api for new functions often changes quite rapidly in the -// first few versions it is available in, which means we can't just check for -// the presence of the symbol -// -// Because of those two things, the sanest thing to do is to support features -// based on the minimum minor version from which they are continually -// available and stable. -// -// Any mistake in which version is required for a feature can be fixed in a -// single place, rather than having to have duplicated info elsewhere. - - -#if MagickLibVersion >= 0x700 - #if MagickLibVersion >= 0x702 - #define IM_HAVE_IMAGICK_SETIMAGEINTERPOLATEMETHOD 1 - #endif -#elif MagickLibVersion >= 0x631 - #define IM_HAVE_IMAGICK_SETIMAGEINTERPOLATEMETHOD 1 -#endif - - -#if MagickLibVersion >= 0x709 - #define IM_HAVE_IMAGICK_SETIMAGEPIXELCOLOR 1 -#endif - - -#if MagickLibVersion >= 0x709 - #define IM_HAVE_IMAGICK_SETSEED 1 -#endif - -#if MagickLibVersion >= 0x709 - #define IM_HAVE_IMAGICK_WAVELETDENOISEIMAGE 1 -#endif - -#if MagickLibVersion >= 0x709 - #define IM_HAVE_IMAGICK_MEANSHIFTIMAGE 1 -#endif - -#if MagickLibVersion >= 0x710 - #define IM_HAVE_IMAGICK_KMEANSIMAGE 1 -#endif - -#if MagickLibVersion >= 0x709 - #define IM_HAVE_IMAGICK_RANGETHRESHOLDIMAGE 1 -#endif - -#if MagickLibVersion >= 0x709 - #define IM_HAVE_IMAGICK_AUTOTHRESHOLDIMAGE 1 -#endif - -#if MagickLibVersion >= 0x710 - #define IM_HAVE_IMAGICK_BILATERALBLURIMAGE 1 -#endif - -#if MagickLibVersion >= 0x709 - #define IM_HAVE_IMAGICK_CLAHEIMAGE 1 -#endif - -#if MagickLibVersion >= 0x702 - #define IM_HAVE_IMAGICK_CHANNELFXIMAGE 1 -#endif - -#if MagickLibVersion >= 0x710 - #define IM_HAVE_IMAGICK_COLORTHRESHOLDIMAGE 1 -#endif - -#if MagickLibVersion >= 0x709 - #define IM_HAVE_IMAGICK_COMPLEXIMAGES 1 -#endif - -#if MagickLibVersion >= 0x702 - #define IM_HAVE_IMAGICK_INTERPOLATIVERESIZEIMAGE 1 -#endif - -#if MagickLibVersion >= 0x709 - #define IM_HAVE_IMAGICK_LEVELIMAGECOLORS 1 -#endif - -#if MagickLibVersion >= 0x709 - #define IM_HAVE_IMAGICK_LEVELIZEIMAGE 1 -#endif - -#if MagickLibVersion >= 0x702 - #define IM_HAVE_IMAGICK_ORDEREDDITHERIMAGE 1 -#endif - -#if MagickLibVersion >= 0x70B - #define IM_HAVE_IMAGICK_WHITEBALANCEIMAGE 1 -#endif - -#if MagickLibVersion >= 0x702 - #define IM_HAVE_IMAGICK_ADD_NOISE_WITH_ATTENUATE 1 -#endif - -#if MagickLibVersion >= 0x701 - #define IM_HAVE_IMAGICK_DELETE_OPTION 1 -#endif - -#if MagickLibVersion >= 0x701 - #define IM_HAVE_IMAGICK_GET_BACKGROUND_COLOR 1 -#endif - -#if MagickLibVersion >= 0x701 - #define IM_HAVE_IMAGICK_GET_IMAGE_ARTIFACTS 1 -#endif - -#if MagickLibVersion >= 0x701 - #define IM_HAVE_IMAGICK_GET_IMAGE_DISTORTIONS 1 -#endif - -#if MagickLibVersion >= 0x701 - #define IM_HAVE_IMAGICK_GET_IMAGE_KURTOSIS 1 -#endif - -#if MagickLibVersion >= 0x701 - #define IM_HAVE_IMAGICK_GET_IMAGE_MEAN 1 -#endif - -#if MagickLibVersion >= 0x701 - #define IM_HAVE_IMAGICK_GET_IMAGE_RANGE 1 -#endif - -#if MagickLibVersion >= 0x701 - #define IM_HAVE_IMAGICK_GET_INTERPOLATE_METHOD 1 -#endif - -#if MagickLibVersion >= 0x701 - #define IM_HAVE_IMAGICK_GET_OPTIONS 1 -#endif - -#if MagickLibVersion >= 0x701 - #define IM_HAVE_IMAGICK_GET_ORIENTATION 1 -#endif - -#if MagickLibVersion >= 0x701 - #define IM_HAVE_IMAGICK_GET_RESOLUTION 1 -#endif - -#if MagickLibVersion >= 0x701 - #define IM_HAVE_IMAGICK_GET_TYPE 1 -#endif - -#if MagickLibVersion >= 0x709 - #define IM_HAVE_IMAGICK_POLYNOMIAL_IMAGE 1 -#endif - -#if MagickLibVersion >= 0x701 - #define IM_HAVE_IMAGICK_SET_DEPTH 1 -#endif - -#if MagickLibVersion >= 0x701 - #define IM_HAVE_IMAGICK_SET_EXTRACT 1 -#endif - -#if MagickLibVersion >= 0x701 - #define IM_HAVE_IMAGICK_SET_INTERPOLATE_METHOD 1 -#endif - -#if MagickLibVersion >= 0x701 - #define IM_HAVE_IMAGICK_SET_ORIENTATION 1 -#endif - -#if MagickLibVersion >= 0x70A - // Technically, this may be available earlier, but the behaviour around - // default mask changed. - #define IM_HAVE_IMAGICK_GETSETIMAGEMASK 1 - -// ImageMagick forget to export the header until about 7.0.11-14... -WandExport MagickBooleanType MagickSetImageMask( - MagickWand *wand, const PixelMask type, const MagickWand *clip_mask -); - -#endif - -// The above is sub-optimal as it's hard to read. It'd be better to do -// something like the below: - -//#define MAGICK_LIB_RANGE(NAME, IM6_VERSION, IM7_VERSION) slash -//#if MagickLibVersion >= 0x700 slash -// #if MagickLibVersion >= IM7_VERSION slash -// #define IM_HAVE_##NAME 1 slash -// #endif slash -//#elif MagickLibVersion >= 0x600 slash -// #if MagickLibVersion >= IM6_VERSION slash -// #define IM_HAVE_##NAME 1 slash -// #endif slash -//#endif - -// MAGICK_LIB_RANGE(IMAGICK_SETIMAGEINTERPOLATEMETHOD, 0x631, 0x702) - -// But this type of macro expansion is not possible. -// -// https://stackoverflow.com/questions/48431325/is-it-possible-to-define-macro-inside-macro -// "The resulting completely macro-replaced preprocessing token sequence is not -// processed as a preprocessing directive even if it resembles one,..." -// -// An alternative would be to use code generation to build the define file as -// part of the build process. However that would involve looking at m4 config files. - - -#if MagickLibVersion >= 0x700 -// declare symbols only defined in C source and not in header -WandExport MagickBooleanType MagickSetImageMask( - MagickWand *wand, const PixelMask type, const MagickWand *clip_mask -); -#endif - -#if MagickLibVersion >= 0x710 -// declare symbols only defined in C source and not in header -WandExport MagickBooleanType MagickBilateralBlurImage(MagickWand *wand, - const double radius,const double sigma,const double intensity_sigma, - const double spatial_sigma); -#endif - -#endif /* PHP_IMAGEMAGICK_VERSION_DEFS_H */ \ No newline at end of file
View file
imagick-3.7.0.tgz/imagick-3.7.0/php_imagick.h
Deleted
@@ -1,51 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 / Imagick | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 Mikko Koppanen, Scott MacVicar | - | ImageMagick (c) ImageMagick Studio LLC | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Mikko Kopppanen <mkoppanen@php.net> | - | Scott MacVicar <scottmac@php.net> | - +----------------------------------------------------------------------+ -*/ -#ifndef PHP_IMAGICK_H -/* Prevent double inclusion */ -#define PHP_IMAGICK_H - -/* Define Extension Properties */ -#define PHP_IMAGICK_EXTNAME "imagick" -// The version is deliberately left as 'PACKAGE_VERSION' in source code. -// It is only replaced with the actual version number that packaged through pecl.php.net -#define PHP_IMAGICK_VERSION "3.7.0" -#define PHP_IMAGICK_EXTNUM 30700 - -/* Import configure options when building - outside of the PHP source tree */ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#ifdef ZTS -# include "TSRM.h" -#endif - -/* Include PHP Standard Headers */ -#include "php.h" - -/* Define the entry point symbol - * ZE will use when loading this module - */ -extern zend_module_entry imagick_module_entry; -#define phpext_imagick_ptr &imagick_module_entry - -#endif /* PHP_IMAGICK_H */ -
View file
imagick-3.7.0.tgz/imagick-3.7.0/php_imagick_defs.h
Deleted
@@ -1,1254 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 / Imagick | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 Mikko Koppanen, Scott MacVicar | - | ImageMagick (c) ImageMagick Studio LLC | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Mikko Kopppanen <mkoppanen@php.net> | - | Scott MacVicar <scottmac@php.net> | - +----------------------------------------------------------------------+ -*/ -#ifndef PHP_IMAGICK_DEFS_H /* PHP_IMAGICK_DEFS_H */ -# define PHP_IMAGICK_DEFS_H - -/* Include magic wand header */ -#if defined (IM_MAGICKWAND_HEADER_STYLE_SEVEN) -# include <MagickWand/MagickWand.h> -#elif defined (IM_MAGICKWAND_HEADER_STYLE_OLD) -# include <wand/magick-wand.h> -#else -# include <wand/MagickWand.h> -#endif - -#include "php_imagemagick_version_defs.h" - -#if MagickLibVersion >= 0x700 -#include "shim_im6_to_im7.h" -#endif - -/* Some extra headers */ -#include "Zend/zend_exceptions.h" -#include "Zend/zend_interfaces.h" -#include "ext/standard/php_string.h" -#include "ext/standard/info.h" -#include "ext/standard/php_filestat.h" -#include "php_ini.h" -#include "Zend/zend.h" - -#if PHP_VERSION_ID >= 80000 - #define HAVE_LOCALE_H - #define TSRMLS_C - #define TSRMLS_CC - #define TSRMLS_D - #define TSRMLS_DC - #define TSRMLS_FETCH() - #define TSRMLS_SET_CTX(ctx) -#endif - -/* Include locale header */ -#ifdef HAVE_LOCALE_H -# include <locale.h> -#endif - -#if MagickLibVersion >= 0x680 - #define IMAGICK_WITH_KERNEL -#endif - - - -#if MagickLibVersion >= 0x700 -#if !defined(MaxTextExtent) -# define MaxTextExtent 4096 /* always >= 4096 */ -#endif - -#endif - - -#if PHP_VERSION_ID >= 70000 - #define im_long zend_long -#else - #define im_long long -#endif - -#if PHP_VERSION_ID >= 70200 - #define im_ce_countable zend_ce_countable -#else - #define im_ce_countable spl_ce_Countable -#endif - -typedef struct _php_imagick_callback { - void ***thread_ctx; -#if PHP_VERSION_ID >= 70000 - zval user_callback; -#else - zval *user_callback; -#endif - struct _php_imagick_callback *previous_callback; -} php_imagick_callback; - -/* Globals, needed for the ini settings */ -ZEND_BEGIN_MODULE_GLOBALS(imagick) - zend_bool locale_fix; - zend_bool progress_monitor; - zend_bool skip_version_check; - - zend_bool set_single_thread; - zend_bool allow_zero_dimension_images; - im_long shutdown_sleep_count; - - php_imagick_callback *progress_callback; -#ifdef PHP_IMAGICK_ZEND_MM - MagickWand *keep_alive; -#endif -ZEND_END_MODULE_GLOBALS(imagick) - -#ifdef ZTS -# define IMAGICK_G(v) TSRMG(imagick_globals_id, zend_imagick_globals *, v) -#else -# define IMAGICK_G(v) (imagick_globals.v) -#endif - -ZEND_EXTERN_MODULE_GLOBALS(imagick) - -#ifdef HAVE_LOCALE_H -# if defined(PHP_WIN32) -# define IMAGICK_LC_NUMERIC_LOCALE "English" -# else -# define IMAGICK_LC_NUMERIC_LOCALE "C" -# endif -#endif - -#if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 3 -#define zend_parse_parameters_none() zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") -#endif - - -/* Class names */ -#define PHP_IMAGICK_SC_NAME "Imagick" -#define PHP_IMAGICK_EXCEPTION_SC_NAME "ImagickException" - -#define PHP_IMAGICKDRAW_SC_NAME "ImagickDraw" -#define PHP_IMAGICKDRAW_EXCEPTION_SC_NAME "ImagickDrawException" - -#define PHP_IMAGICKPIXEL_SC_NAME "ImagickPixel" -#define PHP_IMAGICKPIXEL_EXCEPTION_SC_NAME "ImagickPixelException" - -#define PHP_IMAGICKPIXELITERATOR_SC_NAME "ImagickPixelIterator" -#define PHP_IMAGICKPIXELITERATOR_EXCEPTION_SC_NAME "ImagickPixelIteratorException" - -#ifdef IMAGICK_WITH_KERNEL -#define PHP_IMAGICKKERNEL_SC_NAME "ImagickKernel" -#define PHP_IMAGICKKERNEL_EXCEPTION_SC_NAME "ImagickKernelException" -#endif - - -#if PHP_VERSION_ID >= 70000 - -/* Structure for Imagick object. */ -typedef struct _php_imagick_object { - MagickWand *magick_wand; - char *progress_monitor_name; - zend_bool next_out_of_bound; - zend_object zo; -} php_imagick_object; - -#else - -/* Structure for Imagick object. */ -typedef struct _php_imagick_object { - zend_object zo; - MagickWand *magick_wand; - char *progress_monitor_name; - zend_bool next_out_of_bound; -} php_imagick_object; - -#endif - - -#if PHP_VERSION_ID >= 70000 - -/* Structure for ImagickDraw object. */ -typedef struct _php_imagickdraw_object { - DrawingWand *drawing_wand; - zend_object zo; -} php_imagickdraw_object; - - -#else - - -/* Structure for ImagickDraw object. */ -typedef struct _php_imagickdraw_object { - zend_object zo; - DrawingWand *drawing_wand; -} php_imagickdraw_object; - - -#endif - -#if PHP_VERSION_ID >= 70000 - -/* Structure for ImagickPixelIterator object. */ -typedef struct _php_imagickpixeliterator_object { - - PixelIterator *pixel_iterator; - zend_bool initialized; - -#if MagickLibVersion <= 0x628 - long rows; - long iterator_position; -#endif - - zend_object zo; -} php_imagickpixeliterator_object; - -#else - -/* Structure for ImagickPixelIterator object. */ -typedef struct _php_imagickpixeliterator_object { - zend_object zo; - PixelIterator *pixel_iterator; - zend_bool initialized; - -#if MagickLibVersion <= 0x628 - long rows; - long iterator_position; -#endif - -} php_imagickpixeliterator_object; - -#endif - - -#if PHP_VERSION_ID >= 70000 - -/* Structure for ImagickPixel object. */ -typedef struct _php_imagickpixel_object { - PixelWand *pixel_wand; - zend_bool initialized_via_iterator; - zend_object zo; -} php_imagickpixel_object; - - -#else - - -/* Structure for ImagickPixel object. */ -typedef struct _php_imagickpixel_object { - zend_object zo; - PixelWand *pixel_wand; - zend_bool initialized_via_iterator; -} php_imagickpixel_object; - -#endif - - -#ifdef IMAGICK_WITH_KERNEL -#if PHP_VERSION_ID >= 70000 -/* Structure for ImagickKernel object. */ -typedef struct _php_imagickkernel_object { - KernelInfo *kernel_info; - zend_object zo; -} php_imagickkernel_object; -#else - -/* Structure for ImagickKernel object. */ -typedef struct _php_imagickkernel_object { - zend_object zo; - KernelInfo *kernel_info; -} php_imagickkernel_object; -#endif -#endif - -//Object fetching. -#if PHP_VERSION_ID >= 70000 - -static inline php_imagick_object *php_imagick_fetch_object(zend_object *obj) { - return (php_imagick_object *)((char*)(obj) - XtOffsetOf(php_imagick_object, zo)); -} - -static inline php_imagickdraw_object *php_imagickdraw_fetch_object(zend_object *obj) { - return (php_imagickdraw_object *)((char*)(obj) - XtOffsetOf(php_imagickdraw_object, zo)); -} - -static inline php_imagickpixel_object *php_imagickpixel_fetch_object(zend_object *obj) { - return (php_imagickpixel_object *)((char*)(obj) - XtOffsetOf(php_imagickpixel_object, zo)); -} - -static inline php_imagickpixeliterator_object *php_imagickpixeliterator_fetch_object(zend_object *obj) { - return (php_imagickpixeliterator_object *)((char*)(obj) - XtOffsetOf(php_imagickpixeliterator_object, zo)); -} - -#ifdef IMAGICK_WITH_KERNEL -static inline php_imagickkernel_object *php_imagickkernel_fetch_object(zend_object *obj) { - return (php_imagickkernel_object *)((char*)(obj) - XtOffsetOf(php_imagickkernel_object, zo)); -} -#endif - -#else - #define php_imagick_fetch_object(object) ((php_imagick_object *)object) - #define php_imagickdraw_fetch_object(object) ((php_imagickdraw_object *)object) - #define php_imagickpixel_fetch_object(object) ((php_imagickpixel_object *)object) - #define php_imagickpixeliterator_fetch_object(object) ((php_imagickpixeliterator_object *)object) - #define php_imagickkernel_fetch_object(object) ((php_imagickkernel_object *)object) -#endif - -// Object access -#if PHP_VERSION_ID >= 70000 - #define Z_IMAGICK_P(zv) php_imagick_fetch_object(Z_OBJ_P((zv))) - #define Z_IMAGICKDRAW_P(zv) php_imagickdraw_fetch_object(Z_OBJ_P((zv))) - #define Z_IMAGICKPIXEL_P(zv) php_imagickpixel_fetch_object(Z_OBJ_P((zv))) - #define Z_IMAGICKPIXELITERATOR_P(zv) php_imagickpixeliterator_fetch_object(Z_OBJ_P((zv))) -#ifdef IMAGICK_WITH_KERNEL - #define Z_IMAGICKKERNEL_P(zv) php_imagickkernel_fetch_object(Z_OBJ_P((zv))) -#endif -#else - #define Z_IMAGICK_P(zv) (php_imagick_object *)zend_object_store_get_object(zv TSRMLS_CC) - #define Z_IMAGICKDRAW_P(zv) (php_imagickdraw_object *)zend_object_store_get_object(zv TSRMLS_CC) - #define Z_IMAGICKPIXEL_P(zv) (php_imagickpixel_object *) zend_object_store_get_object(zv TSRMLS_CC) - #define Z_IMAGICKPIXELITERATOR_P(zv) (php_imagickpixeliterator_object *)zend_object_store_get_object(zv TSRMLS_CC) - #define Z_IMAGICKKERNEL_P(zv) (php_imagickkernel_object *)zend_object_store_get_object(zv TSRMLS_CC) -#endif - -// String access -#if PHP_VERSION_ID >= 70000 - #define IM_ZVAL_STRING(zv, charstar) ZVAL_STRING(zv, charstar); - #define IM_RETURN_STRING(s) RETURN_STRING(s) -#else - #define IM_ZVAL_STRING(zv, charstar) ZVAL_STRING(zv, charstar, 1); - //RETURN_STRING(s, duplicate) - #define IM_RETURN_STRING(s) RETURN_STRING(s, 0) -#endif - -#if PHP_VERSION_ID >= 70000 - #define IM_add_assoc_string(zv, key, charstr) add_assoc_string(zv, key, charstr) - #define IM_ZVAL_STRINGL(zv, charstr, length) ZVAL_STRINGL(zv, charstr, length) - #define IM_add_next_index_string(zv, charstr) add_next_index_string(zv, charstr) - #define IM_LEN_TYPE size_t -#else - #define IM_add_assoc_string(zv, key, charstr) add_assoc_string(zv, key, charstr, 1) - #define IM_add_assoc_string(zv, key, charstr) add_assoc_string(zv, key, charstr, 1) - #define IM_ZVAL_STRINGL(zv, charstr, length) ZVAL_STRINGL(zv, charstr, length, 1) - #define IM_add_next_index_string(zv, charstr) add_next_index_string(zv, charstr, 1) - #define IM_add_next_index_zval(zv1, zv2) - #define IM_LEN_TYPE int -#endif - -#if PHP_VERSION_ID >= 70000 - #define IM_ZEND_OBJECT zend_object -#else - #define IM_ZEND_OBJECT void -#endif - - - - - -/* Define some color constants */ -typedef enum _php_imagick_color_t { - PHP_IMAGICK_COLOR_MIN = 10, - PHP_IMAGICK_COLOR_BLACK, - PHP_IMAGICK_COLOR_BLUE, - PHP_IMAGICK_COLOR_CYAN, - PHP_IMAGICK_COLOR_GREEN, - PHP_IMAGICK_COLOR_RED, - PHP_IMAGICK_COLOR_YELLOW, - PHP_IMAGICK_COLOR_MAGENTA, -#if MagickLibVersion < 0x700 - PHP_IMAGICK_COLOR_OPACITY, -#endif - PHP_IMAGICK_COLOR_ALPHA, - PHP_IMAGICK_COLOR_FUZZ, - PHP_IMAGICK_COLOR_MAX, -} php_imagick_color_t; - -/* Class enum */ -typedef enum _php_imagick_class_type_t { - IMAGICK_CLASS, - IMAGICKDRAW_CLASS, - IMAGICKPIXELITERATOR_CLASS, - IMAGICKPIXEL_CLASS, -#ifdef IMAGICK_WITH_KERNEL - IMAGICKKERNEL_CLASS -#endif -} php_imagick_class_type_t; - -/* Read / write constants */ -typedef enum _php_imagick_rw_result_t { - IMAGICK_RW_OK, - IMAGICK_RW_SAFE_MODE_ERROR, - IMAGICK_RW_OPEN_BASEDIR_ERROR, - IMAGICK_RW_UNDERLYING_LIBRARY, - IMAGICK_RW_PERMISSION_DENIED, - IMAGICK_RW_FILENAME_TOO_LONG, - IMAGICK_RW_PATH_DOES_NOT_EXIST, - IMAGICK_RW_PATH_IS_DIR, -} php_imagick_rw_result_t; - -/* Class entries */ -extern zend_class_entry *php_imagick_sc_entry; -extern zend_class_entry *php_imagick_exception_class_entry; -extern zend_class_entry *php_imagickdraw_sc_entry; -extern zend_class_entry *php_imagickdraw_exception_class_entry; -extern zend_class_entry *php_imagickpixel_sc_entry; -extern zend_class_entry *php_imagickpixel_exception_class_entry; -extern zend_class_entry *php_imagickpixeliterator_sc_entry; -extern zend_class_entry *php_imagickpixeliterator_exception_class_entry; -#ifdef IMAGICK_WITH_KERNEL -extern zend_class_entry *php_imagickkernel_sc_entry; -extern zend_class_entry *php_imagickkernel_exception_class_entry; -#endif - -/* Forward declarations (Imagick) */ - -#if (MagickLibVersion >= 0x700 && MagickLibVersion >= 0x709) - #define PHP_IMAGICK_HAVE_HOUGHLINE 1 -#else - #define PHP_IMAGICK_HAVE_HOUGHLINE 0 -#endif - -/* The conditional methods */ -#if MagickLibVersion > 0x628 -PHP_METHOD(imagick, pingimageblob); -PHP_METHOD(imagick, pingimagefile); -PHP_METHOD(imagick, transposeimage); -PHP_METHOD(imagick, transverseimage); -PHP_METHOD(imagick, trimimage); -PHP_METHOD(imagick, waveimage); -PHP_METHOD(imagick, vignetteimage); -PHP_METHOD(imagick, compareimagelayers); -PHP_METHOD(imagick, optimizeimagelayers); -PHP_METHOD(imagick, uniqueimagecolors); -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -#if MagickLibVersion < 0x700 -PHP_METHOD(imagick, getimagematte); -#endif //#if MagickLibVersion < 0x700 -#endif -PHP_METHOD(imagick, setimagematte); -PHP_METHOD(imagick, adaptiveresizeimage); -PHP_METHOD(imagick, sketchimage); -PHP_METHOD(imagick, shadeimage); -PHP_METHOD(imagick, getsizeoffset); -PHP_METHOD(imagick, setsizeoffset); -PHP_METHOD(imagick, adaptiveblurimage); -PHP_METHOD(imagick, contraststretchimage); -PHP_METHOD(imagick, adaptivesharpenimage); -PHP_METHOD(imagick, randomthresholdimage); -PHP_METHOD(imagick, roundcornersimage); -PHP_METHOD(imagick, setiteratorindex); -PHP_METHOD(imagick, getiteratorindex); -#if MagickLibVersion < 0x700 -PHP_METHOD(imagick, transformimage); -#endif // #if MagickLibVersion < 0x700 -#endif -#if MagickLibVersion > 0x630 -#if MagickLibVersion < 0x700 -PHP_METHOD(imagick, setimageopacity); -#endif -#if MagickLibVersion >= 0x700 -PHP_METHOD(imagick, setimagealpha); -#endif -#if MagickLibVersion < 0x700 -PHP_METHOD(imagick, orderedposterizeimage); -#endif //#if MagickLibVersion < 0x700 -#endif -#if MagickLibVersion > 0x631 -PHP_METHOD(imagick, polaroidimage); -PHP_METHOD(imagick, getimageproperty); -PHP_METHOD(imagick, setimageproperty); -PHP_METHOD(imagick, deleteimageproperty); -PHP_METHOD(imagick, identifyformat); -#if IM_HAVE_IMAGICK_SETIMAGEINTERPOLATEMETHOD -PHP_METHOD(imagick, setimageinterpolatemethod); -#endif -PHP_METHOD(imagick, getimageinterpolatemethod); -PHP_METHOD(imagick, linearstretchimage); -PHP_METHOD(imagick, getimagelength); -PHP_METHOD(imagick, extentimage); -#endif -#if MagickLibVersion > 0x633 -PHP_METHOD(imagick, getimageorientation); -PHP_METHOD(imagick, setimageorientation); -#endif -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -#if MagickLibVersion > 0x634 -PHP_METHOD(imagick, paintfloodfillimage); -#endif -#endif -#if MagickLibVersion > 0x635 -PHP_METHOD(imagick, clutimage); -PHP_METHOD(imagick, getimageproperties); -PHP_METHOD(imagick, getimageprofiles); -PHP_METHOD(imagick, distortimage); -PHP_METHOD(imagick, writeimagefile); -PHP_METHOD(imagick, writeimagesfile); -PHP_METHOD(imagick, resetimagepage); - -#if MagickLibVersion < 0x700 -PHP_METHOD(imagick, setimageclipmask); -PHP_METHOD(imagick, getimageclipmask); -#endif -PHP_METHOD(imagick, animateimages); -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -#if MagickLibVersion < 0x700 -PHP_METHOD(imagick, recolorimage); -#endif -#endif -#endif -#if MagickLibVersion > 0x636 -PHP_METHOD(imagick, setfont); -PHP_METHOD(imagick, getfont); -PHP_METHOD(imagick, setpointsize); -PHP_METHOD(imagick, getpointsize); -PHP_METHOD(imagick, mergeimagelayers); -#endif -#if MagickLibVersion > 0x637 -PHP_METHOD(imagick, floodfillpaintimage); -PHP_METHOD(imagick, opaquepaintimage); -PHP_METHOD(imagick, transparentpaintimage); -PHP_METHOD(imagick, setimagealphachannel); -#endif -#if MagickLibVersion > 0x638 -PHP_METHOD(imagick, liquidrescaleimage); -PHP_METHOD(imagick, decipherimage); -PHP_METHOD(imagick, encipherimage); -#endif -#if MagickLibVersion > 0x639 -PHP_METHOD(imagick, setgravity); -PHP_METHOD(imagick, getgravity); -PHP_METHOD(imagick, getimagechannelrange); -PHP_METHOD(imagick, getimagealphachannel); -#endif -#if MagickLibVersion > 0x642 -PHP_METHOD(imagick, getimagechanneldistortions); -#endif -#if MagickLibVersion > 0x643 -PHP_METHOD(imagick, getimagegravity); -PHP_METHOD(imagick, setimagegravity); -#endif -#if MagickLibVersion > 0x645 -PHP_METHOD(imagick, importimagepixels); -PHP_METHOD(imagick, deskewimage); - - -#if PHP_IMAGICK_HAVE_HOUGHLINE -PHP_METHOD(imagick, houghlineimage); -#endif -PHP_METHOD(imagick, segmentimage); -PHP_METHOD(imagick, sparsecolorimage); -PHP_METHOD(imagick, remapimage); -#endif -#if MagickLibVersion > 0x646 -PHP_METHOD(imagick, exportimagepixels); -#endif -#if MagickLibVersion > 0x648 -PHP_METHOD(imagick, getimagechannelkurtosis); -PHP_METHOD(imagick, functionimage); -#endif -#if MagickLibVersion > 0x651 -PHP_METHOD(imagick, transformimagecolorspace); -#endif -#if MagickLibVersion > 0x652 -PHP_METHOD(imagick, haldclutimage); -#endif -#if MagickLibVersion > 0x655 -PHP_METHOD(imagick, autolevelimage); -PHP_METHOD(imagick, blueshiftimage); -#endif -#if MagickLibVersion > 0x656 -PHP_METHOD(imagick, setimageartifact); -PHP_METHOD(imagick, getimageartifact); -PHP_METHOD(imagick, deleteimageartifact); -PHP_METHOD(imagick, setcolorspace); -PHP_METHOD(imagick, getcolorspace); -PHP_METHOD(imagick, clampimage); -#endif -#if MagickLibVersion > 0x667 -PHP_METHOD(imagick, smushimages); -#endif - -PHP_METHOD(imagick, __construct); -PHP_METHOD(imagick, __tostring); -PHP_METHOD(imagick, count); -PHP_METHOD(imagick, getpixeliterator); -PHP_METHOD(imagick, getpixelregioniterator); -PHP_METHOD(imagick, readimage); -PHP_METHOD(imagick, readimages); -PHP_METHOD(imagick, pingimage); -PHP_METHOD(imagick, readimageblob); -PHP_METHOD(imagick, readimagefile); -PHP_METHOD(imagick, displayimage); -PHP_METHOD(imagick, displayimages); -PHP_METHOD(imagick, destroy); -PHP_METHOD(imagick, clear); -PHP_METHOD(imagick, clone); -PHP_METHOD(imagick, removeimage); -PHP_METHOD(imagick, writeimage); -PHP_METHOD(imagick, writeimages); -PHP_METHOD(imagick, resetiterator); -PHP_METHOD(imagick, setfirstiterator); -PHP_METHOD(imagick, setlastiterator); -PHP_METHOD(imagick, previousimage); -PHP_METHOD(imagick, nextimage); -PHP_METHOD(imagick, haspreviousimage); -PHP_METHOD(imagick, hasnextimage); -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -#if MagickLibVersion < 0x700 -PHP_METHOD(imagick, setimageindex); -PHP_METHOD(imagick, getimageindex); -#endif // #if MagickLibVersion < 0x700 -#endif -PHP_METHOD(imagick, setimageformat); -PHP_METHOD(imagick, setimagefilename); -PHP_METHOD(imagick, getimagefilename); -PHP_METHOD(imagick, getimageformat); -PHP_METHOD(imagick, getimagemimetype); -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -#if MagickLibVersion < 0x700 -PHP_METHOD(imagick, getimagesize); -#endif -#endif -PHP_METHOD(imagick, getimagegeometry); -PHP_METHOD(imagick, getimagecolors); -PHP_METHOD(imagick, scaleimage); -PHP_METHOD(imagick, blurimage); -PHP_METHOD(imagick, thumbnailimage); -PHP_METHOD(imagick, cropthumbnailimage); -PHP_METHOD(imagick, commentimage); -PHP_METHOD(imagick, cropimage); -PHP_METHOD(imagick, labelimage); -PHP_METHOD(imagick, valid); -PHP_METHOD(imagick, current); -PHP_METHOD(imagick, drawimage); -PHP_METHOD(imagick, getimageblob); -PHP_METHOD(imagick, getimagesblob); -PHP_METHOD(imagick, setimagecompressionquality); -PHP_METHOD(imagick, getimagecompressionquality); -PHP_METHOD(imagick, setimagecompression); -PHP_METHOD(imagick, getimagecompression); -PHP_METHOD(imagick, annotateimage); -PHP_METHOD(imagick, compositeimage); -PHP_METHOD(imagick, modulateimage); -PHP_METHOD(imagick, montageimage); -PHP_METHOD(imagick, morphology); -PHP_METHOD(imagick, identifyimage); -PHP_METHOD(imagick, thresholdimage); -PHP_METHOD(imagick, adaptivethresholdimage); -PHP_METHOD(imagick, blackthresholdimage); -PHP_METHOD(imagick, whitethresholdimage); -PHP_METHOD(imagick, appendimages); -PHP_METHOD(imagick, charcoalimage); -PHP_METHOD(imagick, normalizeimage); -PHP_METHOD(imagick, oilpaintimage); -PHP_METHOD(imagick, posterizeimage); -#if MagickLibVersion < 0x700 -PHP_METHOD(imagick, radialblurimage); -#endif -PHP_METHOD(imagick, raiseimage); -PHP_METHOD(imagick, resampleimage); -PHP_METHOD(imagick, resizeimage); -PHP_METHOD(imagick, rollimage); -PHP_METHOD(imagick, rotateimage); -PHP_METHOD(imagick, sampleimage); -PHP_METHOD(imagick, solarizeimage); -PHP_METHOD(imagick, shadowimage); -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -#if MagickLibVersion < 0x700 -PHP_METHOD(imagick, setimageattribute); -#endif // #if MagickLibVersion < 0x700 -#endif -PHP_METHOD(imagick, setimagebackgroundcolor); -#if MagickLibVersion >= 0x700 -PHP_METHOD(imagick, setimagechannelmask); -#endif -PHP_METHOD(imagick, setimagecompose); -PHP_METHOD(imagick, setimagecompression); -PHP_METHOD(imagick, setimagedelay); -PHP_METHOD(imagick, setimagedepth); -PHP_METHOD(imagick, setimagegamma); -PHP_METHOD(imagick, setimageiterations); -#if MagickLibVersion < 0x700 -PHP_METHOD(imagick, setimagemattecolor); -#endif // #if MagickLibVersion < 0x700 -PHP_METHOD(imagick, setimagepage); -PHP_METHOD(imagick, setimageprogressmonitor); -#if MagickLibVersion > 0x653 -PHP_METHOD(imagick, setprogressmonitor); -#endif -PHP_METHOD(imagick, setimageresolution); -PHP_METHOD(imagick, setimagescene); -PHP_METHOD(imagick, setimagetickspersecond); -PHP_METHOD(imagick, setimagetype); -PHP_METHOD(imagick, setimageunits); -PHP_METHOD(imagick, sharpenimage); -PHP_METHOD(imagick, shaveimage); -PHP_METHOD(imagick, shearimage); -PHP_METHOD(imagick, spliceimage); -PHP_METHOD(imagick, spreadimage); -PHP_METHOD(imagick, swirlimage); -PHP_METHOD(imagick, stripimage); -PHP_METHOD(imagick, queryformats); -PHP_METHOD(imagick, queryfonts); -PHP_METHOD(imagick, queryfontmetrics); -PHP_METHOD(imagick, steganoimage); -PHP_METHOD(imagick, motionblurimage); -#if MagickLibVersion < 0x700 -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -PHP_METHOD(imagick, mosaicimages); -#endif -#endif -PHP_METHOD(imagick, morphimages); -PHP_METHOD(imagick, minifyimage); -PHP_METHOD(imagick, addnoiseimage); -PHP_METHOD(imagick, affinetransformimage); -#if MagickLibVersion < 0x700 -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -PHP_METHOD(imagick, averageimages); -#endif -#endif -PHP_METHOD(imagick, borderimage); -PHP_METHOD(imagick, calculatecrop); -PHP_METHOD(imagick, chopimage); -PHP_METHOD(imagick, clipimage); -PHP_METHOD(imagick, clippathimage); -PHP_METHOD(imagick, coalesceimages); -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -#if MagickLibVersion < 0x700 -PHP_METHOD(imagick, colorfloodfillimage); -#endif //#if MagickLibVersion < 0x700 -#endif -PHP_METHOD(imagick, colorizeimage); -PHP_METHOD(imagick, compareimagechannels); -PHP_METHOD(imagick, compareimages); -PHP_METHOD(imagick, contrastimage); -PHP_METHOD(imagick, combineimages); -PHP_METHOD(imagick, convolveimage); -PHP_METHOD(imagick, cyclecolormapimage); -PHP_METHOD(imagick, deconstructimages); -PHP_METHOD(imagick, despeckleimage); -PHP_METHOD(imagick, edgeimage); -PHP_METHOD(imagick, embossimage); -PHP_METHOD(imagick, enhanceimage); -PHP_METHOD(imagick, equalizeimage); -PHP_METHOD(imagick, evaluateimage); -#if MagickLibVersion >= 0x687 -PHP_METHOD(imagick, evaluateimages); -#endif -#if MagickLibVersion < 0x700 -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -PHP_METHOD(imagick, flattenimages); -#endif -#endif -PHP_METHOD(imagick, flipimage); -PHP_METHOD(imagick, flopimage); -#if MagickLibVersion >= 0x655 -PHP_METHOD(imagick, forwardfouriertransformimage); -#endif -PHP_METHOD(imagick, frameimage); -PHP_METHOD(imagick, fximage); -PHP_METHOD(imagick, gammaimage); -PHP_METHOD(imagick, gaussianblurimage); -#if MagickLibVersion < 0x700 -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -PHP_METHOD(imagick, getimageattribute); -#endif -#endif -PHP_METHOD(imagick, getimagebackgroundcolor); -PHP_METHOD(imagick, getimageblueprimary); -PHP_METHOD(imagick, getimagebordercolor); -PHP_METHOD(imagick, getimagechanneldepth); -PHP_METHOD(imagick, getimagechanneldistortion); -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -#if MagickLibVersion < 0x700 -PHP_METHOD(imagick, getimagechannelextrema); -#endif // #if MagickLibVersion < 0x700 -#endif -PHP_METHOD(imagick, getimagechannelmean); -PHP_METHOD(imagick, getimagechannelstatistics); -PHP_METHOD(imagick, getimagecolormapcolor); -PHP_METHOD(imagick, getimagecolorspace); -PHP_METHOD(imagick, getimagecompose); -PHP_METHOD(imagick, getimagedelay); -PHP_METHOD(imagick, getimagedepth); -PHP_METHOD(imagick, getimagedistortion); -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -#if MagickLibVersion < 0x700 -PHP_METHOD(imagick, getimageextrema); -#endif // #if MagickLibVersion < 0x700 -#endif -PHP_METHOD(imagick, getimagedispose); -PHP_METHOD(imagick, getimagegamma); -PHP_METHOD(imagick, getimagegreenprimary); -PHP_METHOD(imagick, getimageheight); -PHP_METHOD(imagick, getimagehistogram); -PHP_METHOD(imagick, getimageinterlacescheme); -PHP_METHOD(imagick, getimageiterations); -#if MagickLibVersion < 0x700 -PHP_METHOD(imagick, getimagemattecolor); -#endif //#if MagickLibVersion < 0x700 -PHP_METHOD(imagick, getimagepage); -PHP_METHOD(imagick, getimagepixelcolor); -PHP_METHOD(imagick, setImagePixelColor); -PHP_METHOD(imagick, getimageprofile); -PHP_METHOD(imagick, getimageredprimary); -PHP_METHOD(imagick, getimagerenderingintent); -PHP_METHOD(imagick, getimageresolution); -PHP_METHOD(imagick, getimagescene); -PHP_METHOD(imagick, getimagesignature); -PHP_METHOD(imagick, getimagetickspersecond); -PHP_METHOD(imagick, getimagetype); -PHP_METHOD(imagick, getimageunits); -PHP_METHOD(imagick, getimagevirtualpixelmethod); -PHP_METHOD(imagick, getimagewhitepoint); -PHP_METHOD(imagick, getimagewidth); -PHP_METHOD(imagick, getnumberimages); -PHP_METHOD(imagick, getimagetotalinkdensity); -PHP_METHOD(imagick, getimageregion); -PHP_METHOD(imagick, implodeimage); -#if MagickLibVersion >= 0x658 -PHP_METHOD(imagick, inversefouriertransformimage); -#endif -PHP_METHOD(imagick, levelimage); -PHP_METHOD(imagick, magnifyimage); -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -#if MagickLibVersion < 0x700 -PHP_METHOD(imagick, mapimage); -PHP_METHOD(imagick, mattefloodfillimage); -#endif // #if MagickLibVersion < 0x700 -#endif -#if MagickLibVersion < 0x700 -PHP_METHOD(imagick, medianfilterimage); -#endif -PHP_METHOD(imagick, negateimage); -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -#if MagickLibVersion < 0x700 -PHP_METHOD(imagick, paintopaqueimage); -PHP_METHOD(imagick, painttransparentimage); -#endif //#if MagickLibVersion < 0x700 -#endif -PHP_METHOD(imagick, previewimages); -PHP_METHOD(imagick, profileimage); -PHP_METHOD(imagick, quantizeimage); -PHP_METHOD(imagick, quantizeimages); -#if MagickLibVersion < 0x700 -PHP_METHOD(imagick, reducenoiseimage); -#endif -PHP_METHOD(imagick, removeimageprofile); -PHP_METHOD(imagick, separateimagechannel); -PHP_METHOD(imagick, sepiatoneimage); - -#if MagickLibVersion < 0x700 -PHP_METHOD(imagick, setimagebias); -PHP_METHOD(imagick, setimagebiasquantum); -#endif - -PHP_METHOD(imagick, setimageblueprimary); -PHP_METHOD(imagick, setimagebordercolor); -PHP_METHOD(imagick, setimagechanneldepth); -PHP_METHOD(imagick, setimagecolormapcolor); -PHP_METHOD(imagick, setimagecolorspace); -PHP_METHOD(imagick, setimagedispose); -PHP_METHOD(imagick, setimageextent); -PHP_METHOD(imagick, setimagegreenprimary); -PHP_METHOD(imagick, setimageinterlacescheme); -PHP_METHOD(imagick, setimageprofile); -PHP_METHOD(imagick, setimageredprimary); -PHP_METHOD(imagick, setimagerenderingintent); -PHP_METHOD(imagick, setimagevirtualpixelmethod); -PHP_METHOD(imagick, setimagewhitepoint); -PHP_METHOD(imagick, sigmoidalcontrastimage); -PHP_METHOD(imagick, stereoimage); -PHP_METHOD(imagick, textureimage); -PHP_METHOD(imagick, tintimage); -PHP_METHOD(imagick, unsharpmaskimage); -PHP_METHOD(imagick, getimage); -PHP_METHOD(imagick, setimage); -PHP_METHOD(imagick, addimage); -PHP_METHOD(imagick, newimage); -PHP_METHOD(imagick, newpseudoimage); -PHP_METHOD(imagick, getcompression); -PHP_METHOD(imagick, getcompressionquality); -PHP_METHOD(imagick, getcopyright); -PHP_METHOD(imagick, getconfigureoptions); -#if MagickLibVersion > 0x660 -PHP_METHOD(imagick, getfeatures); -#endif -PHP_METHOD(imagick, getfilename); -PHP_METHOD(imagick, getformat); -PHP_METHOD(imagick, gethomeurl); -PHP_METHOD(imagick, getinterlacescheme); -PHP_METHOD(imagick, getoption); -PHP_METHOD(imagick, getpackagename); -PHP_METHOD(imagick, getpage); -PHP_METHOD(imagick, gethdrienabled); -PHP_METHOD(imagick, getquantum); -PHP_METHOD(imagick, getquantumdepth); -PHP_METHOD(imagick, getquantumrange); -PHP_METHOD(imagick, getreleasedate); -PHP_METHOD(imagick, getresource); -PHP_METHOD(imagick, getresourcelimit); -PHP_METHOD(imagick, getsamplingfactors); -PHP_METHOD(imagick, getsize); -PHP_METHOD(imagick, getversion); -PHP_METHOD(imagick, setbackgroundcolor); -PHP_METHOD(imagick, setcompression); -PHP_METHOD(imagick, setcompressionquality); -PHP_METHOD(imagick, setfilename); -PHP_METHOD(imagick, setformat); -PHP_METHOD(imagick, setinterlacescheme); -PHP_METHOD(imagick, setoption); -PHP_METHOD(imagick, setpage); -PHP_METHOD(imagick, setresourcelimit); -PHP_METHOD(imagick, setresolution); -PHP_METHOD(imagick, setsamplingfactors); -PHP_METHOD(imagick, setsize); -PHP_METHOD(imagick, settype); -PHP_METHOD(imagick, brightnesscontrastimage); -#if MagickLibVersion > 0x661 -PHP_METHOD(imagick, colormatriximage); -#endif -PHP_METHOD(imagick, selectiveblurimage); -#if MagickLibVersion >= 0x689 -PHP_METHOD(imagick, rotationalblurimage); -#endif -#if MagickLibVersion >= 0x687 -PHP_METHOD(imagick, optimizeimagetransparency); -#endif -#if MagickLibVersion >= 0x683 -PHP_METHOD(imagick, statisticimage); -#endif -#if MagickLibVersion >= 0x652 -PHP_METHOD(imagick, subimagematch); -#endif - -PHP_METHOD(imagick, setregistry); -PHP_METHOD(imagick, getregistry); -PHP_METHOD(imagick, listregistry); -PHP_METHOD(imagick, morphology); -#if MagickLibVersion < 0x700 -PHP_METHOD(imagick, filter); -#endif // #if MagickLibVersion < 0x700 -PHP_METHOD(imagick, setantialias); -PHP_METHOD(imagick, getantialias); -#if MagickLibVersion > 0x676 -PHP_METHOD(imagick, colordecisionlistimage); -#endif - -#if MagickLibVersion >= 0x660 -PHP_METHOD(imagick, autogammaimage); -#endif //#if MagickLibVersion >= 0x660 -#if MagickLibVersion >= 0x692 -PHP_METHOD(imagick, autoorient); -PHP_METHOD(imagick, compositeimagegravity); -#endif // #if MagickLibVersion >= 0x692 -#if MagickLibVersion >= 0x692 -PHP_METHOD(imagick, localcontrastimage); -#endif // #if MagickLibVersion >= 0x692 -#if MagickLibVersion >= 0x700 -PHP_METHOD(imagick, identifyimagetype); -#endif // #if MagickLibVersion >= 0x700 - -#if IM_HAVE_IMAGICK_SETSEED -PHP_METHOD(imagick, setSeed); -#endif -#if IM_HAVE_IMAGICK_WAVELETDENOISEIMAGE -PHP_METHOD(imagick, waveletDenoiseImage); -#endif -#if IM_HAVE_IMAGICK_MEANSHIFTIMAGE -PHP_METHOD(imagick, meanShiftImage); -#endif -#if IM_HAVE_IMAGICK_KMEANSIMAGE -PHP_METHOD(imagick, kmeansImage); -#endif -#if IM_HAVE_IMAGICK_RANGETHRESHOLDIMAGE -PHP_METHOD(imagick, rangeThresholdImage); -#endif -#if IM_HAVE_IMAGICK_AUTOTHRESHOLDIMAGE -PHP_METHOD(imagick, autoThresholdImage); -#endif -#if IM_HAVE_IMAGICK_BILATERALBLURIMAGE -PHP_METHOD(imagick, bilateralBlurImage); -#endif -#if IM_HAVE_IMAGICK_CLAHEIMAGE -PHP_METHOD(imagick, claheImage); -#endif - -#if IM_HAVE_IMAGICK_CHANNELFXIMAGE -PHP_METHOD(imagick, channelFxImage); -#endif - -#if IM_HAVE_IMAGICK_COLORTHRESHOLDIMAGE -PHP_METHOD(imagick, colorThresholdImage); -#endif -#if IM_HAVE_IMAGICK_COMPLEXIMAGES -PHP_METHOD(imagick, complexImages); -#endif -#if IM_HAVE_IMAGICK_INTERPOLATIVERESIZEIMAGE -PHP_METHOD(imagick, interpolativeResizeImage); -#endif -#if IM_HAVE_IMAGICK_LEVELIMAGECOLORS -PHP_METHOD(imagick, levelImageColors); -#endif -#if IM_HAVE_IMAGICK_LEVELIZEIMAGE -PHP_METHOD(imagick, levelizeImage); -#endif -#if IM_HAVE_IMAGICK_ORDEREDDITHERIMAGE -PHP_METHOD(imagick, orderedDitherImage); -#endif -#if IM_HAVE_IMAGICK_WHITEBALANCEIMAGE -PHP_METHOD(imagick, whiteBalanceImage); -#endif - - - - - - - - - - - - -/* Forward declarations (ImagickDraw) */ -#if MagickLibVersion > 0x628 -PHP_METHOD(imagickdraw, resetvectorgraphics); -#endif -#if MagickLibVersion > 0x649 -PHP_METHOD(imagickdraw, gettextkerning); -PHP_METHOD(imagickdraw, settextkerning); -PHP_METHOD(imagickdraw, gettextinterwordspacing); -PHP_METHOD(imagickdraw, settextinterwordspacing); -#endif -#if MagickLibVersion > 0x655 -PHP_METHOD(imagickdraw, gettextinterlinespacing); -PHP_METHOD(imagickdraw, settextinterlinespacing); -#endif -PHP_METHOD(imagickdraw, __construct); -PHP_METHOD(imagickdraw, setfillcolor); -PHP_METHOD(imagickdraw, setfillalpha); -PHP_METHOD(imagickdraw, setresolution); -PHP_METHOD(imagickdraw, setstrokecolor); -PHP_METHOD(imagickdraw, setstrokealpha); -PHP_METHOD(imagickdraw, setstrokewidth); -PHP_METHOD(imagickdraw, setfont); -PHP_METHOD(imagickdraw, setfontfamily); -PHP_METHOD(imagickdraw, setfontsize); -PHP_METHOD(imagickdraw, setfontstyle); -PHP_METHOD(imagickdraw, setfontweight); -PHP_METHOD(imagickdraw, getfont); -PHP_METHOD(imagickdraw, getfontfamily); -PHP_METHOD(imagickdraw, getfontsize); -PHP_METHOD(imagickdraw, getfontstyle); -PHP_METHOD(imagickdraw, getfontweight); -PHP_METHOD(imagickdraw, clear); -PHP_METHOD(imagickdraw, destroy); -PHP_METHOD(imagickdraw, annotation); -PHP_METHOD(imagickdraw, settextantialias); -PHP_METHOD(imagickdraw, settextencoding); -PHP_METHOD(imagickdraw, rectangle); -PHP_METHOD(imagickdraw, roundrectangle); -PHP_METHOD(imagickdraw, ellipse); -PHP_METHOD(imagickdraw, circle); -PHP_METHOD(imagickdraw, skewx); -PHP_METHOD(imagickdraw, skewy); -PHP_METHOD(imagickdraw, translate); -PHP_METHOD(imagickdraw, line); -PHP_METHOD(imagickdraw, polygon); -PHP_METHOD(imagickdraw, arc); - -#if MagickLibVersion >= 0x700 -PHP_METHOD(imagickdraw, alpha); -#else -PHP_METHOD(imagickdraw, matte); -#endif - -PHP_METHOD(imagickdraw, point); -PHP_METHOD(imagickdraw, getfontstretch); -PHP_METHOD(imagickdraw, setfontstretch); -PHP_METHOD(imagickdraw, settextalignment); -PHP_METHOD(imagickdraw, settextdecoration); -PHP_METHOD(imagickdraw, settextundercolor); -PHP_METHOD(imagickdraw, setviewbox); -PHP_METHOD(imagickdraw, gettextdecoration); -PHP_METHOD(imagickdraw, gettextencoding); -PHP_METHOD(imagickdraw, clone); -PHP_METHOD(imagickdraw, affine); -PHP_METHOD(imagickdraw, bezier); -PHP_METHOD(imagickdraw, composite); -PHP_METHOD(imagickdraw, color); -PHP_METHOD(imagickdraw, comment); -PHP_METHOD(imagickdraw, getclippath); -PHP_METHOD(imagickdraw, getcliprule); -PHP_METHOD(imagickdraw, getclipunits); -PHP_METHOD(imagickdraw, getfillcolor); -PHP_METHOD(imagickdraw, getfillopacity); -PHP_METHOD(imagickdraw, getfillrule); -PHP_METHOD(imagickdraw, getgravity); -PHP_METHOD(imagickdraw, getstrokeantialias); -PHP_METHOD(imagickdraw, getstrokecolor); -PHP_METHOD(imagickdraw, getstrokedasharray); -PHP_METHOD(imagickdraw, getstrokedashoffset); -PHP_METHOD(imagickdraw, getstrokelinecap); -PHP_METHOD(imagickdraw, getstrokelinejoin); -PHP_METHOD(imagickdraw, getstrokemiterlimit); -PHP_METHOD(imagickdraw, getstrokeopacity); -PHP_METHOD(imagickdraw, getstrokewidth); -PHP_METHOD(imagickdraw, gettextalignment); -PHP_METHOD(imagickdraw, gettextantialias); -PHP_METHOD(imagickdraw, getvectorgraphics); -PHP_METHOD(imagickdraw, gettextundercolor); -PHP_METHOD(imagickdraw, pathclose); -PHP_METHOD(imagickdraw, pathcurvetoabsolute); -PHP_METHOD(imagickdraw, pathcurvetorelative); -PHP_METHOD(imagickdraw, pathcurvetoquadraticbezierabsolute); -PHP_METHOD(imagickdraw, pathcurvetoquadraticbezierrelative); -PHP_METHOD(imagickdraw, pathcurvetoquadraticbeziersmoothabsolute); -PHP_METHOD(imagickdraw, pathcurvetoquadraticbeziersmoothrelative); -PHP_METHOD(imagickdraw, pathcurvetosmoothabsolute); -PHP_METHOD(imagickdraw, pathcurvetosmoothrelative); -PHP_METHOD(imagickdraw, pathellipticarcabsolute); -PHP_METHOD(imagickdraw, pathellipticarcrelative); -PHP_METHOD(imagickdraw, pathfinish); -PHP_METHOD(imagickdraw, pathlinetoabsolute); -PHP_METHOD(imagickdraw, pathlinetorelative); -PHP_METHOD(imagickdraw, pathlinetohorizontalabsolute); -PHP_METHOD(imagickdraw, pathlinetohorizontalrelative); -PHP_METHOD(imagickdraw, pathlinetoverticalabsolute); -PHP_METHOD(imagickdraw, pathlinetoverticalrelative); -PHP_METHOD(imagickdraw, pathmovetoabsolute); -PHP_METHOD(imagickdraw, pathmovetorelative); -PHP_METHOD(imagickdraw, pathstart); -PHP_METHOD(imagickdraw, polyline); -PHP_METHOD(imagickdraw, popclippath); -PHP_METHOD(imagickdraw, popdefs); -PHP_METHOD(imagickdraw, poppattern); -PHP_METHOD(imagickdraw, pushclippath); -PHP_METHOD(imagickdraw, pushdefs); -PHP_METHOD(imagickdraw, pushpattern); -PHP_METHOD(imagickdraw, render); -PHP_METHOD(imagickdraw, rotate); -PHP_METHOD(imagickdraw, scale); -PHP_METHOD(imagickdraw, setclippath); -PHP_METHOD(imagickdraw, setcliprule); -PHP_METHOD(imagickdraw, setclipunits); -PHP_METHOD(imagickdraw, setfillopacity); -PHP_METHOD(imagickdraw, setfillpatternurl); -PHP_METHOD(imagickdraw, setfillrule); -PHP_METHOD(imagickdraw, setgravity); -PHP_METHOD(imagickdraw, setstrokepatternurl); -PHP_METHOD(imagickdraw, setstrokeantialias); -PHP_METHOD(imagickdraw, setstrokedasharray); -PHP_METHOD(imagickdraw, setstrokedashoffset); -PHP_METHOD(imagickdraw, setstrokelinecap); -PHP_METHOD(imagickdraw, setstrokelinejoin); -PHP_METHOD(imagickdraw, setstrokemiterlimit); -PHP_METHOD(imagickdraw, setstrokeopacity); -PHP_METHOD(imagickdraw, setvectorgraphics); -PHP_METHOD(imagickdraw, pop); -PHP_METHOD(imagickdraw, push); -#if MagickLibVersion >= 0x693 -PHP_METHOD(imagickdraw, getopacity); -PHP_METHOD(imagickdraw, setopacity); -#endif //MagickLibVersion >= 0x693 - -#if MagickLibVersion >= 0x675 -PHP_METHOD(imagickdraw, getfontresolution); -PHP_METHOD(imagickdraw, setfontresolution); -PHP_METHOD(imagickdraw, getbordercolor); -PHP_METHOD(imagickdraw, setbordercolor); -#endif //#if MagickLibVersion >= 0x675 - -#if MagickLibVersion >= 0x693 -PHP_METHOD(imagickdraw, setdensity); -PHP_METHOD(imagickdraw, getdensity); -#endif// #if MagickLibVersion >= 0x693 - -#if MagickLibVersion >= 0x692 -PHP_METHOD(imagickdraw, gettextdirection); -PHP_METHOD(imagickdraw, settextdirection); -#endif //#if MagickLibVersion >= 0x692 - -/* Imagick Pixel iterator */ -PHP_METHOD(imagickpixeliterator, __construct); -PHP_METHOD(imagickpixeliterator, newpixeliterator); -PHP_METHOD(imagickpixeliterator, newpixelregioniterator); -PHP_METHOD(imagickpixeliterator, getpixeliterator); -PHP_METHOD(imagickpixeliterator, getpixelregioniterator); -PHP_METHOD(imagickpixeliterator, getiteratorrow); -PHP_METHOD(imagickpixeliterator, setiteratorrow); -PHP_METHOD(imagickpixeliterator, getpreviousiteratorrow); -PHP_METHOD(imagickpixeliterator, getcurrentiteratorrow); -PHP_METHOD(imagickpixeliterator, getnextiteratorrow); -PHP_METHOD(imagickpixeliterator, setiteratorfirstrow); -PHP_METHOD(imagickpixeliterator, setiteratorlastrow); -PHP_METHOD(imagickpixeliterator, resetiterator); -PHP_METHOD(imagickpixeliterator, synciterator); -PHP_METHOD(imagickpixeliterator, destroy); -PHP_METHOD(imagickpixeliterator, clear); -PHP_METHOD(imagickpixeliterator, valid); - -/* ImagickPixel */ -#if MagickLibVersion > 0x628 -PHP_METHOD(imagickpixel, gethsl); -PHP_METHOD(imagickpixel, sethsl); -PHP_METHOD(imagickpixel, getcolorvaluequantum); -PHP_METHOD(imagickpixel, setcolorvaluequantum); -PHP_METHOD(imagickpixel, getindex); -PHP_METHOD(imagickpixel, setindex); -#endif -PHP_METHOD(imagickpixel, __construct); -PHP_METHOD(imagickpixel, setcolor); -PHP_METHOD(imagickpixel, clear); -PHP_METHOD(imagickpixel, destroy); -PHP_METHOD(imagickpixel, ispixelsimilarquantum); -PHP_METHOD(imagickpixel, ispixelsimilar); -PHP_METHOD(imagickpixel, getcolorvalue); -PHP_METHOD(imagickpixel, setcolorvalue); -PHP_METHOD(imagickpixel, getcolor); -PHP_METHOD(imagickpixel, getcolorquantum); -PHP_METHOD(imagickpixel, getcolorasstring); -PHP_METHOD(imagickpixel, getcolorcount); -PHP_METHOD(imagickpixel, setcolorcount); -PHP_METHOD(imagickpixel, clone); -#if MagickLibVersion >= 0x693 -PHP_METHOD(imagickpixel, setcolorfrompixel); -#endif //#if MagickLibVersion >= 0x693 - -#ifdef IMAGICK_WITH_KERNEL -PHP_METHOD(imagickkernel, __construct); -PHP_METHOD(imagickkernel, frommatrix); -PHP_METHOD(imagickkernel, frombuiltin); -PHP_METHOD(imagickkernel, addkernel); -PHP_METHOD(imagickkernel, getmatrix); -PHP_METHOD(imagickkernel, separate); -PHP_METHOD(imagickkernel, scale); -PHP_METHOD(imagickkernel, addunitykernel); -#endif - -#if MagickLibVersion < 0x700 -#define KernelValueType double -#else -#define KernelValueType MagickRealType -#endif - - -// This is defined as 'UndefinedChannel' so that when the functions go through -// the shim functions in shim_im6_to_im7.c I can check for whether the user actually -// set the channel or not. -#if MagickLibVersion >= 0x700 -#define IM_DEFAULT_CHANNEL UndefinedChannel -#else -#define IM_DEFAULT_CHANNEL DefaultChannels -#endif - -#endif /* PHP_IMAGICK_DEFS_H */
View file
imagick-3.7.0.tgz/imagick-3.7.0/php_imagick_macros.h
Deleted
@@ -1,49 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 / Imagick | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 Mikko Koppanen, Scott MacVicar | - | ImageMagick (c) ImageMagick Studio LLC | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Mikko Kopppanen <mkoppanen@php.net> | - | Scott MacVicar <scottmac@php.net> | - +----------------------------------------------------------------------+ -*/ - -#ifndef PHP_IMAGICK_MACROS_H -# define PHP_IMAGICK_MACROS_H - -#define IMAGICK_FREE_MAGICK_MEMORY(value) \ - do { \ - if (value) { \ - MagickRelinquishMemory(value); \ - value = NULL; \ - } \ - } while (0) - -#if !defined(E_DEPRECATED) -# define E_DEPRECATED E_STRICT -#endif - -#define IMAGICK_METHOD_DEPRECATED(class_name, method_name) \ - php_error(E_DEPRECATED, "%s::%s method is deprecated and it's use should be avoided", class_name, method_name); - -#define IMAGICK_METHOD_DEPRECATED_USE_INSTEAD(class_name, method_name, new_class, new_method) \ - php_error(E_DEPRECATED, "%s::%s is deprecated. %s::%s should be used instead", class_name, method_name, new_class, new_method); - - -#define IMAGICK_KERNEL_NOT_NULL_EMPTY(kernel) \ - if (kernel->kernel_info == NULL) { \ - zend_throw_exception(php_imagickkernel_exception_class_entry, "ImagickKernel is empty, cannot be used", (long)0 TSRMLS_CC); \ - RETURN_NULL(); \ - } - -#endif /* PHP_IMAGICK_MACROS_H */
View file
imagick-3.7.0.tgz/imagick-3.7.0/shim_im6_to_im7.c
Deleted
@@ -1,890 +0,0 @@ - -/* - +----------------------------------------------------------------------+ - | Imagick | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ -*/ - -#include "php_imagick.h" -#include "php_imagick_defs.h" -#include "php_imagick_macros.h" -#include "php_imagick_helpers.h" -#include "php_imagick_file.h" - - -#if MagickLibVersion >= 0x700 - - -// Functions that have been replaced by channel aware versions -MagickBooleanType MagickAdaptiveBlurImageChannel(MagickWand *wand,const ChannelType channel,const double radius, const double sigma) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickAdaptiveBlurImage(wand, radius, sigma); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - -MagickBooleanType MagickAdaptiveSharpenImageChannel(MagickWand *wand, const ChannelType channel, const double radius, const double sigma) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickAdaptiveSharpenImage(wand, radius, sigma); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - -MagickBooleanType MagickAddNoiseImageChannel(MagickWand *wand,const ChannelType channel,const NoiseType noise_type) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - //TODO - what is the value meant to be? - status = MagickAddNoiseImage(wand, noise_type, 1.0); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - -// This is not actually an ImageMagick function, but the name is likely to -// avoid any symbol clash for the foreseeable. -MagickBooleanType MagickAddNoiseImageChannelWithAttenuate(MagickWand *wand,const ChannelType channel,const NoiseType noise_type, double attenuate) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickAddNoiseImage(wand, noise_type, attenuate); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - - -MagickBooleanType MagickAutoGammaImageChannel(MagickWand *wand, const ChannelType channel) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickAutoGammaImage(wand); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - -MagickBooleanType MagickAutoLevelImageChannel(MagickWand *wand, - const ChannelType channel) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickAutoLevelImage(wand); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - -MagickBooleanType MagickBlurImageChannel(MagickWand *wand, - const ChannelType channel,const double radius,const double sigma) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickBlurImage(wand, radius,sigma); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - -MagickBooleanType MagickBrightnessContrastImageChannel(MagickWand *wand,const ChannelType channel,const double brightness, const double contrast) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickBrightnessContrastImage(wand, brightness, contrast); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - -MagickBooleanType MagickClampImageChannel(MagickWand *wand, const ChannelType channel) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickClampImage(wand); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; - -} - -MagickBooleanType MagickClutImageChannel(MagickWand *wand, const ChannelType channel, const MagickWand *clut_wand) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - //TODO - need to take parameter - status = MagickClutImage(wand, clut_wand, AverageInterpolatePixel); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - -MagickBooleanType MagickCompositeImageChannel(MagickWand *wand, - const ChannelType channel,const MagickWand *source_wand, - const CompositeOperator compose,const ssize_t x,const ssize_t y) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - long clip_to_self = 1; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickCompositeImage(wand, source_wand, compose, clip_to_self, x,y); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - - -MagickWand *MagickCompareImageChannels(MagickWand *wand, const MagickWand *reference, const ChannelType channel, const MetricType metric, double *distortion) { - - MagickWand *tmp_wand; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - tmp_wand = MagickCompareImages(wand, reference, metric, distortion); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - return tmp_wand; -} - - -MagickBooleanType MagickContrastStretchImageChannel(MagickWand *wand, - const ChannelType channel,const double black_point, - const double white_point) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickContrastStretchImage(wand, black_point, white_point); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - -MagickBooleanType MagickConvolveImageChannel(MagickWand *wand, - const ChannelType channel, const KernelInfo *kernel){ - - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickConvolveImage(wand, kernel); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - - -MagickBooleanType MagickEqualizeImageChannel(MagickWand *wand, - const ChannelType channel) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickEqualizeImage(wand); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - - -MagickBooleanType MagickEvaluateImageChannel(MagickWand *wand, - const ChannelType channel,const MagickEvaluateOperator op,const double value) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickEvaluateImage(wand,op,value); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - -//MagickBooleanType MagickFilterImageChannel(MagickWand *wand, -// const ChannelType channel,const KernelInfo *kernel) { -// MagickBooleanType status; -// ChannelType previous_channel_mask; -// -// if (channel != UndefinedChannel) { -// previous_channel_mask = MagickSetImageChannelMask(wand, channel); -// } -// -// status = MagickFilterImage(wand, kernel); -// -// if (channel != UndefinedChannel) { -// (void) MagickSetImageChannelMask(wand, previous_channel_mask); -// } -// -// return status; -//} - -MagickBooleanType MagickFloodfillPaintImageChannel(MagickWand *wand, - const ChannelType channel,const PixelWand *fill,const double fuzz, - const PixelWand *bordercolor,const ssize_t x,const ssize_t y, - const MagickBooleanType invert) { - - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickFloodfillPaintImage(wand, fill, fuzz, bordercolor, x, y, invert); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - -MagickBooleanType MagickFunctionImageChannel(MagickWand *wand, - const ChannelType channel,const MagickFunction function, - const size_t number_arguments,const double *arguments) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickFunctionImage(wand,function,number_arguments,arguments); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - - -MagickWand *MagickFxImageChannel(MagickWand *wand, const ChannelType channel,const char *expression) { - - MagickWand *result_wand; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - result_wand = MagickFxImage(wand, expression); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return result_wand; -} - - -MagickBooleanType MagickGammaImageChannel(MagickWand *wand, - const ChannelType channel,const double gamma) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickGammaImage(wand,gamma); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - -MagickBooleanType MagickGaussianBlurImageChannel(MagickWand *wand, - const ChannelType channel,const double radius,const double sigma) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickGaussianBlurImage(wand,radius,sigma); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - -size_t MagickGetImageChannelDepth(MagickWand *wand, const ChannelType channel) { - size_t depth; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - depth = MagickGetImageDepth(wand); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return depth; -} - -MagickBooleanType MagickGetImageChannelMean(MagickWand *wand, const ChannelType channel,double *mean, - double *standard_deviation) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickGetImageMean(wand, mean, standard_deviation); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - - -MagickBooleanType MagickSetImageChannelDepth(MagickWand *wand, const ChannelType channel, - const size_t depth) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickSetImageDepth(wand, depth); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - -MagickBooleanType MagickGetImageChannelDistortion(MagickWand *wand, - const MagickWand *reference,const ChannelType channel,const MetricType metric, - double *distortion) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickGetImageDistortion(wand, reference, metric, distortion); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - -MagickBooleanType MagickGetImageChannelKurtosis(MagickWand *wand,const ChannelType channel, - double *kurtosis,double *skewness) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickGetImageKurtosis(wand,kurtosis,skewness); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - -MagickBooleanType MagickGetImageChannelRange(MagickWand *wand,const ChannelType channel,double *minima, - double *maxima) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickGetImageRange(wand, minima, maxima); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - -MagickBooleanType MagickOrderedPosterizeImageChannel(MagickWand *wand,const ChannelType channel, - const char *threshold_map) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickOrderedDitherImage(wand, threshold_map); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - -ChannelStatistics *MagickGetImageChannelStatistics(MagickWand *wand) { - return MagickGetImageStatistics(wand); -} - -MagickBooleanType MagickHaldClutImageChannel(MagickWand *wand, const ChannelType channel,const MagickWand *hald_wand) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickHaldClutImage(wand, hald_wand); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - -MagickBooleanType MagickLevelImageChannel(MagickWand *wand, - const ChannelType channel,const double black_point,const double gamma, - const double white_point) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickLevelImage(wand,black_point,gamma, white_point); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - -MagickBooleanType MagickMorphologyImageChannel(MagickWand *wand, - ChannelType channel,MorphologyMethod method,const ssize_t iterations, - KernelInfo *kernel) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickMorphologyImage(wand, method, iterations, kernel); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - -MagickBooleanType MagickMotionBlurImageChannel(MagickWand *wand, - const ChannelType channel,const double radius,const double sigma, - const double angle) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickMotionBlurImage(wand, radius, sigma,angle); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - - -MagickBooleanType MagickNegateImageChannel(MagickWand *wand,const ChannelType channel,const MagickBooleanType gray) { - - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickNegateImage(wand, gray); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - -MagickBooleanType MagickNormalizeImageChannel(MagickWand *wand, - const ChannelType channel) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickNormalizeImage(wand); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - -MagickBooleanType MagickOpaquePaintImageChannel(MagickWand *wand, - const ChannelType channel,const PixelWand *target, - const PixelWand *fill,const double fuzz,const MagickBooleanType invert) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickOpaquePaintImage(wand, target, fill, fuzz, invert); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - - -MagickBooleanType MagickRandomThresholdImageChannel(MagickWand *wand, - const ChannelType channel,const double low,const double high) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickRandomThresholdImage(wand, low, high); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - -MagickBooleanType MagickRotationalBlurImageChannel(MagickWand *wand, - const ChannelType channel,const double angle) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickRotationalBlurImage(wand, angle); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - -MagickBooleanType MagickSelectiveBlurImageChannel(MagickWand *wand, - const ChannelType channel,const double radius,const double sigma, - const double threshold) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickSelectiveBlurImage(wand, radius, sigma, threshold); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - -MagickBooleanType MagickSeparateImageChannel(MagickWand *wand,const ChannelType channel) { - return MagickSeparateImage(wand, channel); -} - -MagickBooleanType MagickSharpenImageChannel(MagickWand *wand, - const ChannelType channel,const double radius,const double sigma) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickSharpenImage(wand, radius, sigma); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - -MagickBooleanType MagickSigmoidalContrastImageChannel( - MagickWand *wand,const ChannelType channel,const MagickBooleanType sharpen, - const double alpha,const double beta) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickSigmoidalContrastImage(wand, sharpen, alpha, beta); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - -MagickBooleanType MagickSolarizeImageChannel(MagickWand *wand, const ChannelType channel,const double threshold) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickSolarizeImage(wand, threshold); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - - - -MagickBooleanType MagickSparseColorImageChannel(MagickWand *wand, const ChannelType channel,const SparseColorMethod method, const size_t number_arguments,const double *arguments) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickSparseColorImage(wand, method, number_arguments, arguments); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - - - -MagickBooleanType MagickStatisticImageChannel(MagickWand *wand, - const ChannelType channel,const StatisticType type,const size_t width, - const size_t height) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickStatisticImage(wand, type, width, height); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - -//MagickBooleanType MagickThresholdImageChannel(MagickWand *wand, -// const ChannelType channel,const double threshold) { -// MagickBooleanType status; -// ChannelType previous_channel_mask; -// -// if (channel != UndefinedChannel) { -// previous_channel_mask = MagickSetImageChannelMask(wand, channel); -// } -// -// status = MagickThresholdImage(wand, threshold); -// -// if (channel != UndefinedChannel) { -// (void) MagickSetImageChannelMask(wand, previous_channel_mask); -// } -// -// return status; -//} - - -MagickBooleanType MagickUnsharpMaskImageChannel(MagickWand *wand, - const ChannelType channel,const double radius,const double sigma, - const double amount,const double threshold) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickUnsharpMaskImage(wand, radius, sigma, amount, threshold); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - - - - -#endif \ No newline at end of file
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/013-read-filehandle.phpt
Deleted
@@ -1,32 +0,0 @@ ---TEST-- -Imagick::readImageFile test ---SKIPIF-- -<?php - require_once(dirname(__FILE__) . '/skipif.inc'); - checkFormatPresent('jpg'); -?> ---FILE-- -<?php - -$file = dirname(__FILE__) . '/__tmp_rose.jpg'; - -$imagick = new Imagick('magick:rose'); -$imagick->setImageFormat('jpg'); -$imagick->writeImage($file); - -$imagick->clear(); - -$handle = fopen($file, 'rb'); -$imagick->readImageFile($handle); - -unlink($file); - -echo 'success'; - -?> ---CLEAN-- -<?php -@unlink(dirname(__FILE__) . '/__tmp_rose.jpg'); -?> ---EXPECT-- -success \ No newline at end of file
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/014-setresourcelimit.phpt
Deleted
@@ -1,68 +0,0 @@ ---TEST-- -Imagick::setResourceLimit test ---SKIPIF-- -<?php -$imageMagickRequiredVersion=0x692; -require_once(dirname(__FILE__) . '/skipif.inc'); -?> ---FILE-- -<?php - - - -$k = 1024; -$m = $k * $k; -$g = $k * $m; -$t = $k * $g; - -// These tests are flaky as the values ImageMagick will accept -// are limited by the policy.xml of the system. - -$tests = array( - Imagick::RESOURCETYPE_AREA => 100000000, - - // Set maximum amount of disk space in bytes permitted for use by the pixel cache. When this limit is exceeded, the pixel cache is not be created and an error message is returned. - Imagick::RESOURCETYPE_DISK => 100, - - - //Set maximum number of open pixel cache files. When this limit is exceeded, any subsequent pixels cached to disk are closed and reopened on demand. This behavior permits a large number of images to be accessed simultaneously on disk, but with a speed penalty due to repeated open/close calls. - Imagick::RESOURCETYPE_FILE => 100, - - // Set maximum amount of memory map in bytes to allocate for the pixel cache. When this limit is exceeded, the image pixels are cached to disk - Imagick::RESOURCETYPE_MAP => 10 * $g, - - // Set maximum amount of memory in bytes to allocate for the pixel cache from the heap. When this limit is exceeded, the image pixels are cached to memory-mapped disk - Imagick::RESOURCETYPE_MEMORY => 10 * $g, -); - -if (defined('Imagick::RESOURCETYPE_TIME')) { - $testsImagick::RESOURCETYPE_TIME = 30; -} - -if (defined('Imagick::RESOURCETYPE_THROTTLE')) { - $testsImagick::RESOURCETYPE_THROTTLE = 1; -} -if (defined('Imagick::RESOURCETYPE_THREAD')) { - $testsImagick::RESOURCETYPE_THREAD = 1; -} -if (defined('Imagick::RESOURCETYPE_WIDTH')) { - $testsImagick::RESOURCETYPE_WIDTH = $g; -} -if (defined('Imagick::RESOURCETYPE_HEIGHT')) { - $testsImagick::RESOURCETYPE_HEIGHT = $g; -} - -foreach ($tests as $resourceType => $value) { - Imagick::setResourceLimit($resourceType, $value); - $actualValue = Imagick::getResourceLimit($resourceType); - - if ($actualValue != $value) { - echo "Error testing $resourceType, value returned $actualValue is not $value \n"; - } -} - -echo 'success'; - -?> ---EXPECTF-- -success \ No newline at end of file
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/031_Imagick_affineTransformImage_basic.phpt
Deleted
@@ -1,143 +0,0 @@ ---TEST-- -Test Imagick, affineTransformImage ---SKIPIF-- -<?php -$imageMagickRequiredVersion=0x675; -require_once(dirname(__FILE__) . '/skipif.inc'); -?> ---XFAIL-- -I don't understand what values are returned in which elements of getImageChannelStatistics ---FILE-- -<?php - - -function checkAllStatsAreValue($channelStatistics, $value) { - - if ($channelStatisticsImagick::CHANNEL_RED'mean' != $value) { - echo "Channel red is wrong " . $channelStatisticsImagick::CHANNEL_RED'mean' . " vs " . $value. "\n"; - } - if ($channelStatisticsImagick::CHANNEL_GREEN'mean' != $value) { - echo "Channel green is wrong " . $channelStatisticsImagick::CHANNEL_GREEN'mean' . " vs " . $value. "\n"; - } - if ($channelStatisticsImagick::CHANNEL_BLUE'mean' != $value) { - echo "Channel blue is wrong " . $channelStatisticsImagick::CHANNEL_BLUE'mean' . " vs " . $value. "\n"; - } - - echo "Stats checked\n"; -} - -function affineTransformImage() { - $imagick = new \Imagick(); - $imagick->newPseudoImage(640, 640, "xc:black"); - $draw = new \ImagickDraw(); - - $angle = deg2rad(45); - //$angle = deg2rad(3); - - $draw->setFillColor('white'); - $draw->setStrokeColor('white'); - $draw->setStrokeWidth(10.0); - $draw->setStrokeLineCap(Imagick::LINECAP_SQUARE); - $draw->setStrokeLineJoin(Imagick::LINEJOIN_BEVEL); - - $draw->line( - $start_x = -50, - $start_y = -50, - $end_x = 690, - $end_y = 690 - ); - - $imagick->drawImage($draw); - - $draw = new \ImagickDraw(); - - $affineRotate = array( - "sx" => cos($angle), "sy" => cos($angle), - "rx" => sin($angle), "ry" => -sin($angle), - "tx" => 0, "ty" => 0, - ); - - $draw->affine($affineRotate); - - $imagick->setImageVirtualPixelMethod(Imagick::VIRTUALPIXELMETHOD_BLACK); - $imagick->affineTransformImage($draw); - $imagick->setImagePage($imagick->getimageWidth(), $imagick->getimageheight(), 0, 0); - - $imagick->cropImage( - $imagick->getImageWidth() - 40, - $imagick->getImageHeight() - 40, - 20, - 20 - ); - - $imagick->setImageFormat('png'); - $imagick->writeImage(__DIR__ . '/test_031.png'); - - - $lineCheckBlack = clone $imagick; - $blackout = new \ImagickDraw(); - $blackout->setStrokeColor('black'); - $blackout->setFillColor('black'); - $blackout->rectangle( - ($lineCheckBlack->getImageWidth() / 2) - 20, - 0, - ($lineCheckBlack->getImageWidth() / 2) + 20, - $lineCheckBlack->getImageHeight() - ); - - $lineCheckBlack->drawImage($blackout); - // $lineCheckBlack->writeImage(__DIR__ . '/test_031_blank.png'); - - $whiteout = new \ImagickDraw(); - $lineCheckWhite = clone $imagick; - $whiteout->setStrokeColor('white'); - $whiteout->setFillColor('white'); - $whiteout->rectangle( - ($lineCheckBlack->getImageWidth() / 2) - 4, - 0, - 0, - $lineCheckBlack->getImageHeight() - ); - $whiteout->rectangle( - ($lineCheckWhite->getImageWidth() / 2) + 4, - 0, - $lineCheckWhite->getImageWidth(), - $lineCheckWhite->getImageHeight() - ); - - $lineCheckWhite->drawImage($whiteout); - // $lineCheckWhite->writeImage(__DIR__ . '/test_031_white.png'); - - $channelStatistics = $lineCheckWhite->getImageChannelStatistics(); - - echo "Checking white\n"; - checkAllStatsAreValue($channelStatistics, Imagick::getQuantum()); - - - $channelStatistics = $lineCheckBlack->getImageChannelStatistics(); -// var_dump( -// "lineCheckBlack channel stats are:", -// $channelStatistics -// ); - - echo "Checking black\n"; - checkAllStatsAreValue($channelStatistics, 0); - - $bytes = $imagick->getImageBlob(); - if (strlen($bytes) <= 0) { echo "Failed to generate image.";} -} - -affineTransformImage() ; -echo "Ok"; -?> ---CLEAN-- -<?php -$f = __DIR__ . "/test_031.png"; -if (file_exists($f)) unlink($f); -?> ---EXPECTF-- -Checking white -Stats checked -Checking black -Stats checked -Ok
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/042_Imagick_clutImage_basic.phpt
Deleted
@@ -1,28 +0,0 @@ ---TEST-- -Test Imagick, clutImage ---SKIPIF-- -<?php -$imageMagickRequiredVersion=0x675; -require_once(dirname(__FILE__) . '/skipif.inc'); -?> ---FILE-- -<?php - - -function clutImage() { - $imagick = new \Imagick(); - $imagick->newPseudoImage(640, 480, "magick:logo"); - //$imagick->quantizeImage(16, \Imagick::COLORSPACE_YIQ, 8, true, false); - - $clutImagick = new \Imagick(); - $clutImagick->newPseudoImage(640, 480, "magick:NETSCAPE"); - $imagick->clutImage($clutImagick); - $bytes = $imagick->getImageBlob(); - if (strlen($bytes) <= 0) { echo "Failed to generate image.";} -} - -clutImage() ; -echo "Ok"; -?> ---EXPECTF-- -Ok \ No newline at end of file
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/092_Imagick_mergeImageLayers_basic.phpt
Deleted
@@ -1,39 +0,0 @@ ---TEST-- -Test Imagick, mergeImageLayers ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -$layerMethodType = 13; - -function mergeImageLayers($layerMethodType) { - - $imagick = new \Imagick(); - $nextImage = null; - $imageNames = array( - "magick:NETSCAPE", - "magick:logo", - "magick:GRANITE", - ); - - foreach ($imageNames as $imageName) { - $nextImage = new \Imagick(); - $nextImage->newPseudoImage(640, 480, $imageName); - $imagick->addImage($nextImage); - } - - $imagick->resetIterator(); - - $imagick->setImageFormat('png'); - - $result = $imagick->mergeImageLayers($layerMethodType); - $bytes = $result->getImageBlob(); - if (strlen($bytes) <= 0) { echo "Failed to generate image.";} -} - -mergeImageLayers($layerMethodType); -echo "Ok"; -?> ---EXPECTF-- -Ok \ No newline at end of file
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/145_imagickkernel_coverage.phpt
Deleted
@@ -1,210 +0,0 @@ ---TEST-- -ImagickKernel::fromMatrix test ---SKIPIF-- -<?php - -$imageMagickRequiredVersion = 0x680; -require_once(dirname(__FILE__) . '/skipif.inc'); - -?> ---FILE-- -<?php - - -$kernel = array( - array(1, 0, -1), - array(1, 0, -1), - array(1, 0, -1), -); - -$kernel = ImagickKernel::fromMatrix($kernel); -$kernel->scale(1, \Imagick::NORMALIZE_KERNEL_VALUE); -$kernel->addUnityKernel(0.50); -$imagick = new \Imagick(); -$imagick->newPseudoImage(640, 480, "magick:logo"); -$imagick->morphology( - \Imagick::MORPHOLOGY_CONVOLVE, - 1, - $kernel -); - - -$tests = array(); - -$tests = array( - "Cannot create kernel, matrix is empty.", - array() -); - -$tests = array( - "Values must be matrix, with the same number of columns in each row.", - array(0, 1, 1) -); - -//Should fail, matrix needs to have same number columns in each row -$tests = array( - "Values must be matrix, with the same number of columns in each row.", - array( - array(1, 0, 1), - array(1, 0, 1), - array(1, 0), - ) -); - -//Should fail, value instead of second row -$tests = array( - "Values must be matrix, with the same number of columns in each row.", - array( - array(0, 1), - 1 - ) -); - -//Should fail, value instead of second row -$tests = array( - "Only numbers or false are valid values in a kernel matrix.", - array( - array(0, 1), - array(0, new StdClass), - ) -); - -$tests = array( - "For kernels with even numbered rows or columns, the origin position must be specified.", - array( - array(1, 0), - ), -); - - -foreach ($tests as $test) { - - list($expectedMessage, $testValue) = $test; - - try { - $kernel = ImagickKernel::fromMatrix($testValue); - echo "Failed to throw exception".PHP_EOL; - } - catch(ImagickKernelException $e) { - if ($e->getMessage() != $expectedMessage) { - echo "Unexpected message ".$e->getMessage()." for test:".PHP_EOL; - var_dump($test); - } - } -} - - -try { - $kernel = ImagickKernel::fromBuiltin(\Imagick::KERNEL_DIAMOND, "CestNestPasUneKernel"); - //echo "builtIn OK".PHP_EOL; -} -catch(Exception $e) { - echo "Unexpected exception: ".$e->getMessage().PHP_EOL; -} - - -//Test adding unity kernel works. -$matrix1 = array( - array(1, 1, 1), - array(0, 0, 0), - array(-1, -1, -1), -); -$kernel = ImagickKernel::fromMatrix($matrix1); -$kernel->addUnityKernel(0.5); -$matrix = $kernel->getMatrix(); - -if ($matrix11 != 0.5) { - echo "center point should be 0.5 but is actually ".$matrix11.PHP_EOL; - var_dump($matrix); -} -//echo "Adding unity kernel ok".PHP_EOL; - -// Test adding kernel works and you can get the values back -$matrix1 = array( - array(1, 1), - array(0, 0), -); -$matrix2 = array( - array(0, 0), - array(1, 1), -); -$kernel1 = ImagickKernel::fromMatrix($matrix1, array(0, 0)); -$kernel2 = ImagickKernel::fromMatrix($matrix2, array(0, 0)); -$kernel1->addKernel($kernel2); - -$kernelList = $kernel1->separate(); -if (count($kernelList) != 2) { - echo "Incorrect number of matrixes returned."; -} -else { - if ($kernelList0->getMatrix() != $matrix1) { - echo "Matrix 1 does not match".PHP_EOL; - var_dump($kernelList0); - } - if ($kernelList1->getMatrix() != $matrix2) { - echo "Matrix 2 does not match".PHP_EOL; - var_dump($kernelList1); - } -} - -//Test Scaling -$matrixIn = array( - array(-1, 0, -1), - array( 0, 8, 0), - array(-1, 0, -1), -); -$kernel = ImagickKernel::fromMatrix($matrixIn); -$kernel->scale(1, \Imagick::NORMALIZE_KERNEL_VALUE); -$matrixOut = $kernel->getMatrix(); - -if ($matrixOut11 != 2) { - echo "Matrix was not normalised correctly."; - var_dump($matrixOut); -} - - - -//Test single line kernel works -$matrixIn = array( - array(1, 0), -); -$kernel = ImagickKernel::fromMatrix($matrixIn, array(1, 0)); -if ($kernel->getMatrix() != $matrixIn) { - echo "Values do not match for 'Test single line kernel works'".PHP_EOL; -} - -//Test even sized kernel works -$matrixIn = array( - array(-1, 0), - array( 0, 1) -); -$kernel = ImagickKernel::fromMatrix($matrixIn, array(0, 1)); -if ($kernel->getMatrix() != $matrixIn) { - echo "Values do not match for 'Test even sized kernel works'".PHP_EOL; -} - -//Test 'wrong' order matrix is converted correctly. -$matrix = array( - array(0.0, 1.0), - array(0.5, false) -); - -$outOfOrderMatrix = array(); -$outOfOrderMatrix11 = $matrix11; -$outOfOrderMatrix10 = $matrix10; -$outOfOrderMatrix01 = $matrix01; -$outOfOrderMatrix00 = $matrix00; - -$kernel = ImagickKernel::fromMatrix($outOfOrderMatrix, array(0, 0)); -$kernelMatrix = $kernel->getMatrix(); -if ($kernelMatrix !== $matrix) { - echo "Kernel generated from 'out of order' matrix is incorrect.".PHP_EOL; - var_dump($matrix); - echo "vs".PHP_EOL; - var_dump($kernelMatrix); -} - -echo "Complete".PHP_EOL; -?> ---EXPECTF-- -Complete
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/182_ImagickDraw_pathCurveToQuadraticBezierAbsolute_basic.phpt
Deleted
@@ -1,64 +0,0 @@ ---TEST-- -Test ImagickDraw, pathCurveToQuadraticBezierAbsolute ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -$backgroundColor = 'rgb(225, 225, 225)'; -$strokeColor = 'rgb(0, 0, 0)'; -$fillColor = 'DodgerBlue2'; - -function pathCurveToQuadraticBezierAbsolute($strokeColor, $fillColor, $backgroundColor) { - - $draw = new \ImagickDraw(); - - $draw->setStrokeOpacity(1); - $draw->setStrokeColor($strokeColor); - $draw->setFillColor($fillColor); - - $draw->setStrokeWidth(2); - $draw->setFontSize(72); - - $draw->pathStart(); - $draw->pathMoveToAbsolute(50,250); - - // This specifies a quadratic bezier curve with the current position as the start - // point, the control point is the first two params, and the end point is the last two params. - $draw->pathCurveToQuadraticBezierAbsolute( - 150,50, - 250,250 - ); - - // This specifies a quadratic bezier curve with the current position as the start - // point, the control point is mirrored from the previous curves control point - // and the end point is defined by the x, y values. - $draw->pathCurveToQuadraticBezierSmoothAbsolute( - 450,250 - ); - - // This specifies a quadratic bezier curve with the current position as the start - // point, the control point is mirrored from the previous curves control point - // and the end point is defined relative from the current position by the x, y values. - $draw->pathCurveToQuadraticBezierSmoothRelative( - 200,-100 - ); - - $draw->pathFinish(); - - $imagick = new \Imagick(); - $imagick->newImage(700, 500, $backgroundColor); - $imagick->setImageFormat("png"); - - $imagick->drawImage($draw); - - $bytes = $imagick->getImageBlob(); - if (strlen($bytes) <= 0) { echo "Failed to generate image.";} - -} - -pathCurveToQuadraticBezierAbsolute($strokeColor, $fillColor, $backgroundColor) ; -echo "Ok"; -?> ---EXPECTF-- -Ok \ No newline at end of file
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/187_ImagickDraw_push_basic.phpt
Deleted
@@ -1,41 +0,0 @@ ---TEST-- -Test ImagickDraw, push ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -$backgroundColor = 'rgb(225, 225, 225)'; -$strokeColor = 'rgb(0, 0, 0)'; -$fillColor = 'DodgerBlue2'; -$fillModifiedColor = 'LightCoral'; - -function push($strokeColor, $fillColor, $backgroundColor, $fillModifiedColor) { - - $draw = new \ImagickDraw(); - $draw->setStrokeColor($strokeColor); - $draw->setFillColor($fillModifiedColor); - $draw->setStrokeWidth(2); - $draw->setFontSize(72); - $draw->push(); - $draw->translate(50, 50); - $draw->rectangle(200, 200, 300, 300); - $draw->pop(); - $draw->setFillColor($fillColor); - $draw->rectangle(200, 200, 300, 300); - - $imagick = new \Imagick(); - $imagick->newImage(500, 500, $backgroundColor); - $imagick->setImageFormat("png"); - - $imagick->drawImage($draw); - - $bytes = $imagick->getImageBlob(); - if (strlen($bytes) <= 0) { echo "Failed to generate image.";} -} - -push($strokeColor, $fillColor, $backgroundColor, $fillModifiedColor) ; -echo "Ok"; -?> ---EXPECTF-- -Ok \ No newline at end of file
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/188_ImagickDraw_pushPattern_basic.phpt
Deleted
@@ -1,59 +0,0 @@ ---TEST-- -Test ImagickDraw, pushPattern ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -$backgroundColor = 'rgb(225, 225, 225)'; -$strokeColor = 'rgb(0, 0, 0)'; -$fillColor = 'DodgerBlue2'; - -function pushPattern($strokeColor, $fillColor, $backgroundColor) { - $draw = new \ImagickDraw(); - - $draw->setStrokeColor($strokeColor); - $draw->setFillColor($fillColor); - $draw->setStrokeWidth(1); - $draw->setStrokeOpacity(1); - $draw->setStrokeColor($strokeColor); - $draw->setFillColor($fillColor); - - $draw->setStrokeWidth(1); - - $draw->pushPattern("MyFirstPattern", 0, 0, 50, 50); - for ($x = 0; $x < 50; $x += 10) { - for ($y = 0; $y < 50; $y += 5) { - $positionX = $x + (($y / 5) % 5); - $draw->rectangle($positionX, $y, $positionX + 5, $y + 5); - } - } - $draw->popPattern(); - - $draw->setFillOpacity(0); - $draw->rectangle(100, 100, 400, 400); - $draw->setFillOpacity(1); - - $draw->setFillOpacity(1); - - $draw->push(); - $draw->setFillPatternURL('#MyFirstPattern'); - $draw->setFillColor('yellow'); - $draw->rectangle(100, 100, 400, 400); - $draw->pop(); - - $imagick = new \Imagick(); - $imagick->newImage(500, 500, $backgroundColor); - $imagick->setImageFormat("png"); - - $imagick->drawImage($draw); - - $bytes = $imagick->getImageBlob(); - if (strlen($bytes) <= 0) { echo "Failed to generate image.";} -} - -pushPattern($strokeColor, $fillColor, $backgroundColor) ; -echo "Ok"; -?> ---EXPECTF-- -Ok \ No newline at end of file
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/192_ImagickDraw_setClipPath_basic.phpt
Deleted
@@ -1,42 +0,0 @@ ---TEST-- -Test ImagickDraw, setClipPath ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -$backgroundColor = 'rgb(225, 225, 225)'; -$strokeColor = 'rgb(0, 0, 0)'; -$fillColor = 'DodgerBlue2'; - -function setClipPath($strokeColor, $fillColor, $backgroundColor) { - - $draw = new \ImagickDraw(); - $draw->setStrokeColor($strokeColor); - $draw->setFillColor($fillColor); - $draw->setStrokeOpacity(1); - $draw->setStrokeWidth(2); - - $clipPathName = 'testClipPath'; - - $draw->pushClipPath($clipPathName); - $draw->rectangle(0, 0, 250, 250); - $draw->popClipPath(); - $draw->setClipPath($clipPathName); - $draw->rectangle(100, 100, 400, 400); - - $imagick = new \Imagick(); - $imagick->newImage(500, 500, $backgroundColor); - $imagick->setImageFormat("png"); - - $imagick->drawImage($draw); - - $bytes = $imagick->getImageBlob(); - if (strlen($bytes) <= 0) { echo "Failed to generate image.";} -} - -setClipPath($strokeColor, $fillColor, $backgroundColor) ; -echo "Ok"; -?> ---EXPECTF-- -Ok \ No newline at end of file
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/246_antialias_image.phpt
Deleted
@@ -1,28 +0,0 @@ ---TEST-- -Test pseudo formats ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -$im = new Imagick(); -$im->newPseudoImage(10, 10, "magick:logo"); -//On by default -var_export($im->getAntiAlias()); -echo PHP_EOL; - -//Turn off -$im->setAntiAlias(false); -var_export($im->getAntiAlias()); -echo PHP_EOL; - -//Turn back on -$im->setAntiAlias(true); -var_export($im->getAntiAlias()); -echo PHP_EOL; - -?> ---EXPECTF-- -true -false -true \ No newline at end of file
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/247_ImagickPixelIterator_construct_basic.phpt
Deleted
@@ -1,39 +0,0 @@ ---TEST-- -Test ImagickPixelIterator, construct ---SKIPIF-- -<?php -$imageMagickRequiredVersion=0x675; -require_once(dirname(__FILE__) . '/skipif.inc'); -?> ---FILE-- -<?php - - -function construct() { - $imagick = new \Imagick(); - $imagick->newPseudoImage(640, 480, "magick:logo"); - $imageIterator = new \ImagickPixelIterator($imagick); - - /* Loop through pixel rows */ - foreach ($imageIterator as $pixels) { - /* Loop through the pixels in the row (columns) */ - foreach ($pixels as $column => $pixel) { - /** @var $pixel \ImagickPixel */ - if ($column % 2) { - /* Paint every second pixel black*/ - $pixel->setColor("rgba(0, 0, 0, 0)"); - } - } - /* Sync the iterator, this is important to do on each iteration */ - $imageIterator->syncIterator(); - } - - $bytes = $imagick; - if (strlen($bytes) <= 0) { echo "Failed to generate image.";} -} - -construct() ; -echo "Ok"; -?> ---EXPECTF-- -Ok \ No newline at end of file
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/254_getConfigureOptions.phpt
Deleted
@@ -1,160 +0,0 @@ ---TEST-- -Test Imagick::getConfigureOptions ---SKIPIF-- -<?php - -require_once(dirname(__FILE__) . '/skipif.inc'); - -checkClassMethods('Imagick', array('getconfigureoptions')); - - -?> ---FILE-- -<?php - -$allOptions = Imagick::getConfigureOptions(); - -if (!is_array($allOptions)) { - echo "Failed to return array".PHP_EOL; - var_dump($options); -} -else if (count($allOptions) == 0) { - echo "allOptions is empty".PHP_EOL; -} - - -$optionsStartingWithC = Imagick::getConfigureOptions("Q*"); - -if (!is_array($optionsStartingWithC)) { - echo "Failed to return array".PHP_EOL; - var_dump($optionsStartingWithC); -} -else if (count($optionsStartingWithC) == 0) { - echo "optionsStartingWithC is empty".PHP_EOL; - echo "All options are:\n"; - var_dump(Imagick::getConfigureOptions()); -} - -//Example output on Debian -// -//array(38) { -// "CC"=> -// string(3) "gcc" -// "CFLAGS"=> -// string(186) "-I/usr/include/libxml2 -I/usr/include/libpng16 -I/usr/include/freetype2 -fopenmp -Wall -g -O2 -mtune=core2 -fexceptions -pthread -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16" -// "CODER_PATH"=> -// string(56) "/usr/local/lib/ImageMagick-7.0.11/modules-Q16HDRI/coders" -// "CONFIGURE"=> -// string(155) "./configure '--with-quantum-depth=16' '--with-magick-plus-plus=no' '--without-perl' '--disable-static' '--disable-docs' '--with-jpeg=yes' '--with-png=yes'" -// "CONFIGURE_PATH"=> -// string(29) "/usr/local/etc/ImageMagick-7/" -// "COPYRIGHT"=> -// string(46) "Copyright (C) 1999-2021 ImageMagick Studio LLC" -// "CPPFLAGS"=> -// string(34) "-I/usr/local/include/ImageMagick-7" -// "CXX"=> -// string(3) "g++" -// "CXXFLAGS"=> -// string(9) " -pthread" -// "DEFS"=> -// string(15) "-DHAVE_CONFIG_H" -// "DELEGATES"=> -// string(33) "freetype jng jpeg png ps xml zlib" -// "DISTCHECK_CONFIG_FLAGS"=> -// string(217) " --disable-deprecated --with-quantum-depth=16 --with-jemalloc=no --with-umem=no --with-autotrace=no --with-fftw=no --with-gslib=no --with-fontpath= --with-jxl=no --with-rsvg=no --with-wmf=no --with-perl=no " -// "DOCUMENTATION_PATH"=> -// string(34) "/usr/local/share/doc/ImageMagick-7" -// "EXEC-PREFIX"=> -// string(10) "/usr/local" -// "EXECUTABLE_PATH"=> -// string(14) "/usr/local/bin" -// "FEATURES"=> -// string(22) "DPC HDRI Cipher OpenMP" -// "FILTER_PATH"=> -// string(57) "/usr/local/lib/ImageMagick-7.0.11/modules-Q16HDRI/filters" -// "GIT_REVISION"=> -// string(24) "18571:309fcfa1c:20210328" -// "HOST"=> -// string(19) "x86_64-pc-linux-gnu" -// "INCLUDE_PATH"=> -// string(32) "/usr/local/include/ImageMagick-7" -// "LDFLAGS"=> -// string(17) "-L/usr/local/lib " -// "LIB_VERSION"=> -// string(5) "0x70B" -// "LIB_VERSION_NUMBER"=> -// string(8) "7,0,11,6" -// "LIBRARY_PATH"=> -// string(33) "/usr/local/lib/ImageMagick-7.0.11" -// "LIBS"=> -// string(96) " -lfreetype -ljpeg -lpng16 -lxml2 -lz -lm -lpthread -lgomp" -// "MAGICK_TEMPORARY_PATH"=> -// string(4) "/tmp" -// "NAME"=> -// string(11) "ImageMagick" -// "PCFLAGS"=> -// string(65) "-fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16" -// "PREFIX"=> -// string(10) "/usr/local" -// "QuantumDepth"=> -// string(2) "16" -// "RELEASE_DATE"=> -// string(10) "2021-03-28" -// "SHARE_PATH"=> -// string(30) "/usr/local/share/ImageMagick-7" -// "SHAREARCH_PATH"=> -// string(48) "/usr/local/lib/ImageMagick-7.0.11/config-Q16HDRI" -// "TARGET_CPU"=> -// string(6) "x86_64" -// "TARGET_OS"=> -// string(9) "linux-gnu" -// "TARGET_VENDOR"=> -// string(2) "pc" -// "VERSION"=> -// string(6) "7.0.11" -// "WEBSITE"=> -// string(23) "https://imagemagick.org" -//} - - - -// Examples of output on nixos -//array(5) { -// "DELEGATES"=> -// string(102) "bzlib cairo djvu fontconfig freetype heic jng jp2 jpeg lcms lzma openexr png rsvg tiff webp x xml zlib" -// "FEATURES"=> -// string(28) "Cipher DPC HDRI OpenMP(4.5) " -// "MAGICK_TEMPORARY_PATH"=> -// string(4) "/tmp" -// "NAME"=> -// string(11) "ImageMagick" -// "QuantumDepth"=> -// string(3) "Q16" -//} - - - - - - - - -if (!(count($optionsStartingWithC) < count($allOptions))) { - echo ""; - var_dump($optionsStartingWithC); - var_dump($allOptions); -} - -foreach ($optionsStartingWithC as $key => $value) { - $key = strtolower($key); - - if (stripos($key, "q") !== 0) { - echo "key $key does not start with c".PHP_EOL; - } -} - -echo "Ok"; - -?> ---EXPECTF-- -Ok \ No newline at end of file
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/257_Imagick_setImageChannelMask_basic.phpt
Deleted
@@ -1,37 +0,0 @@ ---TEST-- -Test Imagick, Imagick::exportImagePixels ---SKIPIF-- -<?php -$imageMagickRequiredVersion=0x700; -require_once(dirname(__FILE__) . '/skipif.inc'); -?> ---FILE-- -<?php - -$imagick = new \Imagick(); -$imagick->newPseudoImage(256, 256, "gradient:black-white"); - -$initialMask = $imagick->setImageChannelMask(\Imagick::CHANNEL_RED); -$imagick->brightnessContrastImage(-20, 20); -$imagick->setImageFormat("png"); -$imagick->writeImage(__DIR__ . "/maskTest.png"); - -$redMask = $imagick->setImageChannelMask(\Imagick::CHANNEL_DEFAULT); - -if ($initialMask != \Imagick::CHANNEL_DEFAULT) { - echo "initialMask is not equal to \Imagick::CHANNEL_DEFAULT but instead is $initialMask\n"; -} - -if ($redMask != \Imagick::CHANNEL_RED) { - echo "redMask is not equal to \Imagick::CHANNEL_RED but instead is $redMask\n"; -} - -echo "Ok"; -?> ---CLEAN-- -<?php -$f = __DIR__ . '/maskTest.png'; -if (file_exists($f)) unlink($f); -?> ---EXPECTF-- -Ok
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/263_autoGammaImage.phpt
Deleted
@@ -1,22 +0,0 @@ ---TEST-- -Test autoGammaImage ---SKIPIF-- -<?php -require_once(dirname(__FILE__) . '/skipif.inc'); -checkClassMethods('Imagick', array('autoGammaImage')); -?> ---FILE-- -<?php - -$im = new Imagick("magick:logo"); -$im->autoGammaImage(); - - -$im = new Imagick("magick:logo"); -$im->autoGammaImage(\Imagick::CHANNEL_RED); - -echo "Ok"; - -?> ---EXPECT-- -Ok \ No newline at end of file
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/264_ImagickDraw_getTextDirection_basic.phpt
Deleted
@@ -1,71 +0,0 @@ ---TEST-- -Test ImagickDraw, getTextDirection ---SKIPIF-- -<?php -require_once(dirname(__FILE__) . '/skipif.inc'); -checkClassMethods('ImagickDraw', array('getTextDirection', 'setTextDirection')); -?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/functions.inc'); - -$backgroundColor = 'rgb(225, 225, 225)'; -$strokeColor = 'rgb(0, 0, 0)'; -$fillColor = 'DodgerBlue2'; - - - -$draw = new \ImagickDraw(); -setFontForImagickDraw($draw); - -$draw->setStrokeColor($strokeColor); -$draw->setFillColor($fillColor); - -$draw->setStrokeWidth(2); -$draw->setFontSize(56); - -$directions = array( - \Imagick::DIRECTION_LEFT_TO_RIGHT, - \Imagick::DIRECTION_RIGHT_TO_LEFT, - \Imagick::DIRECTION_LEFT_TO_RIGHT, -); - -$i = 0; -foreach ($directions as $directionToSet) { - $draw->setTextDirection($directionToSet); - $directionReturned = $draw->getTextDirection(); - - if ($directionReturned != $directionToSet) { - echo "Direction error for $i \n"; - } - - $position = 36; - if ($directionToSet == \Imagick::DIRECTION_RIGHT_TO_LEFT) { - $position = 500 - 36; - } - - $draw->annotation($position, (72 * $i) + 64, "Lorem Ipsum!"); - - $i++; -} - -$imagick = new \Imagick(); -$imagick->newImage(500, 500, $backgroundColor); -$imagick->setImageFormat("png"); -$imagick->drawImage($draw); - -$bytes = $imagick->getImageBlob(); -if (strlen($bytes) <= 0) { echo "Failed to generate image.";} - -$imagick->writeImage(__DIR__ . '/directionTest.png'); - -echo "Ok"; -?> ---CLEAN-- -<?php -$f = __DIR__ . '/directionTest.png'; -if (file_exists($f)) unlink($f); -?> ---EXPECTF-- -Ok
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/274_imagick_setImageAlpha.phpt
Deleted
@@ -1,77 +0,0 @@ ---TEST-- -Imagick::setImageAlpha ---SKIPIF-- -<?php -$imageMagickRequiredVersion=0x700; -require_once(dirname(__FILE__) . '/skipif.inc'); -?> ---FILE-- -<?php - -require_once __DIR__ . "/../util/functions.php"; - -$imagick = new Imagick(); -$imagick->newPseudoImage(256, 256, 'xc:purple'); -$imagick->setImageAlpha(0.5); - -$imagick->setImageFormat('png'); -$imagick->writeImage(__DIR__ . "/setAlphaTest.png"); - -$pixelTypes = array( - Imagick::PIXEL_CHAR => array(128, 0, 128, 128), - Imagick::PIXEL_FLOAT => array(0.50196081399918, 0, 0.50196081399918, 0.5), - Imagick::PIXEL_DOUBLE => array(0.50196078431373, 0, 0.50196078431373, 0.5), - Imagick::PIXEL_SHORT => array(32896, 0, 32896, 32768), -); - -function getColorError($type, $expected, $actual) { - - if ($type == Imagick::PIXEL_CHAR || - $type == Imagick::PIXEL_SHORT) { - $string = "Expected: " . $actual . "\n"; - $string .= "Actual : " . $actual . "\n"; - - return $string; - } - - if ($type == Imagick::PIXEL_FLOAT) { - return float_compare_32($expected, $actual); - } - - if ($type == Imagick::PIXEL_DOUBLE) { - return float_compare($expected, $actual); - } - - echo "Unknown type: $type \n"; - exit(-1); -} - - -foreach ($pixelTypes as $pixelType => $expectedValues) { - $pixels = $imagick->exportImagePixels(0, 0, 1, 1, "RGBA", $pixelType); - $channelNames = 'R', 'G', 'B', 'A'; - - // Loop over the colours - for ($channel = 0; $channel < 4; $channel++) { - $actual = $pixels$channel; - $expected = $expectedValues$channel; - if (abs($actual - $expected) > get_epsilon_for_off_by_half_errors()) { - $channelName = $channelNames$channel; - - echo "Pixel values appear incorrect for pixelType $pixelType channel:$channelName\n"; - echo getColorError($pixelType, $expected, $actual); - break; - } - } -} - -echo "Ok"; - -?> ---CLEAN-- -<?php -$f = __DIR__ . '/setAlphaTest.png'; -if (file_exists($f)) unlink($f); -?> ---EXPECTF-- -Ok
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/278_Imagick_optimaze_gif.phpt
Deleted
@@ -1,86 +0,0 @@ ---TEST-- -Test Imagick::optimizeimagelayers and Imagick::optimizeimagetransparency ---SKIPIF-- -<?php - -$imageMagickRequiredVersion = 0x686; - -require_once(dirname(__FILE__) . '/skipif.inc'); -checkClassMethods('Imagick', array('optimizeimagelayers')); -checkClassMethods('Imagick', array('optimizeimagetransparency')); - -?> ---FILE-- -<?php - -function makeSimpleGif() { - $aniGif = new \Imagick(); - $aniGif->setFormat("gif"); - - $circleRadius = 20; - $imageFrames = 6; - $imageSize = 200; - - $background = new \Imagick(); - $background->newpseudoimage($imageSize, $imageSize, "canvas:gray"); - - $blackWhite = new \Imagick(); - $blackWhite->newpseudoimage($imageSize, $imageSize, "gradient:black-white"); - - $backgroundPalette = clone $background; - $backgroundPalette->quantizeImage(240, \Imagick::COLORSPACE_RGB, 8, false, false); - - $blackWhitePalette = clone $blackWhite; - $blackWhitePalette->quantizeImage(16, \Imagick::COLORSPACE_RGB, 8, false, false); - - $backgroundPalette->addimage($blackWhitePalette); - - for($count=0 ; $count<$imageFrames ; $count++) { - echo "Frame: ".$count."\n"; - $drawing = new \ImagickDraw(); - $drawing->setFillColor('white'); - $drawing->setStrokeColor('rgba(64, 64, 64, 0.8)'); - $strokeWidth = 4; - $drawing->setStrokeWidth($strokeWidth); - - $distanceToMove = $imageSize + (($circleRadius + $strokeWidth) * 2); - $offset = ($distanceToMove * $count / ($imageFrames -1)) - ($circleRadius + $strokeWidth); - $drawing->translate($offset, ($imageSize / 2) + ($imageSize / 3 * cos(20 * $count / $imageFrames))); - $drawing->circle(0, 0, $circleRadius, 0); - - $frame = clone $background; - $frame->drawimage($drawing); - $frame->clutimage($backgroundPalette); - $frame->setImageDelay(10); - $aniGif->addImage($frame); - } - - $aniGif = $aniGif->deconstructImages(); - - $bytes = $aniGif->getImagesBlob(); - if (strlen($bytes) <= 0) { - echo "Failed to generate image."; - } - - return $aniGif; -} - -function optimizeGif($im) { - $im = $im->coalesceImages(); - $im->optimizeImageLayers(); - $im->optimizeimagetransparency(); -} - -$simpleGif = makeSimpleGif(); -optimizeGif($simpleGif); - -echo "Ok" -?> ---EXPECT-- -Frame: 0 -Frame: 1 -Frame: 2 -Frame: 3 -Frame: 4 -Frame: 5 -Ok \ No newline at end of file
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/281_imagick_houghLineImage_basic.phpt
Deleted
@@ -1,36 +0,0 @@ ---TEST-- -Test Imagick, houghLineImage ---SKIPIF-- -<?php -require_once(dirname(__FILE__) . '/skipif.inc'); -checkClassMethods('Imagick', array('houghLineImage')); -?> ---FILE-- -<?php - - -function houghLineImage() { - $path = realpath(__DIR__ . '/houghline_input_image.png'); - - if ($path === false) { - echo "Image is not readable.\n"; - exit(-1); - } - - $imagick = new \Imagick(); - $imagick->readImage($path); - $imagick->setbackgroundcolor('rgb(64, 64, 64)'); - $imagick->houghLineImage(20,40, 40); - $imagick->writeImage(__DIR__ . '/houghline_output_image.png'); -} - -houghLineImage() ; -echo "Ok"; -?> ---CLEAN-- -<?php -$f = __DIR__ . '/houghline_output_image.png'; -if (file_exists($f)) unlink($f); -?> ---EXPECTF-- -Ok
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/289_Imagick_setImageMask_basic.phpt
Deleted
@@ -1,69 +0,0 @@ ---TEST-- -Test Imagick, medianFilterImage ---SKIPIF-- -<?php -require_once(dirname(__FILE__) . '/skipif.inc'); -checkClassMethods('Imagick', array('getImageMask', 'setImageMask')); -?> ---FILE-- -<?php - -$canvas = new Imagick(__DIR__ . '/houghline_input_image.png'); - -$mask = new Imagick(); -$mask->newPseudoImage( - $canvas->getImageWidth(), - $canvas->getImageHeight(), - 'xc:black' -); - -$drawing = new ImagickDraw(); -$drawing->setBorderColor('black'); -$drawing->setFillColor('black'); -$drawing->rectangle(0, 0, $mask->getImageWidth(), $mask->getImageHeight()); - -$drawing->setBorderColor('white'); -$drawing->setFillColor('white'); -$drawing->circle( - $mask->getImageWidth() / 2, - $mask->getImageHeight() / 2, - 2 * $mask->getImageWidth() / 3, - $mask->getImageHeight() / 2 -); - -$mask->drawImage($drawing); -//$mask->writeImage(__DIR__ . "/test_mask.png"); - -// This would probably be more useful for users -// but shows the issue with PIXELMASK_COMPOSITE -// $mask->blurImage(10, 2); - -$mask_types = array( - \Imagick::PIXELMASK_READ => "PIXELMASK_READ", - \Imagick::PIXELMASK_WRITE => "PIXELMASK_WRITE", - \Imagick::PIXELMASK_COMPOSITE => "PIXELMASK_COMPOSITE", -); - -$channel_types = array( - \Imagick::CHANNEL_ALL => "CHANNEL_ALL", - \Imagick::CHANNEL_RED => "CHANNEL_RED", - \Imagick::CHANNEL_ALPHA => "CHANNEL_ALPHA", - \Imagick::CHANNEL_RGBA => "CHANNEL_RGBA", - \Imagick::CHANNEL_BLACK => "CHANNEL_BLACK", - \Imagick::CHANNEL_DEFAULT => "CHANNEL_DEFAULT", -); - -foreach ($channel_types as $channel_type => $channel_name) { - foreach ($mask_types as $type => $type_name) { - $output = clone $canvas; - $output->setImageMask($mask, $type); - - $output->blurImage(15, 4, $channel_type); -// $output->writeImage(__DIR__ . "/test_canvas" . $type_name . "_" . $channel_name . ".png"); - } -} - -echo "Ok"; -?> ---EXPECTF-- -Ok \ No newline at end of file
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/316_Imagick_getImageKurtosis.phpt
Deleted
@@ -1,27 +0,0 @@ ---TEST-- -Test Imagick, getImageKurtosis ---SKIPIF-- -<?php -require_once(dirname(__FILE__) . '/skipif.inc'); -checkClassMethods('Imagick', array('getImageKurtosis')); -?> ---FILE-- -<?php - -require_once(__DIR__ . '/functions.inc'); - -function getImageKurtosis() { - $imagick = new \Imagick(__DIR__ . '/Biter_500.jpg'); - $values = $imagick->getImageKurtosis(); - - check_value($values, "kurtosis", -0.9379261035010518); - check_value($values, "skewness", 0.4562517200972045); -} - -getImageKurtosis() ; -echo "Ok"; -?> ---EXPECTF-- -Value for 'kurtosis' is %f which is close enough to expected %f -Value for 'skewness' is %f which is close enough to expected %f -Ok \ No newline at end of file
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/324_Imagick_polynomialImage.phpt
Deleted
@@ -1,34 +0,0 @@ ---TEST-- -Test Imagick, polynomialImage ---SKIPIF-- -<?php -require_once(dirname(__FILE__) . '/skipif.inc'); -checkClassMethods('Imagick', array('polynomialImage')); -?> ---FILE-- -<?php - -function polynomialImage() { - $imagick = new \Imagick(__DIR__ . '/Biter_500.jpg'); - $imagick_gradient = new \Imagick(); - $imagick_gradient->newPseudoImage( - $imagick->getImageWidth(), - $imagick->getImageHeight(), - "gradient:black-white" - ); - - $imagick->addImage($imagick_gradient); - - $terms = 1, 1, 0.1, 0.1; - - // is 2 x (number_terms + 1 (the constant). - $imagick->polynomialImage($terms); - $imagick->writeImage(__DIR__ . '/polynomialImage_output_image.png'); - $imagick->getImageBlob(); -} - -polynomialImage() ; -echo "Ok"; -?> ---EXPECTF-- -Ok
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/325_Imagick_setDepth.phpt
Deleted
@@ -1,27 +0,0 @@ ---TEST-- -Test Imagick, setDepth ---SKIPIF-- -<?php -require_once(dirname(__FILE__) . '/skipif.inc'); -checkClassMethods('Imagick', array('setDepth')); -?> ---FILE-- -<?php - -function setDepth() { - $imagick = new \Imagick(); - - $imagick->setDepth(16); - $imagick->newPseudoImage(640, 480, "gradient:red-blue"); - - echo "Depth is " .$imagick->getImageDepth() . "\n"; - - $imagick->getImageBlob(); -} - -setDepth() ; -echo "Ok"; -?> ---EXPECTF-- -Depth is 16 -Ok
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/functions.inc
Deleted
@@ -1,158 +0,0 @@ -<?php - -/** - * - * Gets the installed version of ImageMagick and compares the - * appropriate version to the installed version. * - * - * @param $testIm6Version - * @param $im7Version - * @return int - */ -function version_compare_imagemagick($testIm6Version, $im7Version) -{ - $versionInfo = \Imagick::getVersion(); - - if (array_key_exists("versionString", $versionInfo) == false) { - die("skip unable to determine ImageMagick version."); - } - - $versionInstalledStringComplete = $versionInfo"versionString"; - - $firstSpace = strpos($versionInstalledStringComplete, ' '); - if ($firstSpace === false) { - die("Failed to understand version string $versionInstalledStringComplete - finding first space"); - } - - $secondSpace = strpos($versionInstalledStringComplete, ' ', $firstSpace + 1); - if ($secondSpace === false) { - die("Failed to understand version string $versionInstalledStringComplete - finding second space"); - } - - $versionInstalledString = substr($versionInstalledStringComplete, $firstSpace + 1, $secondSpace - $firstSpace - 1); - // echo "versionInstalledString is $versionInstalledString \n"; - - $versionToCompare = $im7Version; - if (substr($versionInstalledString, 0, 1) === '6') { - $versionToCompare = $testIm6Version; - } - - return version_compare($versionInstalledString, $versionToCompare); -} - -/** - * - * Compares the installed version of ImageMagick and returns true if the appropriate - * version is greater - * - * @param $testIm6Version - * @param $im7Version - * @return bool - */ -function isVersionGreaterEqual($testIm6Version, $im7Version) -{ - $versionCompare = version_compare_imagemagick($testIm6Version, $im7Version); - // echo "version compare for $testIm6Version, $im7Version is $versionCompare \n"; - - if ($versionCompare >= 0) { - return true; - } - - return false; -} - -/** - * On some systems, where the standard fonts aren't available, trying - * to draw any text fails as the ImageMagick default font is null. - * - * This function just find a 'sensible' font to use, either from the - * preferred list, or just the first one from queryFonts(). That 'probably' - * is the right thing to do, as it makes the tests more stable. - */ -function findDefaultFont() -{ - $knownFonts = - 'Courier', - 'Helvetica', - 'Times-Roman', - 'Liberation-Mono', - 'Utopia', - ; - - $fontList = \Imagick::queryFonts(); - - foreach ($knownFonts as $knownFont) { - - if (in_array($knownFont, $fontList, true) === true) { - return $knownFont; - } - } - - if (count($fontList) !== 0) { - return $fontList0; - } - - throw new \Exception("No fonts available on system, apparently."); -} - -// Find and set a font for the Imagick object -function setFontForImagick(\Imagick $imagick) -{ - $font = findDefaultFont(); - - $imagick->setFont($font); -} - -// Find and set a font for the ImagickDraw object -function setFontForImagickDraw(\ImagickDraw $imagickDraw) -{ - $font = findDefaultFont(); - - $imagickDraw->setFont($font); -} - - -function check_value(array $values, $name, $expected_value) -{ - if (array_key_exists($name, $values) !== true) { - - $message = "Expected key '$name' not set. Array contains:\n"; - $message .= var_export($values, true); - - throw new \Exception($message); - } - - - $value = $values$name; - - $epsilon = 0.01; - - if (($value < $expected_value - $epsilon) || ($value > $expected_value + $epsilon)) { - $message = "Value for $name doesn't match expected. Expected: $expected_value, actual: $value"; - throw new \Exception($message); - } - - echo "Value for '$name' is $value which is close enough to expected $expected_value\n"; -} - - -function check_value_with_epsilon(array $values, $name, $expected_value, $epsilon) -{ - if (array_key_exists($name, $values) !== true) { - - $message = "Expected key '$name' not set. Array contains:\n"; - $message .= var_export($values, true); - - throw new \Exception($message); - } - - - $value = $values$name; - - if (($value < $expected_value - $epsilon) || ($value > $expected_value + $epsilon)) { - $message = "Value for $name doesn't match expected. Expected: $expected_value, actual: $value, epsilon = $epsilon"; - throw new \Exception($message); - } - - echo "Value for '$name' is $value which is close enough to expected $expected_value\n"; -} \ No newline at end of file
View file
imagick-3.7.0.tgz/imagick-3.7.0/util/fixup_arginfo.php
Deleted
@@ -1,145 +0,0 @@ -<?php - -declare(strict_types = 1); - - -if ($argc !== 2) { - fwrite(STDERR, "usage php fixup_arginfo.php \$arginfo_filename\n"); - exit(-1); -} - -$filename = $argv1; - -$fixup_note = "file has been fixedup for different versions"; - -echo "Fixing $filename\n"; - -$input_lines = file($filename); - -foreach ($input_lines as $input_line) { - if (strpos($input_line, $fixup_note) !== false) { - echo "File has already been fixedup.\n"; - exit(0); - } -} - -$output_lines = ; - -$search = ; -$replace = ; - -$search = "#.*Stub hash: (.*) .*/#iu"; -$replace = "* Stub hash: regen with 'sh regen_arginfo.sh' \n* $fixup_note */"; - -$search = "#ZEND_ARG_OBJ_INFO\(0, (\w*), IMAGICK_QUANTUM_TYPE, 0\)#iu"; -$replace = " -#if MAGICKCORE_HDRI_ENABLE - ZEND_ARG_TYPE_INFO(0, $1, IS_DOUBLE, 0) -#else - ZEND_ARG_TYPE_INFO(0, $1, IS_LONG, 0) -#endif -"; - - -// ZEND_ARG_TYPE_INFO(pass_by_ref, name, type_hint, allow_null) -// ZEND_ARG_INFO(pass_by_ref, name) - -$search = "#ZEND_ARG_TYPE_INFO\((\w*), (\w*), (\w*), (\w*)\)#iu"; -$replace = " -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO($1, $2, $3, $4) -#else - ZEND_ARG_INFO($1, $2) -#endif"; - -$search = "#ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX\((\w*), 0, (\w*), IMAGICK_QUANTUM_TYPE, 0\)#iu"; -$replace = " -#if MAGICKCORE_HDRI_ENABLE -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX($1, 0, $2, IS_DOUBLE, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX($1, 0, $2, IS_LONG, 0) -#endif -"; - - -//ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, type, allow_null) -#define ZEND_BEGIN_ARG_INFO_EX(name, _unused, return_reference, required_num_args) -$search = "#ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX\((\w*), (\w*), (\w*), (\w*), (\w*)\)#iu"; -$replace = " -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX($1, $2, $3, $4, $5) -#else -ZEND_BEGIN_ARG_INFO_EX($1, 0, $2, $3) -#endif -"; - -//#define ZEND_ARG_TYPE_MASK(pass_by_ref, name, type_mask, default_value) \ -$search = "#.*ZEND_ARG_TYPE_MASK\((\w|\|*), (\w|\|*), (\w|\|*), (\w\|\"*)\)#iu"; -$replace = " -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_MASK($1, $2, $3, $4) -#else - ZEND_ARG_INFO($1, $2) -#endif -"; - -//ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(name, return_reference, required_num_args, type) -//ZEND_BEGIN_ARG_INFO_EX(name, _unused, return_reference, required_num_args) - -$search = "#.*ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX\((\w|\|*), (\w|\|*), (\w|\|*), (\w|\|*)\)#iu"; -$replace = " -#if PHP_VERSION_ID >= 80000 - ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX($1, $2, $3, $4) -#else - ZEND_BEGIN_ARG_INFO_EX($1, 0, $2, $3) -#endif -"; - -//ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(name, return_reference, required_num_args, class_name, allow_null) -$search = "#ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX\((\w*), (\w*), (\w*), (\w*), (\w*)\)#iu"; -$replace = " -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX($1, $2, $3, $4, $5) -#else -ZEND_BEGIN_ARG_INFO_EX($1, 0, $2, $3) -#endif -"; - -//ZEND_ARG_OBJ_INFO(pass_by_ref, name, classname, allow_null) \ -$search = "#.*ZEND_ARG_OBJ_INFO\((\w*), (\w*), resource, (\w*)\)#iu"; -$replace = " -#if PHP_VERSION_ID >= 80000 -\tZEND_ARG_OBJ_INFO($1, $2, resource, $3) -#else -\tZEND_ARG_INFO($1, $2) -#endif -"; - -// ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, filename, IS_STRING, 1, "null") -$search = "#.*ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE\((\w*), (\w*), (\w*), (\w*), (\w\"*)\)#iu"; -$replace = " -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE($1, $2, $3, $4, $5) -#else - ZEND_ARG_INFO($1, $2) -#endif -"; - - -//#if PHP_VERSION_ID >= 80000 -//ZEND_ARG_TYPE_MASK(0, files, MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_NULL, NULL) -//#else -// ZEND_ARG_INFO(0, files) -//#endif - - - -foreach ($input_lines as $input_line) { - $input_line = rtrim($input_line); - $input_line = preg_replace($search, $replace, $input_line); - - $output_lines = $input_line; -} - -file_put_contents($filename, implode("\n", $output_lines)); -echo "File has now been fixedup.\n";
View file
imagick-3.8.0.tgz/imagick-3.8.0/CREDITS
Changed
(renamed from imagick-3.7.0/CREDITS)
View file
imagick-3.8.0.tgz/imagick-3.8.0/ChangeLog
Added
@@ -0,0 +1,1175 @@ +3.8.0 +- Fixes: + * Fix signedness formatting mistakes + +3.8.0RC2 +- Fixes: + * Corrected PHP_IMAGICK_EXTNUM + +3.8.0RC1 +- Fixes: + * Imagick::clutImage(...) now respects the images interpolate method. + * You can now pass null to ImagickDraw::setStrokeDashArray() to reset the dash array. + * Fixed memory leak in ImageKernel + * Fixed compiling against PHP 8.4. + * Fixed various reflection issues related to incorrect arginfo +- Added: + * function Imagick::clutImageWithInterpolate(Imagick $lookup_table, int $pixel_interpolate_method): bool {} + * Constants Imagick::COMPRESSION_BC5, Imagick::COMPRESSION_BC7, Imagick::COMPRESSION_LERC, Imagick::DIRECTION_TOP_TO_BOTTOM, Imagick::ALPHACHANNEL_OFF_IF_OPAQUE + +3.7.0 +- Added: + * Imagick::COMPOSITE_SALIENCY_BLEND + +3.7.0RC1 +- Added: + * function Imagick::deleteOption(string $option): bool {} + * function Imagick::getBackgroundColor(): ImagickPixel {} + * function Imagick::getImageArtifacts(string $pattern = "*"): array {} + * function Imagick::getImageKurtosis(): array {} + * function Imagick::getImageMean(): array {} + * function Imagick::getImageRange(): array {} + * function Imagick::getInterpolateMethod(): int {} + * function Imagick::getOptions(string $pattern = "*"): array {} + * function Imagick::getOrientation(): int {} + * function Imagick::getResolution(): array {} + * function Imagick::getType(): int {} + * function Imagick::implodeImageWithMethod(float $radius, int $pixel_interpolate_method): bool {} + * function Imagick::oilPaintImageWithSigma(float $radius, float $sigma) + * function Imagick::polaroidWithTextAndMethod(ImagickDraw $settings, float $angle, string $caption, int $method): bool {} + * function Imagick::polynomialImage(array $terms): bool {} + * function Imagick::setDepth(int $depth): bool {} + * function Imagick::setExtract(string $geometry): bool {} + * function Imagick::setInterpolateMethod(int $method): bool{} + * function Imagick::setOrientation(int $orientation): bool {} + * function Imagick::spreadImageWithMethod(float $radius, int $interpolate_method): bool {} + * function Imagick::swirlImageWithMethod(float $degrees, int $interpolate_method): bool {} + * function Imagick::waveImageWithMethod(float $amplitude, float $length, int $interpolate_method): bool {} + * Imagick::IMAGE_TYPE_BILEVEL + * Imagick::IMAGE_TYPE_GRAYSCALE + * Imagick::IMAGE_TYPE_GRAYSCALE_ALPHA + * Imagick::IMAGE_TYPE_PALETTE + * Imagick::IMAGE_TYPE_PALETTE_ALPHA + * Imagick::IMAGE_TYPE_TRUE_COLOR + * Imagick::IMAGE_TYPE_TRUE_COLOR_ALPHA + * Imagick::IMAGE_TYPE_COLOR_SEPARATION + * Imagick::IMAGE_TYPE_COLOR_SEPARATION_ALPHA + * Imagick::IMAGE_TYPE_OPTIMIZE + * Imagick::IMAGE_TYPE_PALETTE_BILEVEL_ALPHA + * Imagick::COMPOSITE_SEAMLESS_BLEND +- Changed: + * Imagick::setImageArtifact can now take null for the string value. + * Return type for Imagick::getImageArtifact is string|null instead of string. + +3.6.0 + - No change from 3.6.0RC2 + +3.6.0RC2 +- Fixes: + * Remove deprecated message from Imagick::roundCorners() +- Added: + * Imagick::addNoiseImageWithAttenuate() + +3.6.0RC1 + - Imagick::getImageInterlaceScheme is undeprecated. It's the appropriate function to call to get the image interlace setting. + - Image formats are now normalised to lower case. + - Imagick::getImageIndex and Imagick::setImageIndex are undeprecated and work on ImageMagick 7. They call MagickGetIteratorIndex and MagickSetIteratorIndex internally. + - Imagick::averageImages is undeprecated. For IM 7 it now calls EvaluateImages(wand->images,MeanEvaluateOperator). + - Imagick::flattenImages is undeprecated. For IM 7 it now calls MagickMergeImageLayers(intern->magick_wand, FlattenLayer); internally. + - Imagick::getImageSize is undeprecated. For IM 7 it now calls MagickGetImageLength internally. + - Imagick::roundCornersImage is undeprecated and available on IM7. +- Fixes: + * Imagick::borderImage() changed internally to use OverCompositeOp rather than AtopCompositeOp for ImageMagick > 7. If you need the old behaviour, please use Imagick::borderImageWithComposite() instead, which allows you to set the composite method. + * Imagick::frameImage() changed internally to use OverCompositeOp rather than AtopCompositeOp for ImageMagick > 7. If you need the old behaviour, please use Imagick::frameImageWithComposite() instead, which allows you to set the composite method. + * Imagick::profileImage() fixed to allow null as second paramter again. If you can't upgrade to this version yet, pass in "", which has the same effect. + * Imagick::ALPHACHANNEL_COPY and Imagick::ALPHACHANNEL_OPAQUE should be available on IM7. + * Imagick::setImageMatteColor() should be available on IM7. +- Added: + * Imagick::borderImageWithComposite() same as Imagick::borderImage() but allows user to set composite operator used. + * Imagick::frameImageWithComposite() same as Imagick::frameImage() but allows user to set composite operator used. + * function Imagick::cannyEdgeImage + * function Imagick::setSeed + * function Imagick::waveletDenoiseImage + * function Imagick::meanShiftImage + * function Imagick::kmeansImage + * function Imagick::rangeThresholdImage + * function Imagick::autoThresholdImage + * function Imagick::bilateralBlurImage + * function Imagick::claheImage + * function Imagick::channelFxImage + * function Imagick::colorThresholdImage + * function Imagick::complexImages + * function Imagick::interpolativeResizeImage + * function Imagick::levelImageColors + * function Imagick::levelizeImage + * function Imagick::orderedDitherImage + * function Imagick::whiteBalanceImage + +3.5.1 + - No change from 3.5.1RC1 + +3.5.1RC1 + - Better detection of appropriate OpenMP library to use, i.e. GCC or Clang. + +3.5.0 + - Correct parameter for ImagickPixel::getColorValue and ImagickPixel::setIndex. + +3.5.0RC2 + - Fix incorrect parameter defaults, and small fixes on arginfo generation. + +3.5.0RC1 +- ImageMagick 7 is still not widely available on systems. So contrary to previous plans, ImageMagick 6 support will continue for now, but users are recommended to use ImageMagick 7 if possible. +- Method names have been changed to not be all lower case. Both method names and parameter information is built from the Imagick*.stub.php files. +- Prevent accidental creation of zero dimension images. ImageMagick doesn't prevent creation of zero dimension images, but will give an error when that image is used. I don't think this will affect any correctly program, but if it does, and you need to re-enable zero dimension images, please open an issue at https://phpimagick.com/issues +- Various pieces of work have been done to make GOMP not segfault including: + * Call omp_pause_resource_all when available during shutdown. + * Added the 'imagick.shutdown_sleep_count' (default 10) and 'imagick.set_single_thread' (default On). Both of these exist to mitigate the segaults on shutdown. +- Fixes: + * Correct version check to make RemoveAlphaChannel and FlattenAlphaChannel be available when using Imagick with ImageMagick version 6.7.8-x + * Imagick::morphology now no longer ignores channel parameter +- Added: + * PHP 8.0 support. + * Location check for ImageMagick 7 for NixOS and Brew. + * Imagick::houghLineImage(int $width, int $height, float $threshold): bool {} + * Imagick::setImagePixelColor(int $x, int $y, ImagickPixel|string $color) + * Imagick::setImageMask(Imagick $clip_mask, int $pixelmask_type) + * Imagick::getImageMask(int $pixelmask_type) + * Imagick::VIRTUALPIXELMETHOD_DITHER + * Imagick::VIRTUALPIXELMETHOD_RANDOM + * Imagick::COMPOSITE_FREEZE + * Imagick::COMPOSITE_INTERPOLATE + * Imagick::COMPOSITE_NEGATE + * Imagick::COMPOSITE_REFLECT + * Imagick::COMPOSITE_SOFTBURN + * Imagick::COMPOSITE_SOFTDODGE + * Imagick::COMPOSITE_STAMP + * Imagick::COMPOSITE_RMSE + * Imagick::COMPRESSION_DWAA + * Imagick::COMPRESSION_DWAB + * Imagick::EVALUATE_INVERSE_LOG + * Imagick::COLORSPACE_DISPLAYP3 + * Imagick::COLORSPACE_ADOBE98 + * Imagick::COLORSPACE_PROPHOTO + * Imagick::COLORSPACE_JZAZBZ + * Imagick::DISTORTION_RIGID_AFFINE + * Imagick::DISTORTION_BARRELINVERSE + * Imagick::STATISTIC_ROOT_MEAN_SQUARE + +3.4.4 +- Fixes: + * Correct version check to make RemoveAlphaChannel and FlattenAlphaChannel be available when using Imagick with ImageMagick version 6.7.8-x + +3.4.4RC2 +- Fixes: + * Correct stability for RC release + * Fix undefined variable for ZTS build + +3.4.4RC1 +- The 3.4.4 release is intended to be the last release (other than small bug fixes) that will support either PHP 5.x, or ImageMagick 6.x. The next planned release will be PHP > 7.0 and ImageMagick > 7.0 at least, if not higher. +- Added: + * function Imagick::optimizeImageTransparency() + * METRIC_STRUCTURAL_SIMILARITY_ERROR + * METRIC_STRUCTURAL_DISSIMILARITY_ERROR + * COMPRESSION_ZSTD - https://github.com/facebook/zstd + * COMPRESSION_WEBP + * CHANNEL_COMPOSITE_MASK + * FILTER_CUBIC_SPLINE - "Define the lobes with the -define filter:lobes={2,3,4} (reference https://imagemagick.org/discourse-server/viewtopic.php?f=2&t=32506)." + * Imagick now explicitly conflicts with the Gmagick extension. +- Fixes: + * Bug 77128 - Imagick::setImageInterpolateMethod() not available on Windows + * Prevent memory leak when ImagickPixel::__construct called after object instantiation. + * Prevent segfault when ImagickPixel internal constructor not called. + * Imagick::setResourceLimit support for values larger than 2GB (2^31) on 32bit platforms. + * Corrected memory overwrite in Imagick::colorDecisionListImage() + * Bug 77791 - ImagickKernel::fromMatrix() out of bounds write. +- Deprecated: + * The following functions have been deprecated: + ImagickDraw, matte + Imagick::averageimages + Imagick::colorfloodfillimage + Imagick::filter + Imagick::flattenimages + Imagick::getimageattribute + Imagick::getimagechannelextrema + Imagick::getimageclipmask + Imagick::getimageextrema + Imagick::getimageindex + Imagick::getimagematte + Imagick::getimagemattecolor + Imagick::getimagesize + Imagick::mapimage + Imagick::mattefloodfillimage + Imagick::medianfilterimage + Imagick::mosaicimages + Imagick::orderedposterizeimage + Imagick::paintfloodfillimage + Imagick::paintopaqueimage + Imagick::painttransparentimage + Imagick::radialblurimage + Imagick::recolorimage + Imagick::reducenoiseimage + Imagick::roundcornersimage + Imagick::roundcorners + Imagick::setimageattribute + Imagick::setimagebias + Imagick::setimageclipmask + Imagick::setimageindex + Imagick::setimagemattecolor + Imagick::setimagebiasquantum + Imagick::setimageopacity + Imagick::transformimage + +3.4.3 + No changes from 3.4.3RC4. + +3.4.3RC4 +- Fixes: + * Avoid internal segfault. + +3.4.3RC3 +- Fixes: + * Correct file permissions in built package. + +3.4.3RC2 +- Fixes: + * Imagick::getRegistry() now throws an exception if the key does not exist, rather than terminating the program. + * Prevent attempts to resize image to zero width or height, which is not supported by ImageMagick. + * Fix compiling on Windows issue. +- Added: + * function Imagick::setImageAlpha() which replaces ImagickDraw::setOpacity() + +3.4.3RC1 +- Fixes: + * Imagick::transformImage and Imagick::orderedPosterizeImage now correctly excluded from + IM7 build. + * Bug 72311 - compiling against PHP 7.1. + * Bug 72226 - regression for Imagick Exception classes being final on 7.x + * Corrected reference of constants. Imagick::METRIC_MEANERRORPERPIXELMETRIC from MeanErrorPerPixelMetric to MeanErrorPerPixelErrorMetric. Imagick::METRIC_PEAKSIGNALTONOISERATIO from PeakSignalToNoiseRatioMetric to PeakSignalToNoiseRatioErrorMetric +- Added: + * function Imagick::identifyImageType() : int returns one of the Imagick::IMGTYPE_* constants + * Imagick::INTERPOLATE_NEAREST_PIXEL for ImageMagick >= 7 + * In ImageMagick, the names of two filter constants were corrected to the standard spelling. Support for the new spelling has been added. The old constants are left in place for legacy support. + Legacy: FILTER_HANNING, new name: FILTER_HANN + Legacy: FILTER_WELSH, new name: FILTER_WELCH + * The Imagick::IMGTYPE_*MATTE* constants are deprecated for ImageMagick 7. Instead an appropriate Imagick::IMGTYPE_*MATTE* should be used. + IMGTYPE_GRAYSCALEMATTE => IMGTYPE_GRAYSCALEALPHA + IMGTYPE_PALETTEMATTE => IMGTYPE_PALETTEALPHA + IMGTYPE_TRUECOLORALPHA => IMGTYPE_TRUECOLORMATTE + IMGTYPE_COLORSEPARATIONALPHA => IMGTYPE_COLORSEPARATIONMATTE + IMGTYPE_PALETTEBILEVELALPHA => IMGTYPE_PALETTEBILEVELMATTE + * Several ALPHACHANNEL_* constants are only available in ImageMagick < 7 + IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_RESET", ResetAlphaChannel); + IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_COPY", CopyAlphaChannel); + IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_OPAQUE", OpaqueAlphaChannel); + * Several ALPHACHANNEL_* constants are only available in ImageMagick >= 7. These constants re-use the values of the constants removed. + IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_ON", OnAlphaChannel); + IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_OFF", OffAlphaChannel); + IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_DISCRETE", DiscreteAlphaChannel); + +3.4.2 +- Fixes: + * Bug: IM143 Correct ifdef around setOpacity, getOpacity and localContrastImage. + * Bug: IM147 Imagick was Borging PHP's error handler. + +3.4.1 +- Fixes: + * Bug 71742 - arrays that contain data that is held by reference gives error. +- Added: + * Imagick::autoGammaImage(int channel = CHANNEL_ALL) + * Imagick::autoOrient() + * Imagick::compositeImageGravity(Imagick $image, int COMPOSITE_CONSTANT, int GRAVITY_CONSTANT) + * Imagick::localContrastImage(float radius, float strength) + * Imagick::DIRECTION_LEFT_TO_RIGHT + * Imagick::DIRECTION_RIGHT_TO_LEFT + * Imagick::SPARSECOLORMETHOD_MANHATTAN + * ImagickDraw::getOpacity() : float + * ImagickDraw::setOpacity(float opacity) :bool + * ImagickDraw::getFontResolution() : array + * ImagickDraw::setFontResolution(float x, float y) : bool + * ImagickDraw::getTextDirection() : bool + * ImagickDraw::setTextDirection(int direction) : bool + * ImagickDraw::getBorderColor() : ImagickPixel + * ImagickDraw::setBorderColor(ImagickPixel color) : bool + * ImagickDraw::getDensity() : string|null + * ImagickDraw::setDensity(string density_string) : bool + * ImagickPixel::setColorFromPixel(ImagickPixel $srcPixel) : bool + +3.4.0 + No changes from 3.4.0RC6. + +3.4.0RC6 +- Added: + * Imagick::evaluateImages(int EVALUATE_CONSTANT) : Imagick +- Fixes: + * Imagick::setImageWhitePoint, Imagick::setImageRedPrimary, Imagick::setImageGreenPrimary, + Imagick::setImageBluePrimary now take 3 params when compiled against IM7. + * Imagick::getImageWhitePoint, Imagick::getImageRedPrimary, Imagick::getImageGreenPrimary, + Imagick::getImageBluePrimary now return 3 values when compiled against IM7. + +3.4.0RC5 +- Added: + * Imagick::subImageMatch() added parameters. The signature is now: + Imagick::subimagematch(Imagick $subimage, array &$bestMatch, float &similarity, + float $similarity_threshold = 0, int $metric = ) + These parameters are only used when compiled against ImageMagick 7. +- Fixes: + * wrong type for zend_parse_parameters. + +3.4.0RC4 +- Fixes: + * Remove duplicated definitions of class constants. + +3.4.0RC3 +- Fixes: + * Imagick::adaptiveResizeImage, Imagick::cropThumbnailImage Imagick::resizeImage, + Imagick::scaleImage, and Imagick::thumbnailImage have all had a rounding bug fixed. + An additional parameter has been added to each of them, 'bool $legacy'. If legacy + is true, the calculations are done with the small rounding bug that existed in + Imagick before 3.4.0. If false, the calculations should produce the same results as + ImageMagick CLI does. + * Imagick::colorizeImage() and Imagick::tintImage were using the wrong behaviour. + It is now fixed and the legacy behaviour can still be used by passing a 3rd + parameter of `true` to the function to indicate that the legacy behaviour is + desired. + * Imagick::importImagePixels regression fixed. + * Imagick::subImageMatch use correct error metric in IM7 +- Added methods: + * Imagick::similarityImage() which is an alias to Imagick::subImageMatch() + +3.4.0RC2 +- Fixes: + * Version number in extension header. + +3.4.0RC1 +- Added support: + * PHP 7 + * ImageMagick 7. Imagick can be compiled against either ImageMagick 6 or ImageMagick 7 + However it must be run with the exact same version it was compiled against. Trying + to run Imagick with a different version of ImageMagick than it was compiled against + is not supported. Please see http://nextgen.imagemagick.org/script/porting.php for + more information about ImageMagick 7. +- Minimum versions supported are now PHP >= 5.4.0 and ImageMagick >= 6.5.3-10. + Earlier versions may continue to work, but they are no longer supported. +- Added methods: + * Imagick::getConfigureOptions + * Imagick::getFeatures + * Imagick::getHDRIEnabled + * Imagick::setImageChannelMask (IM7 only) +- Added IM7 constants: + * Imagick::CHANNEL_READ_MASK + * Imagick::CHANNEL_WRITE_MASK + * Imagick::CHANNEL_META +- Fixes: + * ImagickPixel::getColorQuantum, ImagickPixel::getColorValueQuantum and + ImagickPixel::setColorValueQuantum now correctly use floats when Imagick + was compiled against a HDRI version of ImageMagick + * Imagick::exportImagePixels works for all storage types + +3.3.0 + No changes + +3.3.0RC2 +- Corrected package versioning to exclude PHP7 +- Correct params for Imagick::getColorValueQuantum + +3.3.0RC1 +- Added ImagickKernel class. These can be used with the Imagick::morphology or + Imagick::filter functions. +- Added methods: + * Imagick::brightnessContrastImage() + * Imagick::colorMatrixImage() + * Imagick::deleteImageProperty() + * Imagick::filter() + * Imagick::forwardFourierTransformImage() + * Imagick::getAntiAlias() + * Imagick::getImageCompression() + * Imagick::getRegistry() + * Imagick::getQuantum() + * Imagick::identifyFormat() + * Imagick::inverseFourierTransformImage() + * Imagick::isPixelSimilarQuantum() + * Imagick::listRegistry() + * Imagick::morphology() + * Imagick::rotationalBlurImage() + * Imagick::selectiveBlurImage() + * Imagick::setAntiAlias() + * Imagick::setImageBiasQuantum() + * Imagick::setProgressMonitor() + * Imagick::setRegistry() - which allows setting the "temporary-path" used by ImageMagick + * Imagick::statisticImage() + * Imagick::subImageMatch() + * ImagickPixel::getColorQuantum() +- Added constants: + * Imagick::RESOURCETYPE_TIME + * Imagick::RESOURCETYPE_THROTTLE + * Imagick::CHANNEL_RGBA + * Imagick::ALPHACHANNEL_BACKGROUND + * Imagick::FUNCTION_ARCSIN + * Imagick::FUNCTION_ARCTAN +- Fixed Imagick::clutImage() parameter parsing +- Fixed tint image bug +- Fixed ImageMagick compiled with HDRI having quantum values as floats +- Fixed memory leaks in: + * Imagick::getImageBlob() + * Imagick::getImagesBlob() + * Imagick::getImageChannelStatistics() + * Imagick::getImageFormat() + * Imagick::getImageMimetype() + * Imagick::getSamplingFactors() + * Imagick::identifyImage() + * Imagick::tintImage +- Fixed segfault when compiling statically +- ImagickDraw::setFontFamily no longer checks whether the font is available. This allows a + font family to be set where the family name is not the same as the font name. However it also + means an invalid family name can be set, leading to the default font being used, instead of an + exception being thrown. See https://github.com/mkoppanen/imagick/issues/77 +- Removed Zend MM support +- Excluded deprecated methods: + * Imagick::getImageMatte() + * Imagick::colorFloodfillImage() + * Imagick::matteFloodfillImage() + * Imagick::paintFloodfillImage() + * Imagick::paintOpaqueImage() + * Imagick::paintTransparentImage() + * Imagick::mapImage() + * Imagick::recolorImage() + * Imagick::setImageIndex() + * Imagick::getImageIndex() + * Imagick::getImageSize() + * Imagick::setImageAttribute() + * Imagick::getImageAttribute() + * Imagick::mosaicImages() + * Imagick::averageImages() + * Imagick::flattenImages() + This is replaced by $im = $im->mergeImageLayers(\Imagick::LAYERMETHOD_FLATTEN) + * Imagick::getImageChannelExtrema() + * Imagick::getImageExtrema() +- Ini file changes + * Added imagick.skip_version_check. Imagick now checks that it was compiled against the same version of + ImageMagick that it is being run with, and will give a warning if it was compiled against a different + version of ImageMagick. The skip_version_check setting allows you to suppress this warning. However + it is strongly recommended to use the version of ImageMagick that Imagick was compiled against. +- Misc: + * CI now compiles with CFLAGS="-Wno-deprecated-declarations -Wdeclaration-after-statement -Werror" + +3.2.0RC1 +- Fix bug #66098: Segfault in zval_addref_p + +3.2.0b2 +- A lot of internal improvements on the code +- Added ImagickPixel::isPixelSimilar and deprecate ImagickPixel::isSimilar #10 +- Added imagick::smushimages +- Added imagick::blueshiftimage and imagick::clampimage +- Added Imagick::autolevelimage +- Added constants: + Imagick::ALPHACHANNEL_REMOVE + Imagick::ALPHACHANNEL_FLATTEN + Imagick::RESOURCETYPE_THREAD + Imagick::COMPOSITE_CHANGEMASK + Imagick::COMPOSITE_LINEARLIGHT + Imagick::COMPOSITE_DIVIDE + Imagick::COMPOSITE_DISTORT + Imagick::COMPOSITE_BLUR + Imagick::COMPOSITE_PEGTOPLIGHT + Imagick::COMPOSITE_VIVIDLIGHT + Imagick::COMPOSITE_PINLIGHT + Imagick::COMPOSITE_LINEARDODGE + Imagick::COMPOSITE_LINEARBURN + Imagick::COMPOSITE_MATHEMATICS + Imagick::COMPOSITE_MODULUSADD + Imagick::COMPOSITE_MODULUSSUBTRACT + Imagick::COMPOSITE_MINUSDST + Imagick::COMPOSITE_DIVIDEDST + Imagick::COMPOSITE_DIVIDESRC + Imagick::COMPOSITE_MINUSSRC + Imagick::COMPOSITE_DARKENINTENSITY + Imagick::COMPOSITE_LIGHTENINTENSITY + Imagick::FILTER_KAISER + Imagick::FILTER_WELSH + Imagick::FILTER_PARZEN + Imagick::FILTER_LAGRANGE + Imagick::FILTER_SENTINEL + Imagick::FILTER_BOHMAN + Imagick::FILTER_BARTLETT + Imagick::FILTER_JINC + Imagick::FILTER_SINCFAST + Imagick::FILTER_ROBIDOUX + Imagick::FILTER_LANCZOSSHARP + Imagick::FILTER_LANCZOS2 + Imagick::FILTER_LANCZOS2SHARP + Imagick::FILTER_ROBIDOUXSHARP + Imagick::FILTER_COSINE + Imagick::FILTER_SPLINE + Imagick::FILTER_LANCZOSRADIUS + Imagick::COMPRESSION_ZIPS + Imagick::COMPRESSION_PIZ + Imagick::COMPRESSION_PXR24 + Imagick::COMPRESSION_B44 + Imagick::COMPRESSION_B44A + Imagick::COMPRESSION_LZMA + Imagick::COMPRESSION_JBIG1 + Imagick::COMPRESSION_JBIG2 + +3.2.0b1 +- Added Countable interface to Imagick class +- Added experimental support for Zend MM. If compiled with --enable-imagick-zend-mm + Imagick will respect PHP memory limits +- Added additional parameter to writeImageFile to allow setting format +- Distribute tests as part of the release +- Fixed Bug #65043: Destroy and clear method do the same things +- Fixed Bug #64945: ZEND_ACC_ALLOW_STATIC vs ZEND_ACC_STATIC +- A lot of internal refactoring: rewrite macros as functions, clean up naming etc + +3.1.2 +- Fixed ZTS build +- Added LICENSE file to comply with Fedora Packaging Guidelines +- Fixed memory leaks +- Added mime type to identifyImage + +3.1.1 +- Reworked identifyImage method + +3.1.0 +- Releasing RC3 as is + +3.1.0RC3 +- Fixed building against latest ImageMagick versions (#GH-2) +- Fixed thumbnail resize bug (#GH-1) +- Fixed building against latest PHP versions + +3.1.0RC2 +- Fixed PHP bug #61879 (Imagick writeImages no longer works with PHP5.4) + +3.1.0RC1 +- Fixed PECL Bug #22722 +- Fixed possible memory leaks in error scenarios +- Added PHP 5.4 support + +3.1.0b1 +- Fixed PECL Bug #21229 +- Fixed PECL Bug #20636 +- Deprecated clone() method in favour of clone keyword +- Added ImagickDraw::setResolution +- Internal refactoring on read/write code + +3.0.1 +- Fixed PECL bug #17244 + +3.0.1RC2 +- Fixed a bug which caused failure in writing files with format prefix + (such as png:test.jpg) + +3.0.1RC1 +- Fixed build against PHP 5.1.x +- Fixed PECL bug #17892 + +3.0.0 +- No bugs reported against RC2 so releasing as stable + +3.0.0RC2 +- Added set/getColorspace +- Added transformImageColorspace (Patrick Durold) +- Fix writeImage logic error in filename_len checking. +- Fix conversion to double in affine matrices +- s,function_entry,zend_function_entry, (Johannes) + +3.0.0RC1 +- Fixes a crash when setResourceLimit is called statically +- Fixes PECL bug #16932 Unable to read image from the filehandle +- Return empty string if original value is empty in: + * ImagickDraw::getClipPath + * ImagickDraw::getEncoding + * ImagickDraw::getFont + * ImagickDraw::getFontFamily +- More relaxed validation on affinematrices +- Initialize the counter properly in polygons. Thanks to Etienne Kneus + +3.0.0b2 +- Fixes building against PHP 5.2.x + +3.0.0b1 +- Fixes incorrect error message "wand contains no images" +- Change cropthumbnailimage behavior to actually do what it is supposed to do +- setimageartifact, getimageartifact, deleteimageartifact +- added fill param to thumbnailImage +- Added support for using imagick objects in other extensions + +2.3.0 +- imagick::setImageVirtualPixelMethod not deprecated anymore +- fixed windows build + +2.3.0RC3 +- Closed bug reports and pushing out RC just in case before stable. + +2.3.0RC2 +- Fixed image reading routines. Page defitions (test.pdf0) were broken on RC1 +- Fixed imagick::colorizeImage, it had no effect on images + +2.3.0RC1 +- Fixes PECL bug #16085 (Twice crop returns invalid result) +- Removed unnecessary checks + +2.3.0b1 +- Fixed compilation against older ImageMagick versions (Patch by Tim Herzog) +- Fixed getImageMatte to actually return boolean instead of int + +- Added methods: +* Imagick::getImageMimeType +* Imagick::writeimagefile +* Imagick::writeimagesfile +* Imagick::resetimagepage +* Imagick::setimageclipmask +* Imagick::getimageclipmask +* Imagick::animateimages +* Imagick::recolorimage +* Imagick::floodfillpaintimage +* Imagick::opaquepaintimage +* Imagick::transparentpaintimage +* Imagick::decipherimage +* Imagick::encipherimage +* Imagick::getimagealphachannel +* Imagick::getimagechanneldistortions +* Imagick::getimagegravity +* Imagick::setimagegravity +* Imagick::remapimage +* Imagick::exportimagepixels +* Imagick::getimagechannelkurtosis +* Imagick::functionimage +* Imagick::importImagePixels +* Imagick::sparseColorImage +* Imagick::deskewImage +* Imagick::segmentImage + +* Imagickdraw::gettextkerning +* Imagickdraw::settextkerning +* Imagickdraw::gettextinterwordspacing +* Imagickdraw::gettextinterwordspacing + +* ImagickPixel::getColorValueQuantum +* ImagickPixel::setColorValueQuamtum +* ImagickPixel::getIndex +* ImagickPixel::setIndex + +2.2.2 +- No bugs reported against RC4 so releasing it as is + +2.2.2RC4 +- Check for ImageMagick version in config.m4 before trying to search for headers +- Fixed memory leak where pointinfo is used +- Fixed incorrect memory handling of array where php array is converted to array of doubles +- Cleaned up image writing routines +- Added missing semicolon on constant registration +- Added distortion and alphachannel constants + +2.2.2RC3 +- Fixed clone keyword to actually clone the wand ptr +- Imagick progress monitor name is now correctly cloned +- Fixes PECL Bug #15614 + +2.2.2RC2 ++ Added Imagick::setImageProgressmonitor and Imagick::orderedPosterizeImage +- Fixes http://imagemagick.org/discourse-server/viewtopic.php?f=18&t=12828 +- Fixes error with empty exception messages +- Fixes PECL Bug #15332 +- Fixed a possible memory leak in Imagick::convolveImage + +2.2.2RC1 +- Fixes Pecl bug #15321 +- Added getImageCompressionQuality +- Fixes building against PHP 5.3 + +2.2.1 +- No bugs reported against RC2 so releasing it as is + +2.2.1RC2 +- Fixed ZTS build + +2.2.1RC1 +- Fixes a small memory leak when casting a string to ImagickPixel object +- Added new constants +- Added getImageChannelRange method +- Some cleaning up on the syntax + +2.2.0 +- Changes since 2.1.1: +* Major refactoring of the file structure +* Fixes bugs related to the refactoring + +2.2.0RC1 +- Fix build on Mac related to duplicate symbols + +2.2.0b2 +- Closes PECL Bugs #13841 and #13787 + +2.2.0b1 +- Major refactoring of the internal file structure + +2.1.1 +- Fixed a bug with fit parameter when scaling images with scaling ratio 1:1 + * This is a minor BWC break. Scripts relying on incorrect behavior might need revisiting. + +2.1.1RC1 +- Fixed building against ImageMagick 6.3.8-x + +2.1.0 +- Addded setImageAlphaChannel method +- Fixed sharpenImage parameters being reversed +- Fixed building with pre 5.2 versions + +2.1.0RC3 +- Fixes PECL Bug #12851 +- Some major housekeeping changing numeral values to constants + +2.1.0RC2 +- Closes PECL Bugs #12463 and #12479 +- Fixes the behavior of flattenImages and fximage +- Fixes incorrect thumbnail behavior +- Fixes a bug in Imagick::cropThumbnailImage +- Added new constant Imagick::NOISE_RANDOM + +2.1.0RC1 ++ All methods that expect ImagickPixel now allow a string representing the color ++ Added support for pixeliterator in all supported ImageMagick versions. ++ ImagickPixelIterator now implements the iterator interface ++ It is now possible to set the row with region iterator ++ Added MAXPATHLEN checks for image reads/writes ++ Added a fix to Imagick::cropThumbnailImage() to check if images are already at the desired size ++ Fixed a memory leak in Imagick::getImageHistogram() ++ Speed improvements to Imagick::cropThumbnailImage() ++ Added interpolate constants ++ Fixed ImagickPixel::getColor() ++ Marked ImagickDraw::__construct() with ZEND_ACC_CTOR ++ Added fit parameter and proportional scaling to: +- Imagick::adaptiveResizeImage() +- Imagick::scaleImage() +- Imagick::resizeImage() ++ Added imagick.locale_fix ini setting to fix drawing bug on some locale ++ Suppressed warnings in readImageFile and pingImageFile (PECL Bug #12367) ++ Added methods: +- ImagickPixel::clone() +- ImagickPixel::getColorAsString() +- Imagick::mergeImageLayers() +- Imagick::paintFloodfillImage() +- Imagick::setFont() +- Imagick::getFont() +- Imagick::setPointsize() +- Imagick::getPointsize() + +2.0.1 ++ ImagickDraw::setFont and ImagickDraw::setFontFamily now allow only valid fonts ++ Added IMAGICK_EXTVER and IMAGICK_EXTNUM constants ++ Added check for empty or invalid pseudo format string in Imagick::newPseudoImage ++ Fixed incorrect arg hinting for Imagick::compareImageChannels + +2.0.1RC1 ++ Added Imagick::distortImage and Imagick::setlastiterator ++ Added optional fourth parameter to newImage to set the format when creating a new canvas ++ Fixed fitting to zero size image in Imagick::thumbnailImage ++ Fixed the destroy methods. ++ Most of the operations that read / add images to the stack move the iterator position to the last element ++ Fixed memleaks in methods that replace the internal MagickWand* pointer + +2.0.0 ++ Added Imagick::extentImage ++ Added Imagick::IMAGICK_VERSION_NUMBER and Imagick::IMAGICK_VERSION_STRING constants ++ Fixed a possible crash in Imagick::newPseudoImage + +2.0.0RC4 ++ Moved getimagelength into #if block ++ Added optional third parameter to thumbnailImage ++ Added second optional parameter to getImageProperties and getImageProfiles to return just the available properties. ++ Closes PECL Bug #12006 + +2.0.0RC3 ++ Closes PECL Bug #12006 ++ Fixes a possible crash in queryFontMetrics ++ New methods: ++ Imagick::clutImage ++ Imagick::setImage ++ Imagick::getImageLength ++ Imagick::getImageOrientation ++ Imagick::setImageOrientation ++ Imagick::getImageProperties ++ Imagick::getImageProfiles + +2.0.0RC2 ++ Added support for forcing image format during write operations. ++ Added more interlace constants. They are present if imagick is compiled against ImagickMagick 6.3.4 or newer. ++ Added Imagick::getImageAttribute. ++ Added LAYERMETHOD constants. Available if compiled against ImageMagick 6.2.8 or later. ++ Closes PECL Bug #11934 - setImageVirtualPixelMethod triggers exception ++ Fixed safe_mode and open_basedir bypass for __construct, readImage, readImages and pingImage + +2.0.0RC1 ++ Suppress error when reading image from a stream. ++ Fixed allow_url_fopen bypass in Imagick::newPseudoImage(). ++ Fixed imagick::__tostring to return empty string if the object doesnt contain images. ++ Fixed a problem with Imagick::getImagesBlob() when an older version of ImageMagick is used. ++ Fixed a crash on Windows when no arguments are passed to the Imagick constructor. ++ Fixed a crash when using a threaded SAPI under Windows. ++ Fixed a bug in ImagickDraw::affine(). ++ Added Imagick::getIteratorIndex() and Imagick::setIteratorIndex(). ++ Added Imagick::readImages() + +2.0.0b3 ++ Closes PECL Request #11513 ++ Fixes ImagickPixel bug reported by Imran Nazar. ++ Fixed Imagick::setImageDispose and Imagick::setImageUnits. ++ Fixed Imagick::queryFontMetrics to autodetect multiline text if multiline argument is not passed or is null. ++ Fixed open_basedir bypasses in Imagick::newPseudoImage ++ Fixed "Undefined Exception" error messages + +NOTE: Using threaded SAPI in Windows is not currently recommended. + +2.0.0b2 ++ Fixed open_basedir bypasses. ++ Fixed PECL Bug #11328 ++ Added methods: +- Imagick::queryFonts() +- Imagick::queryFontMetrics() + +NOTE: Using threaded SAPI in Windows is not currently recommended. + +2.0.0b1 +- fix PECL bug #10967 - supplied path fails to compile +- Added new methods ++ Imagick::displayImage() ++ Imagick::displayImages() ++ Imagick::cropThumbnailImage() ++ Imagick::roundCorners() ++ Imagick::polaroidImage() ++ Imagick::getImageProperty() ++ Imagick::setImageProperty() ++ Imagick::newPseudoImage() ++ Imagick::__toString() ++ ImagickPixel::setColorCount() +- Added missing DisposeType constants. +- Merged ImagickPixel::getColorAsString and ImagickPixel::getColorAsNormalizedString into ImagickPixel::getColor( bool normalized ) +- Fixed wrong exception type in Imagick::setSamplingFactors +- Removed useless check from ImagickPixelIterator::syncIterator +- Renamed ImagickDraw::pushDrawingWand to ImagickDraw::push +- Renamed ImagickDraw::popDrawingWand to ImagickDraw::pop + +2.0.0a3 +- Removed support for ImagickPixelIterator if compiled against older version of ImageMagick (below 6.2.8) +- Fixed a lot of functions which were not present in older ImageMagick versions. (below 6.2.8) +- Added support for passing color name as parameter for ImagickPixel constructor +- Added support for passing a filename or an array of filenames to Imagick constructor +- Fixed anomalies with ImagickPixelIterator exceptions +- Fixed a possible segfault in Imagick::appendImages +- Fixed double-free errors in some Imagick methods +- Added composite operator constants. +- Fixed ImagickPixelIterator::__construct to accept Imagick object as parameter. + ++ Some of the changes are a bit experimental so please report bugs. + +2.0.0a2 +- Fixed segfaults in ImagickDraw::getFont(), ImagickDraw::getFontFamily(), + ImagickDraw::getTextEncoding() and ImagickDraw::getClipPath() +- Added a PHP version check to config.m4 + +2.0.0a1 +- Initial Release + +0.9.13 +- Fixed compile error with newer versions of GraphicsMagick and ImageMagick +- Fixed assertion when using imagick_setfillcolor +- Fixed segfault when an empty blob is loaded +- Use new API for fetching support image formats / fonts + +0.9.11 +- Fix some segfaults on errors (by Andrei Nigmatulin) +- EXPERIMENTAL support for ImageMagick >= 6.0.0 (hint by Stanislav Yadykin). Please report successes or failures. + +0.9.10 +- A ./configure change release only. +- Changed config.m4 for checking for correct ImageMagick Version. + ImageMagick >= 5.5.3 and < 6.6.0 or GraphicsMagick >= 1.0.0 are needed. +- ImageMagick >= 6.0.0 does not work currently. Patches are welcome ;) + +0.9.9 +- added function imagick_set_image_comment() for setting the comment attribute +of an image. +- function imagick_setcompressiontype() was not setting the correct structure. +This was identified and tested by Sergio Salvatore (sergio@cucinalogica.com). +- added function imagick_transparent() for setting a particular color to be +transparent within an image. +- changed how certain errors are handled in _php_imagick_is_error() to be +less restrictive. This apparently helps fix issues with certain types +of images that otherwise appear corrupt. Thanks to Hien Duy Nguyenxi +(hdn@umich.edu) for finding this, recommending the change and testing it. +- added imagick_set_image_quality() for manipulating the quality of the +resultant image. +- added examples/set_image_quality.php for testing the +imagick_set_image_quality() function. Thanks to Derrick DeLoreno Threatt +(dthreatt@digitalcreations.net) for bringing up the need for this function +and testing it. + +0.9.8 +- fixed critical error in call to strlen() in _php_imagick_set_last_error(). +I strongly recommend you upgrade. + +0.9.7 +- fixed bug in imagick_free() that would cause it to SEGFAULT everytime +it's called. +- fixed to work with versions of ImageMagick >= 5.5.7 - special thanks to +James Huston (hustonjs@itadevelopment.com) for helping make this happen. +- test compiled against ImageMagick 5.5.3, 5.5.6 and 5.5.7 with success. +- test compiled against GraphicsMagick 1.0.1 with success. + +0.9.6 +- functions added: +imagick_getcolorspace() +imagick_error() +- added a new example called transparent_1x1.html and some explanatory text. +I can think of many uses for this code. +- thanks to James Huston (hustonjs@itadevelopment.com) for suggesting +imagick_getcolorspace() and testing it out. +- added GraphicsMagick (http://www.graphicsmagick.org) support to configure +script (enable it with --with-imagick-gm) +- imagick_readimage() now returns false if ImageMagick ReadImage() fails. +- imagick_error() returns 1 string representing any errors that have occurred +on an operation. IT IS LARGELY UNTESTED! Beware! However, you can now +do things like: +$handle = imagick_readimage( "image.jpg" ) or die( imagick_error() ) ; +- fixed configure script. It honours now values returned by Magick-config. + +0.9.5 +- functions added: +imagick_newimagelist() +imagick_pushlist() +imagick_poplist() +imagick_mosaic() +imagick_setcompressiontype() +imagick_setcompressionquality() +- modified how all functions check to see if ImageMagick has been initialized. +- added a number of new examples for demonstrating how to use image lists. +- fixed bugs in _php_imagick_alloc_handle() and _php_imagick_clear_errors() +causing core dump when working with image lists. I wasn't checking to make +sure the structures I was examining were allocated. +- thanks to James Huston (hustonjs@itadevelopment.com) for suggesting +imagick_setcompressiontype() and imagick_setcompressionquality() and +testing them. +- added supporting IMAGICK_COMPRESSION_* constants for use with +imagick_setcompressiontype(). +- renamed imagick_setcompression() to imagick_setcompressiontype(). +(note: this was done before the new version was released so no users should +be impacted.) + +0.9.4 +- functions added: +imagick_flatten() +imagick_getmagick() +imagick_setfillopacity() +- fixed bad code in these functions: +imagick_despeckle() +imagick_edge() +imagick_emboss() +imagick_enhance() +imagick_gaussianblur() +imagick_medianfilter() +imagick_motionblur() +imagick_reducenoise() +imagick_shade() +imagick_sharpen() +imagick_spread() +imagick_unsharpmask() +- for the above functions, if call to corresponding ImageMagick +function the module would probably core dump. If it didn't the +results would be really buddy and weird. +- setfillopacity() thanks to Allen Condit, condit@isri.unlv.edu. + +0.9.3 +- functions added: +imagick_zoom() +- the difference between imagick_zoom() and imagick_resize() is +that zoom applies the blur and filter that are defined by +the image. It is a much simpler way of resizing an image. +- added imagick.dsp and modifications for compiling under Windows. +- changed all instances of le_handle to le_imagick_handle to avoid +future conflicts. + +0.9.2 +- functions added: +imagick_profile() +- created IMAGICK_PROFILE_* to support imagick_profile(). +- this release is significant because of the issue with Microsoft IE +where the image's profile causes the browser to not properly render +images (you only get red X's). See this posting: +http://studio.imagemagick.org/pipermail/magick-users/2002-September/005072.html +- added this filter IMAGICK_FILTER_UNKNOWN. If the user specifies +this filter to imagick_resize(), the resize function will take +whatever filter is defined by the image. +- modified imagick_resize() to take 6th optional parameter that is +the modifier to the geometry to facility building geometries such +as 800x600+200+200! or 450x230>. +- modified imagick_scale() to take 4th optional parameter that is +the modifier to the geometry to facility building geometries such +as 800x600+200+200! or 450x230>. +- modified imagick_sample() to take 4th optional parameter that is +the modifier to the geometry to facility building geometries such +as 800x600+200+200! or 450x230>. + +0.9.1 +- functions added: +imagick_chop() +imagick_crop() +imagick_flip() +imagick_flop() +imagick_roll() +imagick_getimagedepth() +imagick_getnumbercolors() +imagick_isgrayimage() +imagick_ismonochromeimage() +imagick_isopaqueimage() +imagick_ispaletteimage() +imagick_ordereddither() +imagick_composite() +- Added IMAGICK_COMPOSITE_OP_* for use with imagick_composite(). + +0.9.0.1 +IMPORTANT!!! +This release breaks Backwards Compatibility with the 0.1.x series of ext/imagick. read the examples for more information (in $doc_dir/imagick/examples). + +Big Credits go to Michael C. Montero, who wrote the whole extension from scratch. Without him, we would still be at 0.1.x. He will be the future lead for this package (as soon as he has an account on pear). + +0.2-0.5 were never released within PEAR. + +version 0.9.0.1: +- more appropriate changelog/notes, no changes in code. + +version 0.9: +- functions added: +imagick_next() +imagick_prev() +imagick_first() +imagick_goto() +imagick_getlistsize() +imagick_getlistindex() +imagick_getimagefromlist() +imagick_blob2image() +imagick_reducenoise() +imagick_shade() +imagick_sharpen() +imagick_spread() +imagick_threshold() +imagick_unsharpmask() +- cut over deprecation reporting to a more standized and easier to use method +- cut over all php_error calls to standard method +- added Christian's code to info function for displaying a list of supported image formats +- rewrote all code to use proper parameter parsing function +- fixed minor issue with a number of example files; was nothing critical + +version: 0.5a +- functions added: +imagick_getcanvas() +imagick_blur() +imagick_despeckle() +imagick_edge() +imagick_emboss() +imagick_enhance() +imagick_gaussianblur() +imagick_medianfilter() +imagick_motionblur() +- one major change - renamed everything to imagick*; I've joined my efforts with Christian Stocker who had a previously written but smaller extension +- magick_getcanvas() allows you to create a blank image to draw on +- changed comment header in imagick.h to match the one in imagick.c +- added Christian Stocker to credits +- moved over to Christian Stocker's config.m4, removed the need for gen_configm4 +- rewrote INSTALL to reflect new config.m4 +- slight modifications to config.m4 to get it to work properly +- added package.xml +- removed ChangeLog, everything is now in package.xml +- removed imagick_free_reason() and imagick_free_description() since they are no longer necessary +- preceded all internal functions with _php_ +- created imagick_read() for backward compatibility with old extension +- created imagick_write() for backward compatibility with old extension + +version 0.4a +- functions added: +magick_writeimages() +magick_destroyhandle() +magick_image2blob() +magick_drawarc() +magick_drawcircle() +magick_drawpoint() +magick_border() +magick_frame() +magick_raise() +magick_getwidth() +magick_getheight() +magick_getmimetype() +magick_setfillcolor() +magick_setfontface() +magick_charcoal() +magick_implode() +magick_oilpaint() +magick_solarize() +magick_swirl() +magick_wave() +- more preparation for image lists +- fixed incorrect comments in some examples +- fixed incorrect calls to magick_failedreason() and magick_faileddescription() in most examples +- a number of examples weren't exiting properly on errors, that's been fixed +- phpinfo() now displays available font family and font names +- coolest function so far: magick_oilpaint(). The output is awesome! +- added MaxRGB to phpinfo() section + +version 0.2a +- functions added: +magick_rotate() +magick_shear() +magick_contrast() +magick_equalize() +magick_gamma() +magick_level() +magick_modulate() +magick_negate() +magick_normalize() +magick_drawellipse() +- slight changes to output of gen_configm4 +- fixed comments in all examples after the initial magick_readimage(), they were wrong +- fixed all examples so they exit properly on errors +- fixed all examples so they work as either standalone script or web page; they do better output as well +- fixed output of magick info. when calling phpinfo() +- more commenting +- significantly better error handling + +0.9 +IMPORTANT!!! +This release breaks BC with the 0.1.x series of ext/imagick. +read the examples for more information (in $doc_dir/imagick/examples) + +0.2-0.5 were never released within PEAR. + +- functions added: +imagick_next() +imagick_prev() +imagick_first() +imagick_goto() +imagick_getlistsize() +imagick_getlistindex() +imagick_getimagefromlist() +imagick_blob2image() +imagick_reducenoise() +imagick_shade() +imagick_sharpen() +imagick_spread() +imagick_threshold() +imagick_unsharpmask() +- cut over deprecation reporting to a more standized and easier +to use method +- cut over all php_error calls to standard method +- added Christian's code to info function for displaying a list of +supported image formats +- rewrote all code to use proper parameter parsing function +- fixed minor issue with a number of example files; was nothing +critical + +0.1.2 +- Added imagick_border(). (pierre-alain joye) +- Fixed return of annotate and rotate (true on success). (pierre-alain joye) + +0.1.1 +- Make it compatible with ImageMagick 5.4.5 (and this is also the needed version now) +- adjust package.xml to the new "pear build" command
View file
imagick-3.8.0.tgz/imagick-3.8.0/Imagick.stub.php
Added
@@ -0,0 +1,1675 @@ +<?php + +/** + * @generate-function-entries + * @generate-legacy-arginfo 70000 + */ + +class Imagick +{ + + public function optimizeImageLayers(): Imagick {} + + // METRIC_* + public function compareImageLayers(int $metric): Imagick {} + + public function pingImageBlob(string $image): bool {} + + // $filehandle should be a resource, but that is a pseudo-type + // which causes problems for people trying to mock the class + public function pingImageFile(/*resource*/mixed $filehandle, ?string $filename = null): bool {} + + public function transposeImage(): bool {} + + public function transverseImage(): bool {} + + public function trimImage(float $fuzz): bool {} + + public function waveImage(float $amplitude, float $length): bool {} + +#if MagickLibVersion >= 0x700 + public function waveImageWithMethod( + float $amplitude, + float $length, + int $interpolate_method // INTERPOLATE_* + ): bool {} +#endif + + public function vignetteImage(float $black_point, float $white_point, int $x, int $y): bool {} + + public function uniqueImageColors(): bool {} + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 +// PHP_ME(imagick, getimagematte, imagick_zero_args, ZEND_ACC_PUBLIC | ZEND_ACC_DEPRECATED) + /** @deprecated */ + public function getImageMatte(): bool {} +#endif +#endif + + // TODO - enabled? + public function setImageMatte(bool $matte): bool {} + + public function adaptiveResizeImage( + int $columns, + int $rows, + bool $bestfit = false, + bool $legacy = false): bool {} + + public function sketchImage(float $radius, float $sigma, float $angle): bool {} + + public function shadeImage(bool $gray, float $azimuth, float $elevation): bool {} + + public function getSizeOffset(): int {} + + public function setSizeOffset(int $columns, int $rows, int $offset): bool {} + + + public function adaptiveBlurImage( + float $radius, + float $sigma, + int $channel = Imagick::CHANNEL_DEFAULT + ): bool {} + + public function contrastStretchImage( + float $black_point, + float $white_point, + int $channel = Imagick::CHANNEL_DEFAULT + ): bool {} + + public function adaptiveSharpenImage( + float $radius, + float $sigma, + int $channel = Imagick::CHANNEL_DEFAULT + ): bool {} + + + public function randomThresholdImage( + float $low, + float $high, + int $channel = Imagick::CHANNEL_DEFAULT + ): bool {} + + + + public function roundCornersImage( + float $x_rounding, + float $y_rounding, + float $stroke_width = 10, + float $displace = 5, + float $size_correction = -6): bool {} + + /** + * @alias Imagick::roundCornersImage + */ + public function roundCorners( + float $x_rounding, + float $y_rounding, + float $stroke_width = 10, + float $displace = 5, + float $size_correction = -6): bool {} + + public function setIteratorIndex(int $index): bool {} + + public function getIteratorIndex(): int {} + +#if MagickLibVersion < 0x700 + /** @deprecated */ + public function transformImage(string $crop, string $geometry): Imagick {} +#endif + +#if MagickLibVersion > 0x630 +#if MagickLibVersion < 0x700 + /** @deprecated */ + public function setImageOpacity(float $opacity): bool {} +#endif +#endif + +#if MagickLibVersion >= 0x700 + public function setImageAlpha(float $alpha): bool {} +#endif + +#if MagickLibVersion < 0x700 + + /** @deprecated */ + public function orderedPosterizeImage( + string $threshold_map, + int $channel = Imagick::CHANNEL_DEFAULT + ): bool {} +#endif + +#if MagickLibVersion >= 0x700 + public function polaroidWithTextAndMethod( + ImagickDraw $settings, + float $angle, + string $caption, + int $method + ): bool {} +#endif + + + public function polaroidImage(ImagickDraw $settings, float $angle): bool {} + + public function getImageProperty(string $name): string {} + + public function setImageProperty(string $name, string $value): bool {} + + public function deleteImageProperty(string $name): bool {} + + // Replaces any embedded formatting characters with the appropriate + // image property and returns the interpreted text. + // See http://www.imagemagick.org/script/escape.php for escape sequences. + // -format "%m:%f %wx%h" + public function identifyFormat(string $format): string {} + + +#if IM_HAVE_IMAGICK_SETIMAGEINTERPOLATEMETHOD + // INTERPOLATE_* + public function setImageInterpolateMethod(int $method): bool {} +#endif + + // why does this not need to be inside the 'if' for IM_HAVE_IMAGICK_SETIMAGEINTERPOLATEMETHOD ..? + public function getImageInterpolateMethod(): int {} + + public function linearStretchImage(float $black_point, float $white_point): bool {} + + public function getImageLength(): int {} + + public function extentImage(int $width, int $height, int $x, int $y): bool {} + +#if MagickLibVersion > 0x633 + public function getImageOrientation(): int {} + + public function setImageOrientation(int $orientation): bool {} +#endif + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion > 0x634 +#if MagickLibVersion < 0x700 + /** @deprecated */ + public function paintFloodfillImage( + ImagickPixel|string $fill_color, + float $fuzz, + ImagickPixel|string $border_color, + int $x, + int $y, + int $channel = Imagick::CHANNEL_DEFAULT + ): bool {} +#endif +#endif +#endif + + public function clutImage(Imagick $lookup_table, int $channel = Imagick::CHANNEL_DEFAULT): bool {} + +#if MagickLibVersion >= 0x700 + public function clutImageWithInterpolate( + Imagick $lookup_table, + int $pixel_interpolate_method // PixelInterpolateMethod + ): bool {} +#endif + + public function getImageProperties(string $pattern = "*", bool $include_values = true): array {} + + public function getImageProfiles(string $pattern = "*", bool $include_values = true): array {} + + // DISTORTION_* + public function distortImage(int $distortion, array $arguments, bool $bestfit): bool {} + + // $filehandle should be a resource, but that is a pseudo-type + // which causes problems for people trying to mock the class + public function writeImageFile(/*resource*/mixed $filehandle, ?string $format = null): bool {} + + // $filehandle should be a resource, but that is a pseudo-type + // which causes problems for people trying to mock the class + public function writeImagesFile(/*resource*/mixed $filehandle, ?string $format = null): bool {} + + public function resetImagePage(string $page): bool {} + +#if MagickLibVersion < 0x700 + /** @deprecated */ + public function setImageClipMask(imagick $clip_mask): bool {} + + /** @deprecated */ + public function getImageClipMask(): Imagick {} +#endif + + // TODO - x server? + public function animateImages(string $x_server): bool {} + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 + /** @deprecated */ + public function recolorImage(array $matrix): bool {} +#endif +#endif + + +#if MagickLibVersion > 0x636 + public function setFont(string $font): bool {} + + public function getFont(): string {} + + public function setPointSize(float $point_size): bool {} + + public function getPointSize(): float {} + + // LAYERMETHOD_* + public function mergeImageLayers(int $layermethod): Imagick {} +#endif + +#if MagickLibVersion > 0x637 + // ALPHACHANNEL_* + public function setImageAlphaChannel(int $alphachannel): bool {} + + // TODO - ImagickPixel ugh +// TODO - ugh MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand, +// const PixelWand *fill,const double fuzz,const PixelWand *bordercolor, +// const ssize_t x,const ssize_t y,const MagickBooleanType invert) + + public function floodfillPaintImage( + ImagickPixel|string $fill_color, + float $fuzz, + ImagickPixel|string $border_color, + int $x, + int $y, + bool $invert, + ?int $channel = Imagick::CHANNEL_DEFAULT + ): bool{} + + + + public function opaquePaintImage( + ImagickPixel|string $target_color, + ImagickPixel|string $fill_color, + float $fuzz, + bool $invert, + int $channel = Imagick::CHANNEL_DEFAULT): bool {} + + public function transparentPaintImage( + ImagickPixel|string $target_color, + float $alpha, + float $fuzz, + bool $invert + ): bool {} +#endif +#if MagickLibVersion > 0x638 + public function liquidRescaleImage(int $width, int $height, float $delta_x, float $rigidity): bool {} + + public function encipherImage(string $passphrase): bool {} + + public function decipherImage(string $passphrase): bool {} +#endif + +#if MagickLibVersion > 0x639 + + // GRAVITY_* + public function setGravity(int $gravity): bool {} + + public function getGravity(): int {} + + // CHANNEL_ + public function getImageChannelRange(int $channel): array {} + + public function getImageAlphaChannel(): bool {} +#endif + +#if MagickLibVersion > 0x642 + public function getImageChannelDistortions( + Imagick $reference_image, + int $metric, + int $channel = Imagick::CHANNEL_DEFAULT + ): float {} +#endif + +#if MagickLibVersion > 0x643 + // GRAVITY_ + public function setImageGravity(int $gravity): bool {} + + public function getImageGravity(): int {} +#endif + +#if MagickLibVersion > 0x645 + public function importImagePixels( + int $x, + int $y, + int $width, + int $height, + string $map, + int $pixelstorage, // PIXELSTORAGE + array $pixels): bool {} + + public function deskewImage(float $threshold): bool {} + + + public function segmentImage( + int $colorspace, // COLORSPACE + float $cluster_threshold, + float $smooth_threshold, + bool $verbose = false + ): bool {} + + + public function sparseColorImage( + int $sparsecolormethod, // SPARSECOLORMETHOD_* + array $arguments, + int $channel = Imagick::CHANNEL_DEFAULT + ): bool {} + + public function remapImage(Imagick $replacement, int $dither_method): bool {} +#endif + + +#if PHP_IMAGICK_HAVE_HOUGHLINE + public function houghLineImage(int $width, int $height, float $threshold): bool {} +#endif + +#if MagickLibVersion > 0x646 + public function exportImagePixels( + int $x, + int $y, + int $width, + int $height, + string $map, // e.g. "RGB" + int $pixelstorage // PIXELSTORAGE + ): array {} +#endif + +#if MagickLibVersion > 0x648 + public function getImageChannelKurtosis(int $channel = Imagick::CHANNEL_DEFAULT): array {} + + public function functionImage( + int $function, + array $parameters, + int $channel = Imagick::CHANNEL_DEFAULT + ): bool {} +#endif + +#if MagickLibVersion > 0x651 + // COLORSPACE_* + public function transformImageColorspace(int $colorspace): bool {} +#endif + +#if MagickLibVersion > 0x652 + public function haldClutImage(Imagick $clut, int $channel = Imagick::CHANNEL_DEFAULT): bool {} +#endif + +#if MagickLibVersion > 0x655 + public function autoLevelImage(int $channel = Imagick::CHANNEL_DEFAULT): bool {} + + public function blueShiftImage(float $factor = 1.5): bool {} +#endif + +#if MagickLibVersion > 0x656 + /** + * $artifact example 'compose:args' + * + */ + public function getImageArtifact(string $artifact): string|null {} + + /** + * $artifact example 'compose:args' + * $value example "1,0,-0.5,0.5" + * + */ + public function setImageArtifact(string $artifact, string|null $value): bool {} + + public function deleteImageArtifact(string $artifact): bool {} + + // Will return CHANNEL_* + public function getColorspace(): int {} + +// PHP_ME(imagick, setcolorspace, imagick_setcolorspace_args, ZEND_ACC_PUBLIC) + public function setColorspace(int $colorspace): bool {} + + // CHANNEL_* + public function clampImage(int $channel = Imagick::CHANNEL_DEFAULT): bool {} +#endif + +#if MagickLibVersion > 0x667 + // stack By default, images are stacked left-to-right. Set stack to MagickTrue to stack them top-to-bottom. + //offset minimum distance in pixels between images. + public function smushImages(bool $stack, int $offset): Imagick {} +#endif + +// PHP_ME(imagick, __construct, imagick_construct_args, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) + // TODO int|float? :spocks_eyebrow.gif: + public function __construct(string|array|int|float|null $files = null) {} + + public function __toString(): string {} + +#if PHP_VERSION_ID >= 50600 + // This calls MagickGetNumberImages underneath + // mode is unused. Remove at next major release + // https://github.com/Imagick/imagick/commit/13302500c0ab0ce58e6502e68871187180f7987c + public function count(int $mode = 0): int {} +#else + public function count(): int {} +#endif + + public function getPixelIterator(): ImagickPixelIterator {} + + public function getPixelRegionIterator(int $x, int $y, int $columns, int $rows): ImagickPixelIterator {} + + public function readImage(string $filename): bool {} + + public function readImages(array $filenames): bool {} + + public function readImageBlob(string $image, ?string $filename = null): bool {} + + public function setImageFormat(string $format): bool {} + + public function scaleImage(int $columns, int $rows, bool $bestfit = false, bool $legacy = false): bool {} + + public function writeImage(?string $filename = null): bool {} + + public function writeImages(string $filename, bool $adjoin): bool {} + + // CHANNEL_ + public function blurImage(float $radius, float $sigma, int $channel = Imagick::CHANNEL_DEFAULT): bool {} + + public function thumbnailImage( + ?int $columns, + ?int $rows, + bool $bestfit = false, + bool $fill = false, + bool $legacy = false): bool {} + + public function cropThumbnailImage(int $width, int $height, bool $legacy = false): bool {} + + public function getImageFilename(): string {} + + public function setImageFilename(string $filename): bool {} + + public function getImageFormat(): string {} + + public function getImageMimeType(): string {} + + public function removeImage(): bool {} + + /** @alias Imagick::clear */ + public function destroy(): bool {} + + public function clear(): bool {} + + public function clone(): Imagick {} + + public function getImageSize(): int {} + + public function getImageBlob(): ?string {} + + public function getImagesBlob(): string {} + + public function setFirstIterator(): bool {} + + public function setLastIterator(): bool {} + + public function resetIterator(): void {} + + public function previousImage(): bool {} + + public function nextImage(): bool {} + + public function hasPreviousImage(): bool {} + + public function hasNextImage(): bool {} + + public function setImageIndex(int $index): bool {} + + public function getImageIndex(): int {} + + public function commentImage(string $comment): bool {} + + public function cropImage(int $width, int $height, int $x, int $y): bool {} + + public function labelImage(string $label): bool {} + + public function getImageGeometry(): array {} + + public function drawImage(ImagickDraw $drawing): bool {} + + public function setImageCompressionQuality(int $quality): bool {} + + public function getImageCompressionQuality(): int {} + + public function setImageCompression(int $compression): bool {} + + public function getImageCompression(): int {} + + public function annotateImage( + ImagickDraw $settings, + float $x, + float $y, + float $angle, + string $text + ): bool {} + + public function compositeImage( + Imagick $composite_image, + int $composite, + int $x, + int $y, + int $channel = Imagick::CHANNEL_DEFAULT): bool{} + + public function modulateImage(float $brightness, float $saturation, float $hue): bool {} + + public function getImageColors(): int {} + + + public function montageImage( + ImagickDraw $settings, + string $tile_geometry, // e.g. "3x2+0+0" + string $thumbnail_geometry, // e.g. "200x160+3+3>" + int $monatgemode, // MONTAGEMODE_ + string $frame // "10x10+2+2" + ): Imagick {} + + public function identifyImage(bool $append_raw_output = false): array {} + + public function thresholdImage(float $threshold, int $channel = Imagick::CHANNEL_DEFAULT): bool {} + + public function adaptiveThresholdImage(int $width, int $height, int $offset): bool {} + + public function blackThresholdImage(ImagickPixel|string $threshold_color): bool {} + + public function whiteThresholdImage(ImagickPixel|string $threshold_color): bool {} + + public function appendImages(bool $stack): Imagick {} + + public function charcoalImage(float $radius, float $sigma): bool {} + + public function normalizeImage(int $channel = Imagick::CHANNEL_DEFAULT): bool {} + +#if MagickLibVersion >= 0x700 + public function oilPaintImageWithSigma(float $radius, float $sigma): bool {} +#endif + + public function oilPaintImage(float $radius): bool {} + + public function posterizeImage(int $levels, bool $dither): bool {} + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 + /** @deprecated */ + public function radialBlurImage(float $angle, int $channel = Imagick::CHANNEL_DEFAULT): bool {} +#endif +#endif + + public function raiseImage(int $width, int $height, int $x, int $y, bool $raise): bool {} + + public function resampleImage(float $x_resolution, float $y_resolution, int $filter, float $blur): bool {} + + public function resizeImage( + int $columns, + int $rows, + int $filter, + float $blur, + bool $bestfit = false, + bool $legacy = false): bool {} + + public function rollImage(int $x, int $y): bool {} + + public function rotateImage(ImagickPixel|string $background_color, float $degrees): bool {} + + public function sampleImage(int $columns, int $rows): bool {} + + public function solarizeImage(int $threshold): bool {} + + public function shadowImage(float $opacity, float $sigma, int $x, int $y): bool {} + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 + /** @deprecated */ + public function setImageAttribute(string $key, string $value): bool {} +#endif +#endif + + public function setImageBackgroundColor(ImagickPixel|string $background_color): bool {} + +#if MagickLibVersion >= 0x700 + public function setImageChannelMask(int $channel): int {} +#endif + + public function setImageCompose(int $compose): bool {} + + public function setImageDelay(int $delay): bool {} + + public function setImageDepth(int $depth): bool {} + + public function setImageGamma(float $gamma): bool {} + + public function setImageIterations(int $iterations): bool {} + + +#if MagickLibVersion < 0x700 || MagickLibVersion >= 0x705 + public function setImageMatteColor(ImagickPixel|string $matte_color): bool {} +#endif + + public function setImagePage(int $width, int $height, int $x, int $y): bool {} + + // TODO test this. + public function setImageProgressMonitor(string $filename): bool {} + +#if MagickLibVersion > 0x653 + public function setProgressMonitor(callable $callback): bool {} +#endif + + public function setImageResolution(float $x_resolution, float $y_resolution): bool {} + + // I have no idea what scene does. + public function setImageScene(int $scene): bool {} + + public function setImageTicksPerSecond(int $ticks_per_second): bool {} + + // IMGTYPE_* + public function setImageType(int $image_type): bool {} + + public function setImageUnits(int $units): bool {} + + public function sharpenImage(float $radius, float $sigma, int $channel = Imagick::CHANNEL_DEFAULT): bool {} + + public function shaveImage(int $columns, int $rows): bool {} + + public function shearImage(ImagickPixel|string $background_color, float $x_shear, float $y_shear): bool {} + + public function spliceImage(int $width, int $height, int $x, int $y): bool {} + + public function pingImage(string $filename): bool {} + + // $filehandle should be a resource, but that is a pseudo-type + // which causes problems for people trying to mock the class + public function readImageFile(/*resource*/mixed $filehandle, ?string $filename = null): bool {} + + public function displayImage(string $servername): bool {} + + public function displayImages(string $servername): bool {} + + public function spreadImage(float $radius): bool {} + +#if MagickLibVersion >= 0x700 + public function spreadImageWithMethod( + float $radius, + int $interpolate_method // INTERPOLATE_* + ): bool {} +#endif + + public function swirlImage(float $degrees): bool {} + +#if MagickLibVersion >= 0x700 + public function swirlImageWithMethod( + float $degrees, + int $interpolate_method // INTERPOLATE_* + ): bool {} +#endif + + public function stripImage(): bool {} + + public static function queryFormats(string $pattern = "*"): array {} + + public static function queryFonts(string $pattern = "*"): array {} + + /* TODO $multiline == null, means we should autodetect */ + public function queryFontMetrics(ImagickDraw $settings, string $text, ?bool $multiline = null): array {} + + public function steganoImage(Imagick $watermark, int $offset): Imagick {} + + // NOISE_* + public function addNoiseImage(int $noise, int $channel = Imagick::CHANNEL_DEFAULT): bool {} + +#if IM_HAVE_IMAGICK_ADD_NOISE_WITH_ATTENUATE + public function addNoiseImageWithAttenuate( + int $noise, + float $attenuate, + int $channel = Imagick::CHANNEL_DEFAULT + ): bool {} +#endif + + public function motionBlurImage( + float $radius, + float $sigma, + float $angle, + int $channel = Imagick::CHANNEL_DEFAULT + ):bool {} + +#if MagickLibVersion < 0x700 +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) + /** @deprecated */ + public function mosaicImages(): Imagick {} +#endif +#endif + + public function morphImages(int $number_frames): Imagick {} + + public function minifyImage(): bool {} + + public function affineTransformImage(ImagickDraw $settings): bool {} + + public function averageImages(): Imagick {} + + public function borderImage( + ImagickPixel|string $border_color, + int $width, + int $height + ): bool {} + +#if MagickLibVersion >= 0x700 + public function borderImageWithComposite( + ImagickPixel|string $border_color, + int $width, + int $height, + int $composite // COMPOSITE_ // null rather than OverCompositeOp as we don't control the value + ): bool {} +#endif + + public static function calculateCrop( + int $original_width, + int $original_height, + int $desired_width, + int $desired_height, + bool $legacy = false): array {} + + public function chopImage(int $width, int $height, int $x, int $y): bool {} + + public function clipImage(): bool {} + + public function clipPathImage(string $pathname, bool $inside): bool {} + + /* clippathimage has been deprecated. Create alias here and use the newer API function if present */ + /** @alias Imagick::clipPathImage */ + public function clipImagePath(string $pathname, bool $inside): void {} + + public function coalesceImages(): Imagick {} + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 + /** @deprecated */ + public function colorFloodfillImage( + ImagickPixel|string $fill_color, + float $fuzz, + ImagickPixel|string $border_color, + int $x, + int $y + ): bool {} +#endif +#endif + + // TODO - opacity is actually float if legacy is true... + public function colorizeImage( + ImagickPixel|string $colorize_color, + ImagickPixel|string|false $opacity_color, + ?bool $legacy = false ): bool {} + + public function compareImageChannels(Imagick $reference, int $channel, int $metric): array {} + + public function compareImages(Imagick $reference, int $metric): array {} + + public function contrastImage(bool $sharpen): bool {} + + public function combineImages(int $colorspace): Imagick {} + +#if MagickLibVersion >= 0x700 + public function convolveImage(ImagickKernel $kernel, int $channel = Imagick::CHANNEL_DEFAULT): bool {} +#else + // kernel is a 2d array of float values + public function convolveImage(array $kernel, int $channel = Imagick::CHANNEL_DEFAULT): bool {} +#endif + + public function cycleColormapImage(int $displace): bool {} + + public function deconstructImages(): Imagick {} + + public function despeckleImage(): bool {} + + public function edgeImage(float $radius): bool {} + + public function embossImage(float $radius, float $sigma): bool {} + + public function enhanceImage(): bool {} + + public function equalizeImage(): bool {} + + // EVALUATE_* + public function evaluateImage(int $evaluate, float $constant, int $channel = Imagick::CHANNEL_DEFAULT): bool {} + +#if MagickLibVersion >= 0x687 +// Merge multiple images of the same size together with the selected operator. +//http://www.imagemagick.org/Usage/layers/#evaluate-sequence + + // EVALUATE_* + public function evaluateImages(int $evaluate): Imagick {} + +#endif + + public function flattenImages(): Imagick {} + + public function flipImage(): bool {} + + public function flopImage(): bool {} + +#if MagickLibVersion >= 0x655 + public function forwardFourierTransformImage(bool $magnitude): bool {} +#endif + + public function frameImage( + ImagickPixel|string $matte_color, + int $width, + int $height, + int $inner_bevel, + int $outer_bevel + ): bool {} + +#if MagickLibVersion >= 0x700 + public function frameImageWithComposite( + ImagickPixel|string $matte_color, + int $width, + int $height, + int $inner_bevel, + int $outer_bevel, + int $composite + ): bool {} +#endif + + public function fxImage(string $expression, int $channel = Imagick::CHANNEL_DEFAULT): Imagick {} + + public function gammaImage(float $gamma, int $channel = Imagick::CHANNEL_DEFAULT): bool {} + + public function gaussianBlurImage(float $radius, float $sigma, int $channel = Imagick::CHANNEL_DEFAULT): bool {} + +#if MagickLibVersion < 0x700 +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) + /** @deprecated */ + public function getImageAttribute(string $key): string {} +#endif +#endif + + public function getImageBackgroundColor(): ImagickPixel {} + + public function getImageBluePrimary(): array {} + + public function getImageBorderColor(): ImagickPixel {} + + public function getImageChannelDepth(int $channel): int {} + + public function getImageChannelDistortion(Imagick $reference, int $channel, int $metric): float {} + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 + /** @deprecated */ + public function getImageChannelExtrema(int $channel): array {} +#endif +#endif + + public function getImageChannelMean(int $channel): array {} + + public function getImageChannelStatistics(): array {} + + // index - the offset into the image colormap. I have no idea. + public function getImageColormapColor(int $index): ImagickPixel {} + + public function getImageColorspace(): int {} + + public function getImageCompose(): int {} + + public function getImageDelay(): int {} + + public function getImageDepth(): int {} + + // METRIC_ + public function getImageDistortion(Imagick $reference, int $metric): float {} + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 + /** @deprecated */ + public function getImageExtrema(): array {} +#endif +#endif + + public function getImageDispose(): int {} + + public function getImageGamma(): float {} + + public function getImageGreenPrimary(): array {} + + public function getImageHeight(): int {} + + public function getImageHistogram(): array {} + + public function getImageInterlaceScheme(): int {} + + public function getImageIterations(): int {} + +#if MagickLibVersion < 0x700 + /** @deprecated */ + public function getImageMatteColor(): ImagickPixel {} +#endif + + public function getImagePage(): array {} + + public function getImagePixelColor(int $x, int $y): ImagickPixel {} + + +#if IM_HAVE_IMAGICK_SETIMAGEPIXELCOLOR + // TODO - needs a test. + public function setImagePixelColor(int $x, int $y, ImagickPixel|string $color): ImagickPixel {} +#endif + + public function getImageProfile(string $name): string {} + + public function getImageRedPrimary(): array {} + + public function getImageRenderingIntent(): int {} + + public function getImageResolution(): array {} + + public function getImageScene(): int {} + + public function getImageSignature(): string {} + + public function getImageTicksPerSecond(): int {} + + public function getImageType(): int {} + + public function getImageUnits(): int {} + + public function getImageVirtualPixelMethod(): int {} + + public function getImageWhitePoint(): array {} + + public function getImageWidth(): int {} + + public function getNumberImages(): int {} + + public function getImageTotalInkDensity(): float {} + + public function getImageRegion(int $width, int $height, int $x, int $y): Imagick {} + + public function implodeImage(float $radius): bool {} + +#if MagickLibVersion >= 0x700 + public function implodeImageWithMethod( + float $radius, + int $pixel_interpolate_method // PixelInterpolateMethod + ): bool {} +#endif + +#if MagickLibVersion >= 0x658 + // TODO MagickWand *magnitude_wand,MagickWand *phase_wand, + public function inverseFourierTransformImage(Imagick $complement, bool $magnitude): bool {} +#endif + + public function levelImage( + float $black_point, + float $gamma, + float $white_point, + int $channel = Imagick::CHANNEL_DEFAULT + ): bool {} + + public function magnifyImage(): bool {} + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 + /** @deprecated */ + public function mapImage(imagick $map, bool $dither): bool {} + + /** @deprecated */ + public function matteFloodfillImage( + float $alpha, + float $fuzz, + ImagickPixel|string $border_color, + int $x, + int $y + ): bool {} +#endif +#endif + +#if MagickLibVersion < 0x700 +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) + /** @deprecated */ + public function medianFilterImage(float $radius): bool {} +#endif +#endif + + public function negateImage(bool $gray, int $channel = Imagick::CHANNEL_DEFAULT): bool {} + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 + /** @deprecated */ + public function paintOpaqueImage( + ImagickPixel|string $target_color, + ImagickPixel|string $fill_color, + float $fuzz, + int $channel = Imagick::CHANNEL_DEFAULT + ): bool {} + + /** @deprecated */ + public function paintTransparentImage(ImagickPixel|string $target_color, float $alpha, float $fuzz): bool {} +#endif +#endif + + // PREVIEW_* + public function previewImages(int $preview): bool {} + + public function profileImage(string $name, ?string $profile): bool {} + + public function quantizeImage( + int $number_colors, + int $colorspace, + int $tree_depth, + bool $dither, + bool $measure_error + ): bool {} + + + public function quantizeImages( + int $number_colors, + int $colorspace, + int $tree_depth, + bool $dither, + bool $measure_error): bool {} + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 + /** @deprecated */ + public function reduceNoiseImage(float $radius): bool {} +#endif +#endif + + public function removeImageProfile(string $name): string {} + + public function separateImageChannel(int $channel): bool {} + + public function sepiaToneImage(float $threshold): bool {} + +#if MagickLibVersion < 0x700 + /** @deprecated */ + public function setImageBias(float $bias): bool {} + + /** @deprecated */ + public function setImageBiasQuantum(string $bias): void {} +#endif + +#if MagickLibVersion >= 0x700 + public function setImageBluePrimary(float $x, float $y, float $z): bool {} +#else + public function setImageBluePrimary(float $x, float $y): bool {} +#endif + /* {{{ proto bool Imagick::setImageBluePrimary(float x,float y) +For IM7 the prototype is +proto bool Imagick::setImageBluePrimary(float x, float y, float z) */ + + public function setImageBorderColor(ImagickPixel|string $border_color): bool {} + + public function setImageChannelDepth(int $channel, int $depth): bool {} + + public function setImageColormapColor(int $index, ImagickPixel|string $color): bool {} + + public function setImageColorspace(int $colorspace): bool {} + + public function setImageDispose(int $dispose): bool {} + + public function setImageExtent(int $columns, int $rows): bool {} + +#if MagickLibVersion >= 0x700 + public function setImageGreenPrimary(float $x, float $y, float $z): bool {} +#else + public function setImageGreenPrimary(float $x, float $y): bool {} +#endif + + // INTERLACE_* + public function setImageInterlaceScheme(int $interlace): bool {} + + public function setImageProfile(string $name, string $profile): bool {} + +#if MagickLibVersion >= 0x700 + public function setImageRedPrimary(float $x, float $y, float $z): bool {} +#else + public function setImageRedPrimary(float $x, float $y): bool {} +#endif + + // RENDERINGINTENT + public function setImageRenderingIntent(int $rendering_intent): bool {} + + public function setImageVirtualPixelMethod(int $method): bool {} + +#if MagickLibVersion >= 0x700 + public function setImageWhitePoint(float $x, float $y, float $z): bool {} +#else + public function setImageWhitePoint(float $x, float $y): bool {} +#endif + + public function sigmoidalContrastImage( + bool $sharpen, + float $alpha, + float $beta, + int $channel = Imagick::CHANNEL_DEFAULT + ): bool{} + + // TODO - MagickStereoImage() composites two images and produces a single + // image that is the composite of a left and right image of a stereo pair + public function stereoImage(Imagick $offset_image): bool {} + + public function textureImage(Imagick $texture): Imagick {} + + public function tintImage( + ImagickPixel|string $tint_color, + ImagickPixel|string $opacity_color, + bool $legacy = false + ): bool {} + + public function unsharpMaskImage( + float $radius, + float $sigma, + float $amount, + float $threshold, + int $channel = Imagick::CHANNEL_DEFAULT + ): bool {} + + public function getImage(): Imagick {} + + public function addImage(Imagick $image): bool {} + + public function setImage(Imagick $image): bool {} + + + public function newImage( + int $columns, + int $rows, + ImagickPixel|string $background_color, + ?string $format = null + ): bool {} + + // TODO - canvas? description + public function newPseudoImage(int $columns, int $rows, string $pseudo_format): bool {} + + public function getCompression(): int {} + + public function getCompressionQuality(): int {} + + public static function getCopyright(): string {} + + /** + * @return string + */ + public static function getConfigureOptions(string $pattern = "*"): array {} + +#if MagickLibVersion > 0x660 + public static function getFeatures(): string {} +#endif + + public function getFilename(): string {} + + public function getFormat(): string {} + + public static function getHomeURL(): string {} + + public function getInterlaceScheme(): int {} + + public function getOption(string $key): string {} + + public static function getPackageName(): string {} + + public function getPage(): array {} + + public static function getQuantum(): int {} + + public static function getHdriEnabled(): bool {} + + public static function getQuantumDepth(): array {} + + public static function getQuantumRange(): array {} + + public static function getReleaseDate(): string {} + + public static function getResource(int $type): int {} + + public static function getResourceLimit(int $type): float {} + + public function getSamplingFactors(): array {} + + public function getSize(): array {} + + public static function getVersion(): array {} + + public function setBackgroundColor(ImagickPixel|string $background_color): bool {} + + public function setCompression(int $compression): bool {} + + public function setCompressionQuality(int $quality): bool {} + + public function setFilename(string $filename): bool {} + + public function setFormat(string $format): bool {} + + // INTERLACE_* + public function setInterlaceScheme(int $interlace): bool {} + + public function setOption(string $key, string $value): bool {} + + public function setPage(int $width, int $height, int $x, int $y): bool {} + + public static function setResourceLimit(int $type, int $limit): bool {} + + public function setResolution(float $x_resolution, float $y_resolution): bool {} + + public function setSamplingFactors(array $factors): bool {} + + public function setSize(int $columns, int $rows): bool {} + + // IMGTYPE_* + public function setType(int $imgtype): bool {} + +#if MagickLibVersion > 0x628 + /** @alias Imagick::getIteratorIndex */ + public function key(): int {} + +//#else +//# if defined(MAGICKCORE_EXCLUDE_DEPRECATED) +//# error "MAGICKCORE_EXCLUDE_DEPRECATED should not be defined with ImageMagick version below 6.2.8" +//# else +//// PHP_MALIAS(imagick, key, getimageindex, imagick_zero_args, ZEND_ACC_PUBLIC) +// /** @alias Imagick::getImageIndex */ +// public function key(): int {} +// +//# endif +#endif + + public function next(): void {} + + public function rewind(): void {} + + public function valid(): bool {} + + public function current(): Imagick {} + +#if MagickLibVersion >= 0x659 + public function brightnessContrastImage( + float $brightness, + float $contrast, + int $channel = Imagick::CHANNEL_DEFAULT + ): bool {} +#endif + +#if MagickLibVersion > 0x661 + public function colorMatrixImage(array $color_matrix): bool {} +#endif + + public function selectiveBlurImage( + float $radius, + float $sigma, + float $threshold, + int $channel = Imagick::CHANNEL_DEFAULT + ): bool {} + +#if MagickLibVersion >= 0x689 + public function rotationalBlurImage(float $angle, int $channel = Imagick::CHANNEL_DEFAULT): bool {} +#endif + +#if MagickLibVersion >= 0x683 + public function statisticImage( + int $type, + int $width, + int $height, + int $channel = Imagick::CHANNEL_DEFAULT + ): bool {} +#endif + +#if MagickLibVersion >= 0x652 + /** + * @param array $offset + * @param float $similarity + */ + public function subimageMatch(Imagick $image, &$offset = null, &$similarity = null, float $threshold = 0.0, int $metric = 0): Imagick {} + + /** + * @alias Imagick::subimageMatch + * @param array $offset + * @param float $similarity + */ + public function similarityImage(Imagick $image, &$offset = null, &$similarity = null, float $threshold = 0.0, int $metric = 0): Imagick {} +#endif + + public static function setRegistry(string $key, string $value): bool {} + + public static function getRegistry(string $key): string|false {} + + public static function listRegistry(): array {} + +#if MagickLibVersion >= 0x680 + + public function morphology( + int $morphology, // MORPHOLOGY_* + int $iterations, + ImagickKernel $kernel, + int $channel = Imagick::CHANNEL_DEFAULT + ): bool {} +#endif + +#ifdef IMAGICK_WITH_KERNEL +#if MagickLibVersion < 0x700 + /** @deprecated */ + public function filter(ImagickKernel $kernel, int $channel = Imagick::CHANNEL_UNDEFINED): bool {} +#endif +#endif + + public function setAntialias(bool $antialias): void {} + + public function getAntialias(): bool {} + +#if MagickLibVersion > 0x676 + /** + * $color_correction_collection example: + * <ColorCorrectionCollection xmlns="urn:ASC:CDL:v1.2"> + * <ColorCorrection id="cc03345"> + * <SOPNode> + * <Slope> 0.9 1.2 0.5 </Slope> + * <Offset> 0.4 -0.5 0.6 </Offset> + * <Power> 1.0 0.8 1.5 </Power> + * </SOPNode> + * <SATNode> + * <Saturation> 0.85 </Saturation> + * </SATNode> + * </ColorCorrection> + * </ColorCorrectionCollection> + * + */ + public function colorDecisionListImage(string $color_correction_collection): bool {} +#endif + +#if MagickLibVersion >= 0x687 + public function optimizeImageTransparency(): void {} +#endif + +#if MagickLibVersion >= 0x660 + public function autoGammaImage(?int $channel = Imagick::CHANNEL_ALL): void {} +#endif + +#if MagickLibVersion >= 0x692 + public function autoOrient(): void {} + + /** @alias Imagick::autoOrient */ + public function autoOrientate(): void {} + + // COMPOSITE_* + public function compositeImageGravity(Imagick $image, int $composite_constant, int $gravity): bool {} + +#endif + +#if MagickLibVersion >= 0x693 + public function localContrastImage(float $radius, float $strength): bool {} +#endif + +#if MagickLibVersion >= 0x700 + // Identifies the potential image type, returns one of the Imagick::IMGTYPE_* constants + public function identifyImageType(): int {} +#endif + + +#if IM_HAVE_IMAGICK_GETSETIMAGEMASK + // PIXELMASK_* + public function getImageMask(int $pixelmask): ?Imagick {} + + // PIXELMASK_* + public function setImageMask(Imagick $clip_mask, int $pixelmask): void {} +#endif + + + // TODO - needs deleting from docs. +// public function getImageMagickLicense(): string {} + + // TODO - needs deleting from docs. +// public function render(): bool {} + +// public function floodfillPaintImage( +// ImagickPixel|string $fill, +// float $fuzz, +// ImagickPixel|string $bordercolor, +// int $x, +// int $y, +// bool $invert, +// int $channel = Imagick::CHANNEL_DEFAULT): null {} + + +#if IM_HAVE_IMAGICK_CANNYEDGEIMAGE + public function cannyEdgeImage( + float $radius, + float $sigma, + float $lower_percent, + float $upper_percent + ): bool {} +#endif + +#if IM_HAVE_IMAGICK_SETSEED + public static function setSeed(int $seed): void {} +#endif + +#if IM_HAVE_IMAGICK_WAVELETDENOISEIMAGE + public function waveletDenoiseImage(float $threshold, float $softness): bool {} +#endif + +#if IM_HAVE_IMAGICK_MEANSHIFTIMAGE + public function meanShiftImage( + int $width, + int $height, + float $color_distance + ): bool {} +#endif + +#if IM_HAVE_IMAGICK_KMEANSIMAGE + public function kmeansImage( + int $number_colors, + int $max_iterations, + float $tolerance + ): bool {} +#endif + +#if IM_HAVE_IMAGICK_RANGETHRESHOLDIMAGE + public function rangeThresholdImage( + float $low_black, + float $low_white, + float $high_white, + float $high_black + ): bool {} +#endif + +#if IM_HAVE_IMAGICK_AUTOTHRESHOLDIMAGE + // AUTO_THRESHOLD_* + public function autoThresholdImage(int $auto_threshold_method): bool {} +#endif + +#if IM_HAVE_IMAGICK_BILATERALBLURIMAGE + public function bilateralBlurImage( + float $radius, + float $sigma, + float $intensity_sigma, + float $spatial_sigma + ): bool {} +#endif + +#if IM_HAVE_IMAGICK_CLAHEIMAGE + public function claheImage( + int $width, + int $height, + int $number_bins, + float $clip_limit + ): bool {} +#endif + +#if IM_HAVE_IMAGICK_CHANNELFXIMAGE + // MagickChannelFxImage() applies a channel expression to the specified image. + // The expression consists of one or more channels, either mnemonic or numeric + // (e.g. red, 1), separated by actions as follows: + // + // <=> exchange two channels (e.g. red<=>blue) + // => transfer a channel to another (e.g. red=>green) + // , separate channel operations (e.g. red, green) + // | read channels from next input image (e.g. red | green) + // ; write channels to next output image (e.g. red; green; blue) + public function channelFxImage(string $expression): Imagick {} +#endif + +#if IM_HAVE_IMAGICK_COLORTHRESHOLDIMAGE + public function colorThresholdImage( + ImagickPixel|string $start_color, + ImagickPixel|string $stop_color + ): bool {} +#endif + +#if IM_HAVE_IMAGICK_COMPLEXIMAGES + // COMPLEX_OPERATOR_ + public function complexImages(int $complex_operator): Imagick {} +#endif + +#if IM_HAVE_IMAGICK_INTERPOLATIVERESIZEIMAGE + public function interpolativeResizeImage( + int $columns, + int $rows, + int $interpolate // INTERPOLATE_ + ): bool {} +#endif + +#if IM_HAVE_IMAGICK_LEVELIMAGECOLORS + public function levelImageColors( + ImagickPixel|string $black_color, + ImagickPixel|string $white_color, + bool $invert + ): bool {} +#endif + +#if IM_HAVE_IMAGICK_LEVELIZEIMAGE + public function levelizeImage( + float $black_point, + float $gamma, + float $white_point + ): bool {} +#endif + + //For example: "o3x3,6" generates a 6 level posterization of the image + // with a ordered 3x3 diffused pixel dither being applied between each + // level. While checker,8,8,4 will produce a 332 colormaped image with + // only a single checkerboard hash pattern (50% grey) between each color + // level, to basically double the number of color levels with a bare + // minimim of dithering. + +#if IM_HAVE_IMAGICK_ORDEREDDITHERIMAGE + public function orderedDitherImage(string $dither_format): bool {} +#endif + +#if IM_HAVE_IMAGICK_WHITEBALANCEIMAGE + public function whiteBalanceImage(): bool {} +#endif + +#if IM_HAVE_IMAGICK_DELETE_OPTION + public function deleteOption(string $option): bool {} +#endif + +#if IM_HAVE_IMAGICK_GET_BACKGROUND_COLOR + public function getBackgroundColor(): ImagickPixel {} +#endif + +#if IM_HAVE_IMAGICK_GET_IMAGE_ARTIFACTS + /** + * @return string + */ + public function getImageArtifacts(string $pattern = "*"): array {} +#endif + +#if IM_HAVE_IMAGICK_GET_IMAGE_DISTORTIONS + + /** + * metric - MetricType_ + * @return float + */ +// public function getImageDistortions(int $metric): array{} +// for (j=0; j <= MaxPixelChannels; j++) +// distortionj+=channel_distortionj; +// Use MagickRelinquishMemory() to free the metrics when you are done with them. +#endif + +#if IM_HAVE_IMAGICK_GET_IMAGE_KURTOSIS + + /** + * return kurtosis:float,skewness: float + */ + public function getImageKurtosis(): array {} +#endif + +#if IM_HAVE_IMAGICK_GET_IMAGE_MEAN + /** + * return $mean, $standard_deviation + */ + public function getImageMean(): array {} +#endif + +#if IM_HAVE_IMAGICK_GET_IMAGE_RANGE + /** + * return minima, float $maxima + */ + public function getImageRange(): array {} +#endif + +#if IM_HAVE_IMAGICK_GET_INTERPOLATE_METHOD + /** + * return int - PixelInterpolateMethod + */ + public function getInterpolateMethod(): int {} +#endif + +#if IM_HAVE_IMAGICK_GET_OPTIONS + /** + * return string + */ + public function getOptions(string $pattern = "*"): array {} +#endif + +#if IM_HAVE_IMAGICK_GET_ORIENTATION + /** + * return int OrientationType + */ + public function getOrientation(): int {} +#endif + +#if IM_HAVE_IMAGICK_GET_RESOLUTION + /** + * return x: float, y: float + */ + public function getResolution(): array {} +#endif + +#if IM_HAVE_IMAGICK_GET_TYPE + /** + * return ImageType + */ + public function getType(): int {} +#endif + +#if IM_HAVE_IMAGICK_POLYNOMIAL_IMAGE + //% o number_terms: the number of terms in the list. The actual list length + //% is 2 x number_terms + 1 (the constant). + public function polynomialImage(array $terms): bool {} +#endif + +#if IM_HAVE_IMAGICK_SET_DEPTH + public function setDepth(int $depth): bool {} +#endif + +#if IM_HAVE_IMAGICK_SET_EXTRACT + //% MagickSetExtract() sets the extract geometry before you read or write an + //% image file. Use it for inline cropping (e.g. 200x200+0+0) or resizing + //% (e.g.200x200). + public function setExtract(string $geometry): bool {} +#endif + +#if IM_HAVE_IMAGICK_SET_INTERPOLATE_METHOD +/** + * int $method - PixelInterpolateMethod + */ + public function setInterpolateMethod(int $method): bool{} +#endif + +#if IM_HAVE_IMAGICK_SET_ORIENTATION + /** + * $orientation - OrientationType + */ + public function setOrientation(int $orientation): bool {} +#endif + +}
View file
imagick-3.8.0.tgz/imagick-3.8.0/ImagickDraw.stub.php
Added
@@ -0,0 +1,411 @@ +<?php + +/** + * @generate-function-entries + * @generate-legacy-arginfo 70000 + */ +class ImagickDraw +{ +#if MagickLibVersion > 0x628 + public function resetVectorGraphics(): bool {} +#endif +#if MagickLibVersion > 0x649 + public function getTextKerning(): float {} + public function setTextKerning(float $kerning): bool {} + public function getTextInterwordSpacing(): float {} + + public function setTextInterwordSpacing(float $spacing): bool {} +#endif +#if MagickLibVersion > 0x655 + public function getTextInterlineSpacing(): float {} + public function setTextInterlineSpacing(float $spacing): bool {} +#endif + + public function __construct() {} + + public function setFillColor(ImagickPixel|string $fill_color): bool {} + + public function setFillAlpha(float $alpha): bool {} + + public function setResolution(float $resolution_x, float $resolution_y): bool {} + + public function setStrokeColor(ImagickPixel|string $color): bool {} + + public function setStrokeAlpha(float $alpha): bool {} + + public function setStrokeWidth(float $width): bool {} + + public function clear(): bool {} + + public function circle( + float $origin_x, + float $origin_y, + float $perimeter_x, + float $perimeter_y + ): bool {} + + public function annotation(float $x, float $y, string $text): bool {} + + public function setTextAntialias(bool $antialias): bool {} + + public function setTextEncoding(string $encoding): bool {} + + public function setFont(string $font_name): bool {} + + public function setFontFamily(string $font_family): bool {} + + public function setFontSize(float $point_size): bool {} + + // STYLE_* + public function setFontStyle(int $style): bool {} + + /** + * $weight font weight (valid range 100-900) + */ + public function setFontWeight(int $weight): bool {} + + public function getFont(): string {} + + public function getFontFamily(): string {} + + public function getFontSize(): float {} + + public function getFontStyle(): int {} + + public function getFontWeight(): int {} + + /** @alias ImagickDraw::clear */ + public function destroy(): bool {} + + public function rectangle(float $top_left_x, float $top_left_y, float $bottom_right_x, float $bottom_right_y): bool {} + + public function roundRectangle(float $top_left_x, float $top_left_y, float $bottom_right_x, float $bottom_right_y, float $rounding_x, float $rounding_y): bool {} + + + //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 + + public function ellipse(float $origin_x, float $origin_y, float $radius_x, float $radius_y, float $angle_start, float $angle_end): bool {} + + public function skewX(float $degrees): bool {} + + public function skewY(float $degrees): bool {} + + public function translate(float $x, float $y): bool {} + + public function line(float $start_x, float $start_y, float $end_x, float $end_y): bool {} + + +//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 + + public function arc( + float $start_x, + float $start_y, + float $end_x, + float $end_y, + float $start_angle, + float $end_angle + ): bool {} + +#if MagickLibVersion >= 0x700 + // PAINT_* + public function alpha(float $x, float $y, int $paint): bool {} +#else + /** @deprecated */ + // PAINT_* + public function matte(float $x, float $y, int $paint): bool {} +#endif + + public function polygon(array $coordinates): bool {} + + public function point(float $x, float $y): bool {} + + public function getTextDecoration(): int {} + + public function getTextEncoding(): false|string {} + + public function getFontStretch(): int {} + + // STRETCH_* font_stretch + public function setFontStretch(int $stretch): bool {} + + public function setStrokeAntialias(bool $enabled): bool {} + + // ALIGN_* + public function setTextAlignment(int $align): bool {} + + // DECORATION_* + public function setTextDecoration(int $decoration): bool {} + + public function setTextUnderColor(ImagickPixel|string $under_color): bool {} + + public function setViewbox(int $left_x, int $top_y, int $right_x, int $bottom_y): bool {} + + public function clone(): ImagickDraw {} + + public function affine(array $affine): bool {} + + public function bezier(array $coordinates): bool {} + + // COMPOSITE_* + public function composite( + int $composite, + float $x, + float $y, + float $width, + float $height, + Imagick $image + ): bool {} + + // PAINT_* + public function color(float $x, float $y, int $paint): bool {} + + public function comment(string $comment): bool {} + + public function getClipPath(): false|string {} + + public function getClipRule(): int {} + + public function getClipUnits(): int {} + + public function getFillColor(): ImagickPixel {} + + public function getFillOpacity(): float {} + + public function getFillRule(): int {} + + public function getGravity(): int {} + + public function getStrokeAntialias(): bool {} + + public function getStrokeColor(): ImagickPixel {} + + public function getStrokeDashArray(): array {} + + public function getStrokeDashOffset(): float {} + + public function getStrokeLineCap(): int {} + + public function getStrokeLineJoin(): int {} + + public function getStrokeMiterLimit(): int {} + + public function getStrokeOpacity(): float {} + + public function getStrokeWidth(): float {} + + public function getTextAlignment(): int {} + + public function getTextAntialias(): bool {} + + public function getVectorGraphics(): string {} + + public function getTextUnderColor(): ImagickPixel {} + + public function pathClose(): bool {} + + // We use the following scheme for naming: + // * control points are numbered e.g. x1 + // * end points are not numbered. e.g. x + // + // This makes the functions that have control points match those which + // don't have control points. + +//x1 +//x ordinate of control point for curve beginning +//y1 +//y ordinate of control point for curve beginning +//x2 +//x ordinate of control point for curve ending +//y2 +//y ordinate of control point for curve ending +//x +//x ordinate of the end of the curve +//y +//y ordinate of the end of the curve + public function pathCurveToAbsolute(float $x1, float $y1, float $x2, float $y2, float $x, float $y): bool {} + + public function pathCurveToRelative(float $x1, float $y1, float $x2, float $y2, float $x, float $y): bool {} + + public function pathCurveToQuadraticBezierAbsolute(float $x1, float $y1, float $x_end, float $y): bool {} + + public function pathCurveToQuadraticBezierRelative(float $x1, float $y1, float $x_end, float $y): bool {} + + // TODO - should these be $x_end, float $y_end to be consistent? + // Or should the $x_end be $x above. + public function pathCurveToQuadraticBezierSmoothAbsolute(float $x, float $y): bool {} + + // TODO - should these be $x_end, float $y_end to be consistent + public function pathCurveToQuadraticBezierSmoothRelative(float $x, float $y): bool {} + + public function pathCurveToSmoothAbsolute(float $x2, float $y2, float $x, float $y): bool {} + + public function pathCurveToSmoothRelative(float $x2, float $y2, float $x, float $y): bool {} + + // rx x radius + // ry y radius + // x_axis_rotation indicates how the ellipse as a whole is rotated relative to the current coordinate system + // large_arc If non-zero (true) then draw the larger of the available arcs + // sweep If non-zero (true) then draw the arc matching a clock-wise rotation + public function pathEllipticArcAbsolute( + float $rx, + float $ry, + float $x_axis_rotation, + bool $large_arc, + bool $sweep, + float $x, float $y + ): bool {} + + public function pathEllipticArcRelative( + float $rx, + float $ry, + float $x_axis_rotation, + bool $large_arc, + bool $sweep, + float $x, + float $y + ): bool {} + + public function pathFinish(): bool {} + + public function pathLineToAbsolute(float $x, float $y): bool {} + + public function pathLineToRelative(float $x, float $y): bool {} + + public function pathLineToHorizontalAbsolute(float $x): bool {} + + public function pathLineToHorizontalRelative(float $x): bool {} + + public function pathLineToVerticalAbsolute(float $y): bool {} + + public function pathLineToVerticalRelative(float $y): bool {} + + public function pathMoveToAbsolute(float $x, float $y): bool {} + + public function pathMoveToRelative(float $x, float $y): bool {} + + public function pathStart(): bool {} + + public function polyline(array $coordinates): bool {} + + public function popClipPath(): bool {} + + public function popDefs(): bool {} + + public function popPattern(): bool {} + + public function pushClipPath(string $clip_mask_id): bool {} + + public function pushDefs(): bool {} + + public function pushPattern( + string $pattern_id, + float $x, + float $y, + float $width, + float $height + ): bool {} + + public function render(): bool {} + + public function rotate(float $degrees): bool {} + + public function scale(float $x, float $y): bool {} + + public function setClipPath(string $clip_mask): bool {} + + // FILLRULE_* + public function setClipRule(int $fillrule): bool {} + + // PATHUNITS_* uh, this is unfortunate. The ImageMagick constant + // is call ClipPathUnits. The constant dropped the 'clip' and the + // method call dropped the 'path'. _Maybe_ add a setClipPathUnits + // method, and deprecate this one. Or just ignore the issue. + public function setClipUnits(int $pathunits): bool {} + + public function setFillOpacity(float $opacity): bool {} + + public function setFillPatternUrl(string $fill_url): bool {} + + // FILLRULE_* + public function setFillRule(int $fillrule): bool {} + + // GRAVITY_* + public function setGravity(int $gravity): bool {} + + public function setStrokePatternUrl(string $stroke_url): bool {} + + public function setStrokeDashOffset(float $dash_offset): bool {} + + // LINECAP_* + public function setStrokeLineCap(int $linecap): bool {} + + // LINEJOIN_* + public function setStrokeLineJoin(int $linejoin): bool {} + + // The miterLimit' imposes a limit on the ratio of the miter length to the 'lineWidth'. + public function setStrokeMiterLimit(int $miterlimit): bool {} + + // range 0-1 + public function setStrokeOpacity(float $opacity): bool {} + + public function setVectorGraphics(string $xml): bool {} + + public function pop(): bool {} + + public function push(): bool {} + + // A typical stroke dash array might contain the members 5 3 2. + public function setStrokeDashArray(array|null $dashes): bool {} + +#if MagickLibVersion >= 0x693 + public function getOpacity(): float {} + + // TODO - imply 0 to 1 range. + public function setOpacity(float $opacity): bool {} +#endif + +#if MagickLibVersion >= 0x675 + public function getFontResolution(): array {} + + public function setFontResolution(float $x, float $y): bool {} + + public function getBorderColor(): ImagickPixel {} + + public function setBorderColor(ImagickPixel|string $color): bool {} +#endif + +#if MagickLibVersion >= 0x693 + public function setDensity(string $density): bool {} + + public function getDensity(): ?string {} +#endif + +#if MagickLibVersion >= 0x692 + public function getTextDirection(): int {} + + // DIRECTION_* + public function setTextDirection(int $direction): bool {} +#endif +}
View file
imagick-3.8.0.tgz/imagick-3.8.0/ImagickDraw_arginfo.h
Added
@@ -0,0 +1,1954 @@ +/* This is a generated file, edit the .stub.php file instead. +* Stub hash: regen with 'sh regen_arginfo.sh' +* file has been fixedup for different versions */ + +#if MagickLibVersion > 0x628 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_resetVectorGraphics, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_resetVectorGraphics, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x649 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_getTextKerning, 0, 0, IS_DOUBLE, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_getTextKerning, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x649 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setTextKerning, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setTextKerning, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, kerning, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, kerning) +#endif +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x649 +#define arginfo_class_ImagickDraw_getTextInterwordSpacing arginfo_class_ImagickDraw_getTextKerning +#endif + +#if MagickLibVersion > 0x649 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setTextInterwordSpacing, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setTextInterwordSpacing, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, spacing, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, spacing) +#endif +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x655 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_getTextInterlineSpacing, 0, 0, IS_DOUBLE, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_getTextInterlineSpacing, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x655 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setTextInterlineSpacing, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setTextInterlineSpacing, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, spacing, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, spacing) +#endif +ZEND_END_ARG_INFO() +#endif + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw___construct, 0, 0, 0) +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setFillColor, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setFillColor, 0, 0, 1) +#endif + + ZEND_ARG_OBJ_TYPE_MASK(0, fill_color, ImagickPixel, MAY_BE_STRING, NULL) +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setFillAlpha, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setFillAlpha, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, alpha, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, alpha) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setResolution, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setResolution, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, resolution_x, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, resolution_x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, resolution_y, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, resolution_y) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setStrokeColor, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setStrokeColor, 0, 0, 1) +#endif + + ZEND_ARG_OBJ_TYPE_MASK(0, color, ImagickPixel, MAY_BE_STRING, NULL) +ZEND_END_ARG_INFO() + +#define arginfo_class_ImagickDraw_setStrokeAlpha arginfo_class_ImagickDraw_setFillAlpha + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setStrokeWidth, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setStrokeWidth, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, width, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, width) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_clear, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_clear, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_circle, 0, 4, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_circle, 0, 0, 4) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, origin_x, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, origin_x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, origin_y, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, origin_y) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, perimeter_x, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, perimeter_x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, perimeter_y, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, perimeter_y) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_annotation, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_annotation, 0, 0, 3) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, y) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, text, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, text) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setTextAntialias, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setTextAntialias, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, antialias, _IS_BOOL, 0) +#else + ZEND_ARG_INFO(0, antialias) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setTextEncoding, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setTextEncoding, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, encoding, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, encoding) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setFont, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setFont, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, font_name, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, font_name) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setFontFamily, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setFontFamily, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, font_family, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, font_family) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setFontSize, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setFontSize, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, point_size, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, point_size) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setFontStyle, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setFontStyle, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, style, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, style) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setFontWeight, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setFontWeight, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, weight, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, weight) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_getFont, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_getFont, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() + +#define arginfo_class_ImagickDraw_getFontFamily arginfo_class_ImagickDraw_getFont + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_getFontSize, 0, 0, IS_DOUBLE, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_getFontSize, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_getFontStyle, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_getFontStyle, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() + +#define arginfo_class_ImagickDraw_getFontWeight arginfo_class_ImagickDraw_getFontStyle + +#define arginfo_class_ImagickDraw_destroy arginfo_class_ImagickDraw_clear + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_rectangle, 0, 4, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_rectangle, 0, 0, 4) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, top_left_x, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, top_left_x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, top_left_y, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, top_left_y) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, bottom_right_x, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, bottom_right_x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, bottom_right_y, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, bottom_right_y) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_roundRectangle, 0, 6, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_roundRectangle, 0, 0, 6) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, top_left_x, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, top_left_x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, top_left_y, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, top_left_y) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, bottom_right_x, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, bottom_right_x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, bottom_right_y, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, bottom_right_y) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, rounding_x, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, rounding_x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, rounding_y, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, rounding_y) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_ellipse, 0, 6, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_ellipse, 0, 0, 6) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, origin_x, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, origin_x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, origin_y, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, origin_y) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, radius_x, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, radius_x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, radius_y, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, radius_y) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, angle_start, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, angle_start) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, angle_end, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, angle_end) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_skewX, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_skewX, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, degrees, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, degrees) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_ImagickDraw_skewY arginfo_class_ImagickDraw_skewX + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_translate, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_translate, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, y) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_line, 0, 4, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_line, 0, 0, 4) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, start_x, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, start_x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, start_y, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, start_y) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, end_x, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, end_x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, end_y, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, end_y) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_arc, 0, 6, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_arc, 0, 0, 6) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, start_x, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, start_x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, start_y, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, start_y) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, end_x, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, end_x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, end_y, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, end_y) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, start_angle, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, start_angle) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, end_angle, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, end_angle) +#endif +ZEND_END_ARG_INFO() + +#if MagickLibVersion >= 0x700 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_alpha, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_alpha, 0, 0, 3) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, y) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, paint, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, paint) +#endif +ZEND_END_ARG_INFO() +#endif + +#if !(MagickLibVersion >= 0x700) + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_matte, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_matte, 0, 0, 3) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, y) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, paint, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, paint) +#endif +ZEND_END_ARG_INFO() +#endif + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_polygon, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_polygon, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, coordinates, IS_ARRAY, 0) +#else + ZEND_ARG_INFO(0, coordinates) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_ImagickDraw_point arginfo_class_ImagickDraw_translate + +#define arginfo_class_ImagickDraw_getTextDecoration arginfo_class_ImagickDraw_getFontStyle + + +#if PHP_VERSION_ID >= 80000 + ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_ImagickDraw_getTextEncoding, 0, 0, MAY_BE_FALSE|MAY_BE_STRING) +#else + ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_getTextEncoding, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() + +#define arginfo_class_ImagickDraw_getFontStretch arginfo_class_ImagickDraw_getFontStyle + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setFontStretch, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setFontStretch, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, stretch, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, stretch) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setStrokeAntialias, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setStrokeAntialias, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, enabled, _IS_BOOL, 0) +#else + ZEND_ARG_INFO(0, enabled) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setTextAlignment, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setTextAlignment, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, align, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, align) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setTextDecoration, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setTextDecoration, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, decoration, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, decoration) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setTextUnderColor, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setTextUnderColor, 0, 0, 1) +#endif + + ZEND_ARG_OBJ_TYPE_MASK(0, under_color, ImagickPixel, MAY_BE_STRING, NULL) +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setViewbox, 0, 4, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setViewbox, 0, 0, 4) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, left_x, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, left_x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, top_y, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, top_y) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, right_x, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, right_x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, bottom_y, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, bottom_y) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_ImagickDraw_clone, 0, 0, ImagickDraw, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_clone, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_affine, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_affine, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, affine, IS_ARRAY, 0) +#else + ZEND_ARG_INFO(0, affine) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_ImagickDraw_bezier arginfo_class_ImagickDraw_polygon + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_composite, 0, 6, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_composite, 0, 0, 6) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, composite, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, composite) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, y) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, width, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, width) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, height, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, height) +#endif + ZEND_ARG_OBJ_INFO(0, image, Imagick, 0) +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_color, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_color, 0, 0, 3) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, y) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, paint, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, paint) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_comment, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_comment, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, comment, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, comment) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_ImagickDraw_getClipPath arginfo_class_ImagickDraw_getTextEncoding + +#define arginfo_class_ImagickDraw_getClipRule arginfo_class_ImagickDraw_getFontStyle + +#define arginfo_class_ImagickDraw_getClipUnits arginfo_class_ImagickDraw_getFontStyle + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_ImagickDraw_getFillColor, 0, 0, ImagickPixel, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_getFillColor, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() + +#define arginfo_class_ImagickDraw_getFillOpacity arginfo_class_ImagickDraw_getFontSize + +#define arginfo_class_ImagickDraw_getFillRule arginfo_class_ImagickDraw_getFontStyle + +#define arginfo_class_ImagickDraw_getGravity arginfo_class_ImagickDraw_getFontStyle + +#define arginfo_class_ImagickDraw_getStrokeAntialias arginfo_class_ImagickDraw_clear + +#define arginfo_class_ImagickDraw_getStrokeColor arginfo_class_ImagickDraw_getFillColor + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_getStrokeDashArray, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_getStrokeDashArray, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() + +#define arginfo_class_ImagickDraw_getStrokeDashOffset arginfo_class_ImagickDraw_getFontSize + +#define arginfo_class_ImagickDraw_getStrokeLineCap arginfo_class_ImagickDraw_getFontStyle + +#define arginfo_class_ImagickDraw_getStrokeLineJoin arginfo_class_ImagickDraw_getFontStyle + +#define arginfo_class_ImagickDraw_getStrokeMiterLimit arginfo_class_ImagickDraw_getFontStyle + +#define arginfo_class_ImagickDraw_getStrokeOpacity arginfo_class_ImagickDraw_getFontSize + +#define arginfo_class_ImagickDraw_getStrokeWidth arginfo_class_ImagickDraw_getFontSize + +#define arginfo_class_ImagickDraw_getTextAlignment arginfo_class_ImagickDraw_getFontStyle + +#define arginfo_class_ImagickDraw_getTextAntialias arginfo_class_ImagickDraw_clear + +#define arginfo_class_ImagickDraw_getVectorGraphics arginfo_class_ImagickDraw_getFont + +#define arginfo_class_ImagickDraw_getTextUnderColor arginfo_class_ImagickDraw_getFillColor + +#define arginfo_class_ImagickDraw_pathClose arginfo_class_ImagickDraw_clear + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_pathCurveToAbsolute, 0, 6, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_pathCurveToAbsolute, 0, 0, 6) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x1, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, x1) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y1, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, y1) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x2, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, x2) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y2, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, y2) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, y) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_ImagickDraw_pathCurveToRelative arginfo_class_ImagickDraw_pathCurveToAbsolute + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_pathCurveToQuadraticBezierAbsolute, 0, 4, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_pathCurveToQuadraticBezierAbsolute, 0, 0, 4) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x1, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, x1) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y1, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, y1) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x_end, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, x_end) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, y) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_ImagickDraw_pathCurveToQuadraticBezierRelative arginfo_class_ImagickDraw_pathCurveToQuadraticBezierAbsolute + +#define arginfo_class_ImagickDraw_pathCurveToQuadraticBezierSmoothAbsolute arginfo_class_ImagickDraw_translate + +#define arginfo_class_ImagickDraw_pathCurveToQuadraticBezierSmoothRelative arginfo_class_ImagickDraw_translate + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_pathCurveToSmoothAbsolute, 0, 4, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_pathCurveToSmoothAbsolute, 0, 0, 4) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x2, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, x2) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y2, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, y2) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, y) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_ImagickDraw_pathCurveToSmoothRelative arginfo_class_ImagickDraw_pathCurveToSmoothAbsolute + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_pathEllipticArcAbsolute, 0, 7, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_pathEllipticArcAbsolute, 0, 0, 7) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, rx, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, rx) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, ry, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, ry) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x_axis_rotation, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, x_axis_rotation) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, large_arc, _IS_BOOL, 0) +#else + ZEND_ARG_INFO(0, large_arc) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, sweep, _IS_BOOL, 0) +#else + ZEND_ARG_INFO(0, sweep) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, y) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_ImagickDraw_pathEllipticArcRelative arginfo_class_ImagickDraw_pathEllipticArcAbsolute + +#define arginfo_class_ImagickDraw_pathFinish arginfo_class_ImagickDraw_clear + +#define arginfo_class_ImagickDraw_pathLineToAbsolute arginfo_class_ImagickDraw_translate + +#define arginfo_class_ImagickDraw_pathLineToRelative arginfo_class_ImagickDraw_translate + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_pathLineToHorizontalAbsolute, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_pathLineToHorizontalAbsolute, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, x) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_ImagickDraw_pathLineToHorizontalRelative arginfo_class_ImagickDraw_pathLineToHorizontalAbsolute + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_pathLineToVerticalAbsolute, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_pathLineToVerticalAbsolute, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, y) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_ImagickDraw_pathLineToVerticalRelative arginfo_class_ImagickDraw_pathLineToVerticalAbsolute + +#define arginfo_class_ImagickDraw_pathMoveToAbsolute arginfo_class_ImagickDraw_translate + +#define arginfo_class_ImagickDraw_pathMoveToRelative arginfo_class_ImagickDraw_translate + +#define arginfo_class_ImagickDraw_pathStart arginfo_class_ImagickDraw_clear + +#define arginfo_class_ImagickDraw_polyline arginfo_class_ImagickDraw_polygon + +#define arginfo_class_ImagickDraw_popClipPath arginfo_class_ImagickDraw_clear + +#define arginfo_class_ImagickDraw_popDefs arginfo_class_ImagickDraw_clear + +#define arginfo_class_ImagickDraw_popPattern arginfo_class_ImagickDraw_clear + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_pushClipPath, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_pushClipPath, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, clip_mask_id, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, clip_mask_id) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_ImagickDraw_pushDefs arginfo_class_ImagickDraw_clear + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_pushPattern, 0, 5, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_pushPattern, 0, 0, 5) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, pattern_id, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, pattern_id) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, y) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, width, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, width) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, height, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, height) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_ImagickDraw_render arginfo_class_ImagickDraw_clear + +#define arginfo_class_ImagickDraw_rotate arginfo_class_ImagickDraw_skewX + +#define arginfo_class_ImagickDraw_scale arginfo_class_ImagickDraw_translate + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setClipPath, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setClipPath, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, clip_mask, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, clip_mask) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setClipRule, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setClipRule, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, fillrule, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, fillrule) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setClipUnits, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setClipUnits, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, pathunits, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, pathunits) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setFillOpacity, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setFillOpacity, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, opacity, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, opacity) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setFillPatternUrl, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setFillPatternUrl, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, fill_url, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, fill_url) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_ImagickDraw_setFillRule arginfo_class_ImagickDraw_setClipRule + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setGravity, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setGravity, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, gravity, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, gravity) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setStrokePatternUrl, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setStrokePatternUrl, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, stroke_url, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, stroke_url) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setStrokeDashOffset, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setStrokeDashOffset, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, dash_offset, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, dash_offset) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setStrokeLineCap, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setStrokeLineCap, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, linecap, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, linecap) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setStrokeLineJoin, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setStrokeLineJoin, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, linejoin, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, linejoin) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setStrokeMiterLimit, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setStrokeMiterLimit, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, miterlimit, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, miterlimit) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_ImagickDraw_setStrokeOpacity arginfo_class_ImagickDraw_setFillOpacity + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setVectorGraphics, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setVectorGraphics, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, xml, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, xml) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_ImagickDraw_pop arginfo_class_ImagickDraw_clear + +#define arginfo_class_ImagickDraw_push arginfo_class_ImagickDraw_clear + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setStrokeDashArray, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setStrokeDashArray, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, dashes, IS_ARRAY, 1) +#else + ZEND_ARG_INFO(0, dashes) +#endif +ZEND_END_ARG_INFO() + +#if MagickLibVersion >= 0x693 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_getOpacity, 0, 0, IS_DOUBLE, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_getOpacity, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion >= 0x693 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setOpacity, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setOpacity, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, opacity, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, opacity) +#endif +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion >= 0x675 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_getFontResolution, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_getFontResolution, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion >= 0x675 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setFontResolution, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setFontResolution, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, y) +#endif +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion >= 0x675 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_ImagickDraw_getBorderColor, 0, 0, ImagickPixel, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_getBorderColor, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion >= 0x675 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setBorderColor, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setBorderColor, 0, 0, 1) +#endif + + ZEND_ARG_OBJ_TYPE_MASK(0, color, ImagickPixel, MAY_BE_STRING, NULL) +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion >= 0x693 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setDensity, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setDensity, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, density, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, density) +#endif +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion >= 0x693 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_getDensity, 0, 0, IS_STRING, 1) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_getDensity, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion >= 0x692 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_getTextDirection, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_getTextDirection, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion >= 0x692 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setTextDirection, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setTextDirection, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, direction, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, direction) +#endif +ZEND_END_ARG_INFO() +#endif + + +#if MagickLibVersion > 0x628 +ZEND_METHOD(ImagickDraw, resetVectorGraphics); +#endif +#if MagickLibVersion > 0x649 +ZEND_METHOD(ImagickDraw, getTextKerning); +#endif +#if MagickLibVersion > 0x649 +ZEND_METHOD(ImagickDraw, setTextKerning); +#endif +#if MagickLibVersion > 0x649 +ZEND_METHOD(ImagickDraw, getTextInterwordSpacing); +#endif +#if MagickLibVersion > 0x649 +ZEND_METHOD(ImagickDraw, setTextInterwordSpacing); +#endif +#if MagickLibVersion > 0x655 +ZEND_METHOD(ImagickDraw, getTextInterlineSpacing); +#endif +#if MagickLibVersion > 0x655 +ZEND_METHOD(ImagickDraw, setTextInterlineSpacing); +#endif +ZEND_METHOD(ImagickDraw, __construct); +ZEND_METHOD(ImagickDraw, setFillColor); +ZEND_METHOD(ImagickDraw, setFillAlpha); +ZEND_METHOD(ImagickDraw, setResolution); +ZEND_METHOD(ImagickDraw, setStrokeColor); +ZEND_METHOD(ImagickDraw, setStrokeAlpha); +ZEND_METHOD(ImagickDraw, setStrokeWidth); +ZEND_METHOD(ImagickDraw, clear); +ZEND_METHOD(ImagickDraw, circle); +ZEND_METHOD(ImagickDraw, annotation); +ZEND_METHOD(ImagickDraw, setTextAntialias); +ZEND_METHOD(ImagickDraw, setTextEncoding); +ZEND_METHOD(ImagickDraw, setFont); +ZEND_METHOD(ImagickDraw, setFontFamily); +ZEND_METHOD(ImagickDraw, setFontSize); +ZEND_METHOD(ImagickDraw, setFontStyle); +ZEND_METHOD(ImagickDraw, setFontWeight); +ZEND_METHOD(ImagickDraw, getFont); +ZEND_METHOD(ImagickDraw, getFontFamily); +ZEND_METHOD(ImagickDraw, getFontSize); +ZEND_METHOD(ImagickDraw, getFontStyle); +ZEND_METHOD(ImagickDraw, getFontWeight); +ZEND_METHOD(ImagickDraw, rectangle); +ZEND_METHOD(ImagickDraw, roundRectangle); +ZEND_METHOD(ImagickDraw, ellipse); +ZEND_METHOD(ImagickDraw, skewX); +ZEND_METHOD(ImagickDraw, skewY); +ZEND_METHOD(ImagickDraw, translate); +ZEND_METHOD(ImagickDraw, line); +ZEND_METHOD(ImagickDraw, arc); +#if MagickLibVersion >= 0x700 +ZEND_METHOD(ImagickDraw, alpha); +#endif +#if !(MagickLibVersion >= 0x700) +ZEND_METHOD(ImagickDraw, matte); +#endif +ZEND_METHOD(ImagickDraw, polygon); +ZEND_METHOD(ImagickDraw, point); +ZEND_METHOD(ImagickDraw, getTextDecoration); +ZEND_METHOD(ImagickDraw, getTextEncoding); +ZEND_METHOD(ImagickDraw, getFontStretch); +ZEND_METHOD(ImagickDraw, setFontStretch); +ZEND_METHOD(ImagickDraw, setStrokeAntialias); +ZEND_METHOD(ImagickDraw, setTextAlignment); +ZEND_METHOD(ImagickDraw, setTextDecoration); +ZEND_METHOD(ImagickDraw, setTextUnderColor); +ZEND_METHOD(ImagickDraw, setViewbox); +ZEND_METHOD(ImagickDraw, clone); +ZEND_METHOD(ImagickDraw, affine); +ZEND_METHOD(ImagickDraw, bezier); +ZEND_METHOD(ImagickDraw, composite); +ZEND_METHOD(ImagickDraw, color); +ZEND_METHOD(ImagickDraw, comment); +ZEND_METHOD(ImagickDraw, getClipPath); +ZEND_METHOD(ImagickDraw, getClipRule); +ZEND_METHOD(ImagickDraw, getClipUnits); +ZEND_METHOD(ImagickDraw, getFillColor); +ZEND_METHOD(ImagickDraw, getFillOpacity); +ZEND_METHOD(ImagickDraw, getFillRule); +ZEND_METHOD(ImagickDraw, getGravity); +ZEND_METHOD(ImagickDraw, getStrokeAntialias); +ZEND_METHOD(ImagickDraw, getStrokeColor); +ZEND_METHOD(ImagickDraw, getStrokeDashArray); +ZEND_METHOD(ImagickDraw, getStrokeDashOffset); +ZEND_METHOD(ImagickDraw, getStrokeLineCap); +ZEND_METHOD(ImagickDraw, getStrokeLineJoin); +ZEND_METHOD(ImagickDraw, getStrokeMiterLimit); +ZEND_METHOD(ImagickDraw, getStrokeOpacity); +ZEND_METHOD(ImagickDraw, getStrokeWidth); +ZEND_METHOD(ImagickDraw, getTextAlignment); +ZEND_METHOD(ImagickDraw, getTextAntialias); +ZEND_METHOD(ImagickDraw, getVectorGraphics); +ZEND_METHOD(ImagickDraw, getTextUnderColor); +ZEND_METHOD(ImagickDraw, pathClose); +ZEND_METHOD(ImagickDraw, pathCurveToAbsolute); +ZEND_METHOD(ImagickDraw, pathCurveToRelative); +ZEND_METHOD(ImagickDraw, pathCurveToQuadraticBezierAbsolute); +ZEND_METHOD(ImagickDraw, pathCurveToQuadraticBezierRelative); +ZEND_METHOD(ImagickDraw, pathCurveToQuadraticBezierSmoothAbsolute); +ZEND_METHOD(ImagickDraw, pathCurveToQuadraticBezierSmoothRelative); +ZEND_METHOD(ImagickDraw, pathCurveToSmoothAbsolute); +ZEND_METHOD(ImagickDraw, pathCurveToSmoothRelative); +ZEND_METHOD(ImagickDraw, pathEllipticArcAbsolute); +ZEND_METHOD(ImagickDraw, pathEllipticArcRelative); +ZEND_METHOD(ImagickDraw, pathFinish); +ZEND_METHOD(ImagickDraw, pathLineToAbsolute); +ZEND_METHOD(ImagickDraw, pathLineToRelative); +ZEND_METHOD(ImagickDraw, pathLineToHorizontalAbsolute); +ZEND_METHOD(ImagickDraw, pathLineToHorizontalRelative); +ZEND_METHOD(ImagickDraw, pathLineToVerticalAbsolute); +ZEND_METHOD(ImagickDraw, pathLineToVerticalRelative); +ZEND_METHOD(ImagickDraw, pathMoveToAbsolute); +ZEND_METHOD(ImagickDraw, pathMoveToRelative); +ZEND_METHOD(ImagickDraw, pathStart); +ZEND_METHOD(ImagickDraw, polyline); +ZEND_METHOD(ImagickDraw, popClipPath); +ZEND_METHOD(ImagickDraw, popDefs); +ZEND_METHOD(ImagickDraw, popPattern); +ZEND_METHOD(ImagickDraw, pushClipPath); +ZEND_METHOD(ImagickDraw, pushDefs); +ZEND_METHOD(ImagickDraw, pushPattern); +ZEND_METHOD(ImagickDraw, render); +ZEND_METHOD(ImagickDraw, rotate); +ZEND_METHOD(ImagickDraw, scale); +ZEND_METHOD(ImagickDraw, setClipPath); +ZEND_METHOD(ImagickDraw, setClipRule); +ZEND_METHOD(ImagickDraw, setClipUnits); +ZEND_METHOD(ImagickDraw, setFillOpacity); +ZEND_METHOD(ImagickDraw, setFillPatternUrl); +ZEND_METHOD(ImagickDraw, setFillRule); +ZEND_METHOD(ImagickDraw, setGravity); +ZEND_METHOD(ImagickDraw, setStrokePatternUrl); +ZEND_METHOD(ImagickDraw, setStrokeDashOffset); +ZEND_METHOD(ImagickDraw, setStrokeLineCap); +ZEND_METHOD(ImagickDraw, setStrokeLineJoin); +ZEND_METHOD(ImagickDraw, setStrokeMiterLimit); +ZEND_METHOD(ImagickDraw, setStrokeOpacity); +ZEND_METHOD(ImagickDraw, setVectorGraphics); +ZEND_METHOD(ImagickDraw, pop); +ZEND_METHOD(ImagickDraw, push); +ZEND_METHOD(ImagickDraw, setStrokeDashArray); +#if MagickLibVersion >= 0x693 +ZEND_METHOD(ImagickDraw, getOpacity); +#endif +#if MagickLibVersion >= 0x693 +ZEND_METHOD(ImagickDraw, setOpacity); +#endif +#if MagickLibVersion >= 0x675 +ZEND_METHOD(ImagickDraw, getFontResolution); +#endif +#if MagickLibVersion >= 0x675 +ZEND_METHOD(ImagickDraw, setFontResolution); +#endif +#if MagickLibVersion >= 0x675 +ZEND_METHOD(ImagickDraw, getBorderColor); +#endif +#if MagickLibVersion >= 0x675 +ZEND_METHOD(ImagickDraw, setBorderColor); +#endif +#if MagickLibVersion >= 0x693 +ZEND_METHOD(ImagickDraw, setDensity); +#endif +#if MagickLibVersion >= 0x693 +ZEND_METHOD(ImagickDraw, getDensity); +#endif +#if MagickLibVersion >= 0x692 +ZEND_METHOD(ImagickDraw, getTextDirection); +#endif +#if MagickLibVersion >= 0x692 +ZEND_METHOD(ImagickDraw, setTextDirection); +#endif + + +static const zend_function_entry class_ImagickDraw_methods = { +#if MagickLibVersion > 0x628 + ZEND_ME(ImagickDraw, resetVectorGraphics, arginfo_class_ImagickDraw_resetVectorGraphics, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x649 + ZEND_ME(ImagickDraw, getTextKerning, arginfo_class_ImagickDraw_getTextKerning, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x649 + ZEND_ME(ImagickDraw, setTextKerning, arginfo_class_ImagickDraw_setTextKerning, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x649 + ZEND_ME(ImagickDraw, getTextInterwordSpacing, arginfo_class_ImagickDraw_getTextInterwordSpacing, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x649 + ZEND_ME(ImagickDraw, setTextInterwordSpacing, arginfo_class_ImagickDraw_setTextInterwordSpacing, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x655 + ZEND_ME(ImagickDraw, getTextInterlineSpacing, arginfo_class_ImagickDraw_getTextInterlineSpacing, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x655 + ZEND_ME(ImagickDraw, setTextInterlineSpacing, arginfo_class_ImagickDraw_setTextInterlineSpacing, ZEND_ACC_PUBLIC) +#endif + ZEND_ME(ImagickDraw, __construct, arginfo_class_ImagickDraw___construct, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, setFillColor, arginfo_class_ImagickDraw_setFillColor, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, setFillAlpha, arginfo_class_ImagickDraw_setFillAlpha, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, setResolution, arginfo_class_ImagickDraw_setResolution, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, setStrokeColor, arginfo_class_ImagickDraw_setStrokeColor, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, setStrokeAlpha, arginfo_class_ImagickDraw_setStrokeAlpha, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, setStrokeWidth, arginfo_class_ImagickDraw_setStrokeWidth, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, clear, arginfo_class_ImagickDraw_clear, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, circle, arginfo_class_ImagickDraw_circle, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, annotation, arginfo_class_ImagickDraw_annotation, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, setTextAntialias, arginfo_class_ImagickDraw_setTextAntialias, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, setTextEncoding, arginfo_class_ImagickDraw_setTextEncoding, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, setFont, arginfo_class_ImagickDraw_setFont, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, setFontFamily, arginfo_class_ImagickDraw_setFontFamily, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, setFontSize, arginfo_class_ImagickDraw_setFontSize, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, setFontStyle, arginfo_class_ImagickDraw_setFontStyle, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, setFontWeight, arginfo_class_ImagickDraw_setFontWeight, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, getFont, arginfo_class_ImagickDraw_getFont, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, getFontFamily, arginfo_class_ImagickDraw_getFontFamily, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, getFontSize, arginfo_class_ImagickDraw_getFontSize, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, getFontStyle, arginfo_class_ImagickDraw_getFontStyle, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, getFontWeight, arginfo_class_ImagickDraw_getFontWeight, ZEND_ACC_PUBLIC) + ZEND_MALIAS(ImagickDraw, destroy, clear, arginfo_class_ImagickDraw_destroy, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, rectangle, arginfo_class_ImagickDraw_rectangle, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, roundRectangle, arginfo_class_ImagickDraw_roundRectangle, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, ellipse, arginfo_class_ImagickDraw_ellipse, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, skewX, arginfo_class_ImagickDraw_skewX, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, skewY, arginfo_class_ImagickDraw_skewY, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, translate, arginfo_class_ImagickDraw_translate, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, line, arginfo_class_ImagickDraw_line, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, arc, arginfo_class_ImagickDraw_arc, ZEND_ACC_PUBLIC) +#if MagickLibVersion >= 0x700 + ZEND_ME(ImagickDraw, alpha, arginfo_class_ImagickDraw_alpha, ZEND_ACC_PUBLIC) +#endif +#if !(MagickLibVersion >= 0x700) + ZEND_ME(ImagickDraw, matte, arginfo_class_ImagickDraw_matte, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) +#endif + ZEND_ME(ImagickDraw, polygon, arginfo_class_ImagickDraw_polygon, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, point, arginfo_class_ImagickDraw_point, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, getTextDecoration, arginfo_class_ImagickDraw_getTextDecoration, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, getTextEncoding, arginfo_class_ImagickDraw_getTextEncoding, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, getFontStretch, arginfo_class_ImagickDraw_getFontStretch, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, setFontStretch, arginfo_class_ImagickDraw_setFontStretch, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, setStrokeAntialias, arginfo_class_ImagickDraw_setStrokeAntialias, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, setTextAlignment, arginfo_class_ImagickDraw_setTextAlignment, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, setTextDecoration, arginfo_class_ImagickDraw_setTextDecoration, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, setTextUnderColor, arginfo_class_ImagickDraw_setTextUnderColor, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, setViewbox, arginfo_class_ImagickDraw_setViewbox, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, clone, arginfo_class_ImagickDraw_clone, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, affine, arginfo_class_ImagickDraw_affine, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, bezier, arginfo_class_ImagickDraw_bezier, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, composite, arginfo_class_ImagickDraw_composite, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, color, arginfo_class_ImagickDraw_color, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, comment, arginfo_class_ImagickDraw_comment, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, getClipPath, arginfo_class_ImagickDraw_getClipPath, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, getClipRule, arginfo_class_ImagickDraw_getClipRule, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, getClipUnits, arginfo_class_ImagickDraw_getClipUnits, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, getFillColor, arginfo_class_ImagickDraw_getFillColor, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, getFillOpacity, arginfo_class_ImagickDraw_getFillOpacity, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, getFillRule, arginfo_class_ImagickDraw_getFillRule, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, getGravity, arginfo_class_ImagickDraw_getGravity, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, getStrokeAntialias, arginfo_class_ImagickDraw_getStrokeAntialias, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, getStrokeColor, arginfo_class_ImagickDraw_getStrokeColor, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, getStrokeDashArray, arginfo_class_ImagickDraw_getStrokeDashArray, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, getStrokeDashOffset, arginfo_class_ImagickDraw_getStrokeDashOffset, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, getStrokeLineCap, arginfo_class_ImagickDraw_getStrokeLineCap, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, getStrokeLineJoin, arginfo_class_ImagickDraw_getStrokeLineJoin, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, getStrokeMiterLimit, arginfo_class_ImagickDraw_getStrokeMiterLimit, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, getStrokeOpacity, arginfo_class_ImagickDraw_getStrokeOpacity, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, getStrokeWidth, arginfo_class_ImagickDraw_getStrokeWidth, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, getTextAlignment, arginfo_class_ImagickDraw_getTextAlignment, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, getTextAntialias, arginfo_class_ImagickDraw_getTextAntialias, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, getVectorGraphics, arginfo_class_ImagickDraw_getVectorGraphics, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, getTextUnderColor, arginfo_class_ImagickDraw_getTextUnderColor, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, pathClose, arginfo_class_ImagickDraw_pathClose, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, pathCurveToAbsolute, arginfo_class_ImagickDraw_pathCurveToAbsolute, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, pathCurveToRelative, arginfo_class_ImagickDraw_pathCurveToRelative, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, pathCurveToQuadraticBezierAbsolute, arginfo_class_ImagickDraw_pathCurveToQuadraticBezierAbsolute, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, pathCurveToQuadraticBezierRelative, arginfo_class_ImagickDraw_pathCurveToQuadraticBezierRelative, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, pathCurveToQuadraticBezierSmoothAbsolute, arginfo_class_ImagickDraw_pathCurveToQuadraticBezierSmoothAbsolute, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, pathCurveToQuadraticBezierSmoothRelative, arginfo_class_ImagickDraw_pathCurveToQuadraticBezierSmoothRelative, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, pathCurveToSmoothAbsolute, arginfo_class_ImagickDraw_pathCurveToSmoothAbsolute, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, pathCurveToSmoothRelative, arginfo_class_ImagickDraw_pathCurveToSmoothRelative, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, pathEllipticArcAbsolute, arginfo_class_ImagickDraw_pathEllipticArcAbsolute, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, pathEllipticArcRelative, arginfo_class_ImagickDraw_pathEllipticArcRelative, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, pathFinish, arginfo_class_ImagickDraw_pathFinish, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, pathLineToAbsolute, arginfo_class_ImagickDraw_pathLineToAbsolute, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, pathLineToRelative, arginfo_class_ImagickDraw_pathLineToRelative, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, pathLineToHorizontalAbsolute, arginfo_class_ImagickDraw_pathLineToHorizontalAbsolute, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, pathLineToHorizontalRelative, arginfo_class_ImagickDraw_pathLineToHorizontalRelative, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, pathLineToVerticalAbsolute, arginfo_class_ImagickDraw_pathLineToVerticalAbsolute, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, pathLineToVerticalRelative, arginfo_class_ImagickDraw_pathLineToVerticalRelative, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, pathMoveToAbsolute, arginfo_class_ImagickDraw_pathMoveToAbsolute, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, pathMoveToRelative, arginfo_class_ImagickDraw_pathMoveToRelative, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, pathStart, arginfo_class_ImagickDraw_pathStart, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, polyline, arginfo_class_ImagickDraw_polyline, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, popClipPath, arginfo_class_ImagickDraw_popClipPath, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, popDefs, arginfo_class_ImagickDraw_popDefs, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, popPattern, arginfo_class_ImagickDraw_popPattern, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, pushClipPath, arginfo_class_ImagickDraw_pushClipPath, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, pushDefs, arginfo_class_ImagickDraw_pushDefs, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, pushPattern, arginfo_class_ImagickDraw_pushPattern, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, render, arginfo_class_ImagickDraw_render, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, rotate, arginfo_class_ImagickDraw_rotate, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, scale, arginfo_class_ImagickDraw_scale, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, setClipPath, arginfo_class_ImagickDraw_setClipPath, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, setClipRule, arginfo_class_ImagickDraw_setClipRule, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, setClipUnits, arginfo_class_ImagickDraw_setClipUnits, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, setFillOpacity, arginfo_class_ImagickDraw_setFillOpacity, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, setFillPatternUrl, arginfo_class_ImagickDraw_setFillPatternUrl, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, setFillRule, arginfo_class_ImagickDraw_setFillRule, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, setGravity, arginfo_class_ImagickDraw_setGravity, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, setStrokePatternUrl, arginfo_class_ImagickDraw_setStrokePatternUrl, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, setStrokeDashOffset, arginfo_class_ImagickDraw_setStrokeDashOffset, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, setStrokeLineCap, arginfo_class_ImagickDraw_setStrokeLineCap, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, setStrokeLineJoin, arginfo_class_ImagickDraw_setStrokeLineJoin, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, setStrokeMiterLimit, arginfo_class_ImagickDraw_setStrokeMiterLimit, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, setStrokeOpacity, arginfo_class_ImagickDraw_setStrokeOpacity, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, setVectorGraphics, arginfo_class_ImagickDraw_setVectorGraphics, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, pop, arginfo_class_ImagickDraw_pop, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, push, arginfo_class_ImagickDraw_push, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickDraw, setStrokeDashArray, arginfo_class_ImagickDraw_setStrokeDashArray, ZEND_ACC_PUBLIC) +#if MagickLibVersion >= 0x693 + ZEND_ME(ImagickDraw, getOpacity, arginfo_class_ImagickDraw_getOpacity, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion >= 0x693 + ZEND_ME(ImagickDraw, setOpacity, arginfo_class_ImagickDraw_setOpacity, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion >= 0x675 + ZEND_ME(ImagickDraw, getFontResolution, arginfo_class_ImagickDraw_getFontResolution, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion >= 0x675 + ZEND_ME(ImagickDraw, setFontResolution, arginfo_class_ImagickDraw_setFontResolution, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion >= 0x675 + ZEND_ME(ImagickDraw, getBorderColor, arginfo_class_ImagickDraw_getBorderColor, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion >= 0x675 + ZEND_ME(ImagickDraw, setBorderColor, arginfo_class_ImagickDraw_setBorderColor, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion >= 0x693 + ZEND_ME(ImagickDraw, setDensity, arginfo_class_ImagickDraw_setDensity, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion >= 0x693 + ZEND_ME(ImagickDraw, getDensity, arginfo_class_ImagickDraw_getDensity, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion >= 0x692 + ZEND_ME(ImagickDraw, getTextDirection, arginfo_class_ImagickDraw_getTextDirection, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion >= 0x692 + ZEND_ME(ImagickDraw, setTextDirection, arginfo_class_ImagickDraw_setTextDirection, ZEND_ACC_PUBLIC) +#endif + ZEND_FE_END +}; \ No newline at end of file
View file
imagick-3.8.0.tgz/imagick-3.8.0/ImagickKernel.stub.php
Added
@@ -0,0 +1,28 @@ +<?php + +/** + * @generate-function-entries + * @generate-legacy-arginfo 70000 + */ + +#ifdef IMAGICK_WITH_KERNEL +class ImagickKernel +{ + public function addKernel(ImagickKernel $kernel): void {} + + public function addUnityKernel(float $scale): void {} + + // KERNEL_* + public static function fromBuiltin(int $kernel, string $shape): ImagickKernel {} + + public static function fromMatrix(array $matrix, ?array $origin = null): ImagickKernel {} + + public function getMatrix(): array {} + + // NORMALIZE_KERNEL_ + public function scale(float $scale, ?int $normalize_kernel = null): void {} + + public function separate(): array {} +} +#endif +
View file
imagick-3.8.0.tgz/imagick-3.8.0/ImagickKernel_arginfo.h
Added
@@ -0,0 +1,155 @@ +/* This is a generated file, edit the .stub.php file instead. +* Stub hash: regen with 'sh regen_arginfo.sh' +* file has been fixedup for different versions */ + +#if defined(IMAGICK_WITH_KERNEL) + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickKernel_addKernel, 0, 1, IS_VOID, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickKernel_addKernel, 0, 0, 1) +#endif + + ZEND_ARG_OBJ_INFO(0, kernel, ImagickKernel, 0) +ZEND_END_ARG_INFO() +#endif + +#if defined(IMAGICK_WITH_KERNEL) + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickKernel_addUnityKernel, 0, 1, IS_VOID, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickKernel_addUnityKernel, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, scale, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, scale) +#endif +ZEND_END_ARG_INFO() +#endif + +#if defined(IMAGICK_WITH_KERNEL) + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_ImagickKernel_fromBuiltin, 0, 2, ImagickKernel, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickKernel_fromBuiltin, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, kernel, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, kernel) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, shape, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, shape) +#endif +ZEND_END_ARG_INFO() +#endif + +#if defined(IMAGICK_WITH_KERNEL) + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_ImagickKernel_fromMatrix, 0, 1, ImagickKernel, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickKernel_fromMatrix, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, matrix, IS_ARRAY, 0) +#else + ZEND_ARG_INFO(0, matrix) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, origin, IS_ARRAY, 1, "null") +#else + ZEND_ARG_INFO(0, origin) +#endif + +ZEND_END_ARG_INFO() +#endif + +#if defined(IMAGICK_WITH_KERNEL) + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickKernel_getMatrix, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickKernel_getMatrix, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + +#if defined(IMAGICK_WITH_KERNEL) + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickKernel_scale, 0, 1, IS_VOID, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickKernel_scale, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, scale, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, scale) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, normalize_kernel, IS_LONG, 1, "null") +#else + ZEND_ARG_INFO(0, normalize_kernel) +#endif + +ZEND_END_ARG_INFO() +#endif + +#if defined(IMAGICK_WITH_KERNEL) +#define arginfo_class_ImagickKernel_separate arginfo_class_ImagickKernel_getMatrix +#endif + + +#if defined(IMAGICK_WITH_KERNEL) +ZEND_METHOD(ImagickKernel, addKernel); +#endif +#if defined(IMAGICK_WITH_KERNEL) +ZEND_METHOD(ImagickKernel, addUnityKernel); +#endif +#if defined(IMAGICK_WITH_KERNEL) +ZEND_METHOD(ImagickKernel, fromBuiltin); +#endif +#if defined(IMAGICK_WITH_KERNEL) +ZEND_METHOD(ImagickKernel, fromMatrix); +#endif +#if defined(IMAGICK_WITH_KERNEL) +ZEND_METHOD(ImagickKernel, getMatrix); +#endif +#if defined(IMAGICK_WITH_KERNEL) +ZEND_METHOD(ImagickKernel, scale); +#endif +#if defined(IMAGICK_WITH_KERNEL) +ZEND_METHOD(ImagickKernel, separate); +#endif + + +#if defined(IMAGICK_WITH_KERNEL) +static const zend_function_entry class_ImagickKernel_methods = { + ZEND_ME(ImagickKernel, addKernel, arginfo_class_ImagickKernel_addKernel, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickKernel, addUnityKernel, arginfo_class_ImagickKernel_addUnityKernel, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickKernel, fromBuiltin, arginfo_class_ImagickKernel_fromBuiltin, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + ZEND_ME(ImagickKernel, fromMatrix, arginfo_class_ImagickKernel_fromMatrix, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + ZEND_ME(ImagickKernel, getMatrix, arginfo_class_ImagickKernel_getMatrix, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickKernel, scale, arginfo_class_ImagickKernel_scale, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickKernel, separate, arginfo_class_ImagickKernel_separate, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; +#endif \ No newline at end of file
View file
imagick-3.8.0.tgz/imagick-3.8.0/ImagickPixel.stub.php
Added
@@ -0,0 +1,86 @@ +<?php + +/** + * @generate-function-entries + * @generate-legacy-arginfo 70000 + */ + +class ImagickPixel +{ + public function __construct(?string $color = null) {} + + public function clear(): bool {} + + /** @alias ImagickPixel::clear */ + public function destroy(): bool {} + + public function getColor(int $normalized = 0): array {} + + public function getColorAsString(): string {} + + public function getColorCount(): int {} + + public function getColorQuantum(): array {} + + // COLOR_* + public function getColorValue(int $color): float {} + + /** + * $color // COLOR_* + * return + * - Float if IM compiled with HDRI + * - int if IM compiled with fixed point math + */ + public function getColorValueQuantum(int $color): IMAGICK_QUANTUM_TYPE {} + + public function getHSL(): array {} + + public function getIndex(): int {} + + public function isPixelSimilar(ImagickPixel|string $color, float $fuzz): ?bool {} + + // The fuzz value should be in the range 0-QuantumRange. The maximum value + // represents the longest possible distance in the colorspace. e.g. from + // RGB(0, 0, 0) to RGB(255, 255, 255) for the RGB colorspace + public function isPixelSimilarQuantum(ImagickPixel|string $color, float $fuzz_quantum_range_scaled_by_square_root_of_three): ?bool {} + + /** @alias ImagickPixel::isPixelSimilarQuantum */ + + public function isSimilar( + ImagickPixel|string $color, + // Feel free to not use named params for this. + float $fuzz_quantum_range_scaled_by_square_root_of_three + ): ?bool{} + + public function setColor(string $color): bool {} + + public function setColorCount(int $color_count): bool {} + + // COLOR_* + public function setColorValue(int $color, float $value): bool {} + + /** + * $color // COLOR_* + * $value + * + * Type of value depends on how ImageMagick was compiled. + * - Float if IM compiled with HDRI + * - int if IM compiled with fixed point math + * + */ + public function setColorValueQuantum(int $color, IMAGICK_QUANTUM_TYPE $value): bool{} + + public function setHSL(float $hue, float $saturation , float $luminosity): bool{} + + // This function could be described more clearly... + // https://imagemagick.org/api/pixel-wand.php#PixelSetIndex + public function setIndex(IMAGICK_QUANTUM_TYPE $index): bool {} + + //// Not in docs. +#if MagickLibVersion >= 0x693 + public function setColorFromPixel(ImagickPixel $pixel): bool {} +#endif +} + + +
View file
imagick-3.8.0.tgz/imagick-3.8.0/ImagickPixelIterator.stub.php
Added
@@ -0,0 +1,63 @@ +<?php + +/** + * @generate-function-entries + * @generate-legacy-arginfo 70000 + */ +class ImagickPixelIterator { + public function __construct(Imagick $imagick) {} + + public function clear(): bool {} + + public static function getPixelIterator(Imagick $imagick) : ImagickPixelIterator {} + + public static function getPixelRegionIterator( + Imagick $imagick, + int $x, + int $y, + int $columns, + int $rows): ImagickPixelIterator {} + + + /** @alias ImagickPixelIterator::clear */ + public function destroy(): bool {} + + public function getCurrentIteratorRow(): ?array {} + + public function getIteratorRow(): int {} + + public function getNextIteratorRow(): ?array {} + + public function getPreviousIteratorRow(): array {} + + /** @alias ImagickPixelIterator::getIteratorRow */ + public function key(): int {} + + public function next(): void {} + + public function rewind(): void {} + + /** @alias ImagickPixelIterator::getCurrentIteratorRow */ + public function current(): ?array {} + + public function newPixelIterator(Imagick $imagick): bool {} + + public function newPixelRegionIterator( + Imagick $imagick, + int $x, + int $y, + int $columns, + int $rows): bool {} + + public function resetIterator(): bool {} + + public function setIteratorFirstRow(): bool {} + + public function setIteratorLastRow(): bool {} + + public function setIteratorRow(int $row): bool {} + + public function syncIterator(): bool {} + + public function valid(): bool {} +}
View file
imagick-3.8.0.tgz/imagick-3.8.0/ImagickPixelIterator_arginfo.h
Added
@@ -0,0 +1,221 @@ +/* This is a generated file, edit the .stub.php file instead. +* Stub hash: regen with 'sh regen_arginfo.sh' +* file has been fixedup for different versions */ + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixelIterator___construct, 0, 0, 1) + ZEND_ARG_OBJ_INFO(0, imagick, Imagick, 0) +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixelIterator_clear, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixelIterator_clear, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_ImagickPixelIterator_getPixelIterator, 0, 1, ImagickPixelIterator, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixelIterator_getPixelIterator, 0, 0, 1) +#endif + + ZEND_ARG_OBJ_INFO(0, imagick, Imagick, 0) +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_ImagickPixelIterator_getPixelRegionIterator, 0, 5, ImagickPixelIterator, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixelIterator_getPixelRegionIterator, 0, 0, 5) +#endif + + ZEND_ARG_OBJ_INFO(0, imagick, Imagick, 0) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, y) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, columns, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, columns) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, rows, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, rows) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_ImagickPixelIterator_destroy arginfo_class_ImagickPixelIterator_clear + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixelIterator_getCurrentIteratorRow, 0, 0, IS_ARRAY, 1) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixelIterator_getCurrentIteratorRow, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixelIterator_getIteratorRow, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixelIterator_getIteratorRow, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() + +#define arginfo_class_ImagickPixelIterator_getNextIteratorRow arginfo_class_ImagickPixelIterator_getCurrentIteratorRow + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixelIterator_getPreviousIteratorRow, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixelIterator_getPreviousIteratorRow, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() + +#define arginfo_class_ImagickPixelIterator_key arginfo_class_ImagickPixelIterator_getIteratorRow + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixelIterator_next, 0, 0, IS_VOID, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixelIterator_next, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() + +#define arginfo_class_ImagickPixelIterator_rewind arginfo_class_ImagickPixelIterator_next + +#define arginfo_class_ImagickPixelIterator_current arginfo_class_ImagickPixelIterator_getCurrentIteratorRow + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixelIterator_newPixelIterator, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixelIterator_newPixelIterator, 0, 0, 1) +#endif + + ZEND_ARG_OBJ_INFO(0, imagick, Imagick, 0) +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixelIterator_newPixelRegionIterator, 0, 5, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixelIterator_newPixelRegionIterator, 0, 0, 5) +#endif + + ZEND_ARG_OBJ_INFO(0, imagick, Imagick, 0) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, y) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, columns, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, columns) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, rows, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, rows) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_ImagickPixelIterator_resetIterator arginfo_class_ImagickPixelIterator_clear + +#define arginfo_class_ImagickPixelIterator_setIteratorFirstRow arginfo_class_ImagickPixelIterator_clear + +#define arginfo_class_ImagickPixelIterator_setIteratorLastRow arginfo_class_ImagickPixelIterator_clear + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixelIterator_setIteratorRow, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixelIterator_setIteratorRow, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, row, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, row) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_ImagickPixelIterator_syncIterator arginfo_class_ImagickPixelIterator_clear + +#define arginfo_class_ImagickPixelIterator_valid arginfo_class_ImagickPixelIterator_clear + + +ZEND_METHOD(ImagickPixelIterator, __construct); +ZEND_METHOD(ImagickPixelIterator, clear); +ZEND_METHOD(ImagickPixelIterator, getPixelIterator); +ZEND_METHOD(ImagickPixelIterator, getPixelRegionIterator); +ZEND_METHOD(ImagickPixelIterator, getCurrentIteratorRow); +ZEND_METHOD(ImagickPixelIterator, getIteratorRow); +ZEND_METHOD(ImagickPixelIterator, getNextIteratorRow); +ZEND_METHOD(ImagickPixelIterator, getPreviousIteratorRow); +ZEND_METHOD(ImagickPixelIterator, next); +ZEND_METHOD(ImagickPixelIterator, rewind); +ZEND_METHOD(ImagickPixelIterator, newPixelIterator); +ZEND_METHOD(ImagickPixelIterator, newPixelRegionIterator); +ZEND_METHOD(ImagickPixelIterator, resetIterator); +ZEND_METHOD(ImagickPixelIterator, setIteratorFirstRow); +ZEND_METHOD(ImagickPixelIterator, setIteratorLastRow); +ZEND_METHOD(ImagickPixelIterator, setIteratorRow); +ZEND_METHOD(ImagickPixelIterator, syncIterator); +ZEND_METHOD(ImagickPixelIterator, valid); + + +static const zend_function_entry class_ImagickPixelIterator_methods = { + ZEND_ME(ImagickPixelIterator, __construct, arginfo_class_ImagickPixelIterator___construct, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickPixelIterator, clear, arginfo_class_ImagickPixelIterator_clear, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickPixelIterator, getPixelIterator, arginfo_class_ImagickPixelIterator_getPixelIterator, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + ZEND_ME(ImagickPixelIterator, getPixelRegionIterator, arginfo_class_ImagickPixelIterator_getPixelRegionIterator, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + ZEND_MALIAS(ImagickPixelIterator, destroy, clear, arginfo_class_ImagickPixelIterator_destroy, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickPixelIterator, getCurrentIteratorRow, arginfo_class_ImagickPixelIterator_getCurrentIteratorRow, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickPixelIterator, getIteratorRow, arginfo_class_ImagickPixelIterator_getIteratorRow, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickPixelIterator, getNextIteratorRow, arginfo_class_ImagickPixelIterator_getNextIteratorRow, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickPixelIterator, getPreviousIteratorRow, arginfo_class_ImagickPixelIterator_getPreviousIteratorRow, ZEND_ACC_PUBLIC) + ZEND_MALIAS(ImagickPixelIterator, key, getIteratorRow, arginfo_class_ImagickPixelIterator_key, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickPixelIterator, next, arginfo_class_ImagickPixelIterator_next, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickPixelIterator, rewind, arginfo_class_ImagickPixelIterator_rewind, ZEND_ACC_PUBLIC) + ZEND_MALIAS(ImagickPixelIterator, current, getCurrentIteratorRow, arginfo_class_ImagickPixelIterator_current, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickPixelIterator, newPixelIterator, arginfo_class_ImagickPixelIterator_newPixelIterator, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickPixelIterator, newPixelRegionIterator, arginfo_class_ImagickPixelIterator_newPixelRegionIterator, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickPixelIterator, resetIterator, arginfo_class_ImagickPixelIterator_resetIterator, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickPixelIterator, setIteratorFirstRow, arginfo_class_ImagickPixelIterator_setIteratorFirstRow, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickPixelIterator, setIteratorLastRow, arginfo_class_ImagickPixelIterator_setIteratorLastRow, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickPixelIterator, setIteratorRow, arginfo_class_ImagickPixelIterator_setIteratorRow, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickPixelIterator, syncIterator, arginfo_class_ImagickPixelIterator_syncIterator, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickPixelIterator, valid, arginfo_class_ImagickPixelIterator_valid, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; \ No newline at end of file
View file
imagick-3.8.0.tgz/imagick-3.8.0/ImagickPixel_arginfo.h
Added
@@ -0,0 +1,346 @@ +/* This is a generated file, edit the .stub.php file instead. +* Stub hash: regen with 'sh regen_arginfo.sh' +* file has been fixedup for different versions */ + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel___construct, 0, 0, 0) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, color, IS_STRING, 1, "null") +#else + ZEND_ARG_INFO(0, color) +#endif + +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_clear, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_clear, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() + +#define arginfo_class_ImagickPixel_destroy arginfo_class_ImagickPixel_clear + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_getColor, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_getColor, 0, 0, 0) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, normalized, IS_LONG, 0, "0") +#else + ZEND_ARG_INFO(0, normalized) +#endif + +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_getColorAsString, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_getColorAsString, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_getColorCount, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_getColorCount, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_getColorQuantum, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_getColorQuantum, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_getColorValue, 0, 1, IS_DOUBLE, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_getColorValue, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, color, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, color) +#endif +ZEND_END_ARG_INFO() + + +#if MAGICKCORE_HDRI_ENABLE + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_getColorValueQuantum, 0, 1, IS_DOUBLE, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_getColorValueQuantum, 0, 0, 1) +#endif + +#else + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_getColorValueQuantum, 0, 1, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_getColorValueQuantum, 0, 0, 1) +#endif + +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, color, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, color) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_ImagickPixel_getHSL arginfo_class_ImagickPixel_getColorQuantum + +#define arginfo_class_ImagickPixel_getIndex arginfo_class_ImagickPixel_getColorCount + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_isPixelSimilar, 0, 2, _IS_BOOL, 1) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_isPixelSimilar, 0, 0, 2) +#endif + + ZEND_ARG_OBJ_TYPE_MASK(0, color, ImagickPixel, MAY_BE_STRING, NULL) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, fuzz, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, fuzz) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_isPixelSimilarQuantum, 0, 2, _IS_BOOL, 1) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_isPixelSimilarQuantum, 0, 0, 2) +#endif + + ZEND_ARG_OBJ_TYPE_MASK(0, color, ImagickPixel, MAY_BE_STRING, NULL) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, fuzz_quantum_range_scaled_by_square_root_of_three, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, fuzz_quantum_range_scaled_by_square_root_of_three) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_ImagickPixel_isSimilar arginfo_class_ImagickPixel_isPixelSimilarQuantum + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_setColor, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_setColor, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, color, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, color) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_setColorCount, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_setColorCount, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, color_count, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, color_count) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_setColorValue, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_setColorValue, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, color, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, color) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, value, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, value) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_setColorValueQuantum, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_setColorValueQuantum, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, color, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, color) +#endif + +#if MAGICKCORE_HDRI_ENABLE + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, value, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, value) +#endif +#else + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, value, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, value) +#endif +#endif + +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_setHSL, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_setHSL, 0, 0, 3) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, hue, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, hue) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, saturation, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, saturation) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, luminosity, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, luminosity) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_setIndex, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_setIndex, 0, 0, 1) +#endif + + +#if MAGICKCORE_HDRI_ENABLE + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, index, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, index) +#endif +#else + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, index) +#endif +#endif + +ZEND_END_ARG_INFO() + +#if MagickLibVersion >= 0x693 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_setColorFromPixel, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_setColorFromPixel, 0, 0, 1) +#endif + + ZEND_ARG_OBJ_INFO(0, pixel, ImagickPixel, 0) +ZEND_END_ARG_INFO() +#endif + + +ZEND_METHOD(ImagickPixel, __construct); +ZEND_METHOD(ImagickPixel, clear); +ZEND_METHOD(ImagickPixel, getColor); +ZEND_METHOD(ImagickPixel, getColorAsString); +ZEND_METHOD(ImagickPixel, getColorCount); +ZEND_METHOD(ImagickPixel, getColorQuantum); +ZEND_METHOD(ImagickPixel, getColorValue); +ZEND_METHOD(ImagickPixel, getColorValueQuantum); +ZEND_METHOD(ImagickPixel, getHSL); +ZEND_METHOD(ImagickPixel, getIndex); +ZEND_METHOD(ImagickPixel, isPixelSimilar); +ZEND_METHOD(ImagickPixel, isPixelSimilarQuantum); +ZEND_METHOD(ImagickPixel, setColor); +ZEND_METHOD(ImagickPixel, setColorCount); +ZEND_METHOD(ImagickPixel, setColorValue); +ZEND_METHOD(ImagickPixel, setColorValueQuantum); +ZEND_METHOD(ImagickPixel, setHSL); +ZEND_METHOD(ImagickPixel, setIndex); +#if MagickLibVersion >= 0x693 +ZEND_METHOD(ImagickPixel, setColorFromPixel); +#endif + + +static const zend_function_entry class_ImagickPixel_methods = { + ZEND_ME(ImagickPixel, __construct, arginfo_class_ImagickPixel___construct, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickPixel, clear, arginfo_class_ImagickPixel_clear, ZEND_ACC_PUBLIC) + ZEND_MALIAS(ImagickPixel, destroy, clear, arginfo_class_ImagickPixel_destroy, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickPixel, getColor, arginfo_class_ImagickPixel_getColor, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickPixel, getColorAsString, arginfo_class_ImagickPixel_getColorAsString, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickPixel, getColorCount, arginfo_class_ImagickPixel_getColorCount, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickPixel, getColorQuantum, arginfo_class_ImagickPixel_getColorQuantum, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickPixel, getColorValue, arginfo_class_ImagickPixel_getColorValue, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickPixel, getColorValueQuantum, arginfo_class_ImagickPixel_getColorValueQuantum, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickPixel, getHSL, arginfo_class_ImagickPixel_getHSL, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickPixel, getIndex, arginfo_class_ImagickPixel_getIndex, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickPixel, isPixelSimilar, arginfo_class_ImagickPixel_isPixelSimilar, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickPixel, isPixelSimilarQuantum, arginfo_class_ImagickPixel_isPixelSimilarQuantum, ZEND_ACC_PUBLIC) + ZEND_MALIAS(ImagickPixel, isSimilar, isPixelSimilarQuantum, arginfo_class_ImagickPixel_isSimilar, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickPixel, setColor, arginfo_class_ImagickPixel_setColor, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickPixel, setColorCount, arginfo_class_ImagickPixel_setColorCount, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickPixel, setColorValue, arginfo_class_ImagickPixel_setColorValue, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickPixel, setColorValueQuantum, arginfo_class_ImagickPixel_setColorValueQuantum, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickPixel, setHSL, arginfo_class_ImagickPixel_setHSL, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickPixel, setIndex, arginfo_class_ImagickPixel_setIndex, ZEND_ACC_PUBLIC) +#if MagickLibVersion >= 0x693 + ZEND_ME(ImagickPixel, setColorFromPixel, arginfo_class_ImagickPixel_setColorFromPixel, ZEND_ACC_PUBLIC) +#endif + ZEND_FE_END +}; \ No newline at end of file
View file
imagick-3.8.0.tgz/imagick-3.8.0/Imagick_arginfo.h
Added
@@ -0,0 +1,7365 @@ +/* This is a generated file, edit the .stub.php file instead. +* Stub hash: regen with 'sh regen_arginfo.sh' +* file has been fixedup for different versions */ + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_optimizeImageLayers, 0, 0, Imagick, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_optimizeImageLayers, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_compareImageLayers, 0, 1, Imagick, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_compareImageLayers, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, metric, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, metric) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_pingImageBlob, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_pingImageBlob, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, image, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, image) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_pingImageFile, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_pingImageFile, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, filehandle, IS_MIXED, 0) +#else + ZEND_ARG_INFO(0, filehandle) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, filename, IS_STRING, 1, "null") +#else + ZEND_ARG_INFO(0, filename) +#endif + +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_transposeImage, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_transposeImage, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_transverseImage arginfo_class_Imagick_transposeImage + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_trimImage, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_trimImage, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, fuzz, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, fuzz) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_waveImage, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_waveImage, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, amplitude, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, amplitude) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, length, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, length) +#endif +ZEND_END_ARG_INFO() + +#if MagickLibVersion >= 0x700 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_waveImageWithMethod, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_waveImageWithMethod, 0, 0, 3) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, amplitude, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, amplitude) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, length, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, length) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, interpolate_method, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, interpolate_method) +#endif +ZEND_END_ARG_INFO() +#endif + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_vignetteImage, 0, 4, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_vignetteImage, 0, 0, 4) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, black_point, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, black_point) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, white_point, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, white_point) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, y) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_uniqueImageColors arginfo_class_Imagick_transposeImage + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageMatte, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageMatte, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageMatte, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageMatte, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, matte, _IS_BOOL, 0) +#else + ZEND_ARG_INFO(0, matte) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_adaptiveResizeImage, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_adaptiveResizeImage, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, columns, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, columns) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, rows, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, rows) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, bestfit, _IS_BOOL, 0, "false") +#else + ZEND_ARG_INFO(0, bestfit) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, legacy, _IS_BOOL, 0, "false") +#else + ZEND_ARG_INFO(0, legacy) +#endif + +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_sketchImage, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_sketchImage, 0, 0, 3) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, radius, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, radius) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, sigma, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, sigma) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, angle, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, angle) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_shadeImage, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_shadeImage, 0, 0, 3) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, gray, _IS_BOOL, 0) +#else + ZEND_ARG_INFO(0, gray) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, azimuth, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, azimuth) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, elevation, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, elevation) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getSizeOffset, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getSizeOffset, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setSizeOffset, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setSizeOffset, 0, 0, 3) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, columns, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, columns) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, rows, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, rows) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, offset) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_adaptiveBlurImage, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_adaptiveBlurImage, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, radius, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, radius) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, sigma, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, sigma) +#endif + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_contrastStretchImage, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_contrastStretchImage, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, black_point, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, black_point) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, white_point, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, white_point) +#endif + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_adaptiveSharpenImage arginfo_class_Imagick_adaptiveBlurImage + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_randomThresholdImage, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_randomThresholdImage, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, low, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, low) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, high, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, high) +#endif + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_roundCornersImage, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_roundCornersImage, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x_rounding, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, x_rounding) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y_rounding, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, y_rounding) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, stroke_width, IS_DOUBLE, 0, "10") +#else + ZEND_ARG_INFO(0, stroke_width) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, displace, IS_DOUBLE, 0, "5") +#else + ZEND_ARG_INFO(0, displace) +#endif + + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, size_correction, IS_DOUBLE, 0, "-6") +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_roundCorners arginfo_class_Imagick_roundCornersImage + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setIteratorIndex, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setIteratorIndex, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, index) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_getIteratorIndex arginfo_class_Imagick_getSizeOffset + +#if MagickLibVersion < 0x700 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_transformImage, 0, 2, Imagick, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_transformImage, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, crop, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, crop) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, geometry, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, geometry) +#endif +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x630 && MagickLibVersion < 0x700 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageOpacity, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageOpacity, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, opacity, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, opacity) +#endif +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion >= 0x700 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageAlpha, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageAlpha, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, alpha, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, alpha) +#endif +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion < 0x700 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_orderedPosterizeImage, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_orderedPosterizeImage, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, threshold_map, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, threshold_map) +#endif + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion >= 0x700 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_polaroidWithTextAndMethod, 0, 4, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_polaroidWithTextAndMethod, 0, 0, 4) +#endif + + ZEND_ARG_OBJ_INFO(0, settings, ImagickDraw, 0) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, angle, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, angle) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, caption, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, caption) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, method, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, method) +#endif +ZEND_END_ARG_INFO() +#endif + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_polaroidImage, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_polaroidImage, 0, 0, 2) +#endif + + ZEND_ARG_OBJ_INFO(0, settings, ImagickDraw, 0) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, angle, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, angle) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageProperty, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageProperty, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, name) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageProperty, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageProperty, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, name) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, value) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_deleteImageProperty, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_deleteImageProperty, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, name) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_identifyFormat, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_identifyFormat, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, format, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, format) +#endif +ZEND_END_ARG_INFO() + +#if IM_HAVE_IMAGICK_SETIMAGEINTERPOLATEMETHOD + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageInterpolateMethod, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageInterpolateMethod, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, method, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, method) +#endif +ZEND_END_ARG_INFO() +#endif + +#define arginfo_class_Imagick_getImageInterpolateMethod arginfo_class_Imagick_getSizeOffset + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_linearStretchImage, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_linearStretchImage, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, black_point, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, black_point) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, white_point, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, white_point) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_getImageLength arginfo_class_Imagick_getSizeOffset + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_extentImage, 0, 4, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_extentImage, 0, 0, 4) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, width) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, height) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, y) +#endif +ZEND_END_ARG_INFO() + +#if MagickLibVersion > 0x633 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageOrientation, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageOrientation, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x633 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageOrientation, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageOrientation, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, orientation, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, orientation) +#endif +ZEND_END_ARG_INFO() +#endif + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion > 0x634 && MagickLibVersion < 0x700 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_paintFloodfillImage, 0, 5, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_paintFloodfillImage, 0, 0, 5) +#endif + + ZEND_ARG_OBJ_TYPE_MASK(0, fill_color, ImagickPixel, MAY_BE_STRING, NULL) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, fuzz, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, fuzz) +#endif + ZEND_ARG_OBJ_TYPE_MASK(0, border_color, ImagickPixel, MAY_BE_STRING, NULL) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, y) +#endif + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") +ZEND_END_ARG_INFO() +#endif + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_clutImage, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_clutImage, 0, 0, 1) +#endif + + ZEND_ARG_OBJ_INFO(0, lookup_table, Imagick, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") +ZEND_END_ARG_INFO() + +#if MagickLibVersion >= 0x700 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_clutImageWithInterpolate, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_clutImageWithInterpolate, 0, 0, 2) +#endif + + ZEND_ARG_OBJ_INFO(0, lookup_table, Imagick, 0) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, pixel_interpolate_method, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, pixel_interpolate_method) +#endif +ZEND_END_ARG_INFO() +#endif + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageProperties, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageProperties, 0, 0, 0) +#endif + + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 0, "\"*\"") + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, include_values, _IS_BOOL, 0, "true") +#else + ZEND_ARG_INFO(0, include_values) +#endif + +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_getImageProfiles arginfo_class_Imagick_getImageProperties + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_distortImage, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_distortImage, 0, 0, 3) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, distortion, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, distortion) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, arguments, IS_ARRAY, 0) +#else + ZEND_ARG_INFO(0, arguments) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, bestfit, _IS_BOOL, 0) +#else + ZEND_ARG_INFO(0, bestfit) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_writeImageFile, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_writeImageFile, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, filehandle, IS_MIXED, 0) +#else + ZEND_ARG_INFO(0, filehandle) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, format, IS_STRING, 1, "null") +#else + ZEND_ARG_INFO(0, format) +#endif + +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_writeImagesFile arginfo_class_Imagick_writeImageFile + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_resetImagePage, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_resetImagePage, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, page, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, page) +#endif +ZEND_END_ARG_INFO() + +#if MagickLibVersion < 0x700 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageClipMask, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageClipMask, 0, 0, 1) +#endif + + ZEND_ARG_OBJ_INFO(0, clip_mask, imagick, 0) +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion < 0x700 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_getImageClipMask, 0, 0, Imagick, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageClipMask, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_animateImages, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_animateImages, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x_server, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, x_server) +#endif +ZEND_END_ARG_INFO() + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_recolorImage, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_recolorImage, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, matrix, IS_ARRAY, 0) +#else + ZEND_ARG_INFO(0, matrix) +#endif +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x636 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setFont, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setFont, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, font, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, font) +#endif +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x636 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getFont, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getFont, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x636 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setPointSize, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setPointSize, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, point_size, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, point_size) +#endif +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x636 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getPointSize, 0, 0, IS_DOUBLE, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getPointSize, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x636 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_mergeImageLayers, 0, 1, Imagick, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_mergeImageLayers, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, layermethod, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, layermethod) +#endif +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x637 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageAlphaChannel, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageAlphaChannel, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, alphachannel, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, alphachannel) +#endif +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x637 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_floodfillPaintImage, 0, 6, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_floodfillPaintImage, 0, 0, 6) +#endif + + ZEND_ARG_OBJ_TYPE_MASK(0, fill_color, ImagickPixel, MAY_BE_STRING, NULL) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, fuzz, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, fuzz) +#endif + ZEND_ARG_OBJ_TYPE_MASK(0, border_color, ImagickPixel, MAY_BE_STRING, NULL) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, y) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, invert, _IS_BOOL, 0) +#else + ZEND_ARG_INFO(0, invert) +#endif + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 1, "Imagick::CHANNEL_DEFAULT") +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x637 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_opaquePaintImage, 0, 4, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_opaquePaintImage, 0, 0, 4) +#endif + + ZEND_ARG_OBJ_TYPE_MASK(0, target_color, ImagickPixel, MAY_BE_STRING, NULL) + ZEND_ARG_OBJ_TYPE_MASK(0, fill_color, ImagickPixel, MAY_BE_STRING, NULL) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, fuzz, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, fuzz) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, invert, _IS_BOOL, 0) +#else + ZEND_ARG_INFO(0, invert) +#endif + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x637 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_transparentPaintImage, 0, 4, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_transparentPaintImage, 0, 0, 4) +#endif + + ZEND_ARG_OBJ_TYPE_MASK(0, target_color, ImagickPixel, MAY_BE_STRING, NULL) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, alpha, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, alpha) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, fuzz, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, fuzz) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, invert, _IS_BOOL, 0) +#else + ZEND_ARG_INFO(0, invert) +#endif +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x638 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_liquidRescaleImage, 0, 4, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_liquidRescaleImage, 0, 0, 4) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, width) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, height) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, delta_x, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, delta_x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, rigidity, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, rigidity) +#endif +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x638 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_encipherImage, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_encipherImage, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, passphrase, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, passphrase) +#endif +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x638 +#define arginfo_class_Imagick_decipherImage arginfo_class_Imagick_encipherImage +#endif + +#if MagickLibVersion > 0x639 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setGravity, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setGravity, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, gravity, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, gravity) +#endif +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x639 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getGravity, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getGravity, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x639 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageChannelRange, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageChannelRange, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, channel, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, channel) +#endif +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x639 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageAlphaChannel, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageAlphaChannel, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x642 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageChannelDistortions, 0, 2, IS_DOUBLE, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageChannelDistortions, 0, 0, 2) +#endif + + ZEND_ARG_OBJ_INFO(0, reference_image, Imagick, 0) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, metric, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, metric) +#endif + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x643 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageGravity, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageGravity, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, gravity, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, gravity) +#endif +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x643 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageGravity, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageGravity, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x645 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_importImagePixels, 0, 7, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_importImagePixels, 0, 0, 7) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, y) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, width) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, height) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, map, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, map) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, pixelstorage, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, pixelstorage) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, pixels, IS_ARRAY, 0) +#else + ZEND_ARG_INFO(0, pixels) +#endif +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x645 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_deskewImage, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_deskewImage, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, threshold, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, threshold) +#endif +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x645 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_segmentImage, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_segmentImage, 0, 0, 3) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, colorspace, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, colorspace) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, cluster_threshold, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, cluster_threshold) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, smooth_threshold, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, smooth_threshold) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, verbose, _IS_BOOL, 0, "false") +#else + ZEND_ARG_INFO(0, verbose) +#endif + +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x645 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_sparseColorImage, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_sparseColorImage, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, sparsecolormethod, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, sparsecolormethod) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, arguments, IS_ARRAY, 0) +#else + ZEND_ARG_INFO(0, arguments) +#endif + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x645 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_remapImage, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_remapImage, 0, 0, 2) +#endif + + ZEND_ARG_OBJ_INFO(0, replacement, Imagick, 0) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, dither_method, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, dither_method) +#endif +ZEND_END_ARG_INFO() +#endif + +#if PHP_IMAGICK_HAVE_HOUGHLINE + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_houghLineImage, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_houghLineImage, 0, 0, 3) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, width) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, height) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, threshold, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, threshold) +#endif +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x646 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_exportImagePixels, 0, 6, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_exportImagePixels, 0, 0, 6) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, y) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, width) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, height) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, map, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, map) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, pixelstorage, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, pixelstorage) +#endif +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x648 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageChannelKurtosis, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageChannelKurtosis, 0, 0, 0) +#endif + + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x648 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_functionImage, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_functionImage, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, function, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, function) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, parameters, IS_ARRAY, 0) +#else + ZEND_ARG_INFO(0, parameters) +#endif + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x651 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_transformImageColorspace, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_transformImageColorspace, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, colorspace, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, colorspace) +#endif +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x652 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_haldClutImage, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_haldClutImage, 0, 0, 1) +#endif + + ZEND_ARG_OBJ_INFO(0, clut, Imagick, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x655 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_autoLevelImage, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_autoLevelImage, 0, 0, 0) +#endif + + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x655 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_blueShiftImage, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_blueShiftImage, 0, 0, 0) +#endif + + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, factor, IS_DOUBLE, 0, "1.5") +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x656 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageArtifact, 0, 1, IS_STRING, 1) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageArtifact, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, artifact, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, artifact) +#endif +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x656 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageArtifact, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageArtifact, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, artifact, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, artifact) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 1) +#else + ZEND_ARG_INFO(0, value) +#endif +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x656 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_deleteImageArtifact, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_deleteImageArtifact, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, artifact, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, artifact) +#endif +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x656 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getColorspace, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getColorspace, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x656 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setColorspace, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setColorspace, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, colorspace, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, colorspace) +#endif +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x656 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_clampImage, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_clampImage, 0, 0, 0) +#endif + + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x667 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_smushImages, 0, 2, Imagick, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_smushImages, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, stack, _IS_BOOL, 0) +#else + ZEND_ARG_INFO(0, stack) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, offset) +#endif +ZEND_END_ARG_INFO() +#endif + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick___construct, 0, 0, 0) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_MASK(0, files, MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_NULL, "null") +#else + ZEND_ARG_INFO(0, files) +#endif + +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick___toString, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick___toString, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 50600 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_count, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_count, 0, 0, 0) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "0") +#else + ZEND_ARG_INFO(0, mode) +#endif + +ZEND_END_ARG_INFO() +#endif + +#if !(PHP_VERSION_ID >= 50600) + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_count, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_count, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_getPixelIterator, 0, 0, ImagickPixelIterator, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getPixelIterator, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_getPixelRegionIterator, 0, 4, ImagickPixelIterator, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getPixelRegionIterator, 0, 0, 4) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, y) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, columns, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, columns) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, rows, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, rows) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_readImage, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_readImage, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, filename) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_readImages, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_readImages, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, filenames, IS_ARRAY, 0) +#else + ZEND_ARG_INFO(0, filenames) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_readImageBlob, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_readImageBlob, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, image, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, image) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, filename, IS_STRING, 1, "null") +#else + ZEND_ARG_INFO(0, filename) +#endif + +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageFormat, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageFormat, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, format, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, format) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_scaleImage arginfo_class_Imagick_adaptiveResizeImage + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_writeImage, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_writeImage, 0, 0, 0) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, filename, IS_STRING, 1, "null") +#else + ZEND_ARG_INFO(0, filename) +#endif + +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_writeImages, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_writeImages, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, filename) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, adjoin, _IS_BOOL, 0) +#else + ZEND_ARG_INFO(0, adjoin) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_blurImage arginfo_class_Imagick_adaptiveBlurImage + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_thumbnailImage, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_thumbnailImage, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, columns, IS_LONG, 1) +#else + ZEND_ARG_INFO(0, columns) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, rows, IS_LONG, 1) +#else + ZEND_ARG_INFO(0, rows) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, bestfit, _IS_BOOL, 0, "false") +#else + ZEND_ARG_INFO(0, bestfit) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, fill, _IS_BOOL, 0, "false") +#else + ZEND_ARG_INFO(0, fill) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, legacy, _IS_BOOL, 0, "false") +#else + ZEND_ARG_INFO(0, legacy) +#endif + +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_cropThumbnailImage, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_cropThumbnailImage, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, width) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, height) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, legacy, _IS_BOOL, 0, "false") +#else + ZEND_ARG_INFO(0, legacy) +#endif + +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_getImageFilename arginfo_class_Imagick___toString + +#define arginfo_class_Imagick_setImageFilename arginfo_class_Imagick_readImage + +#define arginfo_class_Imagick_getImageFormat arginfo_class_Imagick___toString + +#define arginfo_class_Imagick_getImageMimeType arginfo_class_Imagick___toString + +#define arginfo_class_Imagick_removeImage arginfo_class_Imagick_transposeImage + +#define arginfo_class_Imagick_destroy arginfo_class_Imagick_transposeImage + +#define arginfo_class_Imagick_clear arginfo_class_Imagick_transposeImage + +#define arginfo_class_Imagick_clone arginfo_class_Imagick_optimizeImageLayers + +#define arginfo_class_Imagick_getImageSize arginfo_class_Imagick_getSizeOffset + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageBlob, 0, 0, IS_STRING, 1) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageBlob, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_getImagesBlob arginfo_class_Imagick___toString + +#define arginfo_class_Imagick_setFirstIterator arginfo_class_Imagick_transposeImage + +#define arginfo_class_Imagick_setLastIterator arginfo_class_Imagick_transposeImage + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_resetIterator, 0, 0, IS_VOID, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_resetIterator, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_previousImage arginfo_class_Imagick_transposeImage + +#define arginfo_class_Imagick_nextImage arginfo_class_Imagick_transposeImage + +#define arginfo_class_Imagick_hasPreviousImage arginfo_class_Imagick_transposeImage + +#define arginfo_class_Imagick_hasNextImage arginfo_class_Imagick_transposeImage + +#define arginfo_class_Imagick_setImageIndex arginfo_class_Imagick_setIteratorIndex + +#define arginfo_class_Imagick_getImageIndex arginfo_class_Imagick_getSizeOffset + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_commentImage, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_commentImage, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, comment, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, comment) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_cropImage arginfo_class_Imagick_extentImage + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_labelImage, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_labelImage, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, label, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, label) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageGeometry, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageGeometry, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_drawImage, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_drawImage, 0, 0, 1) +#endif + + ZEND_ARG_OBJ_INFO(0, drawing, ImagickDraw, 0) +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageCompressionQuality, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageCompressionQuality, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, quality, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, quality) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_getImageCompressionQuality arginfo_class_Imagick_getSizeOffset + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageCompression, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageCompression, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, compression, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, compression) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_getImageCompression arginfo_class_Imagick_getSizeOffset + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_annotateImage, 0, 5, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_annotateImage, 0, 0, 5) +#endif + + ZEND_ARG_OBJ_INFO(0, settings, ImagickDraw, 0) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, y) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, angle, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, angle) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, text, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, text) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_compositeImage, 0, 4, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_compositeImage, 0, 0, 4) +#endif + + ZEND_ARG_OBJ_INFO(0, composite_image, Imagick, 0) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, composite, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, composite) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, y) +#endif + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_modulateImage, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_modulateImage, 0, 0, 3) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, brightness, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, brightness) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, saturation, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, saturation) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, hue, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, hue) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_getImageColors arginfo_class_Imagick_getSizeOffset + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_montageImage, 0, 5, Imagick, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_montageImage, 0, 0, 5) +#endif + + ZEND_ARG_OBJ_INFO(0, settings, ImagickDraw, 0) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, tile_geometry, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, tile_geometry) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, thumbnail_geometry, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, thumbnail_geometry) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, monatgemode, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, monatgemode) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, frame, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, frame) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_identifyImage, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_identifyImage, 0, 0, 0) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, append_raw_output, _IS_BOOL, 0, "false") +#else + ZEND_ARG_INFO(0, append_raw_output) +#endif + +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_thresholdImage, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_thresholdImage, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, threshold, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, threshold) +#endif + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_adaptiveThresholdImage, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_adaptiveThresholdImage, 0, 0, 3) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, width) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, height) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, offset) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_blackThresholdImage, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_blackThresholdImage, 0, 0, 1) +#endif + + ZEND_ARG_OBJ_TYPE_MASK(0, threshold_color, ImagickPixel, MAY_BE_STRING, NULL) +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_whiteThresholdImage arginfo_class_Imagick_blackThresholdImage + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_appendImages, 0, 1, Imagick, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_appendImages, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, stack, _IS_BOOL, 0) +#else + ZEND_ARG_INFO(0, stack) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_charcoalImage, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_charcoalImage, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, radius, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, radius) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, sigma, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, sigma) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_normalizeImage, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_normalizeImage, 0, 0, 0) +#endif + + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") +ZEND_END_ARG_INFO() + +#if MagickLibVersion >= 0x700 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_oilPaintImageWithSigma, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_oilPaintImageWithSigma, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, radius, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, radius) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, sigma, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, sigma) +#endif +ZEND_END_ARG_INFO() +#endif + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_oilPaintImage, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_oilPaintImage, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, radius, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, radius) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_posterizeImage, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_posterizeImage, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, levels, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, levels) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, dither, _IS_BOOL, 0) +#else + ZEND_ARG_INFO(0, dither) +#endif +ZEND_END_ARG_INFO() + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_radialBlurImage, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_radialBlurImage, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, angle, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, angle) +#endif + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") +ZEND_END_ARG_INFO() +#endif + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_raiseImage, 0, 5, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_raiseImage, 0, 0, 5) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, width) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, height) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, y) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, raise, _IS_BOOL, 0) +#else + ZEND_ARG_INFO(0, raise) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_resampleImage, 0, 4, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_resampleImage, 0, 0, 4) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x_resolution, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, x_resolution) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y_resolution, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, y_resolution) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, filter, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, filter) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, blur, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, blur) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_resizeImage, 0, 4, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_resizeImage, 0, 0, 4) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, columns, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, columns) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, rows, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, rows) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, filter, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, filter) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, blur, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, blur) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, bestfit, _IS_BOOL, 0, "false") +#else + ZEND_ARG_INFO(0, bestfit) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, legacy, _IS_BOOL, 0, "false") +#else + ZEND_ARG_INFO(0, legacy) +#endif + +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_rollImage, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_rollImage, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, y) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_rotateImage, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_rotateImage, 0, 0, 2) +#endif + + ZEND_ARG_OBJ_TYPE_MASK(0, background_color, ImagickPixel, MAY_BE_STRING, NULL) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, degrees, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, degrees) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_sampleImage, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_sampleImage, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, columns, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, columns) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, rows, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, rows) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_solarizeImage, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_solarizeImage, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, threshold, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, threshold) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_shadowImage, 0, 4, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_shadowImage, 0, 0, 4) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, opacity, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, opacity) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, sigma, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, sigma) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, y) +#endif +ZEND_END_ARG_INFO() + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageAttribute, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageAttribute, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, key) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, value) +#endif +ZEND_END_ARG_INFO() +#endif + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageBackgroundColor, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageBackgroundColor, 0, 0, 1) +#endif + + ZEND_ARG_OBJ_TYPE_MASK(0, background_color, ImagickPixel, MAY_BE_STRING, NULL) +ZEND_END_ARG_INFO() + +#if MagickLibVersion >= 0x700 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageChannelMask, 0, 1, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageChannelMask, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, channel, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, channel) +#endif +ZEND_END_ARG_INFO() +#endif + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageCompose, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageCompose, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, compose, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, compose) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageDelay, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageDelay, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, delay, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, delay) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageDepth, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageDepth, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, depth, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, depth) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageGamma, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageGamma, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, gamma, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, gamma) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageIterations, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageIterations, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, iterations, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, iterations) +#endif +ZEND_END_ARG_INFO() + +#if MagickLibVersion < 0x700 || MagickLibVersion >= 0x705 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageMatteColor, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageMatteColor, 0, 0, 1) +#endif + + ZEND_ARG_OBJ_TYPE_MASK(0, matte_color, ImagickPixel, MAY_BE_STRING, NULL) +ZEND_END_ARG_INFO() +#endif + +#define arginfo_class_Imagick_setImagePage arginfo_class_Imagick_extentImage + +#define arginfo_class_Imagick_setImageProgressMonitor arginfo_class_Imagick_readImage + +#if MagickLibVersion > 0x653 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setProgressMonitor, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setProgressMonitor, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0) +#else + ZEND_ARG_INFO(0, callback) +#endif +ZEND_END_ARG_INFO() +#endif + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageResolution, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageResolution, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x_resolution, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, x_resolution) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y_resolution, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, y_resolution) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageScene, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageScene, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, scene, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, scene) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageTicksPerSecond, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageTicksPerSecond, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, ticks_per_second, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, ticks_per_second) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageType, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageType, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, image_type, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, image_type) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageUnits, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageUnits, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, units, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, units) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_sharpenImage arginfo_class_Imagick_adaptiveBlurImage + +#define arginfo_class_Imagick_shaveImage arginfo_class_Imagick_sampleImage + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_shearImage, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_shearImage, 0, 0, 3) +#endif + + ZEND_ARG_OBJ_TYPE_MASK(0, background_color, ImagickPixel, MAY_BE_STRING, NULL) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x_shear, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, x_shear) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y_shear, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, y_shear) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_spliceImage arginfo_class_Imagick_extentImage + +#define arginfo_class_Imagick_pingImage arginfo_class_Imagick_readImage + +#define arginfo_class_Imagick_readImageFile arginfo_class_Imagick_pingImageFile + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_displayImage, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_displayImage, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, servername, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, servername) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_displayImages arginfo_class_Imagick_displayImage + +#define arginfo_class_Imagick_spreadImage arginfo_class_Imagick_oilPaintImage + +#if MagickLibVersion >= 0x700 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_spreadImageWithMethod, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_spreadImageWithMethod, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, radius, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, radius) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, interpolate_method, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, interpolate_method) +#endif +ZEND_END_ARG_INFO() +#endif + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_swirlImage, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_swirlImage, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, degrees, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, degrees) +#endif +ZEND_END_ARG_INFO() + +#if MagickLibVersion >= 0x700 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_swirlImageWithMethod, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_swirlImageWithMethod, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, degrees, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, degrees) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, interpolate_method, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, interpolate_method) +#endif +ZEND_END_ARG_INFO() +#endif + +#define arginfo_class_Imagick_stripImage arginfo_class_Imagick_transposeImage + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_queryFormats, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_queryFormats, 0, 0, 0) +#endif + + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 0, "\"*\"") +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_queryFonts arginfo_class_Imagick_queryFormats + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_queryFontMetrics, 0, 2, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_queryFontMetrics, 0, 0, 2) +#endif + + ZEND_ARG_OBJ_INFO(0, settings, ImagickDraw, 0) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, text, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, text) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, multiline, _IS_BOOL, 1, "null") +#else + ZEND_ARG_INFO(0, multiline) +#endif + +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_steganoImage, 0, 2, Imagick, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_steganoImage, 0, 0, 2) +#endif + + ZEND_ARG_OBJ_INFO(0, watermark, Imagick, 0) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, offset) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_addNoiseImage, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_addNoiseImage, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, noise, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, noise) +#endif + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") +ZEND_END_ARG_INFO() + +#if IM_HAVE_IMAGICK_ADD_NOISE_WITH_ATTENUATE + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_addNoiseImageWithAttenuate, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_addNoiseImageWithAttenuate, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, noise, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, noise) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, attenuate, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, attenuate) +#endif + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") +ZEND_END_ARG_INFO() +#endif + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_motionBlurImage, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_motionBlurImage, 0, 0, 3) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, radius, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, radius) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, sigma, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, sigma) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, angle, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, angle) +#endif + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") +ZEND_END_ARG_INFO() + +#if MagickLibVersion < 0x700 && !defined(MAGICKCORE_EXCLUDE_DEPRECATED) + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_mosaicImages, 0, 0, Imagick, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_mosaicImages, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_morphImages, 0, 1, Imagick, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_morphImages, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, number_frames, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, number_frames) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_minifyImage arginfo_class_Imagick_transposeImage + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_affineTransformImage, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_affineTransformImage, 0, 0, 1) +#endif + + ZEND_ARG_OBJ_INFO(0, settings, ImagickDraw, 0) +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_averageImages arginfo_class_Imagick_optimizeImageLayers + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_borderImage, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_borderImage, 0, 0, 3) +#endif + + ZEND_ARG_OBJ_TYPE_MASK(0, border_color, ImagickPixel, MAY_BE_STRING, NULL) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, width) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, height) +#endif +ZEND_END_ARG_INFO() + +#if MagickLibVersion >= 0x700 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_borderImageWithComposite, 0, 4, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_borderImageWithComposite, 0, 0, 4) +#endif + + ZEND_ARG_OBJ_TYPE_MASK(0, border_color, ImagickPixel, MAY_BE_STRING, NULL) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, width) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, height) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, composite, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, composite) +#endif +ZEND_END_ARG_INFO() +#endif + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_calculateCrop, 0, 4, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_calculateCrop, 0, 0, 4) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, original_width, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, original_width) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, original_height, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, original_height) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, desired_width, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, desired_width) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, desired_height, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, desired_height) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, legacy, _IS_BOOL, 0, "false") +#else + ZEND_ARG_INFO(0, legacy) +#endif + +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_chopImage arginfo_class_Imagick_extentImage + +#define arginfo_class_Imagick_clipImage arginfo_class_Imagick_transposeImage + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_clipPathImage, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_clipPathImage, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, pathname, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, pathname) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, inside, _IS_BOOL, 0) +#else + ZEND_ARG_INFO(0, inside) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_clipImagePath, 0, 2, IS_VOID, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_clipImagePath, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, pathname, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, pathname) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, inside, _IS_BOOL, 0) +#else + ZEND_ARG_INFO(0, inside) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_coalesceImages arginfo_class_Imagick_optimizeImageLayers + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_colorFloodfillImage, 0, 5, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_colorFloodfillImage, 0, 0, 5) +#endif + + ZEND_ARG_OBJ_TYPE_MASK(0, fill_color, ImagickPixel, MAY_BE_STRING, NULL) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, fuzz, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, fuzz) +#endif + ZEND_ARG_OBJ_TYPE_MASK(0, border_color, ImagickPixel, MAY_BE_STRING, NULL) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, y) +#endif +ZEND_END_ARG_INFO() +#endif + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_colorizeImage, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_colorizeImage, 0, 0, 2) +#endif + + ZEND_ARG_OBJ_TYPE_MASK(0, colorize_color, ImagickPixel, MAY_BE_STRING, NULL) + ZEND_ARG_OBJ_TYPE_MASK(0, opacity_color, ImagickPixel, MAY_BE_STRING|MAY_BE_FALSE, NULL) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, legacy, _IS_BOOL, 1, "false") +#else + ZEND_ARG_INFO(0, legacy) +#endif + +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_compareImageChannels, 0, 3, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_compareImageChannels, 0, 0, 3) +#endif + + ZEND_ARG_OBJ_INFO(0, reference, Imagick, 0) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, channel, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, channel) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, metric, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, metric) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_compareImages, 0, 2, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_compareImages, 0, 0, 2) +#endif + + ZEND_ARG_OBJ_INFO(0, reference, Imagick, 0) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, metric, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, metric) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_contrastImage, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_contrastImage, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, sharpen, _IS_BOOL, 0) +#else + ZEND_ARG_INFO(0, sharpen) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_combineImages, 0, 1, Imagick, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_combineImages, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, colorspace, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, colorspace) +#endif +ZEND_END_ARG_INFO() + +#if MagickLibVersion >= 0x700 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_convolveImage, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_convolveImage, 0, 0, 1) +#endif + + ZEND_ARG_OBJ_INFO(0, kernel, ImagickKernel, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") +ZEND_END_ARG_INFO() +#endif + +#if !(MagickLibVersion >= 0x700) + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_convolveImage, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_convolveImage, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, kernel, IS_ARRAY, 0) +#else + ZEND_ARG_INFO(0, kernel) +#endif + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") +ZEND_END_ARG_INFO() +#endif + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_cycleColormapImage, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_cycleColormapImage, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, displace, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, displace) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_deconstructImages arginfo_class_Imagick_optimizeImageLayers + +#define arginfo_class_Imagick_despeckleImage arginfo_class_Imagick_transposeImage + +#define arginfo_class_Imagick_edgeImage arginfo_class_Imagick_oilPaintImage + +#define arginfo_class_Imagick_embossImage arginfo_class_Imagick_charcoalImage + +#define arginfo_class_Imagick_enhanceImage arginfo_class_Imagick_transposeImage + +#define arginfo_class_Imagick_equalizeImage arginfo_class_Imagick_transposeImage + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_evaluateImage, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_evaluateImage, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, evaluate, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, evaluate) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, constant, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, constant) +#endif + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") +ZEND_END_ARG_INFO() + +#if MagickLibVersion >= 0x687 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_evaluateImages, 0, 1, Imagick, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_evaluateImages, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, evaluate, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, evaluate) +#endif +ZEND_END_ARG_INFO() +#endif + +#define arginfo_class_Imagick_flattenImages arginfo_class_Imagick_optimizeImageLayers + +#define arginfo_class_Imagick_flipImage arginfo_class_Imagick_transposeImage + +#define arginfo_class_Imagick_flopImage arginfo_class_Imagick_transposeImage + +#if MagickLibVersion >= 0x655 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_forwardFourierTransformImage, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_forwardFourierTransformImage, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, magnitude, _IS_BOOL, 0) +#else + ZEND_ARG_INFO(0, magnitude) +#endif +ZEND_END_ARG_INFO() +#endif + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_frameImage, 0, 5, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_frameImage, 0, 0, 5) +#endif + + ZEND_ARG_OBJ_TYPE_MASK(0, matte_color, ImagickPixel, MAY_BE_STRING, NULL) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, width) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, height) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, inner_bevel, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, inner_bevel) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, outer_bevel, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, outer_bevel) +#endif +ZEND_END_ARG_INFO() + +#if MagickLibVersion >= 0x700 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_frameImageWithComposite, 0, 6, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_frameImageWithComposite, 0, 0, 6) +#endif + + ZEND_ARG_OBJ_TYPE_MASK(0, matte_color, ImagickPixel, MAY_BE_STRING, NULL) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, width) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, height) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, inner_bevel, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, inner_bevel) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, outer_bevel, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, outer_bevel) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, composite, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, composite) +#endif +ZEND_END_ARG_INFO() +#endif + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_fxImage, 0, 1, Imagick, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_fxImage, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, expression, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, expression) +#endif + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_gammaImage, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_gammaImage, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, gamma, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, gamma) +#endif + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_gaussianBlurImage arginfo_class_Imagick_adaptiveBlurImage + +#if MagickLibVersion < 0x700 && !defined(MAGICKCORE_EXCLUDE_DEPRECATED) + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageAttribute, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageAttribute, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, key) +#endif +ZEND_END_ARG_INFO() +#endif + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_getImageBackgroundColor, 0, 0, ImagickPixel, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageBackgroundColor, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_getImageBluePrimary arginfo_class_Imagick_getImageGeometry + +#define arginfo_class_Imagick_getImageBorderColor arginfo_class_Imagick_getImageBackgroundColor + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageChannelDepth, 0, 1, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageChannelDepth, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, channel, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, channel) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageChannelDistortion, 0, 3, IS_DOUBLE, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageChannelDistortion, 0, 0, 3) +#endif + + ZEND_ARG_OBJ_INFO(0, reference, Imagick, 0) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, channel, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, channel) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, metric, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, metric) +#endif +ZEND_END_ARG_INFO() + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageChannelExtrema, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageChannelExtrema, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, channel, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, channel) +#endif +ZEND_END_ARG_INFO() +#endif + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageChannelMean, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageChannelMean, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, channel, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, channel) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_getImageChannelStatistics arginfo_class_Imagick_getImageGeometry + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_getImageColormapColor, 0, 1, ImagickPixel, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageColormapColor, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, index) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_getImageColorspace arginfo_class_Imagick_getSizeOffset + +#define arginfo_class_Imagick_getImageCompose arginfo_class_Imagick_getSizeOffset + +#define arginfo_class_Imagick_getImageDelay arginfo_class_Imagick_getSizeOffset + +#define arginfo_class_Imagick_getImageDepth arginfo_class_Imagick_getSizeOffset + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageDistortion, 0, 2, IS_DOUBLE, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageDistortion, 0, 0, 2) +#endif + + ZEND_ARG_OBJ_INFO(0, reference, Imagick, 0) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, metric, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, metric) +#endif +ZEND_END_ARG_INFO() + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageExtrema, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageExtrema, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + +#define arginfo_class_Imagick_getImageDispose arginfo_class_Imagick_getSizeOffset + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageGamma, 0, 0, IS_DOUBLE, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageGamma, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_getImageGreenPrimary arginfo_class_Imagick_getImageGeometry + +#define arginfo_class_Imagick_getImageHeight arginfo_class_Imagick_getSizeOffset + +#define arginfo_class_Imagick_getImageHistogram arginfo_class_Imagick_getImageGeometry + +#define arginfo_class_Imagick_getImageInterlaceScheme arginfo_class_Imagick_getSizeOffset + +#define arginfo_class_Imagick_getImageIterations arginfo_class_Imagick_getSizeOffset + +#if MagickLibVersion < 0x700 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_getImageMatteColor, 0, 0, ImagickPixel, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageMatteColor, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + +#define arginfo_class_Imagick_getImagePage arginfo_class_Imagick_getImageGeometry + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_getImagePixelColor, 0, 2, ImagickPixel, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImagePixelColor, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, y) +#endif +ZEND_END_ARG_INFO() + +#if IM_HAVE_IMAGICK_SETIMAGEPIXELCOLOR + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_setImagePixelColor, 0, 3, ImagickPixel, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImagePixelColor, 0, 0, 3) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, y) +#endif + ZEND_ARG_OBJ_TYPE_MASK(0, color, ImagickPixel, MAY_BE_STRING, NULL) +ZEND_END_ARG_INFO() +#endif + +#define arginfo_class_Imagick_getImageProfile arginfo_class_Imagick_getImageProperty + +#define arginfo_class_Imagick_getImageRedPrimary arginfo_class_Imagick_getImageGeometry + +#define arginfo_class_Imagick_getImageRenderingIntent arginfo_class_Imagick_getSizeOffset + +#define arginfo_class_Imagick_getImageResolution arginfo_class_Imagick_getImageGeometry + +#define arginfo_class_Imagick_getImageScene arginfo_class_Imagick_getSizeOffset + +#define arginfo_class_Imagick_getImageSignature arginfo_class_Imagick___toString + +#define arginfo_class_Imagick_getImageTicksPerSecond arginfo_class_Imagick_getSizeOffset + +#define arginfo_class_Imagick_getImageType arginfo_class_Imagick_getSizeOffset + +#define arginfo_class_Imagick_getImageUnits arginfo_class_Imagick_getSizeOffset + +#define arginfo_class_Imagick_getImageVirtualPixelMethod arginfo_class_Imagick_getSizeOffset + +#define arginfo_class_Imagick_getImageWhitePoint arginfo_class_Imagick_getImageGeometry + +#define arginfo_class_Imagick_getImageWidth arginfo_class_Imagick_getSizeOffset + +#define arginfo_class_Imagick_getNumberImages arginfo_class_Imagick_getSizeOffset + +#define arginfo_class_Imagick_getImageTotalInkDensity arginfo_class_Imagick_getImageGamma + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_getImageRegion, 0, 4, Imagick, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageRegion, 0, 0, 4) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, width) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, height) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, y) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_implodeImage arginfo_class_Imagick_oilPaintImage + +#if MagickLibVersion >= 0x700 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_implodeImageWithMethod, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_implodeImageWithMethod, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, radius, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, radius) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, pixel_interpolate_method, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, pixel_interpolate_method) +#endif +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion >= 0x658 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_inverseFourierTransformImage, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_inverseFourierTransformImage, 0, 0, 2) +#endif + + ZEND_ARG_OBJ_INFO(0, complement, Imagick, 0) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, magnitude, _IS_BOOL, 0) +#else + ZEND_ARG_INFO(0, magnitude) +#endif +ZEND_END_ARG_INFO() +#endif + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_levelImage, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_levelImage, 0, 0, 3) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, black_point, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, black_point) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, gamma, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, gamma) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, white_point, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, white_point) +#endif + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_magnifyImage arginfo_class_Imagick_transposeImage + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_mapImage, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_mapImage, 0, 0, 2) +#endif + + ZEND_ARG_OBJ_INFO(0, map, imagick, 0) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, dither, _IS_BOOL, 0) +#else + ZEND_ARG_INFO(0, dither) +#endif +ZEND_END_ARG_INFO() +#endif + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_matteFloodfillImage, 0, 5, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_matteFloodfillImage, 0, 0, 5) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, alpha, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, alpha) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, fuzz, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, fuzz) +#endif + ZEND_ARG_OBJ_TYPE_MASK(0, border_color, ImagickPixel, MAY_BE_STRING, NULL) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, y) +#endif +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion < 0x700 && !defined(MAGICKCORE_EXCLUDE_DEPRECATED) + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_medianFilterImage, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_medianFilterImage, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, radius, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, radius) +#endif +ZEND_END_ARG_INFO() +#endif + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_negateImage, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_negateImage, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, gray, _IS_BOOL, 0) +#else + ZEND_ARG_INFO(0, gray) +#endif + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") +ZEND_END_ARG_INFO() + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_paintOpaqueImage, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_paintOpaqueImage, 0, 0, 3) +#endif + + ZEND_ARG_OBJ_TYPE_MASK(0, target_color, ImagickPixel, MAY_BE_STRING, NULL) + ZEND_ARG_OBJ_TYPE_MASK(0, fill_color, ImagickPixel, MAY_BE_STRING, NULL) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, fuzz, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, fuzz) +#endif + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") +ZEND_END_ARG_INFO() +#endif + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_paintTransparentImage, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_paintTransparentImage, 0, 0, 3) +#endif + + ZEND_ARG_OBJ_TYPE_MASK(0, target_color, ImagickPixel, MAY_BE_STRING, NULL) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, alpha, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, alpha) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, fuzz, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, fuzz) +#endif +ZEND_END_ARG_INFO() +#endif + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_previewImages, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_previewImages, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, preview, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, preview) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_profileImage, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_profileImage, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, name) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, profile, IS_STRING, 1) +#else + ZEND_ARG_INFO(0, profile) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_quantizeImage, 0, 5, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_quantizeImage, 0, 0, 5) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, number_colors, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, number_colors) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, colorspace, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, colorspace) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, tree_depth, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, tree_depth) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, dither, _IS_BOOL, 0) +#else + ZEND_ARG_INFO(0, dither) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, measure_error, _IS_BOOL, 0) +#else + ZEND_ARG_INFO(0, measure_error) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_quantizeImages arginfo_class_Imagick_quantizeImage + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_reduceNoiseImage, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_reduceNoiseImage, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, radius, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, radius) +#endif +ZEND_END_ARG_INFO() +#endif + +#define arginfo_class_Imagick_removeImageProfile arginfo_class_Imagick_getImageProperty + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_separateImageChannel, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_separateImageChannel, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, channel, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, channel) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_sepiaToneImage, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_sepiaToneImage, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, threshold, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, threshold) +#endif +ZEND_END_ARG_INFO() + +#if MagickLibVersion < 0x700 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageBias, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageBias, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, bias, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, bias) +#endif +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion < 0x700 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageBiasQuantum, 0, 1, IS_VOID, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageBiasQuantum, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, bias, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, bias) +#endif +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion >= 0x700 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageBluePrimary, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageBluePrimary, 0, 0, 3) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, y) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, z, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, z) +#endif +ZEND_END_ARG_INFO() +#endif + +#if !(MagickLibVersion >= 0x700) + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageBluePrimary, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageBluePrimary, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, y) +#endif +ZEND_END_ARG_INFO() +#endif + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageBorderColor, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageBorderColor, 0, 0, 1) +#endif + + ZEND_ARG_OBJ_TYPE_MASK(0, border_color, ImagickPixel, MAY_BE_STRING, NULL) +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageChannelDepth, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageChannelDepth, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, channel, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, channel) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, depth, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, depth) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageColormapColor, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageColormapColor, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, index) +#endif + ZEND_ARG_OBJ_TYPE_MASK(0, color, ImagickPixel, MAY_BE_STRING, NULL) +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageColorspace, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageColorspace, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, colorspace, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, colorspace) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageDispose, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageDispose, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, dispose, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, dispose) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_setImageExtent arginfo_class_Imagick_sampleImage + +#if MagickLibVersion >= 0x700 +#define arginfo_class_Imagick_setImageGreenPrimary arginfo_class_Imagick_setImageBluePrimary +#endif + +#if !(MagickLibVersion >= 0x700) +#define arginfo_class_Imagick_setImageGreenPrimary arginfo_class_Imagick_setImageBluePrimary +#endif + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageInterlaceScheme, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageInterlaceScheme, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, interlace, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, interlace) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageProfile, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageProfile, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, name) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, profile, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, profile) +#endif +ZEND_END_ARG_INFO() + +#if MagickLibVersion >= 0x700 +#define arginfo_class_Imagick_setImageRedPrimary arginfo_class_Imagick_setImageBluePrimary +#endif + +#if !(MagickLibVersion >= 0x700) +#define arginfo_class_Imagick_setImageRedPrimary arginfo_class_Imagick_setImageBluePrimary +#endif + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageRenderingIntent, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageRenderingIntent, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, rendering_intent, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, rendering_intent) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageVirtualPixelMethod, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageVirtualPixelMethod, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, method, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, method) +#endif +ZEND_END_ARG_INFO() + +#if MagickLibVersion >= 0x700 +#define arginfo_class_Imagick_setImageWhitePoint arginfo_class_Imagick_setImageBluePrimary +#endif + +#if !(MagickLibVersion >= 0x700) +#define arginfo_class_Imagick_setImageWhitePoint arginfo_class_Imagick_setImageBluePrimary +#endif + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_sigmoidalContrastImage, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_sigmoidalContrastImage, 0, 0, 3) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, sharpen, _IS_BOOL, 0) +#else + ZEND_ARG_INFO(0, sharpen) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, alpha, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, alpha) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, beta, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, beta) +#endif + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_stereoImage, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_stereoImage, 0, 0, 1) +#endif + + ZEND_ARG_OBJ_INFO(0, offset_image, Imagick, 0) +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_textureImage, 0, 1, Imagick, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_textureImage, 0, 0, 1) +#endif + + ZEND_ARG_OBJ_INFO(0, texture, Imagick, 0) +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_tintImage, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_tintImage, 0, 0, 2) +#endif + + ZEND_ARG_OBJ_TYPE_MASK(0, tint_color, ImagickPixel, MAY_BE_STRING, NULL) + ZEND_ARG_OBJ_TYPE_MASK(0, opacity_color, ImagickPixel, MAY_BE_STRING, NULL) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, legacy, _IS_BOOL, 0, "false") +#else + ZEND_ARG_INFO(0, legacy) +#endif + +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_unsharpMaskImage, 0, 4, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_unsharpMaskImage, 0, 0, 4) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, radius, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, radius) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, sigma, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, sigma) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, amount, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, amount) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, threshold, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, threshold) +#endif + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_getImage arginfo_class_Imagick_optimizeImageLayers + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_addImage, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_addImage, 0, 0, 1) +#endif + + ZEND_ARG_OBJ_INFO(0, image, Imagick, 0) +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_setImage arginfo_class_Imagick_addImage + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_newImage, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_newImage, 0, 0, 3) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, columns, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, columns) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, rows, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, rows) +#endif + ZEND_ARG_OBJ_TYPE_MASK(0, background_color, ImagickPixel, MAY_BE_STRING, NULL) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, format, IS_STRING, 1, "null") +#else + ZEND_ARG_INFO(0, format) +#endif + +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_newPseudoImage, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_newPseudoImage, 0, 0, 3) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, columns, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, columns) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, rows, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, rows) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, pseudo_format, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, pseudo_format) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_getCompression arginfo_class_Imagick_getSizeOffset + +#define arginfo_class_Imagick_getCompressionQuality arginfo_class_Imagick_getSizeOffset + +#define arginfo_class_Imagick_getCopyright arginfo_class_Imagick___toString + +#define arginfo_class_Imagick_getConfigureOptions arginfo_class_Imagick_queryFormats + +#if MagickLibVersion > 0x660 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getFeatures, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getFeatures, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + +#define arginfo_class_Imagick_getFilename arginfo_class_Imagick___toString + +#define arginfo_class_Imagick_getFormat arginfo_class_Imagick___toString + +#define arginfo_class_Imagick_getHomeURL arginfo_class_Imagick___toString + +#define arginfo_class_Imagick_getInterlaceScheme arginfo_class_Imagick_getSizeOffset + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getOption, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getOption, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, key) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_getPackageName arginfo_class_Imagick___toString + +#define arginfo_class_Imagick_getPage arginfo_class_Imagick_getImageGeometry + +#define arginfo_class_Imagick_getQuantum arginfo_class_Imagick_getSizeOffset + +#define arginfo_class_Imagick_getHdriEnabled arginfo_class_Imagick_transposeImage + +#define arginfo_class_Imagick_getQuantumDepth arginfo_class_Imagick_getImageGeometry + +#define arginfo_class_Imagick_getQuantumRange arginfo_class_Imagick_getImageGeometry + +#define arginfo_class_Imagick_getReleaseDate arginfo_class_Imagick___toString + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getResource, 0, 1, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getResource, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, type) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getResourceLimit, 0, 1, IS_DOUBLE, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getResourceLimit, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, type) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_getSamplingFactors arginfo_class_Imagick_getImageGeometry + +#define arginfo_class_Imagick_getSize arginfo_class_Imagick_getImageGeometry + +#define arginfo_class_Imagick_getVersion arginfo_class_Imagick_getImageGeometry + +#define arginfo_class_Imagick_setBackgroundColor arginfo_class_Imagick_setImageBackgroundColor + +#define arginfo_class_Imagick_setCompression arginfo_class_Imagick_setImageCompression + +#define arginfo_class_Imagick_setCompressionQuality arginfo_class_Imagick_setImageCompressionQuality + +#define arginfo_class_Imagick_setFilename arginfo_class_Imagick_readImage + +#define arginfo_class_Imagick_setFormat arginfo_class_Imagick_setImageFormat + +#define arginfo_class_Imagick_setInterlaceScheme arginfo_class_Imagick_setImageInterlaceScheme + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setOption, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setOption, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, key) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, value) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_setPage arginfo_class_Imagick_extentImage + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setResourceLimit, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setResourceLimit, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, type) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, limit, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, limit) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_setResolution arginfo_class_Imagick_setImageResolution + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setSamplingFactors, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setSamplingFactors, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, factors, IS_ARRAY, 0) +#else + ZEND_ARG_INFO(0, factors) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_setSize arginfo_class_Imagick_sampleImage + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setType, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setType, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, imgtype, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, imgtype) +#endif +ZEND_END_ARG_INFO() + +#if MagickLibVersion > 0x628 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_key, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_key, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + +#define arginfo_class_Imagick_next arginfo_class_Imagick_resetIterator + +#define arginfo_class_Imagick_rewind arginfo_class_Imagick_resetIterator + +#define arginfo_class_Imagick_valid arginfo_class_Imagick_transposeImage + +#define arginfo_class_Imagick_current arginfo_class_Imagick_optimizeImageLayers + +#if MagickLibVersion >= 0x659 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_brightnessContrastImage, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_brightnessContrastImage, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, brightness, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, brightness) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, contrast, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, contrast) +#endif + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x661 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_colorMatrixImage, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_colorMatrixImage, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, color_matrix, IS_ARRAY, 0) +#else + ZEND_ARG_INFO(0, color_matrix) +#endif +ZEND_END_ARG_INFO() +#endif + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_selectiveBlurImage, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_selectiveBlurImage, 0, 0, 3) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, radius, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, radius) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, sigma, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, sigma) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, threshold, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, threshold) +#endif + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") +ZEND_END_ARG_INFO() + +#if MagickLibVersion >= 0x689 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_rotationalBlurImage, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_rotationalBlurImage, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, angle, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, angle) +#endif + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion >= 0x683 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_statisticImage, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_statisticImage, 0, 0, 3) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, type) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, width) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, height) +#endif + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion >= 0x652 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_subimageMatch, 0, 1, Imagick, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_subimageMatch, 0, 0, 1) +#endif + + ZEND_ARG_OBJ_INFO(0, image, Imagick, 0) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, offset, "null") +#else + ZEND_ARG_INFO(1, offset) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, similarity, "null") +#else + ZEND_ARG_INFO(1, similarity) +#endif + + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, threshold, IS_DOUBLE, 0, "0.0") + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, metric, IS_LONG, 0, "0") +#else + ZEND_ARG_INFO(0, metric) +#endif + +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion >= 0x652 +#define arginfo_class_Imagick_similarityImage arginfo_class_Imagick_subimageMatch +#endif + +#define arginfo_class_Imagick_setRegistry arginfo_class_Imagick_setOption + + +#if PHP_VERSION_ID >= 80000 + ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_Imagick_getRegistry, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) +#else + ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getRegistry, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, key) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_listRegistry arginfo_class_Imagick_getImageGeometry + +#if MagickLibVersion >= 0x680 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_morphology, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_morphology, 0, 0, 3) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, morphology, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, morphology) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, iterations, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, iterations) +#endif + ZEND_ARG_OBJ_INFO(0, kernel, ImagickKernel, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_DEFAULT") +ZEND_END_ARG_INFO() +#endif + +#if defined(IMAGICK_WITH_KERNEL) && MagickLibVersion < 0x700 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_filter, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_filter, 0, 0, 1) +#endif + + ZEND_ARG_OBJ_INFO(0, kernel, ImagickKernel, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 0, "Imagick::CHANNEL_UNDEFINED") +ZEND_END_ARG_INFO() +#endif + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setAntialias, 0, 1, IS_VOID, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setAntialias, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, antialias, _IS_BOOL, 0) +#else + ZEND_ARG_INFO(0, antialias) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_getAntialias arginfo_class_Imagick_transposeImage + +#if MagickLibVersion > 0x676 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_colorDecisionListImage, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_colorDecisionListImage, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, color_correction_collection, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, color_correction_collection) +#endif +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion >= 0x687 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_optimizeImageTransparency, 0, 0, IS_VOID, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_optimizeImageTransparency, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion >= 0x660 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_autoGammaImage, 0, 0, IS_VOID, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_autoGammaImage, 0, 0, 0) +#endif + + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, channel, IS_LONG, 1, "Imagick::CHANNEL_ALL") +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion >= 0x692 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_autoOrient, 0, 0, IS_VOID, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_autoOrient, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion >= 0x692 +#define arginfo_class_Imagick_autoOrientate arginfo_class_Imagick_autoOrient +#endif + +#if MagickLibVersion >= 0x692 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_compositeImageGravity, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_compositeImageGravity, 0, 0, 3) +#endif + + ZEND_ARG_OBJ_INFO(0, image, Imagick, 0) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, composite_constant, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, composite_constant) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, gravity, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, gravity) +#endif +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion >= 0x693 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_localContrastImage, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_localContrastImage, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, radius, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, radius) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, strength, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, strength) +#endif +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion >= 0x700 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_identifyImageType, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_identifyImageType, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + +#if IM_HAVE_IMAGICK_GETSETIMAGEMASK + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_getImageMask, 0, 1, Imagick, 1) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageMask, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, pixelmask, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, pixelmask) +#endif +ZEND_END_ARG_INFO() +#endif + +#if IM_HAVE_IMAGICK_GETSETIMAGEMASK + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageMask, 0, 2, IS_VOID, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageMask, 0, 0, 2) +#endif + + ZEND_ARG_OBJ_INFO(0, clip_mask, Imagick, 0) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, pixelmask, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, pixelmask) +#endif +ZEND_END_ARG_INFO() +#endif + +#if IM_HAVE_IMAGICK_CANNYEDGEIMAGE + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_cannyEdgeImage, 0, 4, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_cannyEdgeImage, 0, 0, 4) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, radius, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, radius) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, sigma, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, sigma) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, lower_percent, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, lower_percent) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, upper_percent, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, upper_percent) +#endif +ZEND_END_ARG_INFO() +#endif + +#if IM_HAVE_IMAGICK_SETSEED + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setSeed, 0, 1, IS_VOID, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setSeed, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, seed, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, seed) +#endif +ZEND_END_ARG_INFO() +#endif + +#if IM_HAVE_IMAGICK_WAVELETDENOISEIMAGE + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_waveletDenoiseImage, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_waveletDenoiseImage, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, threshold, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, threshold) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, softness, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, softness) +#endif +ZEND_END_ARG_INFO() +#endif + +#if IM_HAVE_IMAGICK_MEANSHIFTIMAGE + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_meanShiftImage, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_meanShiftImage, 0, 0, 3) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, width) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, height) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, color_distance, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, color_distance) +#endif +ZEND_END_ARG_INFO() +#endif + +#if IM_HAVE_IMAGICK_KMEANSIMAGE + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_kmeansImage, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_kmeansImage, 0, 0, 3) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, number_colors, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, number_colors) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, max_iterations, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, max_iterations) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, tolerance, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, tolerance) +#endif +ZEND_END_ARG_INFO() +#endif + +#if IM_HAVE_IMAGICK_RANGETHRESHOLDIMAGE + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_rangeThresholdImage, 0, 4, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_rangeThresholdImage, 0, 0, 4) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, low_black, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, low_black) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, low_white, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, low_white) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, high_white, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, high_white) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, high_black, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, high_black) +#endif +ZEND_END_ARG_INFO() +#endif + +#if IM_HAVE_IMAGICK_AUTOTHRESHOLDIMAGE + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_autoThresholdImage, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_autoThresholdImage, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, auto_threshold_method, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, auto_threshold_method) +#endif +ZEND_END_ARG_INFO() +#endif + +#if IM_HAVE_IMAGICK_BILATERALBLURIMAGE + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_bilateralBlurImage, 0, 4, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_bilateralBlurImage, 0, 0, 4) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, radius, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, radius) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, sigma, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, sigma) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, intensity_sigma, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, intensity_sigma) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, spatial_sigma, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, spatial_sigma) +#endif +ZEND_END_ARG_INFO() +#endif + +#if IM_HAVE_IMAGICK_CLAHEIMAGE + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_claheImage, 0, 4, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_claheImage, 0, 0, 4) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, width) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, height) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, number_bins, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, number_bins) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, clip_limit, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, clip_limit) +#endif +ZEND_END_ARG_INFO() +#endif + +#if IM_HAVE_IMAGICK_CHANNELFXIMAGE + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_channelFxImage, 0, 1, Imagick, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_channelFxImage, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, expression, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, expression) +#endif +ZEND_END_ARG_INFO() +#endif + +#if IM_HAVE_IMAGICK_COLORTHRESHOLDIMAGE + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_colorThresholdImage, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_colorThresholdImage, 0, 0, 2) +#endif + + ZEND_ARG_OBJ_TYPE_MASK(0, start_color, ImagickPixel, MAY_BE_STRING, NULL) + ZEND_ARG_OBJ_TYPE_MASK(0, stop_color, ImagickPixel, MAY_BE_STRING, NULL) +ZEND_END_ARG_INFO() +#endif + +#if IM_HAVE_IMAGICK_COMPLEXIMAGES + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_complexImages, 0, 1, Imagick, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_complexImages, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, complex_operator, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, complex_operator) +#endif +ZEND_END_ARG_INFO() +#endif + +#if IM_HAVE_IMAGICK_INTERPOLATIVERESIZEIMAGE + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_interpolativeResizeImage, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_interpolativeResizeImage, 0, 0, 3) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, columns, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, columns) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, rows, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, rows) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, interpolate, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, interpolate) +#endif +ZEND_END_ARG_INFO() +#endif + +#if IM_HAVE_IMAGICK_LEVELIMAGECOLORS + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_levelImageColors, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_levelImageColors, 0, 0, 3) +#endif + + ZEND_ARG_OBJ_TYPE_MASK(0, black_color, ImagickPixel, MAY_BE_STRING, NULL) + ZEND_ARG_OBJ_TYPE_MASK(0, white_color, ImagickPixel, MAY_BE_STRING, NULL) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, invert, _IS_BOOL, 0) +#else + ZEND_ARG_INFO(0, invert) +#endif +ZEND_END_ARG_INFO() +#endif + +#if IM_HAVE_IMAGICK_LEVELIZEIMAGE + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_levelizeImage, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_levelizeImage, 0, 0, 3) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, black_point, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, black_point) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, gamma, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, gamma) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, white_point, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, white_point) +#endif +ZEND_END_ARG_INFO() +#endif + +#if IM_HAVE_IMAGICK_ORDEREDDITHERIMAGE + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_orderedDitherImage, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_orderedDitherImage, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, dither_format, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, dither_format) +#endif +ZEND_END_ARG_INFO() +#endif + +#if IM_HAVE_IMAGICK_WHITEBALANCEIMAGE + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_whiteBalanceImage, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_whiteBalanceImage, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + +#if IM_HAVE_IMAGICK_DELETE_OPTION + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_deleteOption, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_deleteOption, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, option, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, option) +#endif +ZEND_END_ARG_INFO() +#endif + +#if IM_HAVE_IMAGICK_GET_BACKGROUND_COLOR + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_getBackgroundColor, 0, 0, ImagickPixel, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getBackgroundColor, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + +#if IM_HAVE_IMAGICK_GET_IMAGE_ARTIFACTS + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageArtifacts, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageArtifacts, 0, 0, 0) +#endif + + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 0, "\"*\"") +ZEND_END_ARG_INFO() +#endif + +#if IM_HAVE_IMAGICK_GET_IMAGE_KURTOSIS + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageKurtosis, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageKurtosis, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + +#if IM_HAVE_IMAGICK_GET_IMAGE_MEAN + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageMean, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageMean, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + +#if IM_HAVE_IMAGICK_GET_IMAGE_RANGE + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageRange, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageRange, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + +#if IM_HAVE_IMAGICK_GET_INTERPOLATE_METHOD + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getInterpolateMethod, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getInterpolateMethod, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + +#if IM_HAVE_IMAGICK_GET_OPTIONS + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getOptions, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getOptions, 0, 0, 0) +#endif + + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 0, "\"*\"") +ZEND_END_ARG_INFO() +#endif + +#if IM_HAVE_IMAGICK_GET_ORIENTATION + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getOrientation, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getOrientation, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + +#if IM_HAVE_IMAGICK_GET_RESOLUTION + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getResolution, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getResolution, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + +#if IM_HAVE_IMAGICK_GET_TYPE + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getType, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getType, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + +#if IM_HAVE_IMAGICK_POLYNOMIAL_IMAGE + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_polynomialImage, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_polynomialImage, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, terms, IS_ARRAY, 0) +#else + ZEND_ARG_INFO(0, terms) +#endif +ZEND_END_ARG_INFO() +#endif + +#if IM_HAVE_IMAGICK_SET_DEPTH + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setDepth, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setDepth, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, depth, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, depth) +#endif +ZEND_END_ARG_INFO() +#endif + +#if IM_HAVE_IMAGICK_SET_EXTRACT + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setExtract, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setExtract, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, geometry, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, geometry) +#endif +ZEND_END_ARG_INFO() +#endif + +#if IM_HAVE_IMAGICK_SET_INTERPOLATE_METHOD + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setInterpolateMethod, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setInterpolateMethod, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, method, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, method) +#endif +ZEND_END_ARG_INFO() +#endif + +#if IM_HAVE_IMAGICK_SET_ORIENTATION + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setOrientation, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setOrientation, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, orientation, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, orientation) +#endif +ZEND_END_ARG_INFO() +#endif + + +ZEND_METHOD(Imagick, optimizeImageLayers); +ZEND_METHOD(Imagick, compareImageLayers); +ZEND_METHOD(Imagick, pingImageBlob); +ZEND_METHOD(Imagick, pingImageFile); +ZEND_METHOD(Imagick, transposeImage); +ZEND_METHOD(Imagick, transverseImage); +ZEND_METHOD(Imagick, trimImage); +ZEND_METHOD(Imagick, waveImage); +#if MagickLibVersion >= 0x700 +ZEND_METHOD(Imagick, waveImageWithMethod); +#endif +ZEND_METHOD(Imagick, vignetteImage); +ZEND_METHOD(Imagick, uniqueImageColors); +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 +ZEND_METHOD(Imagick, getImageMatte); +#endif +ZEND_METHOD(Imagick, setImageMatte); +ZEND_METHOD(Imagick, adaptiveResizeImage); +ZEND_METHOD(Imagick, sketchImage); +ZEND_METHOD(Imagick, shadeImage); +ZEND_METHOD(Imagick, getSizeOffset); +ZEND_METHOD(Imagick, setSizeOffset); +ZEND_METHOD(Imagick, adaptiveBlurImage); +ZEND_METHOD(Imagick, contrastStretchImage); +ZEND_METHOD(Imagick, adaptiveSharpenImage); +ZEND_METHOD(Imagick, randomThresholdImage); +ZEND_METHOD(Imagick, roundCornersImage); +ZEND_METHOD(Imagick, setIteratorIndex); +ZEND_METHOD(Imagick, getIteratorIndex); +#if MagickLibVersion < 0x700 +ZEND_METHOD(Imagick, transformImage); +#endif +#if MagickLibVersion > 0x630 && MagickLibVersion < 0x700 +ZEND_METHOD(Imagick, setImageOpacity); +#endif +#if MagickLibVersion >= 0x700 +ZEND_METHOD(Imagick, setImageAlpha); +#endif +#if MagickLibVersion < 0x700 +ZEND_METHOD(Imagick, orderedPosterizeImage); +#endif +#if MagickLibVersion >= 0x700 +ZEND_METHOD(Imagick, polaroidWithTextAndMethod); +#endif +ZEND_METHOD(Imagick, polaroidImage); +ZEND_METHOD(Imagick, getImageProperty); +ZEND_METHOD(Imagick, setImageProperty); +ZEND_METHOD(Imagick, deleteImageProperty); +ZEND_METHOD(Imagick, identifyFormat); +#if IM_HAVE_IMAGICK_SETIMAGEINTERPOLATEMETHOD +ZEND_METHOD(Imagick, setImageInterpolateMethod); +#endif +ZEND_METHOD(Imagick, getImageInterpolateMethod); +ZEND_METHOD(Imagick, linearStretchImage); +ZEND_METHOD(Imagick, getImageLength); +ZEND_METHOD(Imagick, extentImage); +#if MagickLibVersion > 0x633 +ZEND_METHOD(Imagick, getImageOrientation); +#endif +#if MagickLibVersion > 0x633 +ZEND_METHOD(Imagick, setImageOrientation); +#endif +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion > 0x634 && MagickLibVersion < 0x700 +ZEND_METHOD(Imagick, paintFloodfillImage); +#endif +ZEND_METHOD(Imagick, clutImage); +#if MagickLibVersion >= 0x700 +ZEND_METHOD(Imagick, clutImageWithInterpolate); +#endif +ZEND_METHOD(Imagick, getImageProperties); +ZEND_METHOD(Imagick, getImageProfiles); +ZEND_METHOD(Imagick, distortImage); +ZEND_METHOD(Imagick, writeImageFile); +ZEND_METHOD(Imagick, writeImagesFile); +ZEND_METHOD(Imagick, resetImagePage); +#if MagickLibVersion < 0x700 +ZEND_METHOD(Imagick, setImageClipMask); +#endif +#if MagickLibVersion < 0x700 +ZEND_METHOD(Imagick, getImageClipMask); +#endif +ZEND_METHOD(Imagick, animateImages); +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 +ZEND_METHOD(Imagick, recolorImage); +#endif +#if MagickLibVersion > 0x636 +ZEND_METHOD(Imagick, setFont); +#endif +#if MagickLibVersion > 0x636 +ZEND_METHOD(Imagick, getFont); +#endif +#if MagickLibVersion > 0x636 +ZEND_METHOD(Imagick, setPointSize); +#endif +#if MagickLibVersion > 0x636 +ZEND_METHOD(Imagick, getPointSize); +#endif +#if MagickLibVersion > 0x636 +ZEND_METHOD(Imagick, mergeImageLayers); +#endif +#if MagickLibVersion > 0x637 +ZEND_METHOD(Imagick, setImageAlphaChannel); +#endif +#if MagickLibVersion > 0x637 +ZEND_METHOD(Imagick, floodfillPaintImage); +#endif +#if MagickLibVersion > 0x637 +ZEND_METHOD(Imagick, opaquePaintImage); +#endif +#if MagickLibVersion > 0x637 +ZEND_METHOD(Imagick, transparentPaintImage); +#endif +#if MagickLibVersion > 0x638 +ZEND_METHOD(Imagick, liquidRescaleImage); +#endif +#if MagickLibVersion > 0x638 +ZEND_METHOD(Imagick, encipherImage); +#endif +#if MagickLibVersion > 0x638 +ZEND_METHOD(Imagick, decipherImage); +#endif +#if MagickLibVersion > 0x639 +ZEND_METHOD(Imagick, setGravity); +#endif +#if MagickLibVersion > 0x639 +ZEND_METHOD(Imagick, getGravity); +#endif +#if MagickLibVersion > 0x639 +ZEND_METHOD(Imagick, getImageChannelRange); +#endif +#if MagickLibVersion > 0x639 +ZEND_METHOD(Imagick, getImageAlphaChannel); +#endif +#if MagickLibVersion > 0x642 +ZEND_METHOD(Imagick, getImageChannelDistortions); +#endif +#if MagickLibVersion > 0x643 +ZEND_METHOD(Imagick, setImageGravity); +#endif +#if MagickLibVersion > 0x643 +ZEND_METHOD(Imagick, getImageGravity); +#endif +#if MagickLibVersion > 0x645 +ZEND_METHOD(Imagick, importImagePixels); +#endif +#if MagickLibVersion > 0x645 +ZEND_METHOD(Imagick, deskewImage); +#endif +#if MagickLibVersion > 0x645 +ZEND_METHOD(Imagick, segmentImage); +#endif +#if MagickLibVersion > 0x645 +ZEND_METHOD(Imagick, sparseColorImage); +#endif +#if MagickLibVersion > 0x645 +ZEND_METHOD(Imagick, remapImage); +#endif +#if PHP_IMAGICK_HAVE_HOUGHLINE +ZEND_METHOD(Imagick, houghLineImage); +#endif +#if MagickLibVersion > 0x646 +ZEND_METHOD(Imagick, exportImagePixels); +#endif +#if MagickLibVersion > 0x648 +ZEND_METHOD(Imagick, getImageChannelKurtosis); +#endif +#if MagickLibVersion > 0x648 +ZEND_METHOD(Imagick, functionImage); +#endif +#if MagickLibVersion > 0x651 +ZEND_METHOD(Imagick, transformImageColorspace); +#endif +#if MagickLibVersion > 0x652 +ZEND_METHOD(Imagick, haldClutImage); +#endif +#if MagickLibVersion > 0x655 +ZEND_METHOD(Imagick, autoLevelImage); +#endif +#if MagickLibVersion > 0x655 +ZEND_METHOD(Imagick, blueShiftImage); +#endif +#if MagickLibVersion > 0x656 +ZEND_METHOD(Imagick, getImageArtifact); +#endif +#if MagickLibVersion > 0x656 +ZEND_METHOD(Imagick, setImageArtifact); +#endif +#if MagickLibVersion > 0x656 +ZEND_METHOD(Imagick, deleteImageArtifact); +#endif +#if MagickLibVersion > 0x656 +ZEND_METHOD(Imagick, getColorspace); +#endif +#if MagickLibVersion > 0x656 +ZEND_METHOD(Imagick, setColorspace); +#endif +#if MagickLibVersion > 0x656 +ZEND_METHOD(Imagick, clampImage); +#endif +#if MagickLibVersion > 0x667 +ZEND_METHOD(Imagick, smushImages); +#endif +ZEND_METHOD(Imagick, __construct); +ZEND_METHOD(Imagick, __toString); +#if PHP_VERSION_ID >= 50600 +ZEND_METHOD(Imagick, count); +#endif +#if !(PHP_VERSION_ID >= 50600) +ZEND_METHOD(Imagick, count); +#endif +ZEND_METHOD(Imagick, getPixelIterator); +ZEND_METHOD(Imagick, getPixelRegionIterator); +ZEND_METHOD(Imagick, readImage); +ZEND_METHOD(Imagick, readImages); +ZEND_METHOD(Imagick, readImageBlob); +ZEND_METHOD(Imagick, setImageFormat); +ZEND_METHOD(Imagick, scaleImage); +ZEND_METHOD(Imagick, writeImage); +ZEND_METHOD(Imagick, writeImages); +ZEND_METHOD(Imagick, blurImage); +ZEND_METHOD(Imagick, thumbnailImage); +ZEND_METHOD(Imagick, cropThumbnailImage); +ZEND_METHOD(Imagick, getImageFilename); +ZEND_METHOD(Imagick, setImageFilename); +ZEND_METHOD(Imagick, getImageFormat); +ZEND_METHOD(Imagick, getImageMimeType); +ZEND_METHOD(Imagick, removeImage); +ZEND_METHOD(Imagick, clear); +ZEND_METHOD(Imagick, clone); +ZEND_METHOD(Imagick, getImageSize); +ZEND_METHOD(Imagick, getImageBlob); +ZEND_METHOD(Imagick, getImagesBlob); +ZEND_METHOD(Imagick, setFirstIterator); +ZEND_METHOD(Imagick, setLastIterator); +ZEND_METHOD(Imagick, resetIterator); +ZEND_METHOD(Imagick, previousImage); +ZEND_METHOD(Imagick, nextImage); +ZEND_METHOD(Imagick, hasPreviousImage); +ZEND_METHOD(Imagick, hasNextImage); +ZEND_METHOD(Imagick, setImageIndex); +ZEND_METHOD(Imagick, getImageIndex); +ZEND_METHOD(Imagick, commentImage); +ZEND_METHOD(Imagick, cropImage); +ZEND_METHOD(Imagick, labelImage); +ZEND_METHOD(Imagick, getImageGeometry); +ZEND_METHOD(Imagick, drawImage); +ZEND_METHOD(Imagick, setImageCompressionQuality); +ZEND_METHOD(Imagick, getImageCompressionQuality); +ZEND_METHOD(Imagick, setImageCompression); +ZEND_METHOD(Imagick, getImageCompression); +ZEND_METHOD(Imagick, annotateImage); +ZEND_METHOD(Imagick, compositeImage); +ZEND_METHOD(Imagick, modulateImage); +ZEND_METHOD(Imagick, getImageColors); +ZEND_METHOD(Imagick, montageImage); +ZEND_METHOD(Imagick, identifyImage); +ZEND_METHOD(Imagick, thresholdImage); +ZEND_METHOD(Imagick, adaptiveThresholdImage); +ZEND_METHOD(Imagick, blackThresholdImage); +ZEND_METHOD(Imagick, whiteThresholdImage); +ZEND_METHOD(Imagick, appendImages); +ZEND_METHOD(Imagick, charcoalImage); +ZEND_METHOD(Imagick, normalizeImage); +#if MagickLibVersion >= 0x700 +ZEND_METHOD(Imagick, oilPaintImageWithSigma); +#endif +ZEND_METHOD(Imagick, oilPaintImage); +ZEND_METHOD(Imagick, posterizeImage); +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 +ZEND_METHOD(Imagick, radialBlurImage); +#endif +ZEND_METHOD(Imagick, raiseImage); +ZEND_METHOD(Imagick, resampleImage); +ZEND_METHOD(Imagick, resizeImage); +ZEND_METHOD(Imagick, rollImage); +ZEND_METHOD(Imagick, rotateImage); +ZEND_METHOD(Imagick, sampleImage); +ZEND_METHOD(Imagick, solarizeImage); +ZEND_METHOD(Imagick, shadowImage); +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 +ZEND_METHOD(Imagick, setImageAttribute); +#endif +ZEND_METHOD(Imagick, setImageBackgroundColor); +#if MagickLibVersion >= 0x700 +ZEND_METHOD(Imagick, setImageChannelMask); +#endif +ZEND_METHOD(Imagick, setImageCompose); +ZEND_METHOD(Imagick, setImageDelay); +ZEND_METHOD(Imagick, setImageDepth); +ZEND_METHOD(Imagick, setImageGamma); +ZEND_METHOD(Imagick, setImageIterations); +#if MagickLibVersion < 0x700 || MagickLibVersion >= 0x705 +ZEND_METHOD(Imagick, setImageMatteColor); +#endif +ZEND_METHOD(Imagick, setImagePage); +ZEND_METHOD(Imagick, setImageProgressMonitor); +#if MagickLibVersion > 0x653 +ZEND_METHOD(Imagick, setProgressMonitor); +#endif +ZEND_METHOD(Imagick, setImageResolution); +ZEND_METHOD(Imagick, setImageScene); +ZEND_METHOD(Imagick, setImageTicksPerSecond); +ZEND_METHOD(Imagick, setImageType); +ZEND_METHOD(Imagick, setImageUnits); +ZEND_METHOD(Imagick, sharpenImage); +ZEND_METHOD(Imagick, shaveImage); +ZEND_METHOD(Imagick, shearImage); +ZEND_METHOD(Imagick, spliceImage); +ZEND_METHOD(Imagick, pingImage); +ZEND_METHOD(Imagick, readImageFile); +ZEND_METHOD(Imagick, displayImage); +ZEND_METHOD(Imagick, displayImages); +ZEND_METHOD(Imagick, spreadImage); +#if MagickLibVersion >= 0x700 +ZEND_METHOD(Imagick, spreadImageWithMethod); +#endif +ZEND_METHOD(Imagick, swirlImage); +#if MagickLibVersion >= 0x700 +ZEND_METHOD(Imagick, swirlImageWithMethod); +#endif +ZEND_METHOD(Imagick, stripImage); +ZEND_METHOD(Imagick, queryFormats); +ZEND_METHOD(Imagick, queryFonts); +ZEND_METHOD(Imagick, queryFontMetrics); +ZEND_METHOD(Imagick, steganoImage); +ZEND_METHOD(Imagick, addNoiseImage); +#if IM_HAVE_IMAGICK_ADD_NOISE_WITH_ATTENUATE +ZEND_METHOD(Imagick, addNoiseImageWithAttenuate); +#endif +ZEND_METHOD(Imagick, motionBlurImage); +#if MagickLibVersion < 0x700 && !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +ZEND_METHOD(Imagick, mosaicImages); +#endif +ZEND_METHOD(Imagick, morphImages); +ZEND_METHOD(Imagick, minifyImage); +ZEND_METHOD(Imagick, affineTransformImage); +ZEND_METHOD(Imagick, averageImages); +ZEND_METHOD(Imagick, borderImage); +#if MagickLibVersion >= 0x700 +ZEND_METHOD(Imagick, borderImageWithComposite); +#endif +ZEND_METHOD(Imagick, calculateCrop); +ZEND_METHOD(Imagick, chopImage); +ZEND_METHOD(Imagick, clipImage); +ZEND_METHOD(Imagick, clipPathImage); +ZEND_METHOD(Imagick, coalesceImages); +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 +ZEND_METHOD(Imagick, colorFloodfillImage); +#endif +ZEND_METHOD(Imagick, colorizeImage); +ZEND_METHOD(Imagick, compareImageChannels); +ZEND_METHOD(Imagick, compareImages); +ZEND_METHOD(Imagick, contrastImage); +ZEND_METHOD(Imagick, combineImages); +#if MagickLibVersion >= 0x700 +ZEND_METHOD(Imagick, convolveImage); +#endif +#if !(MagickLibVersion >= 0x700) +ZEND_METHOD(Imagick, convolveImage); +#endif +ZEND_METHOD(Imagick, cycleColormapImage); +ZEND_METHOD(Imagick, deconstructImages); +ZEND_METHOD(Imagick, despeckleImage); +ZEND_METHOD(Imagick, edgeImage); +ZEND_METHOD(Imagick, embossImage); +ZEND_METHOD(Imagick, enhanceImage); +ZEND_METHOD(Imagick, equalizeImage); +ZEND_METHOD(Imagick, evaluateImage); +#if MagickLibVersion >= 0x687 +ZEND_METHOD(Imagick, evaluateImages); +#endif +ZEND_METHOD(Imagick, flattenImages); +ZEND_METHOD(Imagick, flipImage); +ZEND_METHOD(Imagick, flopImage); +#if MagickLibVersion >= 0x655 +ZEND_METHOD(Imagick, forwardFourierTransformImage); +#endif +ZEND_METHOD(Imagick, frameImage); +#if MagickLibVersion >= 0x700 +ZEND_METHOD(Imagick, frameImageWithComposite); +#endif +ZEND_METHOD(Imagick, fxImage); +ZEND_METHOD(Imagick, gammaImage); +ZEND_METHOD(Imagick, gaussianBlurImage); +#if MagickLibVersion < 0x700 && !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +ZEND_METHOD(Imagick, getImageAttribute); +#endif +ZEND_METHOD(Imagick, getImageBackgroundColor); +ZEND_METHOD(Imagick, getImageBluePrimary); +ZEND_METHOD(Imagick, getImageBorderColor); +ZEND_METHOD(Imagick, getImageChannelDepth); +ZEND_METHOD(Imagick, getImageChannelDistortion); +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 +ZEND_METHOD(Imagick, getImageChannelExtrema); +#endif +ZEND_METHOD(Imagick, getImageChannelMean); +ZEND_METHOD(Imagick, getImageChannelStatistics); +ZEND_METHOD(Imagick, getImageColormapColor); +ZEND_METHOD(Imagick, getImageColorspace); +ZEND_METHOD(Imagick, getImageCompose); +ZEND_METHOD(Imagick, getImageDelay); +ZEND_METHOD(Imagick, getImageDepth); +ZEND_METHOD(Imagick, getImageDistortion); +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 +ZEND_METHOD(Imagick, getImageExtrema); +#endif +ZEND_METHOD(Imagick, getImageDispose); +ZEND_METHOD(Imagick, getImageGamma); +ZEND_METHOD(Imagick, getImageGreenPrimary); +ZEND_METHOD(Imagick, getImageHeight); +ZEND_METHOD(Imagick, getImageHistogram); +ZEND_METHOD(Imagick, getImageInterlaceScheme); +ZEND_METHOD(Imagick, getImageIterations); +#if MagickLibVersion < 0x700 +ZEND_METHOD(Imagick, getImageMatteColor); +#endif +ZEND_METHOD(Imagick, getImagePage); +ZEND_METHOD(Imagick, getImagePixelColor); +#if IM_HAVE_IMAGICK_SETIMAGEPIXELCOLOR +ZEND_METHOD(Imagick, setImagePixelColor); +#endif +ZEND_METHOD(Imagick, getImageProfile); +ZEND_METHOD(Imagick, getImageRedPrimary); +ZEND_METHOD(Imagick, getImageRenderingIntent); +ZEND_METHOD(Imagick, getImageResolution); +ZEND_METHOD(Imagick, getImageScene); +ZEND_METHOD(Imagick, getImageSignature); +ZEND_METHOD(Imagick, getImageTicksPerSecond); +ZEND_METHOD(Imagick, getImageType); +ZEND_METHOD(Imagick, getImageUnits); +ZEND_METHOD(Imagick, getImageVirtualPixelMethod); +ZEND_METHOD(Imagick, getImageWhitePoint); +ZEND_METHOD(Imagick, getImageWidth); +ZEND_METHOD(Imagick, getNumberImages); +ZEND_METHOD(Imagick, getImageTotalInkDensity); +ZEND_METHOD(Imagick, getImageRegion); +ZEND_METHOD(Imagick, implodeImage); +#if MagickLibVersion >= 0x700 +ZEND_METHOD(Imagick, implodeImageWithMethod); +#endif +#if MagickLibVersion >= 0x658 +ZEND_METHOD(Imagick, inverseFourierTransformImage); +#endif +ZEND_METHOD(Imagick, levelImage); +ZEND_METHOD(Imagick, magnifyImage); +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 +ZEND_METHOD(Imagick, mapImage); +#endif +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 +ZEND_METHOD(Imagick, matteFloodfillImage); +#endif +#if MagickLibVersion < 0x700 && !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +ZEND_METHOD(Imagick, medianFilterImage); +#endif +ZEND_METHOD(Imagick, negateImage); +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 +ZEND_METHOD(Imagick, paintOpaqueImage); +#endif +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 +ZEND_METHOD(Imagick, paintTransparentImage); +#endif +ZEND_METHOD(Imagick, previewImages); +ZEND_METHOD(Imagick, profileImage); +ZEND_METHOD(Imagick, quantizeImage); +ZEND_METHOD(Imagick, quantizeImages); +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 +ZEND_METHOD(Imagick, reduceNoiseImage); +#endif +ZEND_METHOD(Imagick, removeImageProfile); +ZEND_METHOD(Imagick, separateImageChannel); +ZEND_METHOD(Imagick, sepiaToneImage); +#if MagickLibVersion < 0x700 +ZEND_METHOD(Imagick, setImageBias); +#endif +#if MagickLibVersion < 0x700 +ZEND_METHOD(Imagick, setImageBiasQuantum); +#endif +#if MagickLibVersion >= 0x700 +ZEND_METHOD(Imagick, setImageBluePrimary); +#endif +#if !(MagickLibVersion >= 0x700) +ZEND_METHOD(Imagick, setImageBluePrimary); +#endif +ZEND_METHOD(Imagick, setImageBorderColor); +ZEND_METHOD(Imagick, setImageChannelDepth); +ZEND_METHOD(Imagick, setImageColormapColor); +ZEND_METHOD(Imagick, setImageColorspace); +ZEND_METHOD(Imagick, setImageDispose); +ZEND_METHOD(Imagick, setImageExtent); +#if MagickLibVersion >= 0x700 +ZEND_METHOD(Imagick, setImageGreenPrimary); +#endif +#if !(MagickLibVersion >= 0x700) +ZEND_METHOD(Imagick, setImageGreenPrimary); +#endif +ZEND_METHOD(Imagick, setImageInterlaceScheme); +ZEND_METHOD(Imagick, setImageProfile); +#if MagickLibVersion >= 0x700 +ZEND_METHOD(Imagick, setImageRedPrimary); +#endif +#if !(MagickLibVersion >= 0x700) +ZEND_METHOD(Imagick, setImageRedPrimary); +#endif +ZEND_METHOD(Imagick, setImageRenderingIntent); +ZEND_METHOD(Imagick, setImageVirtualPixelMethod); +#if MagickLibVersion >= 0x700 +ZEND_METHOD(Imagick, setImageWhitePoint); +#endif +#if !(MagickLibVersion >= 0x700) +ZEND_METHOD(Imagick, setImageWhitePoint); +#endif +ZEND_METHOD(Imagick, sigmoidalContrastImage); +ZEND_METHOD(Imagick, stereoImage); +ZEND_METHOD(Imagick, textureImage); +ZEND_METHOD(Imagick, tintImage); +ZEND_METHOD(Imagick, unsharpMaskImage); +ZEND_METHOD(Imagick, getImage); +ZEND_METHOD(Imagick, addImage); +ZEND_METHOD(Imagick, setImage); +ZEND_METHOD(Imagick, newImage); +ZEND_METHOD(Imagick, newPseudoImage); +ZEND_METHOD(Imagick, getCompression); +ZEND_METHOD(Imagick, getCompressionQuality); +ZEND_METHOD(Imagick, getCopyright); +ZEND_METHOD(Imagick, getConfigureOptions); +#if MagickLibVersion > 0x660 +ZEND_METHOD(Imagick, getFeatures); +#endif +ZEND_METHOD(Imagick, getFilename); +ZEND_METHOD(Imagick, getFormat); +ZEND_METHOD(Imagick, getHomeURL); +ZEND_METHOD(Imagick, getInterlaceScheme); +ZEND_METHOD(Imagick, getOption); +ZEND_METHOD(Imagick, getPackageName); +ZEND_METHOD(Imagick, getPage); +ZEND_METHOD(Imagick, getQuantum); +ZEND_METHOD(Imagick, getHdriEnabled); +ZEND_METHOD(Imagick, getQuantumDepth); +ZEND_METHOD(Imagick, getQuantumRange); +ZEND_METHOD(Imagick, getReleaseDate); +ZEND_METHOD(Imagick, getResource); +ZEND_METHOD(Imagick, getResourceLimit); +ZEND_METHOD(Imagick, getSamplingFactors); +ZEND_METHOD(Imagick, getSize); +ZEND_METHOD(Imagick, getVersion); +ZEND_METHOD(Imagick, setBackgroundColor); +ZEND_METHOD(Imagick, setCompression); +ZEND_METHOD(Imagick, setCompressionQuality); +ZEND_METHOD(Imagick, setFilename); +ZEND_METHOD(Imagick, setFormat); +ZEND_METHOD(Imagick, setInterlaceScheme); +ZEND_METHOD(Imagick, setOption); +ZEND_METHOD(Imagick, setPage); +ZEND_METHOD(Imagick, setResourceLimit); +ZEND_METHOD(Imagick, setResolution); +ZEND_METHOD(Imagick, setSamplingFactors); +ZEND_METHOD(Imagick, setSize); +ZEND_METHOD(Imagick, setType); +#if MagickLibVersion > 0x628 +ZEND_METHOD(Imagick, getIteratorIndex); +#endif +ZEND_METHOD(Imagick, next); +ZEND_METHOD(Imagick, rewind); +ZEND_METHOD(Imagick, valid); +ZEND_METHOD(Imagick, current); +#if MagickLibVersion >= 0x659 +ZEND_METHOD(Imagick, brightnessContrastImage); +#endif +#if MagickLibVersion > 0x661 +ZEND_METHOD(Imagick, colorMatrixImage); +#endif +ZEND_METHOD(Imagick, selectiveBlurImage); +#if MagickLibVersion >= 0x689 +ZEND_METHOD(Imagick, rotationalBlurImage); +#endif +#if MagickLibVersion >= 0x683 +ZEND_METHOD(Imagick, statisticImage); +#endif +#if MagickLibVersion >= 0x652 +ZEND_METHOD(Imagick, subimageMatch); +#endif +ZEND_METHOD(Imagick, setRegistry); +ZEND_METHOD(Imagick, getRegistry); +ZEND_METHOD(Imagick, listRegistry); +#if MagickLibVersion >= 0x680 +ZEND_METHOD(Imagick, morphology); +#endif +#if defined(IMAGICK_WITH_KERNEL) && MagickLibVersion < 0x700 +ZEND_METHOD(Imagick, filter); +#endif +ZEND_METHOD(Imagick, setAntialias); +ZEND_METHOD(Imagick, getAntialias); +#if MagickLibVersion > 0x676 +ZEND_METHOD(Imagick, colorDecisionListImage); +#endif +#if MagickLibVersion >= 0x687 +ZEND_METHOD(Imagick, optimizeImageTransparency); +#endif +#if MagickLibVersion >= 0x660 +ZEND_METHOD(Imagick, autoGammaImage); +#endif +#if MagickLibVersion >= 0x692 +ZEND_METHOD(Imagick, autoOrient); +#endif +#if MagickLibVersion >= 0x692 +ZEND_METHOD(Imagick, compositeImageGravity); +#endif +#if MagickLibVersion >= 0x693 +ZEND_METHOD(Imagick, localContrastImage); +#endif +#if MagickLibVersion >= 0x700 +ZEND_METHOD(Imagick, identifyImageType); +#endif +#if IM_HAVE_IMAGICK_GETSETIMAGEMASK +ZEND_METHOD(Imagick, getImageMask); +#endif +#if IM_HAVE_IMAGICK_GETSETIMAGEMASK +ZEND_METHOD(Imagick, setImageMask); +#endif +#if IM_HAVE_IMAGICK_CANNYEDGEIMAGE +ZEND_METHOD(Imagick, cannyEdgeImage); +#endif +#if IM_HAVE_IMAGICK_SETSEED +ZEND_METHOD(Imagick, setSeed); +#endif +#if IM_HAVE_IMAGICK_WAVELETDENOISEIMAGE +ZEND_METHOD(Imagick, waveletDenoiseImage); +#endif +#if IM_HAVE_IMAGICK_MEANSHIFTIMAGE +ZEND_METHOD(Imagick, meanShiftImage); +#endif +#if IM_HAVE_IMAGICK_KMEANSIMAGE +ZEND_METHOD(Imagick, kmeansImage); +#endif +#if IM_HAVE_IMAGICK_RANGETHRESHOLDIMAGE +ZEND_METHOD(Imagick, rangeThresholdImage); +#endif +#if IM_HAVE_IMAGICK_AUTOTHRESHOLDIMAGE +ZEND_METHOD(Imagick, autoThresholdImage); +#endif +#if IM_HAVE_IMAGICK_BILATERALBLURIMAGE +ZEND_METHOD(Imagick, bilateralBlurImage); +#endif +#if IM_HAVE_IMAGICK_CLAHEIMAGE +ZEND_METHOD(Imagick, claheImage); +#endif +#if IM_HAVE_IMAGICK_CHANNELFXIMAGE +ZEND_METHOD(Imagick, channelFxImage); +#endif +#if IM_HAVE_IMAGICK_COLORTHRESHOLDIMAGE +ZEND_METHOD(Imagick, colorThresholdImage); +#endif +#if IM_HAVE_IMAGICK_COMPLEXIMAGES +ZEND_METHOD(Imagick, complexImages); +#endif +#if IM_HAVE_IMAGICK_INTERPOLATIVERESIZEIMAGE +ZEND_METHOD(Imagick, interpolativeResizeImage); +#endif +#if IM_HAVE_IMAGICK_LEVELIMAGECOLORS +ZEND_METHOD(Imagick, levelImageColors); +#endif +#if IM_HAVE_IMAGICK_LEVELIZEIMAGE +ZEND_METHOD(Imagick, levelizeImage); +#endif +#if IM_HAVE_IMAGICK_ORDEREDDITHERIMAGE +ZEND_METHOD(Imagick, orderedDitherImage); +#endif +#if IM_HAVE_IMAGICK_WHITEBALANCEIMAGE +ZEND_METHOD(Imagick, whiteBalanceImage); +#endif +#if IM_HAVE_IMAGICK_DELETE_OPTION +ZEND_METHOD(Imagick, deleteOption); +#endif +#if IM_HAVE_IMAGICK_GET_BACKGROUND_COLOR +ZEND_METHOD(Imagick, getBackgroundColor); +#endif +#if IM_HAVE_IMAGICK_GET_IMAGE_ARTIFACTS +ZEND_METHOD(Imagick, getImageArtifacts); +#endif +#if IM_HAVE_IMAGICK_GET_IMAGE_KURTOSIS +ZEND_METHOD(Imagick, getImageKurtosis); +#endif +#if IM_HAVE_IMAGICK_GET_IMAGE_MEAN +ZEND_METHOD(Imagick, getImageMean); +#endif +#if IM_HAVE_IMAGICK_GET_IMAGE_RANGE +ZEND_METHOD(Imagick, getImageRange); +#endif +#if IM_HAVE_IMAGICK_GET_INTERPOLATE_METHOD +ZEND_METHOD(Imagick, getInterpolateMethod); +#endif +#if IM_HAVE_IMAGICK_GET_OPTIONS +ZEND_METHOD(Imagick, getOptions); +#endif +#if IM_HAVE_IMAGICK_GET_ORIENTATION +ZEND_METHOD(Imagick, getOrientation); +#endif +#if IM_HAVE_IMAGICK_GET_RESOLUTION +ZEND_METHOD(Imagick, getResolution); +#endif +#if IM_HAVE_IMAGICK_GET_TYPE +ZEND_METHOD(Imagick, getType); +#endif +#if IM_HAVE_IMAGICK_POLYNOMIAL_IMAGE +ZEND_METHOD(Imagick, polynomialImage); +#endif +#if IM_HAVE_IMAGICK_SET_DEPTH +ZEND_METHOD(Imagick, setDepth); +#endif +#if IM_HAVE_IMAGICK_SET_EXTRACT +ZEND_METHOD(Imagick, setExtract); +#endif +#if IM_HAVE_IMAGICK_SET_INTERPOLATE_METHOD +ZEND_METHOD(Imagick, setInterpolateMethod); +#endif +#if IM_HAVE_IMAGICK_SET_ORIENTATION +ZEND_METHOD(Imagick, setOrientation); +#endif + + +static const zend_function_entry class_Imagick_methods = { + ZEND_ME(Imagick, optimizeImageLayers, arginfo_class_Imagick_optimizeImageLayers, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, compareImageLayers, arginfo_class_Imagick_compareImageLayers, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, pingImageBlob, arginfo_class_Imagick_pingImageBlob, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, pingImageFile, arginfo_class_Imagick_pingImageFile, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, transposeImage, arginfo_class_Imagick_transposeImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, transverseImage, arginfo_class_Imagick_transverseImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, trimImage, arginfo_class_Imagick_trimImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, waveImage, arginfo_class_Imagick_waveImage, ZEND_ACC_PUBLIC) +#if MagickLibVersion >= 0x700 + ZEND_ME(Imagick, waveImageWithMethod, arginfo_class_Imagick_waveImageWithMethod, ZEND_ACC_PUBLIC) +#endif + ZEND_ME(Imagick, vignetteImage, arginfo_class_Imagick_vignetteImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, uniqueImageColors, arginfo_class_Imagick_uniqueImageColors, ZEND_ACC_PUBLIC) +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 + ZEND_ME(Imagick, getImageMatte, arginfo_class_Imagick_getImageMatte, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) +#endif + ZEND_ME(Imagick, setImageMatte, arginfo_class_Imagick_setImageMatte, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, adaptiveResizeImage, arginfo_class_Imagick_adaptiveResizeImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, sketchImage, arginfo_class_Imagick_sketchImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, shadeImage, arginfo_class_Imagick_shadeImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getSizeOffset, arginfo_class_Imagick_getSizeOffset, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, setSizeOffset, arginfo_class_Imagick_setSizeOffset, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, adaptiveBlurImage, arginfo_class_Imagick_adaptiveBlurImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, contrastStretchImage, arginfo_class_Imagick_contrastStretchImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, adaptiveSharpenImage, arginfo_class_Imagick_adaptiveSharpenImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, randomThresholdImage, arginfo_class_Imagick_randomThresholdImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, roundCornersImage, arginfo_class_Imagick_roundCornersImage, ZEND_ACC_PUBLIC) + ZEND_MALIAS(Imagick, roundCorners, roundCornersImage, arginfo_class_Imagick_roundCorners, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, setIteratorIndex, arginfo_class_Imagick_setIteratorIndex, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getIteratorIndex, arginfo_class_Imagick_getIteratorIndex, ZEND_ACC_PUBLIC) +#if MagickLibVersion < 0x700 + ZEND_ME(Imagick, transformImage, arginfo_class_Imagick_transformImage, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) +#endif +#if MagickLibVersion > 0x630 && MagickLibVersion < 0x700 + ZEND_ME(Imagick, setImageOpacity, arginfo_class_Imagick_setImageOpacity, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) +#endif +#if MagickLibVersion >= 0x700 + ZEND_ME(Imagick, setImageAlpha, arginfo_class_Imagick_setImageAlpha, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion < 0x700 + ZEND_ME(Imagick, orderedPosterizeImage, arginfo_class_Imagick_orderedPosterizeImage, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) +#endif +#if MagickLibVersion >= 0x700 + ZEND_ME(Imagick, polaroidWithTextAndMethod, arginfo_class_Imagick_polaroidWithTextAndMethod, ZEND_ACC_PUBLIC) +#endif + ZEND_ME(Imagick, polaroidImage, arginfo_class_Imagick_polaroidImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageProperty, arginfo_class_Imagick_getImageProperty, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, setImageProperty, arginfo_class_Imagick_setImageProperty, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, deleteImageProperty, arginfo_class_Imagick_deleteImageProperty, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, identifyFormat, arginfo_class_Imagick_identifyFormat, ZEND_ACC_PUBLIC) +#if IM_HAVE_IMAGICK_SETIMAGEINTERPOLATEMETHOD + ZEND_ME(Imagick, setImageInterpolateMethod, arginfo_class_Imagick_setImageInterpolateMethod, ZEND_ACC_PUBLIC) +#endif + ZEND_ME(Imagick, getImageInterpolateMethod, arginfo_class_Imagick_getImageInterpolateMethod, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, linearStretchImage, arginfo_class_Imagick_linearStretchImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageLength, arginfo_class_Imagick_getImageLength, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, extentImage, arginfo_class_Imagick_extentImage, ZEND_ACC_PUBLIC) +#if MagickLibVersion > 0x633 + ZEND_ME(Imagick, getImageOrientation, arginfo_class_Imagick_getImageOrientation, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x633 + ZEND_ME(Imagick, setImageOrientation, arginfo_class_Imagick_setImageOrientation, ZEND_ACC_PUBLIC) +#endif +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion > 0x634 && MagickLibVersion < 0x700 + ZEND_ME(Imagick, paintFloodfillImage, arginfo_class_Imagick_paintFloodfillImage, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) +#endif + ZEND_ME(Imagick, clutImage, arginfo_class_Imagick_clutImage, ZEND_ACC_PUBLIC) +#if MagickLibVersion >= 0x700 + ZEND_ME(Imagick, clutImageWithInterpolate, arginfo_class_Imagick_clutImageWithInterpolate, ZEND_ACC_PUBLIC) +#endif + ZEND_ME(Imagick, getImageProperties, arginfo_class_Imagick_getImageProperties, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageProfiles, arginfo_class_Imagick_getImageProfiles, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, distortImage, arginfo_class_Imagick_distortImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, writeImageFile, arginfo_class_Imagick_writeImageFile, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, writeImagesFile, arginfo_class_Imagick_writeImagesFile, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, resetImagePage, arginfo_class_Imagick_resetImagePage, ZEND_ACC_PUBLIC) +#if MagickLibVersion < 0x700 + ZEND_ME(Imagick, setImageClipMask, arginfo_class_Imagick_setImageClipMask, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) +#endif +#if MagickLibVersion < 0x700 + ZEND_ME(Imagick, getImageClipMask, arginfo_class_Imagick_getImageClipMask, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) +#endif + ZEND_ME(Imagick, animateImages, arginfo_class_Imagick_animateImages, ZEND_ACC_PUBLIC) +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 + ZEND_ME(Imagick, recolorImage, arginfo_class_Imagick_recolorImage, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) +#endif +#if MagickLibVersion > 0x636 + ZEND_ME(Imagick, setFont, arginfo_class_Imagick_setFont, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x636 + ZEND_ME(Imagick, getFont, arginfo_class_Imagick_getFont, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x636 + ZEND_ME(Imagick, setPointSize, arginfo_class_Imagick_setPointSize, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x636 + ZEND_ME(Imagick, getPointSize, arginfo_class_Imagick_getPointSize, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x636 + ZEND_ME(Imagick, mergeImageLayers, arginfo_class_Imagick_mergeImageLayers, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x637 + ZEND_ME(Imagick, setImageAlphaChannel, arginfo_class_Imagick_setImageAlphaChannel, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x637 + ZEND_ME(Imagick, floodfillPaintImage, arginfo_class_Imagick_floodfillPaintImage, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x637 + ZEND_ME(Imagick, opaquePaintImage, arginfo_class_Imagick_opaquePaintImage, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x637 + ZEND_ME(Imagick, transparentPaintImage, arginfo_class_Imagick_transparentPaintImage, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x638 + ZEND_ME(Imagick, liquidRescaleImage, arginfo_class_Imagick_liquidRescaleImage, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x638 + ZEND_ME(Imagick, encipherImage, arginfo_class_Imagick_encipherImage, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x638 + ZEND_ME(Imagick, decipherImage, arginfo_class_Imagick_decipherImage, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x639 + ZEND_ME(Imagick, setGravity, arginfo_class_Imagick_setGravity, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x639 + ZEND_ME(Imagick, getGravity, arginfo_class_Imagick_getGravity, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x639 + ZEND_ME(Imagick, getImageChannelRange, arginfo_class_Imagick_getImageChannelRange, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x639 + ZEND_ME(Imagick, getImageAlphaChannel, arginfo_class_Imagick_getImageAlphaChannel, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x642 + ZEND_ME(Imagick, getImageChannelDistortions, arginfo_class_Imagick_getImageChannelDistortions, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x643 + ZEND_ME(Imagick, setImageGravity, arginfo_class_Imagick_setImageGravity, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x643 + ZEND_ME(Imagick, getImageGravity, arginfo_class_Imagick_getImageGravity, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x645 + ZEND_ME(Imagick, importImagePixels, arginfo_class_Imagick_importImagePixels, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x645 + ZEND_ME(Imagick, deskewImage, arginfo_class_Imagick_deskewImage, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x645 + ZEND_ME(Imagick, segmentImage, arginfo_class_Imagick_segmentImage, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x645 + ZEND_ME(Imagick, sparseColorImage, arginfo_class_Imagick_sparseColorImage, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x645 + ZEND_ME(Imagick, remapImage, arginfo_class_Imagick_remapImage, ZEND_ACC_PUBLIC) +#endif +#if PHP_IMAGICK_HAVE_HOUGHLINE + ZEND_ME(Imagick, houghLineImage, arginfo_class_Imagick_houghLineImage, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x646 + ZEND_ME(Imagick, exportImagePixels, arginfo_class_Imagick_exportImagePixels, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x648 + ZEND_ME(Imagick, getImageChannelKurtosis, arginfo_class_Imagick_getImageChannelKurtosis, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x648 + ZEND_ME(Imagick, functionImage, arginfo_class_Imagick_functionImage, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x651 + ZEND_ME(Imagick, transformImageColorspace, arginfo_class_Imagick_transformImageColorspace, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x652 + ZEND_ME(Imagick, haldClutImage, arginfo_class_Imagick_haldClutImage, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x655 + ZEND_ME(Imagick, autoLevelImage, arginfo_class_Imagick_autoLevelImage, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x655 + ZEND_ME(Imagick, blueShiftImage, arginfo_class_Imagick_blueShiftImage, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x656 + ZEND_ME(Imagick, getImageArtifact, arginfo_class_Imagick_getImageArtifact, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x656 + ZEND_ME(Imagick, setImageArtifact, arginfo_class_Imagick_setImageArtifact, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x656 + ZEND_ME(Imagick, deleteImageArtifact, arginfo_class_Imagick_deleteImageArtifact, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x656 + ZEND_ME(Imagick, getColorspace, arginfo_class_Imagick_getColorspace, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x656 + ZEND_ME(Imagick, setColorspace, arginfo_class_Imagick_setColorspace, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x656 + ZEND_ME(Imagick, clampImage, arginfo_class_Imagick_clampImage, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x667 + ZEND_ME(Imagick, smushImages, arginfo_class_Imagick_smushImages, ZEND_ACC_PUBLIC) +#endif + ZEND_ME(Imagick, __construct, arginfo_class_Imagick___construct, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, __toString, arginfo_class_Imagick___toString, ZEND_ACC_PUBLIC) +#if PHP_VERSION_ID >= 50600 + ZEND_ME(Imagick, count, arginfo_class_Imagick_count, ZEND_ACC_PUBLIC) +#endif +#if !(PHP_VERSION_ID >= 50600) + ZEND_ME(Imagick, count, arginfo_class_Imagick_count, ZEND_ACC_PUBLIC) +#endif + ZEND_ME(Imagick, getPixelIterator, arginfo_class_Imagick_getPixelIterator, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getPixelRegionIterator, arginfo_class_Imagick_getPixelRegionIterator, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, readImage, arginfo_class_Imagick_readImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, readImages, arginfo_class_Imagick_readImages, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, readImageBlob, arginfo_class_Imagick_readImageBlob, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, setImageFormat, arginfo_class_Imagick_setImageFormat, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, scaleImage, arginfo_class_Imagick_scaleImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, writeImage, arginfo_class_Imagick_writeImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, writeImages, arginfo_class_Imagick_writeImages, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, blurImage, arginfo_class_Imagick_blurImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, thumbnailImage, arginfo_class_Imagick_thumbnailImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, cropThumbnailImage, arginfo_class_Imagick_cropThumbnailImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageFilename, arginfo_class_Imagick_getImageFilename, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, setImageFilename, arginfo_class_Imagick_setImageFilename, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageFormat, arginfo_class_Imagick_getImageFormat, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageMimeType, arginfo_class_Imagick_getImageMimeType, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, removeImage, arginfo_class_Imagick_removeImage, ZEND_ACC_PUBLIC) + ZEND_MALIAS(Imagick, destroy, clear, arginfo_class_Imagick_destroy, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, clear, arginfo_class_Imagick_clear, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, clone, arginfo_class_Imagick_clone, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageSize, arginfo_class_Imagick_getImageSize, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageBlob, arginfo_class_Imagick_getImageBlob, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImagesBlob, arginfo_class_Imagick_getImagesBlob, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, setFirstIterator, arginfo_class_Imagick_setFirstIterator, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, setLastIterator, arginfo_class_Imagick_setLastIterator, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, resetIterator, arginfo_class_Imagick_resetIterator, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, previousImage, arginfo_class_Imagick_previousImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, nextImage, arginfo_class_Imagick_nextImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, hasPreviousImage, arginfo_class_Imagick_hasPreviousImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, hasNextImage, arginfo_class_Imagick_hasNextImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, setImageIndex, arginfo_class_Imagick_setImageIndex, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageIndex, arginfo_class_Imagick_getImageIndex, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, commentImage, arginfo_class_Imagick_commentImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, cropImage, arginfo_class_Imagick_cropImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, labelImage, arginfo_class_Imagick_labelImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageGeometry, arginfo_class_Imagick_getImageGeometry, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, drawImage, arginfo_class_Imagick_drawImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, setImageCompressionQuality, arginfo_class_Imagick_setImageCompressionQuality, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageCompressionQuality, arginfo_class_Imagick_getImageCompressionQuality, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, setImageCompression, arginfo_class_Imagick_setImageCompression, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageCompression, arginfo_class_Imagick_getImageCompression, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, annotateImage, arginfo_class_Imagick_annotateImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, compositeImage, arginfo_class_Imagick_compositeImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, modulateImage, arginfo_class_Imagick_modulateImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageColors, arginfo_class_Imagick_getImageColors, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, montageImage, arginfo_class_Imagick_montageImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, identifyImage, arginfo_class_Imagick_identifyImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, thresholdImage, arginfo_class_Imagick_thresholdImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, adaptiveThresholdImage, arginfo_class_Imagick_adaptiveThresholdImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, blackThresholdImage, arginfo_class_Imagick_blackThresholdImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, whiteThresholdImage, arginfo_class_Imagick_whiteThresholdImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, appendImages, arginfo_class_Imagick_appendImages, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, charcoalImage, arginfo_class_Imagick_charcoalImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, normalizeImage, arginfo_class_Imagick_normalizeImage, ZEND_ACC_PUBLIC) +#if MagickLibVersion >= 0x700 + ZEND_ME(Imagick, oilPaintImageWithSigma, arginfo_class_Imagick_oilPaintImageWithSigma, ZEND_ACC_PUBLIC) +#endif + ZEND_ME(Imagick, oilPaintImage, arginfo_class_Imagick_oilPaintImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, posterizeImage, arginfo_class_Imagick_posterizeImage, ZEND_ACC_PUBLIC) +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 + ZEND_ME(Imagick, radialBlurImage, arginfo_class_Imagick_radialBlurImage, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) +#endif + ZEND_ME(Imagick, raiseImage, arginfo_class_Imagick_raiseImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, resampleImage, arginfo_class_Imagick_resampleImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, resizeImage, arginfo_class_Imagick_resizeImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, rollImage, arginfo_class_Imagick_rollImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, rotateImage, arginfo_class_Imagick_rotateImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, sampleImage, arginfo_class_Imagick_sampleImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, solarizeImage, arginfo_class_Imagick_solarizeImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, shadowImage, arginfo_class_Imagick_shadowImage, ZEND_ACC_PUBLIC) +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 + ZEND_ME(Imagick, setImageAttribute, arginfo_class_Imagick_setImageAttribute, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) +#endif + ZEND_ME(Imagick, setImageBackgroundColor, arginfo_class_Imagick_setImageBackgroundColor, ZEND_ACC_PUBLIC) +#if MagickLibVersion >= 0x700 + ZEND_ME(Imagick, setImageChannelMask, arginfo_class_Imagick_setImageChannelMask, ZEND_ACC_PUBLIC) +#endif + ZEND_ME(Imagick, setImageCompose, arginfo_class_Imagick_setImageCompose, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, setImageDelay, arginfo_class_Imagick_setImageDelay, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, setImageDepth, arginfo_class_Imagick_setImageDepth, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, setImageGamma, arginfo_class_Imagick_setImageGamma, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, setImageIterations, arginfo_class_Imagick_setImageIterations, ZEND_ACC_PUBLIC) +#if MagickLibVersion < 0x700 || MagickLibVersion >= 0x705 + ZEND_ME(Imagick, setImageMatteColor, arginfo_class_Imagick_setImageMatteColor, ZEND_ACC_PUBLIC) +#endif + ZEND_ME(Imagick, setImagePage, arginfo_class_Imagick_setImagePage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, setImageProgressMonitor, arginfo_class_Imagick_setImageProgressMonitor, ZEND_ACC_PUBLIC) +#if MagickLibVersion > 0x653 + ZEND_ME(Imagick, setProgressMonitor, arginfo_class_Imagick_setProgressMonitor, ZEND_ACC_PUBLIC) +#endif + ZEND_ME(Imagick, setImageResolution, arginfo_class_Imagick_setImageResolution, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, setImageScene, arginfo_class_Imagick_setImageScene, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, setImageTicksPerSecond, arginfo_class_Imagick_setImageTicksPerSecond, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, setImageType, arginfo_class_Imagick_setImageType, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, setImageUnits, arginfo_class_Imagick_setImageUnits, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, sharpenImage, arginfo_class_Imagick_sharpenImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, shaveImage, arginfo_class_Imagick_shaveImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, shearImage, arginfo_class_Imagick_shearImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, spliceImage, arginfo_class_Imagick_spliceImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, pingImage, arginfo_class_Imagick_pingImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, readImageFile, arginfo_class_Imagick_readImageFile, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, displayImage, arginfo_class_Imagick_displayImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, displayImages, arginfo_class_Imagick_displayImages, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, spreadImage, arginfo_class_Imagick_spreadImage, ZEND_ACC_PUBLIC) +#if MagickLibVersion >= 0x700 + ZEND_ME(Imagick, spreadImageWithMethod, arginfo_class_Imagick_spreadImageWithMethod, ZEND_ACC_PUBLIC) +#endif + ZEND_ME(Imagick, swirlImage, arginfo_class_Imagick_swirlImage, ZEND_ACC_PUBLIC) +#if MagickLibVersion >= 0x700 + ZEND_ME(Imagick, swirlImageWithMethod, arginfo_class_Imagick_swirlImageWithMethod, ZEND_ACC_PUBLIC) +#endif + ZEND_ME(Imagick, stripImage, arginfo_class_Imagick_stripImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, queryFormats, arginfo_class_Imagick_queryFormats, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + ZEND_ME(Imagick, queryFonts, arginfo_class_Imagick_queryFonts, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + ZEND_ME(Imagick, queryFontMetrics, arginfo_class_Imagick_queryFontMetrics, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, steganoImage, arginfo_class_Imagick_steganoImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, addNoiseImage, arginfo_class_Imagick_addNoiseImage, ZEND_ACC_PUBLIC) +#if IM_HAVE_IMAGICK_ADD_NOISE_WITH_ATTENUATE + ZEND_ME(Imagick, addNoiseImageWithAttenuate, arginfo_class_Imagick_addNoiseImageWithAttenuate, ZEND_ACC_PUBLIC) +#endif + ZEND_ME(Imagick, motionBlurImage, arginfo_class_Imagick_motionBlurImage, ZEND_ACC_PUBLIC) +#if MagickLibVersion < 0x700 && !defined(MAGICKCORE_EXCLUDE_DEPRECATED) + ZEND_ME(Imagick, mosaicImages, arginfo_class_Imagick_mosaicImages, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) +#endif + ZEND_ME(Imagick, morphImages, arginfo_class_Imagick_morphImages, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, minifyImage, arginfo_class_Imagick_minifyImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, affineTransformImage, arginfo_class_Imagick_affineTransformImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, averageImages, arginfo_class_Imagick_averageImages, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, borderImage, arginfo_class_Imagick_borderImage, ZEND_ACC_PUBLIC) +#if MagickLibVersion >= 0x700 + ZEND_ME(Imagick, borderImageWithComposite, arginfo_class_Imagick_borderImageWithComposite, ZEND_ACC_PUBLIC) +#endif + ZEND_ME(Imagick, calculateCrop, arginfo_class_Imagick_calculateCrop, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + ZEND_ME(Imagick, chopImage, arginfo_class_Imagick_chopImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, clipImage, arginfo_class_Imagick_clipImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, clipPathImage, arginfo_class_Imagick_clipPathImage, ZEND_ACC_PUBLIC) + ZEND_MALIAS(Imagick, clipImagePath, clipPathImage, arginfo_class_Imagick_clipImagePath, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, coalesceImages, arginfo_class_Imagick_coalesceImages, ZEND_ACC_PUBLIC) +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 + ZEND_ME(Imagick, colorFloodfillImage, arginfo_class_Imagick_colorFloodfillImage, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) +#endif + ZEND_ME(Imagick, colorizeImage, arginfo_class_Imagick_colorizeImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, compareImageChannels, arginfo_class_Imagick_compareImageChannels, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, compareImages, arginfo_class_Imagick_compareImages, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, contrastImage, arginfo_class_Imagick_contrastImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, combineImages, arginfo_class_Imagick_combineImages, ZEND_ACC_PUBLIC) +#if MagickLibVersion >= 0x700 + ZEND_ME(Imagick, convolveImage, arginfo_class_Imagick_convolveImage, ZEND_ACC_PUBLIC) +#endif +#if !(MagickLibVersion >= 0x700) + ZEND_ME(Imagick, convolveImage, arginfo_class_Imagick_convolveImage, ZEND_ACC_PUBLIC) +#endif + ZEND_ME(Imagick, cycleColormapImage, arginfo_class_Imagick_cycleColormapImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, deconstructImages, arginfo_class_Imagick_deconstructImages, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, despeckleImage, arginfo_class_Imagick_despeckleImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, edgeImage, arginfo_class_Imagick_edgeImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, embossImage, arginfo_class_Imagick_embossImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, enhanceImage, arginfo_class_Imagick_enhanceImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, equalizeImage, arginfo_class_Imagick_equalizeImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, evaluateImage, arginfo_class_Imagick_evaluateImage, ZEND_ACC_PUBLIC) +#if MagickLibVersion >= 0x687 + ZEND_ME(Imagick, evaluateImages, arginfo_class_Imagick_evaluateImages, ZEND_ACC_PUBLIC) +#endif + ZEND_ME(Imagick, flattenImages, arginfo_class_Imagick_flattenImages, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, flipImage, arginfo_class_Imagick_flipImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, flopImage, arginfo_class_Imagick_flopImage, ZEND_ACC_PUBLIC) +#if MagickLibVersion >= 0x655 + ZEND_ME(Imagick, forwardFourierTransformImage, arginfo_class_Imagick_forwardFourierTransformImage, ZEND_ACC_PUBLIC) +#endif + ZEND_ME(Imagick, frameImage, arginfo_class_Imagick_frameImage, ZEND_ACC_PUBLIC) +#if MagickLibVersion >= 0x700 + ZEND_ME(Imagick, frameImageWithComposite, arginfo_class_Imagick_frameImageWithComposite, ZEND_ACC_PUBLIC) +#endif + ZEND_ME(Imagick, fxImage, arginfo_class_Imagick_fxImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, gammaImage, arginfo_class_Imagick_gammaImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, gaussianBlurImage, arginfo_class_Imagick_gaussianBlurImage, ZEND_ACC_PUBLIC) +#if MagickLibVersion < 0x700 && !defined(MAGICKCORE_EXCLUDE_DEPRECATED) + ZEND_ME(Imagick, getImageAttribute, arginfo_class_Imagick_getImageAttribute, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) +#endif + ZEND_ME(Imagick, getImageBackgroundColor, arginfo_class_Imagick_getImageBackgroundColor, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageBluePrimary, arginfo_class_Imagick_getImageBluePrimary, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageBorderColor, arginfo_class_Imagick_getImageBorderColor, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageChannelDepth, arginfo_class_Imagick_getImageChannelDepth, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageChannelDistortion, arginfo_class_Imagick_getImageChannelDistortion, ZEND_ACC_PUBLIC) +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 + ZEND_ME(Imagick, getImageChannelExtrema, arginfo_class_Imagick_getImageChannelExtrema, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) +#endif + ZEND_ME(Imagick, getImageChannelMean, arginfo_class_Imagick_getImageChannelMean, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageChannelStatistics, arginfo_class_Imagick_getImageChannelStatistics, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageColormapColor, arginfo_class_Imagick_getImageColormapColor, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageColorspace, arginfo_class_Imagick_getImageColorspace, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageCompose, arginfo_class_Imagick_getImageCompose, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageDelay, arginfo_class_Imagick_getImageDelay, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageDepth, arginfo_class_Imagick_getImageDepth, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageDistortion, arginfo_class_Imagick_getImageDistortion, ZEND_ACC_PUBLIC) +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 + ZEND_ME(Imagick, getImageExtrema, arginfo_class_Imagick_getImageExtrema, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) +#endif + ZEND_ME(Imagick, getImageDispose, arginfo_class_Imagick_getImageDispose, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageGamma, arginfo_class_Imagick_getImageGamma, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageGreenPrimary, arginfo_class_Imagick_getImageGreenPrimary, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageHeight, arginfo_class_Imagick_getImageHeight, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageHistogram, arginfo_class_Imagick_getImageHistogram, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageInterlaceScheme, arginfo_class_Imagick_getImageInterlaceScheme, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageIterations, arginfo_class_Imagick_getImageIterations, ZEND_ACC_PUBLIC) +#if MagickLibVersion < 0x700 + ZEND_ME(Imagick, getImageMatteColor, arginfo_class_Imagick_getImageMatteColor, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) +#endif + ZEND_ME(Imagick, getImagePage, arginfo_class_Imagick_getImagePage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImagePixelColor, arginfo_class_Imagick_getImagePixelColor, ZEND_ACC_PUBLIC) +#if IM_HAVE_IMAGICK_SETIMAGEPIXELCOLOR + ZEND_ME(Imagick, setImagePixelColor, arginfo_class_Imagick_setImagePixelColor, ZEND_ACC_PUBLIC) +#endif + ZEND_ME(Imagick, getImageProfile, arginfo_class_Imagick_getImageProfile, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageRedPrimary, arginfo_class_Imagick_getImageRedPrimary, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageRenderingIntent, arginfo_class_Imagick_getImageRenderingIntent, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageResolution, arginfo_class_Imagick_getImageResolution, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageScene, arginfo_class_Imagick_getImageScene, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageSignature, arginfo_class_Imagick_getImageSignature, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageTicksPerSecond, arginfo_class_Imagick_getImageTicksPerSecond, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageType, arginfo_class_Imagick_getImageType, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageUnits, arginfo_class_Imagick_getImageUnits, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageVirtualPixelMethod, arginfo_class_Imagick_getImageVirtualPixelMethod, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageWhitePoint, arginfo_class_Imagick_getImageWhitePoint, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageWidth, arginfo_class_Imagick_getImageWidth, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getNumberImages, arginfo_class_Imagick_getNumberImages, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageTotalInkDensity, arginfo_class_Imagick_getImageTotalInkDensity, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImageRegion, arginfo_class_Imagick_getImageRegion, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, implodeImage, arginfo_class_Imagick_implodeImage, ZEND_ACC_PUBLIC) +#if MagickLibVersion >= 0x700 + ZEND_ME(Imagick, implodeImageWithMethod, arginfo_class_Imagick_implodeImageWithMethod, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion >= 0x658 + ZEND_ME(Imagick, inverseFourierTransformImage, arginfo_class_Imagick_inverseFourierTransformImage, ZEND_ACC_PUBLIC) +#endif + ZEND_ME(Imagick, levelImage, arginfo_class_Imagick_levelImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, magnifyImage, arginfo_class_Imagick_magnifyImage, ZEND_ACC_PUBLIC) +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 + ZEND_ME(Imagick, mapImage, arginfo_class_Imagick_mapImage, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) +#endif +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 + ZEND_ME(Imagick, matteFloodfillImage, arginfo_class_Imagick_matteFloodfillImage, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) +#endif +#if MagickLibVersion < 0x700 && !defined(MAGICKCORE_EXCLUDE_DEPRECATED) + ZEND_ME(Imagick, medianFilterImage, arginfo_class_Imagick_medianFilterImage, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) +#endif + ZEND_ME(Imagick, negateImage, arginfo_class_Imagick_negateImage, ZEND_ACC_PUBLIC) +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 + ZEND_ME(Imagick, paintOpaqueImage, arginfo_class_Imagick_paintOpaqueImage, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) +#endif +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 + ZEND_ME(Imagick, paintTransparentImage, arginfo_class_Imagick_paintTransparentImage, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) +#endif + ZEND_ME(Imagick, previewImages, arginfo_class_Imagick_previewImages, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, profileImage, arginfo_class_Imagick_profileImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, quantizeImage, arginfo_class_Imagick_quantizeImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, quantizeImages, arginfo_class_Imagick_quantizeImages, ZEND_ACC_PUBLIC) +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 + ZEND_ME(Imagick, reduceNoiseImage, arginfo_class_Imagick_reduceNoiseImage, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) +#endif + ZEND_ME(Imagick, removeImageProfile, arginfo_class_Imagick_removeImageProfile, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, separateImageChannel, arginfo_class_Imagick_separateImageChannel, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, sepiaToneImage, arginfo_class_Imagick_sepiaToneImage, ZEND_ACC_PUBLIC) +#if MagickLibVersion < 0x700 + ZEND_ME(Imagick, setImageBias, arginfo_class_Imagick_setImageBias, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) +#endif +#if MagickLibVersion < 0x700 + ZEND_ME(Imagick, setImageBiasQuantum, arginfo_class_Imagick_setImageBiasQuantum, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) +#endif +#if MagickLibVersion >= 0x700 + ZEND_ME(Imagick, setImageBluePrimary, arginfo_class_Imagick_setImageBluePrimary, ZEND_ACC_PUBLIC) +#endif +#if !(MagickLibVersion >= 0x700) + ZEND_ME(Imagick, setImageBluePrimary, arginfo_class_Imagick_setImageBluePrimary, ZEND_ACC_PUBLIC) +#endif + ZEND_ME(Imagick, setImageBorderColor, arginfo_class_Imagick_setImageBorderColor, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, setImageChannelDepth, arginfo_class_Imagick_setImageChannelDepth, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, setImageColormapColor, arginfo_class_Imagick_setImageColormapColor, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, setImageColorspace, arginfo_class_Imagick_setImageColorspace, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, setImageDispose, arginfo_class_Imagick_setImageDispose, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, setImageExtent, arginfo_class_Imagick_setImageExtent, ZEND_ACC_PUBLIC) +#if MagickLibVersion >= 0x700 + ZEND_ME(Imagick, setImageGreenPrimary, arginfo_class_Imagick_setImageGreenPrimary, ZEND_ACC_PUBLIC) +#endif +#if !(MagickLibVersion >= 0x700) + ZEND_ME(Imagick, setImageGreenPrimary, arginfo_class_Imagick_setImageGreenPrimary, ZEND_ACC_PUBLIC) +#endif + ZEND_ME(Imagick, setImageInterlaceScheme, arginfo_class_Imagick_setImageInterlaceScheme, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, setImageProfile, arginfo_class_Imagick_setImageProfile, ZEND_ACC_PUBLIC) +#if MagickLibVersion >= 0x700 + ZEND_ME(Imagick, setImageRedPrimary, arginfo_class_Imagick_setImageRedPrimary, ZEND_ACC_PUBLIC) +#endif +#if !(MagickLibVersion >= 0x700) + ZEND_ME(Imagick, setImageRedPrimary, arginfo_class_Imagick_setImageRedPrimary, ZEND_ACC_PUBLIC) +#endif + ZEND_ME(Imagick, setImageRenderingIntent, arginfo_class_Imagick_setImageRenderingIntent, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, setImageVirtualPixelMethod, arginfo_class_Imagick_setImageVirtualPixelMethod, ZEND_ACC_PUBLIC) +#if MagickLibVersion >= 0x700 + ZEND_ME(Imagick, setImageWhitePoint, arginfo_class_Imagick_setImageWhitePoint, ZEND_ACC_PUBLIC) +#endif +#if !(MagickLibVersion >= 0x700) + ZEND_ME(Imagick, setImageWhitePoint, arginfo_class_Imagick_setImageWhitePoint, ZEND_ACC_PUBLIC) +#endif + ZEND_ME(Imagick, sigmoidalContrastImage, arginfo_class_Imagick_sigmoidalContrastImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, stereoImage, arginfo_class_Imagick_stereoImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, textureImage, arginfo_class_Imagick_textureImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, tintImage, arginfo_class_Imagick_tintImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, unsharpMaskImage, arginfo_class_Imagick_unsharpMaskImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getImage, arginfo_class_Imagick_getImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, addImage, arginfo_class_Imagick_addImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, setImage, arginfo_class_Imagick_setImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, newImage, arginfo_class_Imagick_newImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, newPseudoImage, arginfo_class_Imagick_newPseudoImage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getCompression, arginfo_class_Imagick_getCompression, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getCompressionQuality, arginfo_class_Imagick_getCompressionQuality, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getCopyright, arginfo_class_Imagick_getCopyright, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + ZEND_ME(Imagick, getConfigureOptions, arginfo_class_Imagick_getConfigureOptions, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) +#if MagickLibVersion > 0x660 + ZEND_ME(Imagick, getFeatures, arginfo_class_Imagick_getFeatures, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) +#endif + ZEND_ME(Imagick, getFilename, arginfo_class_Imagick_getFilename, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getFormat, arginfo_class_Imagick_getFormat, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getHomeURL, arginfo_class_Imagick_getHomeURL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + ZEND_ME(Imagick, getInterlaceScheme, arginfo_class_Imagick_getInterlaceScheme, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getOption, arginfo_class_Imagick_getOption, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getPackageName, arginfo_class_Imagick_getPackageName, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + ZEND_ME(Imagick, getPage, arginfo_class_Imagick_getPage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getQuantum, arginfo_class_Imagick_getQuantum, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + ZEND_ME(Imagick, getHdriEnabled, arginfo_class_Imagick_getHdriEnabled, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + ZEND_ME(Imagick, getQuantumDepth, arginfo_class_Imagick_getQuantumDepth, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + ZEND_ME(Imagick, getQuantumRange, arginfo_class_Imagick_getQuantumRange, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + ZEND_ME(Imagick, getReleaseDate, arginfo_class_Imagick_getReleaseDate, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + ZEND_ME(Imagick, getResource, arginfo_class_Imagick_getResource, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + ZEND_ME(Imagick, getResourceLimit, arginfo_class_Imagick_getResourceLimit, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + ZEND_ME(Imagick, getSamplingFactors, arginfo_class_Imagick_getSamplingFactors, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getSize, arginfo_class_Imagick_getSize, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getVersion, arginfo_class_Imagick_getVersion, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + ZEND_ME(Imagick, setBackgroundColor, arginfo_class_Imagick_setBackgroundColor, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, setCompression, arginfo_class_Imagick_setCompression, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, setCompressionQuality, arginfo_class_Imagick_setCompressionQuality, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, setFilename, arginfo_class_Imagick_setFilename, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, setFormat, arginfo_class_Imagick_setFormat, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, setInterlaceScheme, arginfo_class_Imagick_setInterlaceScheme, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, setOption, arginfo_class_Imagick_setOption, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, setPage, arginfo_class_Imagick_setPage, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, setResourceLimit, arginfo_class_Imagick_setResourceLimit, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + ZEND_ME(Imagick, setResolution, arginfo_class_Imagick_setResolution, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, setSamplingFactors, arginfo_class_Imagick_setSamplingFactors, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, setSize, arginfo_class_Imagick_setSize, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, setType, arginfo_class_Imagick_setType, ZEND_ACC_PUBLIC) +#if MagickLibVersion > 0x628 + ZEND_MALIAS(Imagick, key, getIteratorIndex, arginfo_class_Imagick_key, ZEND_ACC_PUBLIC) +#endif + ZEND_ME(Imagick, next, arginfo_class_Imagick_next, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, rewind, arginfo_class_Imagick_rewind, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, valid, arginfo_class_Imagick_valid, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, current, arginfo_class_Imagick_current, ZEND_ACC_PUBLIC) +#if MagickLibVersion >= 0x659 + ZEND_ME(Imagick, brightnessContrastImage, arginfo_class_Imagick_brightnessContrastImage, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion > 0x661 + ZEND_ME(Imagick, colorMatrixImage, arginfo_class_Imagick_colorMatrixImage, ZEND_ACC_PUBLIC) +#endif + ZEND_ME(Imagick, selectiveBlurImage, arginfo_class_Imagick_selectiveBlurImage, ZEND_ACC_PUBLIC) +#if MagickLibVersion >= 0x689 + ZEND_ME(Imagick, rotationalBlurImage, arginfo_class_Imagick_rotationalBlurImage, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion >= 0x683 + ZEND_ME(Imagick, statisticImage, arginfo_class_Imagick_statisticImage, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion >= 0x652 + ZEND_ME(Imagick, subimageMatch, arginfo_class_Imagick_subimageMatch, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion >= 0x652 + ZEND_MALIAS(Imagick, similarityImage, subimageMatch, arginfo_class_Imagick_similarityImage, ZEND_ACC_PUBLIC) +#endif + ZEND_ME(Imagick, setRegistry, arginfo_class_Imagick_setRegistry, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + ZEND_ME(Imagick, getRegistry, arginfo_class_Imagick_getRegistry, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + ZEND_ME(Imagick, listRegistry, arginfo_class_Imagick_listRegistry, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) +#if MagickLibVersion >= 0x680 + ZEND_ME(Imagick, morphology, arginfo_class_Imagick_morphology, ZEND_ACC_PUBLIC) +#endif +#if defined(IMAGICK_WITH_KERNEL) && MagickLibVersion < 0x700 + ZEND_ME(Imagick, filter, arginfo_class_Imagick_filter, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) +#endif + ZEND_ME(Imagick, setAntialias, arginfo_class_Imagick_setAntialias, ZEND_ACC_PUBLIC) + ZEND_ME(Imagick, getAntialias, arginfo_class_Imagick_getAntialias, ZEND_ACC_PUBLIC) +#if MagickLibVersion > 0x676 + ZEND_ME(Imagick, colorDecisionListImage, arginfo_class_Imagick_colorDecisionListImage, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion >= 0x687 + ZEND_ME(Imagick, optimizeImageTransparency, arginfo_class_Imagick_optimizeImageTransparency, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion >= 0x660 + ZEND_ME(Imagick, autoGammaImage, arginfo_class_Imagick_autoGammaImage, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion >= 0x692 + ZEND_ME(Imagick, autoOrient, arginfo_class_Imagick_autoOrient, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion >= 0x692 + ZEND_MALIAS(Imagick, autoOrientate, autoOrient, arginfo_class_Imagick_autoOrientate, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion >= 0x692 + ZEND_ME(Imagick, compositeImageGravity, arginfo_class_Imagick_compositeImageGravity, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion >= 0x693 + ZEND_ME(Imagick, localContrastImage, arginfo_class_Imagick_localContrastImage, ZEND_ACC_PUBLIC) +#endif +#if MagickLibVersion >= 0x700 + ZEND_ME(Imagick, identifyImageType, arginfo_class_Imagick_identifyImageType, ZEND_ACC_PUBLIC) +#endif +#if IM_HAVE_IMAGICK_GETSETIMAGEMASK + ZEND_ME(Imagick, getImageMask, arginfo_class_Imagick_getImageMask, ZEND_ACC_PUBLIC) +#endif +#if IM_HAVE_IMAGICK_GETSETIMAGEMASK + ZEND_ME(Imagick, setImageMask, arginfo_class_Imagick_setImageMask, ZEND_ACC_PUBLIC) +#endif +#if IM_HAVE_IMAGICK_CANNYEDGEIMAGE + ZEND_ME(Imagick, cannyEdgeImage, arginfo_class_Imagick_cannyEdgeImage, ZEND_ACC_PUBLIC) +#endif +#if IM_HAVE_IMAGICK_SETSEED + ZEND_ME(Imagick, setSeed, arginfo_class_Imagick_setSeed, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) +#endif +#if IM_HAVE_IMAGICK_WAVELETDENOISEIMAGE + ZEND_ME(Imagick, waveletDenoiseImage, arginfo_class_Imagick_waveletDenoiseImage, ZEND_ACC_PUBLIC) +#endif +#if IM_HAVE_IMAGICK_MEANSHIFTIMAGE + ZEND_ME(Imagick, meanShiftImage, arginfo_class_Imagick_meanShiftImage, ZEND_ACC_PUBLIC) +#endif +#if IM_HAVE_IMAGICK_KMEANSIMAGE + ZEND_ME(Imagick, kmeansImage, arginfo_class_Imagick_kmeansImage, ZEND_ACC_PUBLIC) +#endif +#if IM_HAVE_IMAGICK_RANGETHRESHOLDIMAGE + ZEND_ME(Imagick, rangeThresholdImage, arginfo_class_Imagick_rangeThresholdImage, ZEND_ACC_PUBLIC) +#endif +#if IM_HAVE_IMAGICK_AUTOTHRESHOLDIMAGE + ZEND_ME(Imagick, autoThresholdImage, arginfo_class_Imagick_autoThresholdImage, ZEND_ACC_PUBLIC) +#endif +#if IM_HAVE_IMAGICK_BILATERALBLURIMAGE + ZEND_ME(Imagick, bilateralBlurImage, arginfo_class_Imagick_bilateralBlurImage, ZEND_ACC_PUBLIC) +#endif +#if IM_HAVE_IMAGICK_CLAHEIMAGE + ZEND_ME(Imagick, claheImage, arginfo_class_Imagick_claheImage, ZEND_ACC_PUBLIC) +#endif +#if IM_HAVE_IMAGICK_CHANNELFXIMAGE + ZEND_ME(Imagick, channelFxImage, arginfo_class_Imagick_channelFxImage, ZEND_ACC_PUBLIC) +#endif +#if IM_HAVE_IMAGICK_COLORTHRESHOLDIMAGE + ZEND_ME(Imagick, colorThresholdImage, arginfo_class_Imagick_colorThresholdImage, ZEND_ACC_PUBLIC) +#endif +#if IM_HAVE_IMAGICK_COMPLEXIMAGES + ZEND_ME(Imagick, complexImages, arginfo_class_Imagick_complexImages, ZEND_ACC_PUBLIC) +#endif +#if IM_HAVE_IMAGICK_INTERPOLATIVERESIZEIMAGE + ZEND_ME(Imagick, interpolativeResizeImage, arginfo_class_Imagick_interpolativeResizeImage, ZEND_ACC_PUBLIC) +#endif +#if IM_HAVE_IMAGICK_LEVELIMAGECOLORS + ZEND_ME(Imagick, levelImageColors, arginfo_class_Imagick_levelImageColors, ZEND_ACC_PUBLIC) +#endif +#if IM_HAVE_IMAGICK_LEVELIZEIMAGE + ZEND_ME(Imagick, levelizeImage, arginfo_class_Imagick_levelizeImage, ZEND_ACC_PUBLIC) +#endif +#if IM_HAVE_IMAGICK_ORDEREDDITHERIMAGE + ZEND_ME(Imagick, orderedDitherImage, arginfo_class_Imagick_orderedDitherImage, ZEND_ACC_PUBLIC) +#endif +#if IM_HAVE_IMAGICK_WHITEBALANCEIMAGE + ZEND_ME(Imagick, whiteBalanceImage, arginfo_class_Imagick_whiteBalanceImage, ZEND_ACC_PUBLIC) +#endif +#if IM_HAVE_IMAGICK_DELETE_OPTION + ZEND_ME(Imagick, deleteOption, arginfo_class_Imagick_deleteOption, ZEND_ACC_PUBLIC) +#endif +#if IM_HAVE_IMAGICK_GET_BACKGROUND_COLOR + ZEND_ME(Imagick, getBackgroundColor, arginfo_class_Imagick_getBackgroundColor, ZEND_ACC_PUBLIC) +#endif +#if IM_HAVE_IMAGICK_GET_IMAGE_ARTIFACTS + ZEND_ME(Imagick, getImageArtifacts, arginfo_class_Imagick_getImageArtifacts, ZEND_ACC_PUBLIC) +#endif +#if IM_HAVE_IMAGICK_GET_IMAGE_KURTOSIS + ZEND_ME(Imagick, getImageKurtosis, arginfo_class_Imagick_getImageKurtosis, ZEND_ACC_PUBLIC) +#endif +#if IM_HAVE_IMAGICK_GET_IMAGE_MEAN + ZEND_ME(Imagick, getImageMean, arginfo_class_Imagick_getImageMean, ZEND_ACC_PUBLIC) +#endif +#if IM_HAVE_IMAGICK_GET_IMAGE_RANGE + ZEND_ME(Imagick, getImageRange, arginfo_class_Imagick_getImageRange, ZEND_ACC_PUBLIC) +#endif +#if IM_HAVE_IMAGICK_GET_INTERPOLATE_METHOD + ZEND_ME(Imagick, getInterpolateMethod, arginfo_class_Imagick_getInterpolateMethod, ZEND_ACC_PUBLIC) +#endif +#if IM_HAVE_IMAGICK_GET_OPTIONS + ZEND_ME(Imagick, getOptions, arginfo_class_Imagick_getOptions, ZEND_ACC_PUBLIC) +#endif +#if IM_HAVE_IMAGICK_GET_ORIENTATION + ZEND_ME(Imagick, getOrientation, arginfo_class_Imagick_getOrientation, ZEND_ACC_PUBLIC) +#endif +#if IM_HAVE_IMAGICK_GET_RESOLUTION + ZEND_ME(Imagick, getResolution, arginfo_class_Imagick_getResolution, ZEND_ACC_PUBLIC) +#endif +#if IM_HAVE_IMAGICK_GET_TYPE + ZEND_ME(Imagick, getType, arginfo_class_Imagick_getType, ZEND_ACC_PUBLIC) +#endif +#if IM_HAVE_IMAGICK_POLYNOMIAL_IMAGE + ZEND_ME(Imagick, polynomialImage, arginfo_class_Imagick_polynomialImage, ZEND_ACC_PUBLIC) +#endif +#if IM_HAVE_IMAGICK_SET_DEPTH + ZEND_ME(Imagick, setDepth, arginfo_class_Imagick_setDepth, ZEND_ACC_PUBLIC) +#endif +#if IM_HAVE_IMAGICK_SET_EXTRACT + ZEND_ME(Imagick, setExtract, arginfo_class_Imagick_setExtract, ZEND_ACC_PUBLIC) +#endif +#if IM_HAVE_IMAGICK_SET_INTERPOLATE_METHOD + ZEND_ME(Imagick, setInterpolateMethod, arginfo_class_Imagick_setInterpolateMethod, ZEND_ACC_PUBLIC) +#endif +#if IM_HAVE_IMAGICK_SET_ORIENTATION + ZEND_ME(Imagick, setOrientation, arginfo_class_Imagick_setOrientation, ZEND_ACC_PUBLIC) +#endif + ZEND_FE_END +}; \ No newline at end of file
View file
imagick-3.8.0.tgz/imagick-3.8.0/LICENSE
Changed
(renamed from imagick-3.7.0/LICENSE)
View file
imagick-3.8.0.tgz/imagick-3.8.0/config.m4
Added
@@ -0,0 +1,111 @@ +PHP_ARG_WITH(imagick, whether to enable the imagick extension, + --with-imagick=DIR Enables the imagick extension. DIR is the prefix to ImageMagick installation directory., no) + + +if test $PHP_IMAGICK != "no"; then + +# +# Find ImageMagick +# +if test "$ext_shared" != "yes" && test "$ext_shared" != "shared"; then + define('PHP_IMAGICK_STATIC', 1) + PHP_IMAGICK_STATIC=yes +fi +m4_include(ifdef('PHP_IMAGICK_STATIC',PHP_EXT_BUILDDIR(imagick)/,)imagemagick.m4) + +# This line checks that ImageMagick is available, and +# meets our minimum supported version. TODO change to 6.7.0 +IM_FIND_IMAGEMAGICK(6.5.3, $PHP_IMAGICK) + +# +# PHP minimum version +# + AC_MSG_CHECKING(PHP version is at least 5.6.0) + + if test -z "${PHP_VERSION_ID}"; then + if test -z "${PHP_CONFIG}"; then + AC_MSG_ERROR(php-config not found) + fi + if test -z "${AWK}"; then + AC_MSG_ERROR(awk not found) + fi + PHP_IMAGICK_FOUND_VERSION=`${PHP_CONFIG} --version` + PHP_IMAGICK_FOUND_VERNUM=`echo "${PHP_IMAGICK_FOUND_VERSION}" | $AWK 'BEGIN { FS = "."; } { printf "%d", ($1 * 100 + $2) * 100 + $3;}'` + else + PHP_IMAGICK_FOUND_VERNUM="${PHP_VERSION_ID}" + PHP_IMAGICK_FOUND_VERSION="${PHP_VERSION}" + fi + + if test "$PHP_IMAGICK_FOUND_VERNUM" -ge "50600"; then + AC_MSG_RESULT(yes. found $PHP_IMAGICK_FOUND_VERSION) + else + AC_MSG_ERROR(no. found $PHP_IMAGICK_FOUND_VERSION) + fi + +# +# Set libs and CFLAGS for building +# + echo "libs" + echo $IM_IMAGEMAGICK_LIBS + echo "" + echo $IMAGICK_SHARED_LIBADD + + PHP_EVAL_LIBLINE($IM_IMAGEMAGICK_LIBS, IMAGICK_SHARED_LIBADD) + PHP_EVAL_INCLINE($IM_IMAGEMAGICK_CFLAGS) + + old_LIBS=$LIBS + LIBS="$LIBS $IM_IMAGEMAGICK_LIBS" + + PHP_CHECK_FUNC(MagickGetVersion) + + LIBS=$old_LIBS + + AC_MSG_CHECKING(omp_pause_resource_all usability) + AC_COMPILE_IFELSE(AC_LANG_PROGRAM( + #include <omp.h> + , + omp_pause_resource_all(omp_pause_hard); + ), + AC_MSG_RESULT(yes) + AC_MSG_CHECKING(Which flavour of OpenMP to link) + + if test "${GCC}" = "yes"; then + # Open64 (passes for GCC but uses different OpenMP implementation) + if test "x$GOMP_LIBS" = x ; then + if $CC --version 2>&1 | grep Open64 > /dev/null ; then + PHP_CHECK_FUNC(omp_pause_resource_all, openmp) + if test "x$ac_cv_func_omp_pause_resource_all" = "xyes"; then + PHP_ADD_LIBRARY(openmp,, IMAGICK_SHARED_LIBADD) + AC_MSG_RESULT(Open64 flavoured OpenMP) + fi + fi + fi + # Clang (passes for GCC but uses different OpenMP implementation) + if test "x$LIB_OMP" = x ; then + if $CC --version 2>&1 | grep clang > /dev/null ; then + PHP_CHECK_FUNC(omp_pause_resource_all, omp) + if test "x$ac_cv_func_omp_pause_resource_all" = "xyes"; then + PHP_ADD_LIBRARY(omp,, IMAGICK_SHARED_LIBADD) + AC_MSG_RESULT(Clang flavoured OpenMP) + fi + fi + fi + # GCC + if test "x$ac_cv_func_omp_pause_resource_all" = x ; then + PHP_CHECK_FUNC(omp_pause_resource_all, gomp) + if test "x$ac_cv_func_omp_pause_resource_all" = "xyes"; then + PHP_ADD_LIBRARY(gomp,, IMAGICK_SHARED_LIBADD) + AC_MSG_RESULT(GCC flavoured OpenMP) + fi + fi + fi + + , + AC_MSG_RESULT(no) + ) + + PHP_SUBST(IMAGICK_SHARED_LIBADD) + AC_DEFINE(HAVE_IMAGICK,1, ) + PHP_NEW_EXTENSION(imagick, imagick_file.c imagick_class.c imagickdraw_class.c imagickpixel_class.c imagickpixeliterator_class.c imagick_helpers.c imagick.c imagickkernel_class.c shim_im6_to_im7.c, $ext_shared,, $IM_IMAGEMAGICK_CFLAGS) + PHP_INSTALL_HEADERS(ext/imagick, php_imagick_shared.h) +fi
View file
imagick-3.8.0.tgz/imagick-3.8.0/config.w32
Changed
(renamed from imagick-3.7.0/config.w32)
View file
imagick-3.8.0.tgz/imagick-3.8.0/examples/captcha.php
Changed
(renamed from imagick-3.7.0/examples/captcha.php)
View file
imagick-3.8.0.tgz/imagick-3.8.0/examples/polygon.php
Changed
(renamed from imagick-3.7.0/examples/polygon.php)
View file
imagick-3.8.0.tgz/imagick-3.8.0/examples/thumbnail.php
Changed
(renamed from imagick-3.7.0/examples/thumbnail.php)
View file
imagick-3.8.0.tgz/imagick-3.8.0/examples/watermark.php
Changed
(renamed from imagick-3.7.0/examples/watermark.php)
View file
imagick-3.8.0.tgz/imagick-3.8.0/imagemagick.m4
Changed
(renamed from imagick-3.7.0/imagemagick.m4)
View file
imagick-3.8.0.tgz/imagick-3.8.0/imagick.c
Added
@@ -0,0 +1,1332 @@ +/* + +----------------------------------------------------------------------+ + | PHP Version 5 / Imagick | + +----------------------------------------------------------------------+ + | Copyright (c) 2006-2013 Mikko Koppanen, Scott MacVicar | + | ImageMagick (c) ImageMagick Studio LLC | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Mikko Kopppanen <mkoppanen@php.net> | + | Scott MacVicar <scottmac@php.net> | + +----------------------------------------------------------------------+ +*/ + +#include "php_imagick.h" +#include "php_imagick_defs.h" +#include "php_imagick_macros.h" +#include "php_imagick_helpers.h" +#include "php_imagick_shared.h" + +#if PHP_VERSION_ID >= 70000 +#include "ext/standard/php_smart_string.h" +#else +#include "ext/standard/php_smart_str.h" +#endif + +#if PHP_VERSION_ID < 70200 +///* For the countable interface */ +#include "ext/spl/spl_iterators.h" +#endif + +#include "shim_php7_to_php8.h" + +#if HAVE_OMP_PAUSE_RESOURCE_ALL +#include <omp.h> +#endif + +ZEND_DECLARE_MODULE_GLOBALS(imagick) + +#ifdef IMAGICK_WITH_KERNEL + #if PHP_VERSION_ID >= 80000 + HashTable* php_imagickkernel_get_debug_info(zend_object *obj, int *is_temp TSRMLS_DC); /* {{{ */ + #else + HashTable* php_imagickkernel_get_debug_info(zval *obj, int *is_temp TSRMLS_DC); /* {{{ */ + #endif +#endif + +#if MAGICKCORE_HDRI_ENABLE + #define IMAGICK_QUANTUM_TYPE IS_DOUBLE +#else + #define IMAGICK_QUANTUM_TYPE IS_LONG +#endif + +zend_class_entry *php_imagick_sc_entry; +zend_class_entry *php_imagick_exception_class_entry; +zend_class_entry *php_imagickdraw_sc_entry; +zend_class_entry *php_imagickdraw_exception_class_entry; +zend_class_entry *php_imagickpixel_sc_entry; +zend_class_entry *php_imagickpixel_exception_class_entry; +zend_class_entry *php_imagickpixeliterator_sc_entry; +zend_class_entry *php_imagickpixeliterator_exception_class_entry; +#ifdef IMAGICK_WITH_KERNEL +zend_class_entry *php_imagickkernel_sc_entry; +zend_class_entry *php_imagickkernel_exception_class_entry; +#endif + +#if defined(ZTS) && defined(PHP_WIN32) +static MUTEX_T imagick_mutex; +static THREAD_T imagick_thread_id; +#endif + +/* Handlers */ +static zend_object_handlers imagick_object_handlers; +static zend_object_handlers imagickdraw_object_handlers; +static zend_object_handlers imagickpixel_object_handlers; +static zend_object_handlers imagickpixeliterator_object_handlers; +#ifdef IMAGICK_WITH_KERNEL +static zend_object_handlers imagickkernel_object_handlers; +#endif + +/* External API */ +PHP_IMAGICK_API zend_class_entry *php_imagick_get_class_entry() +{ + return php_imagick_sc_entry; +} + +PHP_IMAGICK_API zend_class_entry *php_imagickdraw_get_class_entry() +{ + return php_imagickdraw_sc_entry; +} + +PHP_IMAGICK_API zend_class_entry *php_imagickpixel_get_class_entry() +{ + return php_imagickpixel_sc_entry; +} + +static zend_function_entry php_imagick_functions = +{ + PHP_FE_END, +}; + + +#include "ImagickDraw_arginfo.h" +const zend_function_entry *php_imagickdraw_class_methods = class_ImagickDraw_methods; + +#include "ImagickPixelIterator_arginfo.h" +const zend_function_entry *php_imagickpixeliterator_class_methods = class_ImagickPixelIterator_methods; + +#include "ImagickPixel_arginfo.h" +const zend_function_entry *php_imagickpixel_class_methods = class_ImagickPixel_methods; + +#include "Imagick_arginfo.h" +const zend_function_entry *php_imagick_class_methods = class_Imagick_methods; + +#ifdef IMAGICK_WITH_KERNEL +#include "ImagickKernel_arginfo.h" +const zend_function_entry *php_imagickkernel_class_methods = class_ImagickKernel_methods; +#endif + +static void php_imagick_object_free_storage(IM_ZEND_OBJECT *object TSRMLS_DC) +{ + php_imagick_object *intern = php_imagick_fetch_object(object); + + if (!intern) { + return; + } + + if (intern->progress_monitor_name) { + //TODO - is this meant to be free by us? + efree(intern->progress_monitor_name); + } + + if (intern->magick_wand != NULL) { + intern->magick_wand = DestroyMagickWand(intern->magick_wand); + } + + zend_object_std_dtor(&intern->zo TSRMLS_CC); +#if PHP_VERSION_ID < 70000 + efree(intern); +#endif +} + + +static void php_imagickdraw_object_free_storage(IM_ZEND_OBJECT *object TSRMLS_DC) +{ + php_imagickdraw_object *intern = php_imagickdraw_fetch_object(object); + + if (!intern) { + return; + } + + if (intern->drawing_wand != NULL) { + intern->drawing_wand = DestroyDrawingWand(intern->drawing_wand); + } + + zend_object_std_dtor(&intern->zo TSRMLS_CC); + + #if PHP_VERSION_ID < 70000 + efree(intern); + #endif +} + +static void php_imagickpixeliterator_object_free_storage(IM_ZEND_OBJECT *object TSRMLS_DC) +{ + php_imagickpixeliterator_object *intern = php_imagickpixeliterator_fetch_object(object); + + if (!intern) { + return; + } + + if (intern->pixel_iterator != NULL) { + intern->pixel_iterator = DestroyPixelIterator(intern->pixel_iterator); + } + + zend_object_std_dtor(&intern->zo TSRMLS_CC); + #if PHP_VERSION_ID < 70000 + efree(intern); + #endif +} + + + +static void php_imagickpixel_object_free_storage(IM_ZEND_OBJECT *object TSRMLS_DC) +{ + php_imagickpixel_object *intern = php_imagickpixel_fetch_object(object); + + if (!intern) { + return; + } + if (!intern->initialized_via_iterator && intern->pixel_wand) + intern->pixel_wand = DestroyPixelWand(intern->pixel_wand); + + zend_object_std_dtor(&intern->zo TSRMLS_CC); + #if PHP_VERSION_ID < 70000 + efree(intern); + #endif +} + +#ifdef IMAGICK_WITH_KERNEL +static void php_imagickkernel_object_free_storage(IM_ZEND_OBJECT *object TSRMLS_DC) +{ + php_imagickkernel_object *intern = php_imagickkernel_fetch_object(object); + + if (!intern) { + return; + } + + if (intern->kernel_info != NULL) { + // This segfaults in PHP 5.6 + //intern->kernel_info = DestroyKernelInfo(intern->kernel_info); + intern->kernel_info = NULL; + } + + zend_object_std_dtor(&intern->zo TSRMLS_CC); +#if PHP_VERSION_ID < 70000 + efree(intern); +#endif +} +#endif + + +#if PHP_VERSION_ID < 50399 +# define object_properties_init(zo, class_type) { \ + zval *tmp; \ + zend_hash_copy((*zo).properties, \ + &class_type->default_properties, \ + (copy_ctor_func_t) zval_add_ref, \ + (void *) &tmp, \ + sizeof(zval *)); \ + } +#endif + +#if PHP_VERSION_ID >= 70000 +static zend_object * php_imagick_object_new_ex(zend_class_entry *class_type, php_imagick_object **ptr, zend_bool init_wand TSRMLS_DC) +#else +static zend_object_value php_imagick_object_new_ex(zend_class_entry *class_type, php_imagick_object **ptr, zend_bool init_wand TSRMLS_DC) +#endif + +{ + php_imagick_object *intern; + + /* Allocate memory for it */ +#if PHP_VERSION_ID >= 70000 + intern = ecalloc(1, + sizeof(php_imagick_object) + + zend_object_properties_size(class_type)); +#else + zend_object_value retval; + + intern = (php_imagick_object *) emalloc(sizeof(php_imagick_object)); + memset(&intern->zo, 0, sizeof(zend_object)); +#endif + +#if defined(ZTS) && defined(PHP_WIN32) + /* If its our thread then we already have the lock so no need to lock again */ + if (imagick_thread_id != tsrm_thread_id()) { + tsrm_mutex_lock(imagick_mutex); + imagick_thread_id = tsrm_thread_id(); + } +#endif + + if (ptr) { + *ptr = intern; + } + + /* Set the magickwand */ + if (init_wand) { + intern->magick_wand = NewMagickWand(); + + if (!intern->magick_wand) { + zend_error(E_ERROR, "Failed to create Imagick object, could not set magick_wand"); + } + } else { + intern->magick_wand = NULL; + } + intern->next_out_of_bound = 0; + intern->progress_monitor_name = NULL; + + zend_object_std_init(&intern->zo, class_type TSRMLS_CC); + object_properties_init(&intern->zo, class_type); + +#if PHP_VERSION_ID >= 70000 +#if PHP_VERSION_ID < 80300 + intern->zo.handlers = &imagick_object_handlers; +#endif + return &intern->zo; +#else + retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) php_imagick_object_free_storage, NULL TSRMLS_CC); + retval.handlers = (zend_object_handlers *) &imagick_object_handlers; + return retval; +#endif +} + + +#if PHP_VERSION_ID >= 70000 +static zend_object * php_imagick_object_new(zend_class_entry *class_type TSRMLS_DC) +#else +static zend_object_value php_imagick_object_new(zend_class_entry *class_type TSRMLS_DC) +#endif +{ + return php_imagick_object_new_ex(class_type, NULL, 1 TSRMLS_CC); +} + +#if PHP_VERSION_ID >= 70000 +static zend_object * php_imagickdraw_object_new_ex(zend_class_entry *class_type, php_imagickdraw_object **ptr, zend_bool init_wand TSRMLS_DC) +#else +static zend_object_value php_imagickdraw_object_new_ex(zend_class_entry *class_type, php_imagickdraw_object **ptr, zend_bool init_wand TSRMLS_DC) +#endif +{ + php_imagickdraw_object *intern; + +#if PHP_VERSION_ID >= 70000 + /* Allocate memory for it */ + intern = ecalloc(1, + sizeof(php_imagickdraw_object) + + zend_object_properties_size(class_type)); + + zend_object_std_init(&intern->zo, class_type TSRMLS_CC); + object_properties_init(&intern->zo, class_type); +#if PHP_VERSION_ID < 80300 + intern->zo.handlers = &imagickdraw_object_handlers; +#endif +#else + zend_object_value retval; + intern = (php_imagickdraw_object *) emalloc(sizeof(php_imagickdraw_object)); + memset(&intern->zo, 0, sizeof(zend_object)); +#endif + + if (ptr) { + *ptr = intern; + } + + /* Set the DrawingWand */ + if (init_wand) { + intern->drawing_wand = NewDrawingWand(); + + if (!intern->drawing_wand) { + zend_error(E_ERROR, "Failed to create ImagickDraw object"); + } + } else { + intern->drawing_wand = NULL; + } +#if PHP_VERSION_ID >= 70000 + intern->zo.handlers = &imagickdraw_object_handlers; + + return &intern->zo; +#else + /* ALLOC_HASHTABLE(intern->zo.properties); */ + zend_object_std_init(&intern->zo, class_type TSRMLS_CC); + object_properties_init(&intern->zo, class_type); + retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) php_imagickdraw_object_free_storage, NULL TSRMLS_CC); + retval.handlers = (zend_object_handlers *) &imagickdraw_object_handlers; + + return retval; +#endif +} + +#if PHP_VERSION_ID >= 70000 +static zend_object * php_imagickdraw_object_new(zend_class_entry *class_type TSRMLS_DC) +#else +static zend_object_value php_imagickdraw_object_new(zend_class_entry *class_type TSRMLS_DC) +#endif +{ + return php_imagickdraw_object_new_ex(class_type, NULL, 1 TSRMLS_CC); +} + +#if PHP_VERSION_ID >= 70000 +static zend_object * php_imagickpixeliterator_object_new(zend_class_entry *class_type TSRMLS_DC) +#else +static zend_object_value php_imagickpixeliterator_object_new(zend_class_entry *class_type TSRMLS_DC) +#endif +{ + php_imagickpixeliterator_object *intern; + + /* Allocate memory for it */ +#if PHP_VERSION_ID >= 70000 + intern = ecalloc(1, + sizeof(php_imagickpixeliterator_object) + + zend_object_properties_size(class_type)); +#else + zend_object_value retval; + intern = (php_imagickpixeliterator_object *) emalloc(sizeof(php_imagickpixeliterator_object)); + memset(&intern->zo, 0, sizeof(zend_object)); +#endif + + /* We cant initialize yet */ + intern->pixel_iterator = NULL; + intern->initialized = 0; + +#if MagickLibVersion <= 0x628 + intern->rows = 0; + intern->iterator_position = 0; +#endif + + zend_object_std_init(&intern->zo, class_type TSRMLS_CC); + object_properties_init(&intern->zo, class_type); + +#if PHP_VERSION_ID >= 70000 +#if PHP_VERSION_ID < 80300 + intern->zo.handlers = &imagickpixeliterator_object_handlers; +#endif + return &intern->zo; +#else + retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) php_imagickpixeliterator_object_free_storage, NULL TSRMLS_CC); + retval.handlers = (zend_object_handlers *) &imagickpixeliterator_object_handlers; + + return retval; +#endif +} + +#if PHP_VERSION_ID >= 70000 +static zend_object * php_imagickpixel_object_new_ex(zend_class_entry *class_type, php_imagickpixel_object **ptr TSRMLS_DC) +#else +static zend_object_value php_imagickpixel_object_new_ex(zend_class_entry *class_type, php_imagickpixel_object **ptr TSRMLS_DC) +#endif +{ + php_imagickpixel_object *intern; + +#if PHP_VERSION_ID >= 70000 + /* Allocate memory for it */ + intern = ecalloc(1, + sizeof(php_imagickpixel_object) + + zend_object_properties_size(class_type)); +#else + zend_object_value retval; + intern = (php_imagickpixel_object *) emalloc(sizeof(php_imagickpixel_object)); + memset(&intern->zo, 0, sizeof(zend_object)); +#endif + + if (ptr) { + *ptr = intern; + } + + /* Set the pixeliterator */ + intern->pixel_wand = NULL; + intern->initialized_via_iterator = 0; + zend_object_std_init(&intern->zo, class_type TSRMLS_CC); + object_properties_init(&intern->zo, class_type); + +#if PHP_VERSION_ID >= 70000 +#if PHP_VERSION_ID < 80300 + intern->zo.handlers = &imagickpixel_object_handlers; +#endif + return &intern->zo; +#else + retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) php_imagickpixel_object_free_storage, NULL TSRMLS_CC); + retval.handlers = (zend_object_handlers *) &imagickpixel_object_handlers; + + return retval; +#endif + +} + +#if PHP_VERSION_ID >= 70000 +static zend_object * php_imagickpixel_object_new(zend_class_entry *class_type TSRMLS_DC) +#else +static zend_object_value php_imagickpixel_object_new(zend_class_entry *class_type TSRMLS_DC) +#endif +{ + return php_imagickpixel_object_new_ex(class_type, NULL TSRMLS_CC); +} + +#ifdef IMAGICK_WITH_KERNEL + +#if PHP_VERSION_ID >= 70000 +static zend_object * php_imagickkernel_object_new_ex(zend_class_entry *class_type, php_imagickkernel_object **ptr TSRMLS_DC) +#else +static zend_object_value php_imagickkernel_object_new_ex(zend_class_entry *class_type, php_imagickkernel_object **ptr TSRMLS_DC) +#endif +{ + + php_imagickkernel_object *intern; + + /* Allocate memory for it */ +#if PHP_VERSION_ID >= 70000 + intern = ecalloc(1, + sizeof(php_imagickkernel_object) + + zend_object_properties_size(class_type)); +#else + zend_object_value retval; + intern = (php_imagickkernel_object *) emalloc(sizeof(php_imagickkernel_object)); + memset(&intern->zo, 0, sizeof(zend_object)); +#endif + + if (ptr) { + *ptr = intern; + } + + /* Set the kernel */ + intern->kernel_info = NULL; + + /* ALLOC_HASHTABLE(intern->zo.properties); */ + zend_object_std_init(&intern->zo, class_type TSRMLS_CC); + object_properties_init(&intern->zo, class_type); + +#if PHP_VERSION_ID >= 70000 +#if PHP_VERSION_ID < 80300 + intern->zo.handlers = &imagickkernel_object_handlers; +#endif + return &intern->zo; +#else + retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) php_imagickkernel_object_free_storage, NULL TSRMLS_CC); + retval.handlers = (zend_object_handlers *) &imagickkernel_object_handlers; + + return retval; +#endif +} +#endif + +#undef object_properties_init + +#ifdef IMAGICK_WITH_KERNEL +#if PHP_VERSION_ID >= 70000 +static zend_object * php_imagickkernel_object_new(zend_class_entry *class_type TSRMLS_DC) +#else +static zend_object_value php_imagickkernel_object_new(zend_class_entry *class_type TSRMLS_DC) +#endif +{ + return php_imagickkernel_object_new_ex(class_type, NULL TSRMLS_CC); +} +#endif + + + +PHP_INI_BEGIN() + STD_PHP_INI_ENTRY("imagick.locale_fix", "0", PHP_INI_ALL, OnUpdateBool, locale_fix, zend_imagick_globals, imagick_globals) + STD_PHP_INI_ENTRY("imagick.skip_version_check", "0", PHP_INI_ALL, OnUpdateBool, skip_version_check, zend_imagick_globals, imagick_globals) + STD_PHP_INI_ENTRY("imagick.progress_monitor", "0", PHP_INI_SYSTEM, OnUpdateBool, progress_monitor, zend_imagick_globals, imagick_globals) + + STD_PHP_INI_ENTRY("imagick.set_single_thread", "1", PHP_INI_SYSTEM, OnUpdateBool, set_single_thread, zend_imagick_globals, imagick_globals) + STD_PHP_INI_ENTRY("imagick.shutdown_sleep_count", "10", PHP_INI_ALL, OnUpdateLong, shutdown_sleep_count, zend_imagick_globals, imagick_globals) + STD_PHP_INI_ENTRY("imagick.allow_zero_dimension_images", "0", PHP_INI_ALL, OnUpdateBool, allow_zero_dimension_images, zend_imagick_globals, imagick_globals) +PHP_INI_END() + +static void php_imagick_init_globals(zend_imagick_globals *imagick_globals) +{ + imagick_globals->locale_fix = 0; + imagick_globals->progress_monitor = 0; + imagick_globals->skip_version_check = 0; + imagick_globals->set_single_thread = 1; + imagick_globals->allow_zero_dimension_images = 0; + // 10 is magick number, that seems to be enough. + imagick_globals->shutdown_sleep_count = 10; +} + + +#if PHP_VERSION_ID >= 80000 +static int php_imagick_count_elements(zend_object *object, im_long *count) /* {{{ */ +{ + php_imagick_object *intern= php_imagick_fetch_object(object); +#else +static int php_imagick_count_elements(zval *object, im_long *count TSRMLS_DC) /* {{{ */ +{ + php_imagick_object *intern= Z_IMAGICK_P(object); +#endif + + if (intern->magick_wand) { + *count = MagickGetNumberImages(intern->magick_wand); + return SUCCESS; + } + return FAILURE; +} + + +#if PHP_VERSION_ID >= 80000 +static zval *php_imagick_read_property(zend_object *object, zend_string *member, int type, void **cache_slot, zval *rv) +{ + int ret; + php_imagick_object *intern; + zval *retval = NULL; + const zend_object_handlers *std_hnd; + + + std_hnd = zend_get_std_object_handlers(); + + ret = std_hnd->has_property(object, member, type, cache_slot TSRMLS_CC); + + if (ret) { + //TODO - this would allow better immutability + //ZVAL_COPY_VALUE(retval, std_hnd->read_property(object, member, type, cache_slot, rv TSRMLS_CC)); + retval = std_hnd->read_property(object, member, type, cache_slot, rv TSRMLS_CC); + } + else { + + intern = php_imagick_fetch_object(object); + /* Do we have any images? */ + if (MagickGetNumberImages(intern->magick_wand)) { + + //TODO - this seems redundant + /* Is this overloaded? */ + if (!strcmp(ZSTR_VAL(member), "width") || + !strcmp(ZSTR_VAL(member), "height") || + !strcmp(ZSTR_VAL(member), "format")) { + + if (!strcmp(ZSTR_VAL(member), "width")) { + retval = rv; + ZVAL_LONG(retval, MagickGetImageWidth(intern->magick_wand)); + } else if (!strcmp(ZSTR_VAL(member), "height")) { + retval = rv; + ZVAL_LONG(retval, MagickGetImageHeight(intern->magick_wand)); + } else if (!strcmp(ZSTR_VAL(member), "format")) { + char *format = MagickGetImageFormat(intern->magick_wand); + + if (format) { + retval = rv; + ZVAL_STRING(retval, format); + zend_str_tolower(Z_STRVAL_P(retval), Z_STRLEN_P(retval)); + IMAGICK_FREE_MAGICK_MEMORY(format); + } else { + retval = rv; + ZVAL_STRING(retval, ""); + } + } + } + } + } + + if (!retval) { + //TODO - why is the error silent - it would be a small BC break + //to enable the warning. I think it would be the correct thing to do though. + //zend_error(E_NOTICE,"Undefined property: \Imagick::$%s", Z_STRVAL_P(member)); + retval = &EG(uninitialized_zval); + } + + return retval; +} + +#else // PHP_VERSION_ID >= 80000 + +#if PHP_VERSION_ID >= 70000 +static zval *php_imagick_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC) +{ + int ret; + php_imagick_object *intern; + zval *retval = NULL; + zval tmp_member; + const zend_object_handlers *std_hnd; + + ZVAL_DEREF(member); + if (Z_TYPE_P(member) != IS_STRING) { + tmp_member = *member; + zval_copy_ctor(&tmp_member); + convert_to_string(&tmp_member); + member = &tmp_member; + } + + std_hnd = zend_get_std_object_handlers(); + + ret = std_hnd->has_property(object, member, type, cache_slot TSRMLS_CC); + + if (ret) { + //TODO - this would allow better immutability + //ZVAL_COPY_VALUE(retval, std_hnd->read_property(object, member, type, cache_slot, rv TSRMLS_CC)); + retval = std_hnd->read_property(object, member, type, cache_slot, rv TSRMLS_CC); + } + else { + + intern = Z_IMAGICK_P(object); + /* Do we have any images? */ + if (MagickGetNumberImages(intern->magick_wand)) { + + //TODO - this seems redundant + /* Is this overloaded? */ + if (!strcmp(Z_STRVAL_P(member), "width") || + !strcmp(Z_STRVAL_P(member), "height") || + !strcmp(Z_STRVAL_P(member), "format")) { + + if (!strcmp(Z_STRVAL_P(member), "width")) { + retval = rv; + ZVAL_LONG(retval, MagickGetImageWidth(intern->magick_wand)); + } else if (!strcmp(Z_STRVAL_P(member), "height")) { + retval = rv; + ZVAL_LONG(retval, MagickGetImageHeight(intern->magick_wand)); + } else if (!strcmp(Z_STRVAL_P(member), "format")) { + char *format = MagickGetImageFormat(intern->magick_wand); + + if (format) { + retval = rv; + ZVAL_STRING(retval, format); + zend_str_tolower(Z_STRVAL_P(retval), Z_STRLEN_P(retval)); + IMAGICK_FREE_MAGICK_MEMORY(format); + } else { + retval = rv; + ZVAL_STRING(retval, ""); + } + } + } + } + } + + if (!retval) { + //TODO - why is the error silent - it would be a small BC break + //to enable the warning. I think it would be the correct thing to do though. + //zend_error(E_NOTICE,"Undefined property: \Imagick::$%s", Z_STRVAL_P(member)); + retval = &EG(uninitialized_zval); + } + + if (member == &tmp_member) { + zval_dtor(member); + } + + return retval; +} + +#else + +#if PHP_VERSION_ID < 50399 +static zval *php_imagick_read_property(zval *object, zval *member, int type TSRMLS_DC) +#else +static zval *php_imagick_read_property(zval *object, zval *member, int type, const zend_literal *key TSRMLS_DC) +#endif +{ + int ret; + php_imagick_object *intern; + zval *retval = NULL, tmp_member; + zend_object_handlers *std_hnd; + + if (Z_TYPE_P(member) != IS_STRING) { + tmp_member = *member; + zval_copy_ctor(&tmp_member); + convert_to_string(&tmp_member); + member = &tmp_member; + } + + std_hnd = zend_get_std_object_handlers(); +#if PHP_VERSION_ID < 50399 + ret = std_hnd->has_property(object, member, 2 TSRMLS_CC); +#else + ret = std_hnd->has_property(object, member, 2, key TSRMLS_CC); +#endif + + if (ret) { + std_hnd = zend_get_std_object_handlers(); +#if PHP_VERSION_ID < 50399 + retval = std_hnd->read_property(object, member, type TSRMLS_CC); +#else + retval = std_hnd->read_property(object, member, type, key TSRMLS_CC); +#endif + } else { + intern = (php_imagick_object *) zend_object_store_get_object(object TSRMLS_CC); + /* Do we have any images? */ + if (MagickGetNumberImages(intern->magick_wand)) { + /* Is this overloaded? */ + if (!strcmp(Z_STRVAL_P(member), "width") || + !strcmp(Z_STRVAL_P(member), "height") || + !strcmp(Z_STRVAL_P(member), "format")) { + + MAKE_STD_ZVAL(retval); +#ifdef Z_SET_REFCOUNT_P + Z_SET_REFCOUNT_P(retval, 0); +#else + retval->refcount = 0; +#endif + if (!strcmp(Z_STRVAL_P(member), "width")) { + ZVAL_LONG(retval, MagickGetImageWidth(intern->magick_wand)); + } else if (!strcmp(Z_STRVAL_P(member), "height")) { + ZVAL_LONG(retval, MagickGetImageHeight(intern->magick_wand)); + } else if (!strcmp(Z_STRVAL_P(member), "format")) { + char *format = MagickGetImageFormat(intern->magick_wand); + + if (format) { + ZVAL_STRING(retval, format, 1); + zend_str_tolower(Z_STRVAL_P(retval), Z_STRLEN_P(retval)); + IMAGICK_FREE_MAGICK_MEMORY(format); + } else { + ZVAL_STRING(retval, "", 1); + } + } + } + } + } + if (member == &tmp_member) { + zval_dtor(member); + } + + if (!retval) { + retval = EG(uninitialized_zval_ptr); + } + return retval; +} +#endif + +#endif + +#if PHP_VERSION_ID >= 80000 +static zend_object * php_imagick_clone_imagick_object(zend_object *this_ptr) +#elif PHP_VERSION_ID >= 70000 +static zend_object * php_imagick_clone_imagick_object(zval *this_ptr TSRMLS_DC) +#else +static zend_object_value php_imagick_clone_imagick_object(zval *this_ptr TSRMLS_DC) +#endif +{ + MagickWand *wand_copy = NULL; + php_imagick_object *new_obj = NULL; +#if PHP_VERSION_ID >= 80000 + php_imagick_object *old_obj = php_imagick_fetch_object(this_ptr); + zend_object * new_zo = php_imagick_object_new_ex(old_obj->zo.ce, &new_obj, 0 TSRMLS_CC); + zend_objects_clone_members(&new_obj->zo, &old_obj->zo TSRMLS_CC); +#elif PHP_VERSION_ID >= 70000 + php_imagick_object *old_obj = Z_IMAGICK_P(this_ptr); + zend_object * new_zo = php_imagick_object_new_ex(old_obj->zo.ce, &new_obj, 0 TSRMLS_CC); + zend_objects_clone_members(&new_obj->zo, &old_obj->zo TSRMLS_CC); +#else + php_imagick_object *old_obj = (php_imagick_object *) zend_object_store_get_object(this_ptr TSRMLS_CC); + zend_object_value new_zo = php_imagick_object_new_ex(old_obj->zo.ce, &new_obj, 0 TSRMLS_CC); + zend_objects_clone_members(&new_obj->zo, new_zo, &old_obj->zo, Z_OBJ_HANDLE_P(this_ptr) TSRMLS_CC); +#endif + + wand_copy = CloneMagickWand(old_obj->magick_wand); + if (!wand_copy) { + zend_error(E_ERROR, "Failed to clone Imagick object"); + } else { + php_imagick_replace_magickwand(new_obj, wand_copy); + new_obj->next_out_of_bound = old_obj->next_out_of_bound; + + if (old_obj->progress_monitor_name) { + new_obj->progress_monitor_name = estrdup(old_obj->progress_monitor_name); + } + } + return new_zo; +} + +#if PHP_VERSION_ID >= 80000 +static zend_object * php_imagick_clone_imagickdraw_object(zend_object *this_ptr) +#elif PHP_VERSION_ID >= 70000 +static zend_object * php_imagick_clone_imagickdraw_object(zval *this_ptr TSRMLS_DC) +#else +static zend_object_value php_imagick_clone_imagickdraw_object(zval *this_ptr TSRMLS_DC) +#endif +{ + DrawingWand *wand_copy = NULL; + php_imagickdraw_object *new_obj = NULL; +#if PHP_VERSION_ID >= 80000 + php_imagickdraw_object *old_obj = php_imagickdraw_fetch_object(this_ptr); + zend_object * new_zo = php_imagickdraw_object_new_ex(old_obj->zo.ce, &new_obj, 0 TSRMLS_CC); + zend_objects_clone_members(&new_obj->zo, &old_obj->zo TSRMLS_CC); +#elif PHP_VERSION_ID >= 70000 + php_imagickdraw_object *old_obj = Z_IMAGICKDRAW_P(this_ptr); + zend_object * new_zo = php_imagickdraw_object_new_ex(old_obj->zo.ce, &new_obj, 0 TSRMLS_CC); + zend_objects_clone_members(&new_obj->zo, &old_obj->zo TSRMLS_CC); +#else + php_imagickdraw_object *old_obj = (php_imagickdraw_object *) zend_object_store_get_object(this_ptr TSRMLS_CC); + zend_object_value new_zo = php_imagickdraw_object_new_ex(old_obj->zo.ce, &new_obj, 0 TSRMLS_CC); + zend_objects_clone_members(&new_obj->zo, new_zo, &old_obj->zo, Z_OBJ_HANDLE_P(this_ptr) TSRMLS_CC); +#endif + + wand_copy = CloneDrawingWand(old_obj->drawing_wand); + + if (!wand_copy) { + zend_error(E_ERROR, "Failed to clone ImagickDraw object"); + } else { + php_imagick_replace_drawingwand(new_obj, wand_copy); + } + return new_zo; +} + + +#if PHP_VERSION_ID >= 80000 +static zend_object * php_imagick_clone_imagickpixel_object(zend_object *this_ptr) +#elif PHP_VERSION_ID >= 70000 +static zend_object * php_imagick_clone_imagickpixel_object(zval *this_ptr TSRMLS_DC) +#else +static zend_object_value php_imagick_clone_imagickpixel_object(zval *this_ptr TSRMLS_DC) +#endif +{ + PixelWand *wand_copy = NULL; + php_imagickpixel_object *new_obj = NULL; + +#if PHP_VERSION_ID >= 80000 + zend_object *new_zo; + php_imagickpixel_object *old_obj = php_imagickpixel_fetch_object(this_ptr); + new_zo = php_imagickpixel_object_new_ex(old_obj->zo.ce, &new_obj TSRMLS_CC); + zend_objects_clone_members(&new_obj->zo, &old_obj->zo TSRMLS_CC); +#elif PHP_VERSION_ID >= 70000 + zend_object *new_zo; + php_imagickpixel_object *old_obj = Z_IMAGICKPIXEL_P(this_ptr); + new_zo = php_imagickpixel_object_new_ex(old_obj->zo.ce, &new_obj TSRMLS_CC); + zend_objects_clone_members(&new_obj->zo, &old_obj->zo TSRMLS_CC); +#else + php_imagickpixel_object *old_obj = (php_imagickpixel_object *) zend_object_store_get_object(this_ptr TSRMLS_CC); + zend_object_value new_zo = php_imagickpixel_object_new_ex(old_obj->zo.ce, &new_obj TSRMLS_CC); + zend_objects_clone_members(&new_obj->zo, new_zo, &old_obj->zo, Z_OBJ_HANDLE_P(this_ptr) TSRMLS_CC); +#endif + + wand_copy = php_imagick_clone_pixelwand (old_obj->pixel_wand); + if (!wand_copy) { + zend_error(E_ERROR, "Failed to clone ImagickPixel object"); + } else { + php_imagick_replace_pixelwand(new_obj, wand_copy); + new_obj->initialized_via_iterator = 0; + } + return new_zo; +} + +#ifdef IMAGICK_WITH_KERNEL + +#if PHP_VERSION_ID >= 80000 +static zend_object * php_imagick_clone_imagickkernel_object(zend_object *this_ptr TSRMLS_DC) +#elif PHP_VERSION_ID >= 70000 +static zend_object * php_imagick_clone_imagickkernel_object(zval *this_ptr TSRMLS_DC) +#else +static zend_object_value php_imagick_clone_imagickkernel_object(zval *this_ptr TSRMLS_DC) +#endif +{ + KernelInfo *kernel_info_copy = NULL; + php_imagickkernel_object *new_obj = NULL; + +#if PHP_VERSION_ID >= 80000 + zend_object *new_zo; + php_imagickkernel_object *old_obj = php_imagickkernel_fetch_object(this_ptr); + new_zo = php_imagickkernel_object_new_ex(old_obj->zo.ce, &new_obj TSRMLS_CC); + zend_objects_clone_members(&new_obj->zo, &old_obj->zo TSRMLS_CC); +#elif PHP_VERSION_ID >= 70000 + zend_object *new_zo; + php_imagickkernel_object *old_obj = Z_IMAGICKKERNEL_P(this_ptr); + new_zo = php_imagickkernel_object_new_ex(old_obj->zo.ce, &new_obj TSRMLS_CC); + zend_objects_clone_members(&new_obj->zo, &old_obj->zo TSRMLS_CC); +#else + zend_object_value new_zo; + php_imagickkernel_object *old_obj = (php_imagickkernel_object *) zend_object_store_get_object(this_ptr TSRMLS_CC); + new_zo = php_imagickkernel_object_new_ex(old_obj->zo.ce, &new_obj TSRMLS_CC); + zend_objects_clone_members(&new_obj->zo, new_zo, &old_obj->zo, Z_OBJ_HANDLE_P(this_ptr) TSRMLS_CC); +#endif + + if (old_obj->kernel_info != NULL) { + kernel_info_copy = CloneKernelInfo(old_obj->kernel_info); + + if (!kernel_info_copy) { + zend_error(E_ERROR, "Failed to clone ImagickKernel object"); + } + else { + new_obj->kernel_info = kernel_info_copy; + } + } + + return new_zo; +} +#endif + + +static void checkImagickVersion() +{ + //This gets the version that Imagick was compiled against. + size_t imagickVersion = MagickLibVersion; + + //This gets the version of ImageMagick that has been loaded + size_t imageMagickLibraryVersion; + + GetMagickVersion(&imageMagickLibraryVersion); + + if (imagickVersion == imageMagickLibraryVersion) { + return; + } + + zend_error( + E_WARNING, + "Version warning: Imagick was compiled against ImageMagick version %lu but version %lu is loaded. Imagick will run but may behave surprisingly", + (unsigned long)imagickVersion, + (unsigned long)imageMagickLibraryVersion + ); +} + +PHP_MINIT_FUNCTION(imagick) +{ + zend_class_entry ce; + + /* Initialize globals */ + ZEND_INIT_MODULE_GLOBALS(imagick, php_imagick_init_globals, NULL); + + + // This suppresses an 'unused parameter' warning. + (void)type; + + /* + Allocate some memory + */ + memcpy(&imagick_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); + memcpy(&imagickdraw_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); + memcpy(&imagickpixeliterator_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); + memcpy(&imagickpixel_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); +#ifdef IMAGICK_WITH_KERNEL + memcpy(&imagickkernel_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); +#endif + + /* Set custom allocators */ + MagickWandGenesis(); + + /* + Initialize exceptions (Imagick exception) + */ + INIT_CLASS_ENTRY(ce, PHP_IMAGICK_EXCEPTION_SC_NAME, NULL); +#if PHP_VERSION_ID >= 70000 + php_imagick_exception_class_entry = zend_register_internal_class_ex(&ce, zend_ce_exception); +#else + php_imagick_exception_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default(TSRMLS_C), NULL TSRMLS_CC); +#endif + + /* + Initialize exceptions (ImagickDraw exception) + */ + INIT_CLASS_ENTRY(ce, PHP_IMAGICKDRAW_EXCEPTION_SC_NAME, NULL); +#if PHP_VERSION_ID >= 70000 + php_imagickdraw_exception_class_entry = zend_register_internal_class_ex(&ce, zend_ce_exception); +#else + php_imagickdraw_exception_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default(TSRMLS_C), NULL TSRMLS_CC); +#endif + + /* + Initialize exceptions (ImagickPixelIterator exception) + */ + INIT_CLASS_ENTRY(ce, PHP_IMAGICKPIXELITERATOR_EXCEPTION_SC_NAME, NULL); +#if PHP_VERSION_ID >= 70000 + php_imagickpixeliterator_exception_class_entry = zend_register_internal_class_ex(&ce, zend_ce_exception); +#else + php_imagickpixeliterator_exception_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default(TSRMLS_C), NULL TSRMLS_CC); +#endif + + /* + Initialize exceptions (ImagickPixel exception) + */ + INIT_CLASS_ENTRY(ce, PHP_IMAGICKPIXEL_EXCEPTION_SC_NAME, NULL); +#if PHP_VERSION_ID >= 70000 + php_imagickpixel_exception_class_entry = zend_register_internal_class_ex(&ce, zend_ce_exception); +#else + php_imagickpixel_exception_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default(TSRMLS_C), NULL TSRMLS_CC); +#endif + +#ifdef IMAGICK_WITH_KERNEL + /* + Initialize exceptions (ImagickKernel exception) + */ + INIT_CLASS_ENTRY(ce, PHP_IMAGICKKERNEL_EXCEPTION_SC_NAME, NULL); + #if PHP_VERSION_ID >= 70000 + php_imagickkernel_exception_class_entry = zend_register_internal_class_ex(&ce, zend_ce_exception); + #else + php_imagickkernel_exception_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default(TSRMLS_C), NULL TSRMLS_CC); + #endif + +#endif + + /* + Initialize the class (Imagick) + */ + INIT_CLASS_ENTRY(ce, PHP_IMAGICK_SC_NAME, php_imagick_class_methods); +#if PHP_VERSION_ID < 80300 + ce.create_object = php_imagick_object_new; +#endif + imagick_object_handlers.clone_obj = php_imagick_clone_imagick_object; + imagick_object_handlers.read_property = php_imagick_read_property; + imagick_object_handlers.count_elements = php_imagick_count_elements; +#if PHP_VERSION_ID >= 70000 + imagick_object_handlers.offset = XtOffsetOf(php_imagick_object, zo); + imagick_object_handlers.free_obj = php_imagick_object_free_storage; +#endif + + php_imagick_sc_entry = zend_register_internal_class(&ce TSRMLS_CC); +#if PHP_VERSION_ID >= 80300 + php_imagick_sc_entry->create_object = php_imagick_object_new; + php_imagick_sc_entry->default_object_handlers = &imagick_object_handlers; +#endif + zend_class_implements(php_imagick_sc_entry TSRMLS_CC, 2, zend_ce_iterator, im_ce_countable); + + /* + Initialize the class (ImagickDraw) + */ + INIT_CLASS_ENTRY(ce, PHP_IMAGICKDRAW_SC_NAME, php_imagickdraw_class_methods); +#if PHP_VERSION_ID < 80300 + ce.create_object = php_imagickdraw_object_new; +#endif + imagickdraw_object_handlers.clone_obj = php_imagick_clone_imagickdraw_object; +#if PHP_VERSION_ID >= 70000 + imagickdraw_object_handlers.offset = XtOffsetOf(php_imagickdraw_object, zo); + imagickdraw_object_handlers.free_obj = php_imagickdraw_object_free_storage; +#endif + php_imagickdraw_sc_entry = zend_register_internal_class(&ce TSRMLS_CC); +#if PHP_VERSION_ID >= 80300 + php_imagickdraw_sc_entry->create_object = php_imagickdraw_object_new; + php_imagickdraw_sc_entry->default_object_handlers = &imagickdraw_object_handlers; +#endif + + /* + Initialize the class (ImagickPixelIterator) + */ + INIT_CLASS_ENTRY(ce, PHP_IMAGICKPIXELITERATOR_SC_NAME, php_imagickpixeliterator_class_methods); +#if PHP_VERSION_ID < 80300 + ce.create_object = php_imagickpixeliterator_object_new; +#endif + imagickpixeliterator_object_handlers.clone_obj = NULL; +#if PHP_VERSION_ID >= 70000 + imagickpixeliterator_object_handlers.offset = XtOffsetOf(php_imagickpixeliterator_object, zo); + imagickpixeliterator_object_handlers.free_obj = php_imagickpixeliterator_object_free_storage; +#endif + php_imagickpixeliterator_sc_entry = zend_register_internal_class(&ce TSRMLS_CC); +#if PHP_VERSION_ID >= 80300 + php_imagickpixeliterator_sc_entry->create_object = php_imagickpixeliterator_object_new; + php_imagickpixeliterator_sc_entry->default_object_handlers = &imagickpixeliterator_object_handlers; +#endif + zend_class_implements(php_imagickpixeliterator_sc_entry TSRMLS_CC, 1, zend_ce_iterator); + + /* + Initialize the class (ImagickPixel) + */ + INIT_CLASS_ENTRY(ce, PHP_IMAGICKPIXEL_SC_NAME, php_imagickpixel_class_methods); +#if PHP_VERSION_ID < 80300 + ce.create_object = php_imagickpixel_object_new; +#endif + imagickpixel_object_handlers.clone_obj = php_imagick_clone_imagickpixel_object; +#if PHP_VERSION_ID >= 70000 + imagickpixel_object_handlers.offset = XtOffsetOf(php_imagickpixel_object, zo); + imagickpixel_object_handlers.free_obj = php_imagickpixel_object_free_storage; +#endif + + php_imagickpixel_sc_entry = zend_register_internal_class(&ce TSRMLS_CC); +#if PHP_VERSION_ID >= 80300 + php_imagickpixel_sc_entry->create_object = php_imagickpixel_object_new; + php_imagickpixel_sc_entry->default_object_handlers = &imagickpixel_object_handlers; +#endif + +#ifdef IMAGICK_WITH_KERNEL + /* + Initialize the class (ImagickKernel) + */ + INIT_CLASS_ENTRY(ce, PHP_IMAGICKKERNEL_SC_NAME, php_imagickkernel_class_methods); +#if PHP_VERSION_ID < 80300 + ce.create_object = php_imagickkernel_object_new; +#endif + // Disabled until can be compiled under wall correctly + imagickkernel_object_handlers.get_debug_info = php_imagickkernel_get_debug_info; + imagickkernel_object_handlers.clone_obj = php_imagick_clone_imagickkernel_object; + #if PHP_VERSION_ID >= 70000 + imagickkernel_object_handlers.offset = XtOffsetOf(php_imagickkernel_object, zo); + imagickkernel_object_handlers.free_obj = php_imagickkernel_object_free_storage; + #endif + + php_imagickkernel_sc_entry = zend_register_internal_class(&ce TSRMLS_CC); +#if PHP_VERSION_ID >= 80300 + php_imagickkernel_sc_entry->create_object = php_imagickkernel_object_new; + php_imagickkernel_sc_entry->default_object_handlers = &imagickkernel_object_handlers; +#endif +#endif + + php_imagick_initialize_constants (TSRMLS_C); + +#if defined(ZTS) && defined(PHP_WIN32) + imagick_mutex = tsrm_mutex_alloc(); +#endif + + REGISTER_INI_ENTRIES(); + + if (!IMAGICK_G(skip_version_check)) { + checkImagickVersion(); + } + + return SUCCESS; +} + + +PHP_MINFO_FUNCTION(imagick) +{ + +#if PHP_VERSION_ID >= 70000 + smart_string formats = {0}; +#else + smart_str formats = {0}; +#endif + + char **supported_formats, *buffer; + unsigned long i; + size_t num_formats; + size_t version_number; + + num_formats = 0; + + supported_formats = MagickQueryFormats("*", &num_formats); + spprintf(&buffer, 0, "%ld", (long)num_formats); + + php_info_print_table_start(); + php_info_print_table_header(2, "imagick module", "enabled"); + php_info_print_table_row(2, "imagick module version", PHP_IMAGICK_VERSION); +#ifdef IMAGICK_WITH_KERNEL + php_info_print_table_row(2, "imagick classes", "Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator, ImagickKernel"); +#else + php_info_print_table_row(2, "imagick classes", "Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator"); +#endif +#ifdef MagickVersion + php_info_print_table_row(2, "Imagick compiled with ImageMagick version", MagickVersion); +#endif + php_info_print_table_row(2, "Imagick using ImageMagick library version", MagickGetVersion(&version_number)); + php_info_print_table_row(2, "ImageMagick copyright", MagickGetCopyright()); + php_info_print_table_row(2, "ImageMagick release date", MagickGetReleaseDate()); + php_info_print_table_row(2, "ImageMagick number of supported formats: ", buffer); + + efree (buffer); + + if (supported_formats) { + for (i = 0; i < num_formats; i++) { +#if PHP_VERSION_ID >= 70000 + if (i != 0) { + smart_string_appends(&formats, ", "); + } + smart_string_appends(&formats, supported_formatsi); +#else + smart_str_appends(&formats, supported_formatsi); + if (i != (num_formats - 1)) { + smart_str_appends(&formats, ", "); + } +#endif + IMAGICK_FREE_MAGICK_MEMORY(supported_formatsi); + } + +#if PHP_VERSION_ID >= 70000 + smart_string_0(&formats); + php_info_print_table_row(2, "ImageMagick supported formats", formats.c); + smart_string_free(&formats); +#else + smart_str_0(&formats); + php_info_print_table_row(2, "ImageMagick supported formats", formats.c); + smart_str_free(&formats); +#endif + IMAGICK_FREE_MAGICK_MEMORY(supported_formats); + } + + php_info_print_table_end(); + DISPLAY_INI_ENTRIES(); +} + + +PHP_MSHUTDOWN_FUNCTION(imagick) +{ +#if !HAVE_OMP_PAUSE_RESOURCE_ALL + int i; +#endif + +// This suppresses an 'unused parameter' warning. + (void)type; + + MagickWandTerminus(); + +#if HAVE_OMP_PAUSE_RESOURCE_ALL + omp_pause_resource_all(omp_pause_hard); +#else + // Sleep for a bit to hopefully allow OpenMP to + // shut down the threads it created, and avoid a segfault + // This hack won't be needed once everyone is compiling ImageMagick + // against a version of OpenMP that has omp_pause_resource_all() + for (i = 0; i < 100 && i < IMAGICK_G(shutdown_sleep_count); i += 1) { + usleep(1000); + } +#endif + +#if defined(ZTS) && defined(PHP_WIN32) + tsrm_mutex_free(imagick_mutex); +#endif + UNREGISTER_INI_ENTRIES(); + return SUCCESS; +} + +PHP_RINIT_FUNCTION(imagick) +{ + // This suppresses an 'unused parameter' warning. + (void)type; + (void)module_number; + + IMAGICK_G(progress_callback) = NULL; + + if (IMAGICK_G(set_single_thread)) { + MagickSetResourceLimit(ThreadResource, 1); + } + + return SUCCESS; +} + +PHP_RSHUTDOWN_FUNCTION(imagick) +{ + php_imagick_callback* progress_callback = IMAGICK_G(progress_callback); + // This suppresses an 'unused parameter' warning. + (void)type; + (void)module_number; + + if (progress_callback) { + php_imagick_cleanup_progress_callback(progress_callback TSRMLS_CC); + efree(progress_callback); + IMAGICK_G(progress_callback) = NULL; + } + +#if defined(ZTS) && defined(PHP_WIN32) + /* We have the lock so lets release it */ + if (imagick_thread_id == tsrm_thread_id()) { + imagick_thread_id = (THREAD_T)NULL; + tsrm_mutex_unlock(imagick_mutex); + } +#endif + return SUCCESS; +} + +#if ZEND_MODULE_API_NO >= 20050922 +static const zend_module_dep imagick_deps = { + ZEND_MOD_CONFLICTS("gmagick") + ZEND_MOD_REQUIRED("standard") + ZEND_MOD_REQUIRED("spl") + ZEND_MOD_END +}; +#endif + +zend_module_entry imagick_module_entry = +{ +#if ZEND_MODULE_API_NO >= 20050922 + STANDARD_MODULE_HEADER_EX, NULL, + imagick_deps, +#else + STANDARD_MODULE_HEADER, +#endif + PHP_IMAGICK_EXTNAME, + php_imagick_functions, /* Functions */ + PHP_MINIT(imagick), /* MINIT */ + PHP_MSHUTDOWN(imagick), /* MSHUTDOWN */ + PHP_RINIT(imagick), /* RINIT */ + PHP_RSHUTDOWN(imagick), + PHP_MINFO(imagick), /* MINFO */ + PHP_IMAGICK_VERSION, + STANDARD_MODULE_PROPERTIES +}; + +#ifdef COMPILE_DL_IMAGICK +ZEND_GET_MODULE(imagick) +#endif
View file
imagick-3.8.0.tgz/imagick-3.8.0/imagick_class.c
Added
@@ -0,0 +1,14241 @@ +/* + +----------------------------------------------------------------------+ + | PHP Version 5 / Imagick | + +----------------------------------------------------------------------+ + | Copyright (c) 2006-2013 Mikko Koppanen, Scott MacVicar | + | ImageMagick (c) ImageMagick Studio LLC | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Mikko Kopppanen <mkoppanen@php.net> | + | Scott MacVicar <scottmac@php.net> | + +----------------------------------------------------------------------+ +*/ + +#include "php_imagick.h" +#include "php_imagick_defs.h" +#include "php_imagick_macros.h" +#include "php_imagick_helpers.h" +#include "php_imagick_file.h" + + +#if MagickLibVersion > 0x628 +/* {{{ proto bool Imagick::pingImageFile(resource filehandle) + Query image information without reading the whole image to memory +*/ +PHP_METHOD(Imagick, pingImageFile) +{ + char *filename = NULL; + IM_LEN_TYPE filename_len; + php_imagick_object *intern; + zval *zstream; + php_stream *stream; + zend_bool result; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|s!", &zstream, &filename, &filename_len) == FAILURE) + { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + +#if PHP_VERSION_ID >= 70000 + php_stream_from_zval(stream, zstream); +#else + php_stream_from_zval(stream, &zstream); +#endif + result = php_imagick_stream_handler(intern, stream, ImagickPingImageFile TSRMLS_CC); + + if (result == 0) { + if (!EG(exception)) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to ping image from the filehandle" TSRMLS_CC); + } + RETURN_THROWS(); + } + + if (filename) { + MagickSetImageFilename(intern->magick_wand, filename); + MagickSetLastIterator(intern->magick_wand); + } + RETURN_TRUE; +} +/* }}} */ + + +/* {{{ proto bool Imagick::pingImageBlob(string image ) + Query image information without reading the whole image to memory +*/ +PHP_METHOD(Imagick, pingImageBlob) +{ + char *image_string; + IM_LEN_TYPE image_string_len; + MagickBooleanType status; + php_imagick_object *intern; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &image_string, &image_string_len) == FAILURE) { + RETURN_THROWS(); + } + + if (image_string_len == 0) { + php_imagick_throw_exception(IMAGICK_CLASS, "Empty image string passed" TSRMLS_CC); + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + status = MagickPingImageBlob(intern->magick_wand, image_string, image_string_len); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to ping image blob" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::vignetteImage(float blackPoint, float whitePoint, int x, int y ) + Adds vignette filter to the image +*/ +PHP_METHOD(Imagick, vignetteImage) +{ + double black_point, white_point; + im_long x, y; + php_imagick_object *intern; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddll", &black_point, &white_point, &x, &y) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickVignetteImage(intern->magick_wand, black_point, white_point, x, y); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to apply vignette filter" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::transposeImage() + Creates a vertical mirror image +*/ +PHP_METHOD(Imagick, transposeImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickTransposeImage(intern->magick_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to transpose image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::transverseImage() + Creates a horizontal mirror image +*/ +PHP_METHOD(Imagick, transverseImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickTransverseImage(intern->magick_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to transverse image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::adaptiveBlurImage(float radius, float sigma, int channel ) + Adds adaptive blur filter to image +*/ +PHP_METHOD(Imagick, adaptiveBlurImage) +{ + double radius, sigma; + php_imagick_object *intern; + MagickBooleanType status; + im_long channel = IM_DEFAULT_CHANNEL; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd|l", &radius, &sigma, &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickAdaptiveBlurImageChannel(intern->magick_wand, channel, radius, sigma); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to adaptive blur image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::uniqueImageColors() + Discards all but one of any pixel color +*/ +PHP_METHOD(Imagick, uniqueImageColors) +{ + php_imagick_object *intern; + MagickBooleanType status; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickUniqueImageColors(intern->magick_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get unique image colors" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::contrastStretchImage(float black_point, float white_point, int channel) + Enhances the contrast of a color image +*/ +PHP_METHOD(Imagick, contrastStretchImage) +{ + php_imagick_object *intern; + double black_point, white_point; + MagickBooleanType status; + im_long channel = IM_DEFAULT_CHANNEL; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd|l", &black_point, &white_point, &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickContrastStretchImageChannel(intern->magick_wand, channel, black_point, white_point); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to contrast strech image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 +/* {{{ proto int Imagick::getImageMatte() + Returns true if the image has a matte channel otherwise false +*/ +PHP_METHOD(Imagick, getImageMatte) +{ + php_imagick_object *intern; + MagickBooleanType matte; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + IMAGICK_METHOD_DEPRECATED ("Imagick", "getImageMatte"); + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + matte = MagickGetImageMatte(intern->magick_wand); + + if (matte == MagickTrue) { + RETURN_TRUE; + } else { + RETURN_FALSE; + } +} +/* }}} */ +#endif //#if MagickLibVersion < 0x700 +#endif + +/* {{{ proto bool Imagick::setImageMatte(bool matte) + Sets the image matte channel +*/ +PHP_METHOD(Imagick, setImageMatte) +{ + php_imagick_object *intern; + zend_bool matte; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &matte) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSetImageMatte(intern->magick_wand, matte); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image matte" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::adaptiveResizeImage(int width, int height, bool bestfit, bool legacy) + Adaptively resize image with data dependent triangulation + If legacy is true, the calculations are done with the small rounding bug that existed in + Imagick before 3.4.0. If false, the calculations should produce the same results as + ImageMagick CLI does. +*/ +PHP_METHOD(Imagick, adaptiveResizeImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + im_long width, height, new_width, new_height; + zend_bool bestfit = 0; + zend_bool legacy = 0; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll|bb", &width, &height, &bestfit, &legacy) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + if (!php_imagick_thumbnail_dimensions(intern->magick_wand, bestfit, width, height, &new_width, &new_height, legacy)) { + php_imagick_throw_exception(IMAGICK_CLASS, "Invalid image geometry" TSRMLS_CC); + RETURN_THROWS(); + } + + status = MagickAdaptiveResizeImage(intern->magick_wand, new_width, new_height); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to adaptive resize image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +/* {{{ proto bool Imagick::sketchImage(float radius, float sigma, float angle) + Simulates a pencil sketch +*/ +PHP_METHOD(Imagick, sketchImage) +{ + double radius, sigma, angle; + MagickBooleanType status; + php_imagick_object *intern; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddd", &radius, &sigma, &angle) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSketchImage(intern->magick_wand, sigma, radius, angle); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to sketch image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::shadeImage(bool gray, float azimuth, float elevation) + Shines a distant light on an image +*/ +PHP_METHOD(Imagick, shadeImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + double azimuth, elevation; + zend_bool gray; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "bdd", &gray, &azimuth, &elevation) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickShadeImage(intern->magick_wand, gray, azimuth, elevation); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to shade image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto int Imagick::getSizeOffset() + Returns the size offset associated with the Imagick object +*/ +PHP_METHOD(Imagick, getSizeOffset) +{ + php_imagick_object *intern; + ssize_t offset; + MagickBooleanType status; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + status = MagickGetSizeOffset(intern->magick_wand, &offset); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get size offset" TSRMLS_CC); + RETURN_THROWS(); + } + + RETVAL_LONG(offset); +} +/* }}} */ + +/* {{{ proto bool Imagick::setSizeOffset(int columns, int rows, int offset) + Sets the size and offset of the Imagick object +*/ +PHP_METHOD(Imagick, setSizeOffset) +{ + php_imagick_object *intern; + im_long columns, rows, offset; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &columns, &rows, &offset) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + status = MagickSetSizeOffset(intern->magick_wand, columns, rows, offset); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set size offset" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::adaptiveSharpenImage(float radius, float sigma, int channel) + Adaptively sharpen image with data dependent triangulation +*/ +PHP_METHOD(Imagick, adaptiveSharpenImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + double radius, sigma; + im_long channel = IM_DEFAULT_CHANNEL; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd|l", &radius, &sigma, &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickAdaptiveSharpenImageChannel(intern->magick_wand, channel, radius, sigma); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to adaptive sharpen image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + + +/* {{{ proto bool Imagick::randomThresholdImage(float low, float high, int channel) + Changes the value of individual pixels +*/ +PHP_METHOD(Imagick, randomThresholdImage) +{ + php_imagick_object *intern; + double low, high; + MagickBooleanType status; + im_long channel = IM_DEFAULT_CHANNEL; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd|l", &low, &high, &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickRandomThresholdImageChannel(intern->magick_wand, channel, low, high); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to random threshold image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto string Imagick::roundCornersImage(float x_rounding, float y_rounding, float stroke_width = 10, float displace = 5, float size_correction = -6 ) + Rounds image corners +*/ +PHP_METHOD(Imagick, roundCornersImage) +{ + char *old_locale; + double x_rounding, y_rounding; + DrawingWand *draw; + MagickWand *mask_image; + PixelWand *color; + php_imagick_object *intern; + long image_width, image_height; + MagickBooleanType status; + double stroke_width = 10, displace = 5, correction = -6; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd|ddd", &x_rounding, &y_rounding, &stroke_width, &displace, &correction) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + + IMAGICK_NOT_EMPTY(intern); + + image_width = MagickGetImageWidth(intern->magick_wand); + image_height = MagickGetImageHeight(intern->magick_wand); + + if (!image_width || !image_height) { + php_imagick_throw_exception(IMAGICK_CLASS, "Unable to round corners on empty image" TSRMLS_CC); + RETURN_THROWS(); + } + + status = MagickSetImageMatte(intern->magick_wand, MagickTrue); + + if (status == MagickFalse) { + php_imagick_throw_exception(IMAGICK_CLASS, "Unable to set image matte" TSRMLS_CC); + RETURN_THROWS(); + } + + /* Here we go.. */ + color = NewPixelWand(); + if (!color) { + php_imagick_throw_exception (IMAGICK_CLASS, "Failed to allocate PixelWand structure" TSRMLS_CC); + RETURN_THROWS(); + } + + draw = NewDrawingWand(); + if (!draw) { + DestroyPixelWand (color); + php_imagick_throw_exception (IMAGICK_CLASS, "Failed to allocate DrawingWand structure" TSRMLS_CC); + RETURN_THROWS(); + } + + mask_image = NewMagickWand(); + if (!mask_image) { + DestroyPixelWand (color); + DestroyDrawingWand (draw); + php_imagick_throw_exception (IMAGICK_CLASS, "Failed to allocate MagickWand structure" TSRMLS_CC); + RETURN_THROWS(); + } + + +#define exit_cleanup() \ + if (color != NULL) color = DestroyPixelWand(color); \ + if (draw != NULL) draw = DestroyDrawingWand(draw); \ + if (mask_image != NULL) mask_image = DestroyMagickWand(mask_image); + + status = PixelSetColor(color, "transparent"); + + if (status == MagickFalse) { + exit_cleanup(); + php_imagick_throw_exception(IMAGICK_CLASS, "Unable to set pixel color" TSRMLS_CC); + RETURN_THROWS(); + } + + status = MagickNewImage(mask_image, image_width, image_height, color); + + if (status == MagickFalse) { + exit_cleanup(); + php_imagick_throw_exception(IMAGICK_CLASS, "Unable to allocate mask image" TSRMLS_CC); + RETURN_THROWS(); + } + + MagickSetImageBackgroundColor(mask_image, color); + status = PixelSetColor(color, "white"); + + if (status == MagickFalse) { + exit_cleanup(); + php_imagick_throw_exception(IMAGICK_CLASS, "Unable to set pixel color" TSRMLS_CC); + RETURN_THROWS(); + } + + DrawSetFillColor(draw, color); + status = PixelSetColor(color, "black"); + + if (status == MagickFalse) { + exit_cleanup(); + php_imagick_throw_exception(IMAGICK_CLASS, "Unable to set pixel color" TSRMLS_CC); + RETURN_THROWS(); + } + + DrawSetStrokeColor(draw, color); + DrawSetStrokeWidth(draw, stroke_width); + DrawRoundRectangle(draw, displace, displace, image_width + correction, image_height + correction, x_rounding, y_rounding); + + old_locale = php_imagick_set_locale (TSRMLS_C); + + status = MagickDrawImage(mask_image, draw); + + php_imagick_restore_locale (old_locale); + + if (old_locale) + efree (old_locale); + + if (status == MagickFalse) { + exit_cleanup(); + php_imagick_throw_exception(IMAGICK_CLASS, "Unable to draw on image" TSRMLS_CC); + RETURN_THROWS(); + } + + +#if MagickLibVersion >= 0x700 + status = MagickCompositeImage(intern->magick_wand, mask_image, DstInCompositeOp, MagickTrue, 0, 0); +#else + status = MagickCompositeImage(intern->magick_wand, mask_image, DstInCompositeOp, 0, 0); +#endif + + if (status == MagickFalse) { + exit_cleanup(); + php_imagick_throw_exception(IMAGICK_CLASS, "Unable to composite image" TSRMLS_CC); + RETURN_THROWS(); + } + + exit_cleanup(); + RETURN_TRUE; +#undef exit_cleanup +} +/* }}} */ + +/* {{{ proto int Imagick::getIteratorIndex() + Returns the index of the current active image +*/ +PHP_METHOD(Imagick, getIteratorIndex) +{ + MagickBooleanType status; + php_imagick_object *intern; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + + status = MagickGetIteratorIndex(intern->magick_wand); + ZVAL_LONG(return_value, (long)status); +} +/* }}} */ + +/* {{{ proto bool Imagick::setIteratorIndex(int index) + Sets the index of the Imagick object +*/ +PHP_METHOD(Imagick, setIteratorIndex) +{ + im_long index; + MagickBooleanType status; + php_imagick_object *intern; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &index) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + status = MagickSetIteratorIndex(intern->magick_wand, index); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set iterator index" TSRMLS_CC); + RETURN_THROWS(); + } + + intern->next_out_of_bound = 0; + RETURN_TRUE; +} +/* }}} */ + +#if MagickLibVersion < 0x700 +/* {{{ proto Imagick Imagick::transformImage(string crop, string geometry ) + Comfortability method for crop and resize +*/ +PHP_METHOD(Imagick, transformImage) +{ + char *crop, *geometry; + IM_LEN_TYPE crop_len, geometry_len; + MagickWand *transformed; + php_imagick_object *intern, *intern_return; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &crop, &crop_len, &geometry, &geometry_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + transformed = MagickTransformImage(intern->magick_wand, crop, geometry); + + if (!transformed) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Transforming image failed" TSRMLS_CC); + RETURN_THROWS(); + } + + object_init_ex(return_value, php_imagick_sc_entry); + intern_return = Z_IMAGICK_P(return_value); + + php_imagick_replace_magickwand(intern_return, transformed); +} +#endif //#if MagickLibVersion < 0x700 + +/* }}} */ +#endif + +#if MagickLibVersion > 0x630 +#if MagickLibVersion < 0x700 +/* {{{ proto bool Imagick::setImageOpacity(float opacity) + Sets the image to the specified opacity level +*/ +PHP_METHOD(Imagick, setImageOpacity) +{ + double opacity; + MagickBooleanType status; + php_imagick_object *intern; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &opacity) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSetImageOpacity(intern->magick_wand, opacity); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image opacity" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif + + + +#if MagickLibVersion >= 0x700 +/* {{{ proto bool Imagick::setImageAlpha(float alpha) + Sets the image to the specified alpha level +*/ +PHP_METHOD(Imagick, setImageAlpha) +{ + double alpha; + MagickBooleanType status; + php_imagick_object *intern; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &alpha) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSetImageAlpha(intern->magick_wand, alpha); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image alpha" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif + + + +#if MagickLibVersion < 0x700 +/* {{{ proto bool Imagick::orderedPosterizeImage(string threshold_map, int CHANNEL) + Performs an ordered dither +*/ +PHP_METHOD(Imagick, orderedPosterizeImage) +{ + char *map; + IM_LEN_TYPE map_len; + MagickBooleanType status; + php_imagick_object *intern; + im_long channel = IM_DEFAULT_CHANNEL; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &map, &map_len, &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickOrderedPosterizeImageChannel(intern->magick_wand, channel, map); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to posterize image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif //#if MagickLibVersion < 0x700 +#endif //#if MagickLibVersion > 0x630 + +#if MagickLibVersion >= 0x700 +/* {{{ proto bool Imagick::polaroidWithTextAndMethod(ImagickDraw properties, double angle, string text, int method) + Simulates a Polaroid picture with text and PixelInterpolateMethod +*/ +PHP_METHOD(Imagick, polaroidWithTextAndMethod) +{ + zval *objvar; + php_imagick_object *intern; + MagickBooleanType status; + php_imagickdraw_object *internd; + double angle; + char *caption; + IM_LEN_TYPE caption_len; + im_long method; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Odsl", &objvar, php_imagickdraw_sc_entry, &angle, &caption, &caption_len, &method) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + internd = Z_IMAGICKDRAW_P(objvar); + + status = MagickPolaroidImage( + intern->magick_wand, + internd->drawing_wand, + caption, + angle, + method + ); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to polaroidWithTextAndMethod image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif // MagickLibVersion >= 0x700 + + +#if MagickLibVersion > 0x631 +/* {{{ proto bool Imagick::polaroidImage(ImagickDraw properties, double angle ) + Simulates a Polaroid picture +*/ +PHP_METHOD(Imagick, polaroidImage) +{ + zval *objvar; + php_imagick_object *intern; + MagickBooleanType status; + php_imagickdraw_object *internd; + double angle; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Od", &objvar, php_imagickdraw_sc_entry, &angle) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + internd = Z_IMAGICKDRAW_P(objvar); +#if MagickLibVersion >= 0x700 + { + PixelInterpolateMethod method = BilinearInterpolatePixel; + char *caption = "TODO FIXME"; + status = MagickPolaroidImage(intern->magick_wand,internd->drawing_wand,caption,angle,method); + } +#else + status = MagickPolaroidImage(intern->magick_wand, internd->drawing_wand, angle); +#endif + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to polaroid image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto string Imagick::getImageProperty(string name ) + Eeturns a value associated with the specified property +*/ +PHP_METHOD(Imagick, getImageProperty) +{ + php_imagick_object *intern; + char *name, *value; + IM_LEN_TYPE name_len; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + value = MagickGetImageProperty(intern->magick_wand, name); + + if (value) { + IM_ZVAL_STRING(return_value, (char *)value); + IMAGICK_FREE_MAGICK_MEMORY(value); + return; + } + RETURN_FALSE; +} +/* }}} */ + +/* {{{ proto bool Imagick::setImageProperty(string name, string value ) + returns a value associated with the specified property +*/ +PHP_METHOD(Imagick, setImageProperty) +{ + php_imagick_object *intern; + char *name, *value; + IM_LEN_TYPE name_len, value_len; + MagickBooleanType status; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &name_len, &value, &value_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSetImageProperty(intern->magick_wand, name, value); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image property" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::deleteImageProperty(string name) + Deletes an image property. +*/ +PHP_METHOD(Imagick, deleteImageProperty) +{ + php_imagick_object *intern; + char *name; + IM_LEN_TYPE name_len; + MagickBooleanType status; + + Image *image; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + + IMAGICK_NOT_EMPTY(intern); + + image = GetImageFromMagickWand(intern->magick_wand); + status = DeleteImageProperty(image, name); + + if (status == MagickFalse) { + RETURN_FALSE; + } + + RETURN_TRUE; +} +/* }}} */ + + +/* {{{ proto bool Imagick::identifyFormat(string embedText) + Replaces any embedded formatting characters with the appropriate image property and returns the interpreted text. See http://www.imagemagick.org/script/escape.php for escape sequences. +*/ +PHP_METHOD(Imagick, identifyFormat) +{ + php_imagick_object *intern; + char *embedText; + IM_LEN_TYPE embedText_len; + char *result; + + ImageInfo *image_info; + Image *image; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &embedText, &embedText_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + + IMAGICK_NOT_EMPTY(intern); + + image_info = AcquireImageInfo(); + image = GetImageFromMagickWand(intern->magick_wand); + +#if MagickLibVersion >= 0x700 + { + //TODO - handle exception info. + ExceptionInfo *exception = NULL; + result = InterpretImageProperties(image_info, image, embedText, exception); + } +#else + result = InterpretImageProperties(image_info, image, embedText); +#endif + image_info = DestroyImageInfo(image_info); + + if (result) { +#if PHP_VERSION_ID >= 70000 + RETVAL_STRING(result); +#else + RETVAL_STRING(result, 1); +#endif + IMAGICK_FREE_MAGICK_MEMORY(result); + + return; + } + + RETURN_FALSE; +} +/* }}} */ + +/* {{{ proto int Imagick::getImageInterpolateMethod() + Returns the interpolation method for the sepcified image. +*/ +PHP_METHOD(Imagick, getImageInterpolateMethod) +{ + php_imagick_object *intern; + long interpolate; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + interpolate = MagickGetImageInterpolateMethod(intern->magick_wand); + RETVAL_LONG(interpolate); +} +/* }}} */ + +#if IM_HAVE_IMAGICK_SETIMAGEINTERPOLATEMETHOD +/* {{{ proto bool Imagick::setImageInterpolateMethod(int method) + Sets the image interpolate pixel method. +*/ +PHP_METHOD(Imagick, setImageInterpolateMethod) +{ + php_imagick_object *intern; + im_long interpolate; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &interpolate) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSetImageInterpolateMethod(intern->magick_wand, interpolate); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set the image interpolate method" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ +#endif // #if IM_HAVE_IMAGICK_SETIMAGEINTERPOLATEMETHOD + +/* {{{ proto bool Imagick::linearStretchImage(float blackPoint, float whitePoint) + Stretches with saturation the image intensity. +*/ +PHP_METHOD(Imagick, linearStretchImage) +{ + php_imagick_object *intern; + double blackPoint, whitePoint; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &blackPoint, &whitePoint) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickLinearStretchImage(intern->magick_wand, blackPoint, whitePoint); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to linear strech image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto int Imagick::getImageLength() + returns the image length in bytes +*/ +PHP_METHOD(Imagick, getImageLength) +{ + php_imagick_object *intern; + MagickSizeType length; + MagickBooleanType status; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickGetImageLength(intern->magick_wand, &length); + + if (status == MagickFalse) { + php_imagick_throw_exception(IMAGICK_CLASS, "Unable to acquire image length" TSRMLS_CC); + RETURN_THROWS(); + } + + RETVAL_LONG(length); +} +/* }}} */ + +/* {{{ proto bool Imagick::extentImage(int width, int height, int x, int y ) + Sets the image size +*/ +PHP_METHOD(Imagick, extentImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + im_long width, height, x, y; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llll", &width, &height, &x, &y) == FAILURE) + { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickExtentImage(intern->magick_wand, width, height, x, y); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to extent image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif + +#if MagickLibVersion > 0x633 +/* {{{ proto Imagick Imagick::getImageOrientation(void) + Gets the image orientation +*/ +PHP_METHOD(Imagick, getImageOrientation) +{ + php_imagick_object *intern; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + RETVAL_LONG(MagickGetImageOrientation(intern->magick_wand)); +} +/* }}} */ + +/* {{{ proto Imagick Imagick::setImageOrientation(int orientation) + Sets the image orientation +*/ +PHP_METHOD(Imagick, setImageOrientation) +{ + php_imagick_object *intern; + im_long orientation; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &orientation) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSetImageOrientation(intern->magick_wand, orientation); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image orientation" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion > 0x634 +#if MagickLibVersion < 0x700 +/* {{{ proto Imagick Imagick::paintFloodfillImage(mixed fill, float fuzz, mixed bordercolor, int x, int y, int channel) + Sets the image orientation +*/ +PHP_METHOD(Imagick, paintFloodfillImage) +{ + php_imagick_object *intern; + zval *fill_param, *border_param; + im_long x, y, channel = DefaultChannels; + double fuzz; + MagickBooleanType status; + PixelWand *fill_wand, *border_wand = NULL; + zend_bool fill_allocated = 0, border_allocated = 0; + + IMAGICK_METHOD_DEPRECATED ("Imagick", "paintFloodfillImage"); + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zdzll|l", &fill_param, &fuzz, &border_param, &x, &y, &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + fill_wand = php_imagick_zval_to_pixelwand (fill_param, IMAGICK_CLASS, &fill_allocated TSRMLS_CC); + if (!fill_wand) + return; + + if (Z_TYPE_P(border_param) == IS_NULL) { + status = MagickPaintFloodfillImage(intern->magick_wand, channel, fill_wand, fuzz, NULL, x, y); + } else { + border_wand = php_imagick_zval_to_pixelwand (border_param, IMAGICK_CLASS, &border_allocated TSRMLS_CC); + if (!border_wand) { + if (fill_allocated) + DestroyPixelWand (fill_wand); + return; + } + status = MagickPaintFloodfillImage(intern->magick_wand, channel, fill_wand, fuzz, border_wand, x, y); + } + + if (fill_allocated) + DestroyPixelWand (fill_wand); + + if (border_wand) + DestroyPixelWand (border_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to paint floodfill image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ +#endif // #if MagickLibVersion < 0x700 +#endif +#endif + +#if MagickLibVersion > 0x635 +/* {{{ proto Imagick Imagick::clutImage(Imagick lookup, int channel ) + Replaces colors in the image from a color lookup table +*/ +PHP_METHOD(Imagick, clutImage) +{ + zval *objvar; + php_imagick_object *intern, *lookup; + MagickBooleanType status; + im_long channel = IM_DEFAULT_CHANNEL; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|l", &objvar, php_imagick_sc_entry, &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + lookup = Z_IMAGICK_P(objvar); + IMAGICK_NOT_EMPTY(lookup); + + status = MagickClutImageChannel(intern->magick_wand, channel, lookup->magick_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to replace colors in the image from a color lookup table" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + + +#if MagickLibVersion >= 0x700 +/* {{{ proto Imagick Imagick::clutImageWithInterpolate(Imagick lookup, int pixel_interpolate_method) + Replaces colors in the image from a color lookup table. +*/ +PHP_METHOD(Imagick, clutImageWithInterpolate) +{ + zval *objvar; + php_imagick_object *intern, *lookup; + MagickBooleanType status; + im_long interpolate_method; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ol", &objvar, php_imagick_sc_entry, &interpolate_method) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + lookup = Z_IMAGICK_P(objvar); + IMAGICK_NOT_EMPTY(lookup); + + status = MagickClutImage(intern->magick_wand, lookup->magick_wand, interpolate_method); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception( + intern->magick_wand, + "Unable to replace colors in the image from a color lookup table" TSRMLS_CC + ); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif + +/* {{{ proto Imagick Imagick::getImageProperties(string pattern, bool values ) + Returns all the property names that match the specified pattern +*/ +PHP_METHOD(Imagick, getImageProperties) +{ + zend_bool values = 1; + char *pattern = "*", **properties, *property; + IM_LEN_TYPE pattern_len; + unsigned long i; + size_t properties_count; + php_imagick_object *intern; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sb", &pattern, &pattern_len, &values) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + properties = MagickGetImageProperties(intern->magick_wand, pattern, &properties_count); + + if (!properties) { + php_imagick_throw_exception(IMAGICK_CLASS, "Unable to get image properties" TSRMLS_CC); + RETURN_THROWS(); + } + + array_init(return_value); + + if (values) { + + for (i = 0; i < properties_count; i++) { + property = MagickGetImageProperty(intern->magick_wand, propertiesi); + IM_add_assoc_string(return_value, propertiesi, property); + IMAGICK_FREE_MAGICK_MEMORY(property); + } + + } else { + + for (i = 0; i < properties_count; i++) { + IM_add_next_index_string(return_value, propertiesi); + } + } + + IMAGICK_FREE_MAGICK_MEMORY(properties); +} +/* }}} */ + +/* {{{ proto Imagick Imagick::getImageProfiles(string pattern, bool values ) + Returns all the profile names that match the specified pattern +*/ +PHP_METHOD(Imagick, getImageProfiles) +{ + zend_bool values = 1; + char *pattern = "*", **profiles, *profile; + IM_LEN_TYPE pattern_len; + unsigned long i; + php_imagick_object *intern; + size_t length, profiles_count; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sb", &pattern, &pattern_len, &values) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + profiles = MagickGetImageProfiles(intern->magick_wand, pattern, &profiles_count); + + if (!profiles) { + php_imagick_throw_exception(IMAGICK_CLASS, "Unable to get image profiles" TSRMLS_CC); + RETURN_THROWS(); + } + + array_init(return_value); + + if (values) { + + for (i = 0; i < profiles_count; i++) { + + profile = (char *)MagickGetImageProfile(intern->magick_wand, profilesi, &length); +#if PHP_VERSION_ID >= 70000 + add_assoc_stringl(return_value, profilesi, profile, length); +#else + add_assoc_stringl(return_value, profilesi, profile, length, 1); +#endif + IMAGICK_FREE_MAGICK_MEMORY(profile); + } + + } else { + + for (i = 0; i < profiles_count; i++) { + IM_add_next_index_string(return_value, profilesi); + } + } + + IMAGICK_FREE_MAGICK_MEMORY(profiles); +} +/* }}} */ +#endif + +#if MagickLibVersion > 0x635 +/* {{{ proto Imagick Imagick::distortImage(int distortMethod, array arguments, bool bestfit ) + Distorts an image using various distortion methods +*/ +PHP_METHOD(Imagick, distortImage) +{ + php_imagick_object *intern; + double *arguments; + im_long distort_method, elements; + zend_bool bestfit; + zval *arg_array; + MagickBooleanType status; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lab", &distort_method, &arg_array, &bestfit) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + arguments = php_imagick_zval_to_double_array(arg_array, &elements TSRMLS_CC); + + if (!arguments) { + php_imagick_throw_exception (IMAGICK_CLASS, "Can't read argument array" TSRMLS_CC); + RETURN_THROWS(); + } + + status = MagickDistortImage(intern->magick_wand, distort_method, elements, arguments, bestfit); + efree(arguments); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to distort the image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::writeImageFile(resource $handle, string $format) + Writes image to an open filehandle. Optional parameter format defines the format the file + is stored with +*/ +PHP_METHOD(Imagick, writeImageFile) +{ + php_imagick_object *intern; + zval *zstream; + php_stream *stream; + zend_bool result; + char *format = NULL; + IM_LEN_TYPE format_len; + char *orig_name = NULL, *buffer; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|s!", &zstream, &format, &format_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + // Get the current name + if (format) { + orig_name = MagickGetImageFilename (intern->magick_wand); + + spprintf (&buffer, 0, "%s:", format); + MagickSetImageFilename (intern->magick_wand, buffer); + efree (buffer); + } + +#if PHP_VERSION_ID >= 70000 + php_stream_from_zval(stream, zstream); +#else + php_stream_from_zval(stream, &zstream); +#endif + result = php_imagick_stream_handler(intern, stream, ImagickWriteImageFile TSRMLS_CC); + + /* Restore the original name after write */ + if (orig_name) { + MagickSetImageFilename (intern->magick_wand, orig_name); + MagickRelinquishMemory (orig_name); + } + + if (result == 0) { + /* php_stream_cast returns warning on some streams but still does not return FAILURE */ + if (!EG(exception)) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to write image to the filehandle" TSRMLS_CC); + } + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::writeImagesFile(resource $handle, string $format) + Writes images to an open filehandle +*/ +PHP_METHOD(Imagick, writeImagesFile) +{ + php_imagick_object *intern; + zval *zstream; + php_stream *stream; + zend_bool result; + char *format = NULL; + IM_LEN_TYPE format_len; + char *orig_name = NULL, *buffer; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|s!", &zstream, &format, &format_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + // Get the current name + if (format) { + orig_name = MagickGetImageFilename (intern->magick_wand); + + spprintf (&buffer, 0, "%s:", format); + MagickSetImageFilename (intern->magick_wand, buffer); + efree (buffer); + } + +#if PHP_VERSION_ID >= 70000 + php_stream_from_zval(stream, zstream); +#else + php_stream_from_zval(stream, &zstream); +#endif + result = php_imagick_stream_handler(intern, stream, ImagickWriteImagesFile TSRMLS_CC); + + /* Restore the original name after write */ + if (orig_name) { + MagickSetImageFilename (intern->magick_wand, orig_name); + MagickRelinquishMemory (orig_name); + } + + if (result == 0) { + if (!EG(exception)) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to write images to the filehandle" TSRMLS_CC); + } + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::resetImagePage(string page) + Resets the page canvas and position +*/ +PHP_METHOD(Imagick, resetImagePage) +{ + php_imagick_object *intern; + MagickBooleanType status; + char *page; + IM_LEN_TYPE page_len; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &page, &page_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickResetImagePage(intern->magick_wand, page); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to reset image page" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + + +/* {{{ proto Imagick Imagick::getImageClipMask() + Gets image clip mask +*/ +#if MagickLibVersion < 0x700 +PHP_METHOD(Imagick, getImageClipMask) +{ + MagickWand *tmp_wand; + php_imagick_object *intern; + php_imagick_object *intern_return; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + tmp_wand = MagickGetImageClipMask(intern->magick_wand); + + /* No magick is going to happen */ + if (!tmp_wand) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image clip mask" TSRMLS_CC); + RETURN_THROWS(); + } + + object_init_ex(return_value, php_imagick_sc_entry); + intern_return = Z_IMAGICK_P(return_value); + + php_imagick_replace_magickwand(intern_return, tmp_wand); +} +#endif +/* }}} */ + +/* {{{ proto bool Imagick::setImageClipMask(Imagick clip_mask) + Sets the image clip mask +*/ +#if MagickLibVersion < 0x700 +PHP_METHOD(Imagick, setImageClipMask) +{ + php_imagick_object *intern; + php_imagick_object *clip_mask; + MagickBooleanType status; + zval *objvar; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &objvar, php_imagick_sc_entry) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + clip_mask = Z_IMAGICK_P(objvar); + IMAGICK_NOT_EMPTY(clip_mask); + + status = MagickSetImageClipMask(intern->magick_wand, clip_mask->magick_wand); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image clip mask" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +#endif +/* }}} */ + +/* {{{ proto bool Imagick::animateImages(string server_name) + Animates an image or image sequence +*/ +PHP_METHOD(Imagick, animateImages) +{ + php_imagick_object *intern; + MagickBooleanType status; + char *server_name; + IM_LEN_TYPE server_name_len; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &server_name, &server_name_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + /* TODO: should this call be there? Not sure */ + (void)MagickSetFirstIterator(intern->magick_wand); + status = MagickAnimateImages(intern->magick_wand, server_name); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to animate images" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 +/* {{{ proto bool Imagick::recolorImage(array matrix) + Translate, scale, shear, or rotate image colors +*/ +PHP_METHOD(Imagick, recolorImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + im_long num_elements; + zval *matrix; + double *array; + unsigned long order; + + IMAGICK_METHOD_DEPRECATED ("Imagick", "recolorImage"); + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &matrix) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + array = php_imagick_zval_to_double_array(matrix, &num_elements TSRMLS_CC); + + if (!array) { + php_imagick_throw_exception (IMAGICK_CLASS, "The map contains disallowed characters" TSRMLS_CC); + RETURN_THROWS(); + } + + order = (unsigned long)sqrt(num_elements); + + if ((order * order) != num_elements) { + efree(array); + php_imagick_throw_exception(IMAGICK_CLASS, "The color matrix must contain a square number of elements" TSRMLS_CC); + RETURN_THROWS(); + } + + status = MagickRecolorImage(intern->magick_wand, order, array); + efree(array); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to recolor image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif +#endif +#endif + +#if MagickLibVersion > 0x636 +PHP_METHOD(Imagick, setFont) +{ + php_imagick_object *intern; + char *font, *absolute; + IM_LEN_TYPE font_len; + MagickBooleanType status; + php_imagick_rw_result_t rc; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &font, &font_len) == FAILURE) { + RETURN_THROWS(); + } + + /* Check that no empty string is passed */ + if (font_len == 0) { + php_imagick_throw_exception(IMAGICK_CLASS, "Can not set empty font" TSRMLS_CC); + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + + /* And if it wasn't */ + if (!php_imagick_check_font(font, font_len TSRMLS_CC)) { + + if (!(absolute = expand_filepath(font, NULL TSRMLS_CC))) { + php_imagick_throw_exception(IMAGICK_CLASS, "Unable to set font" TSRMLS_CC); + RETURN_THROWS(); + } + + if ((rc = php_imagick_file_access_check (absolute TSRMLS_CC)) != IMAGICK_RW_OK) { + php_imagick_rw_fail_to_exception (intern->magick_wand, rc, absolute TSRMLS_CC); + efree(absolute); + RETURN_THROWS(); + } + status = MagickSetFont(intern->magick_wand, absolute); + efree(absolute); + } else { + status = MagickSetFont(intern->magick_wand, font); + } + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set font" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} + +PHP_METHOD(Imagick, getFont) +{ + char *font; + php_imagick_object *intern; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + font = MagickGetFont(intern->magick_wand); + + if (font) { + IM_ZVAL_STRING(return_value, font); + IMAGICK_FREE_MAGICK_MEMORY(font); + return; + } + RETURN_FALSE; +} + +PHP_METHOD(Imagick, setPointSize) +{ + php_imagick_object *intern; + double point_size; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &point_size) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + status = MagickSetPointsize(intern->magick_wand, point_size); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set point size" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} + +PHP_METHOD(Imagick, getPointSize) +{ + php_imagick_object *intern; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + RETVAL_DOUBLE(MagickGetPointsize(intern->magick_wand)); +} + +PHP_METHOD(Imagick, mergeImageLayers) +{ + php_imagick_object *intern, *intern_return; + im_long layer_method; + MagickWand *merged; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &layer_method) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + /* TODO: SHOULD THIS BE HERE? + Reset the iterator */ + (void)MagickSetFirstIterator(intern->magick_wand); + + merged = MagickMergeImageLayers(intern->magick_wand, layer_method); + + /* No magick is going to happen */ + if (!merged) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to merge image layers" TSRMLS_CC); + RETURN_THROWS(); + } + + object_init_ex(return_value, php_imagick_sc_entry); + intern_return = Z_IMAGICK_P(return_value); + + php_imagick_replace_magickwand(intern_return, merged); +} +#endif + +#if MagickLibVersion > 0x637 +/* {{{ proto bool Imagick::floodfillPaintImage(mixed fill, float fuzz, mixed bordercolor, int x, int y, bool invert, int CHANNEL) + Changes the color value of any pixel that matches target +*/ +PHP_METHOD(Imagick, floodfillPaintImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + zval *fill_param, *border_param; + im_long x, y, channel = IM_DEFAULT_CHANNEL; + zend_bool invert; + double fuzz; + PixelWand *fill_wand, *border_wand; + zend_bool fill_allocated = 0, border_allocated = 0; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zdzllb|l", + &fill_param, &fuzz, &border_param, &x, &y, &invert, &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + fill_wand = php_imagick_zval_to_pixelwand (fill_param, IMAGICK_CLASS, &fill_allocated TSRMLS_CC); + if (!fill_wand) + return; + + border_wand = php_imagick_zval_to_pixelwand (border_param, IMAGICK_CLASS, &border_allocated TSRMLS_CC); + if (!border_wand) { + if (fill_allocated) + fill_wand = DestroyPixelWand (fill_wand); + + return; + } + +#if MagickLibVersion >= 0x700 + status = MagickFloodfillPaintImageChannel(intern->magick_wand, channel, fill_wand, fuzz, border_wand, x, y, invert); +#else + status = MagickFloodfillPaintImage(intern->magick_wand, channel, fill_wand, fuzz, border_wand, x, y, invert); +#endif + + if (fill_allocated) + fill_wand = DestroyPixelWand (fill_wand); + + if (border_allocated) + border_wand = DestroyPixelWand (border_wand); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception (intern->magick_wand, "Unable to floodfill paint image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::opaquePaintImage(mixed target, mixed fill, float fuzz, bool invert, int CHANNEL) + Changes any pixel that matches color with the color defined by fill. +*/ +PHP_METHOD(Imagick, opaquePaintImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + zval *fill_param, *target_param; + zend_bool invert; + double fuzz; + im_long channel = IM_DEFAULT_CHANNEL; + PixelWand *fill_wand, *target_wand; + zend_bool fill_allocated = 0, target_allocated = 0; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zzdb|l", &fill_param, &target_param, &fuzz, &invert, &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + fill_wand = php_imagick_zval_to_pixelwand (fill_param, IMAGICK_CLASS, &fill_allocated TSRMLS_CC); + if (!fill_wand) + return; + + target_wand = php_imagick_zval_to_pixelwand (target_param, IMAGICK_CLASS, &target_allocated TSRMLS_CC); + if (!target_wand) { + if (fill_allocated) + DestroyPixelWand (fill_wand); + return; + } + + status = MagickOpaquePaintImageChannel(intern->magick_wand, channel, fill_wand, target_wand, fuzz, invert); + + if (fill_allocated) + DestroyPixelWand (fill_wand); + + if (target_allocated) + DestroyPixelWand (target_wand); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to opaque paint image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::transparentPaintImage(mixed target, float alpha, float fuzz, bool invert) + Changes any pixel that matches color with the color defined by fill +*/ +PHP_METHOD(Imagick, transparentPaintImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + zval *target_param; + zend_bool invert; + double fuzz, alpha; + PixelWand *target_wand; + zend_bool target_allocated; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zddb", &target_param, &alpha, &fuzz, &invert) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + target_wand = php_imagick_zval_to_pixelwand (target_param, IMAGICK_CLASS, &target_allocated TSRMLS_CC); + if (!target_wand) + return; + + status = MagickTransparentPaintImage(intern->magick_wand, target_wand, alpha, fuzz, invert); + + if (target_allocated) + target_wand = DestroyPixelWand (target_wand); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to paint transparent image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto Imagick Imagick::setImageAlphaChannel(int ALPHACHANNEL ) + Activates, deactivates, resets, or sets the alpha channel +*/ +PHP_METHOD(Imagick, setImageAlphaChannel) +{ + php_imagick_object *intern; + im_long alpha_channel; + MagickBooleanType status; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &alpha_channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + // TODO - allegedly only + // ActivateAlphaChannel, DeactivateAlphaChannel, OpaqueAlphaChannel, or SetAlphaChannel. + // should be allowed? + status = MagickSetImageAlphaChannel(intern->magick_wand, alpha_channel); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image alpha channel" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +#endif + +#if MagickLibVersion > 0x638 +/* {{{ proto Imagick Imagick::liquidRescaleImage(int cols, int rows, float delta_x, float rigidity ) + Rescales image with seam carving +*/ +PHP_METHOD(Imagick, liquidRescaleImage) +{ + php_imagick_object *intern; + im_long cols, rows; + double delta_x, rigidity; + MagickBooleanType status; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lldd", &cols, &rows, &delta_x, &rigidity) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickLiquidRescaleImage(intern->magick_wand, cols, rows, delta_x, rigidity); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to liquid rescale image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::decipherImage(string passphrase) + Converts cipher pixels to plain pixels +*/ +PHP_METHOD(Imagick, decipherImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + char *passphrase; + IM_LEN_TYPE passphrase_len; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &passphrase, &passphrase_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickDecipherImage(intern->magick_wand, passphrase); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to decipher image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::encipherImage(string passphrase) + Converts plain pixels to cipher pixels +*/ +PHP_METHOD(Imagick, encipherImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + char *passphrase; + IM_LEN_TYPE passphrase_len; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &passphrase, &passphrase_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickEncipherImage(intern->magick_wand, passphrase); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to encipher image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ +#endif + +#if MagickLibVersion > 0x639 +/* {{ proto bool Imagick::setGravity(int GRAVITY) + Sets the gravity value +*/ +PHP_METHOD(Imagick, setGravity) +{ + php_imagick_object *intern; + im_long gravity; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &gravity) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + + if (MagickSetGravity(intern->magick_wand, gravity) == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set gravity" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{ proto int Imagick::getGravity() + Gets the gravity value +*/ +PHP_METHOD(Imagick, getGravity) +{ + php_imagick_object *intern; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + + RETVAL_LONG(MagickGetGravity(intern->magick_wand)); +} +/* }}} */ + +/* {{ proto Imagick Imagick::getImageChannelRange(int CHANNEL) + Gets the image channel's range + */ +PHP_METHOD(Imagick, getImageChannelRange) +{ + php_imagick_object *intern; + im_long channel; + double maxima, minima; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + + if (MagickGetImageChannelRange(intern->magick_wand, channel, &minima, &maxima) == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get channel range" TSRMLS_CC); + RETURN_THROWS(); + } + + array_init(return_value); + + add_assoc_double(return_value, "minima", minima); + add_assoc_double(return_value, "maxima", maxima); +} +/* }}} */ + +/* {{{ proto bool Imagick::getImageAlphaChannel() + Returns true if the image has an alpha channel value and false if not, + aka the image is RGB rather than RGBA or CMYK rather than CMYKA. +*/ +PHP_METHOD(Imagick, getImageAlphaChannel) +{ + php_imagick_object *intern; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + RETVAL_BOOL(MagickGetImageAlphaChannel(intern->magick_wand)); +} +/* }}} */ +#endif + +#if MagickLibVersion > 0x642 +/* {{{ proto float Imagick::getImageChannelDistortions(Imagick reference, int METRICTYPE, int CHANNEL) + Compares one or more image channels of an image to a reconstructed image and returns the specified distortion metrics +*/ +PHP_METHOD(Imagick, getImageChannelDistortions) +{ + php_imagick_object *intern; + php_imagick_object *intern_reference; + zval *reference_param; + double distortion; + im_long metric, channel = DefaultChannels; + MagickBooleanType status; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ol|l", &reference_param, php_imagick_sc_entry, &metric, &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + intern_reference = Z_IMAGICK_P(reference_param); + IMAGICK_NOT_EMPTY(intern_reference); + + status = MagickGetImageChannelDistortion(intern->magick_wand, intern_reference->magick_wand, channel, metric, &distortion); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image channel distortion metrics" TSRMLS_CC); + RETURN_THROWS(); + } + + RETVAL_DOUBLE(distortion); +} +/* }}} */ +#endif + +#if MagickLibVersion > 0x643 +/* {{{ proto int Imagick::getImageGravity() + Gets the image gravity +*/ +PHP_METHOD(Imagick, getImageGravity) +{ + php_imagick_object *intern; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + RETVAL_LONG(MagickGetImageGravity(intern->magick_wand)); +} +/* }}} */ + +/* {{{ proto bool Imagick::setImageGravity(int GRAVITY) + Sets the image gravity +*/ +PHP_METHOD(Imagick, setImageGravity) +{ + php_imagick_object *intern; + MagickBooleanType status; + im_long gravity; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &gravity) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSetImageGravity(intern->magick_wand, gravity); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image gravity" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif + +#if MagickLibVersion > 0x645 +/* {{ proto Imagick Imagick::importImagePixels(int x, int y, int width, int height, string map, int STORAGE, array pixels) + Accepts pixel data and stores it in the image at the location you specify + */ +PHP_METHOD(Imagick, importImagePixels) +{ + double *double_array; + im_long *long_array; + unsigned char *char_array; + + php_imagick_object *intern; + MagickBooleanType status; + + im_long storage, num_elements; + im_long x, y, width, height; + IM_LEN_TYPE map_len; + char *map; + zval *pixels; + HashTable *array; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llllsla", &x, &y, &width, &height, &map, &map_len, &storage, &pixels) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + if (x < 0 || y < 0) { + php_imagick_throw_exception (IMAGICK_CLASS, "The coordinates must be non-negative" TSRMLS_CC); + RETURN_THROWS(); + } + + if (width <= 0 || height <= 0) { + php_imagick_throw_exception(IMAGICK_CLASS, "The width and height must be greater than zero" TSRMLS_CC); + RETURN_THROWS(); + } + + array = Z_ARRVAL_P(pixels); + + if (zend_hash_num_elements(array) != ((width * height) * map_len)) { + zend_throw_exception_ex( + php_imagick_exception_class_entry, + 0, +#if PHP_VERSION_ID >= 70000 + "The map contains incorrect number of elements. Expected %ld, array has %u", +#else + "The map contains incorrect number of elements. Expected %ld, array has %d", +#endif + (width * height) * map_len, + zend_hash_num_elements(array) + ); + + RETURN_THROWS(); + } else { + if (!php_imagick_validate_map(map TSRMLS_CC)) { + php_imagick_throw_exception(IMAGICK_CLASS, "The map contains disallowed characters" TSRMLS_CC); + RETURN_THROWS(); + } + } + + switch (storage) { + case FloatPixel: + case DoublePixel: + /* Use doubles */ + storage = DoublePixel; + double_array = php_imagick_zval_to_double_array(pixels, &num_elements TSRMLS_CC); + if (!double_array) { + php_imagick_throw_exception(IMAGICK_CLASS, "The map must contain only numeric values" TSRMLS_CC); + RETURN_THROWS(); + } + status = MagickImportImagePixels(intern->magick_wand, x, y, width, height, map, storage, double_array); + efree(double_array); + break; + + case ShortPixel: +#if MagickLibVersion < 0x700 + case IntegerPixel: +#endif + case LongPixel: + /* Use longs */ + storage = LongPixel; + long_array = php_imagick_zval_to_long_array(pixels, &num_elements TSRMLS_CC); + if (!long_array) { + php_imagick_throw_exception(IMAGICK_CLASS, "The map must contain only numeric values" TSRMLS_CC); + RETURN_THROWS(); + } + status = MagickImportImagePixels(intern->magick_wand, x, y, width, height, map, storage, long_array); + efree(long_array); + break; + + case CharPixel: + char_array = php_imagick_zval_to_char_array(pixels, &num_elements TSRMLS_CC); + if (!char_array) { + php_imagick_throw_exception(IMAGICK_CLASS, "The character array contains incorrect values" TSRMLS_CC); + RETURN_THROWS(); + } + status = MagickImportImagePixels(intern->magick_wand, x, y, width, height, map, storage, char_array); + efree(char_array); + break; + + default: + php_imagick_throw_exception(IMAGICK_CLASS, "Unknown storage format" TSRMLS_CC); + RETURN_THROWS(); + break; + } + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to import image pixels" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +PHP_METHOD(Imagick, deskewImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + double threshold; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &threshold) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickDeskewImage(intern->magick_wand, threshold); + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to deskew image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} + + +#if PHP_IMAGICK_HAVE_HOUGHLINE +/* {{{ proto bool Imagick::houghLineImage(int width, int height, float threshold) + Draw hough lines for the image + +*/ +PHP_METHOD(Imagick, houghLineImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + double threshold; + im_long width, height; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lld", &width, &height, &threshold) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickHoughLineImage(intern->magick_wand, width, height, threshold); + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to Hough line image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ +#endif + +PHP_METHOD(Imagick, segmentImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + im_long colorspace; + zend_bool verbose = 0; + double cluster_threshold, smooth_threshold; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ldd|b", &colorspace, &cluster_threshold, &smooth_threshold, &verbose) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSegmentImage(intern->magick_wand, colorspace, verbose, cluster_threshold, smooth_threshold); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to segment image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} + +PHP_METHOD(Imagick, sparseColorImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + im_long num_elements, sparse_method, channel = IM_DEFAULT_CHANNEL; + zval *arguments; + double *double_array; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "la|l", &sparse_method, &arguments, &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + double_array = php_imagick_zval_to_double_array(arguments, &num_elements TSRMLS_CC); + + if (!double_array) { + php_imagick_throw_exception(IMAGICK_CLASS, "The map must contain only numeric values" TSRMLS_CC); + RETURN_THROWS(); + } + +#if MagickLibVersion >= 0x700 + status = MagickSparseColorImageChannel(intern->magick_wand, channel, sparse_method, num_elements, double_array); +#else + status = MagickSparseColorImage(intern->magick_wand, channel, sparse_method, num_elements, double_array); +#endif + + efree(double_array); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to sparse color image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} + +/* {{{ proto bool Imagick::remapImage(Imagick remap, int DITHERMETHOD) + replaces the colors of an image with the closest color from a reference image +*/ +PHP_METHOD(Imagick, remapImage) +{ + php_imagick_object *intern; + php_imagick_object *intern_remap; + MagickBooleanType status; + im_long dither_method; + zval *remap_param; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ol", &remap_param, php_imagick_sc_entry, &dither_method) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + intern_remap = Z_IMAGICK_P(remap_param); + IMAGICK_NOT_EMPTY(intern_remap); + + status = MagickRemapImage(intern->magick_wand, intern_remap->magick_wand, dither_method); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to remap image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif + +#if MagickLibVersion > 0x646 +/* {{{ proto bool Imagick::exportImagePixels(int x, int y, int width, int height, string map, INT STORAGE) + +The types for the PixelStorage types are: + +CharPixel - unsigned 1 byte integer +DoublePixel - 8 byte floating point +FloatPixel - 4 byte floating point +IntegerPixel - Removed in IM7 unsigned 4 byte integer +LongPixel - unsigned 4 byte integer +QuantumPixel - Quantum, use the defined type from the IM headers. +ShortPixel - unsigned 2 byte integer + + +*/ +PHP_METHOD(Imagick, exportImagePixels) +{ + php_imagick_object *intern; + MagickBooleanType status; + im_long x, y, width, height, storage; + char *map; + int map_size, i = 0; + IM_LEN_TYPE map_len; + double *double_array; + float *float_array; + unsigned char *char_array; + unsigned short *short_array; + unsigned int *long_array; // The long pixel type is implemented in ImageMagick as 'unsigned int' + Quantum *quantum_array; +#if MagickLibVersion >= 0x700 + unsigned long long int *longlong_array; +#endif + +#if INT_MAX != 0x7FFFFFFF + #error "INT_MAX is not 0x7FFFFFFF, the code below assumes it is, as does the ImageMagick code" + // If this happens, you will need to figure out how to make long_array be an array of + // 4 byte unsigned ints +#endif + + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llllsl", &x, &y, &width, &height, &map, &map_len, &storage) == FAILURE) { + RETURN_THROWS(); + } + + if ((x < 0) || (y < 0)) { + php_imagick_throw_exception(IMAGICK_CLASS, "The coordinates must be non-negative" TSRMLS_CC); + RETURN_THROWS(); + } + + if (width <= 0 || height <= 0) { + php_imagick_throw_exception(IMAGICK_CLASS, "The width and height must be greater than zero" TSRMLS_CC); + RETURN_THROWS(); + } + + if (!php_imagick_validate_map(map TSRMLS_CC)) { + php_imagick_throw_exception(IMAGICK_CLASS, "The map contains disallowed characters" TSRMLS_CC); + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + map_size = (map_len * width * height); + + switch (storage) { + case FloatPixel: + float_array = emalloc(map_size * sizeof(float)); + status = MagickExportImagePixels(intern->magick_wand, x, y, width, height, map, FloatPixel, (void *)float_array); + + if (status != MagickFalse) { + array_init(return_value); + for (i = 0; i < map_size; i++) { + add_next_index_double(return_value, float_arrayi); + } + efree(float_array); + return; + } + break; + + case DoublePixel: + double_array = emalloc(map_size * sizeof(double)); + status = MagickExportImagePixels(intern->magick_wand, x, y, width, height, map, DoublePixel, (void *)double_array); + + if (status != MagickFalse) { + array_init(return_value); + for (i = 0; i < map_size; i++) { + add_next_index_double(return_value, double_arrayi); + } + efree(double_array); + return; + } + break; + + case ShortPixel: + short_array = emalloc(map_size * sizeof(unsigned short)); + status = MagickExportImagePixels(intern->magick_wand, x, y, width, height, map, ShortPixel, (void *)short_array); + + if (status != MagickFalse) { + array_init(return_value); + for (i = 0; i < map_size; i++) { + add_next_index_long(return_value, short_arrayi); + } + efree(short_array); + return; + } + break; + +#if MagickLibVersion >= 0x700 + case LongLongPixel: + longlong_array = emalloc(map_size * sizeof(unsigned long long int)); + status = MagickExportImagePixels(intern->magick_wand, x, y, width, height, map, LongLongPixel, (void *)longlong_array); + + if (status != MagickFalse) { + array_init(return_value); + for (i = 0; i < map_size; i++) { + //TODO - think about this. + // on 32bit platforms this will be truncating data + // on 64bit platforms where sizeof(longlong) > 64bits, it will be truncating + // on 64bit platforms where sizeof(longlong) = 64bits, PHP will be + // converting values close to 64bit to be floats... + add_next_index_long(return_value, longlong_arrayi); + } + efree(longlong_array); + return; + } + break; +#endif + +#if MagickLibVersion < 0x700 + case IntegerPixel: +#endif + case LongPixel: + long_array = emalloc(map_size * sizeof(unsigned int)); + status = MagickExportImagePixels(intern->magick_wand, x, y, width, height, map, LongPixel, (void *)long_array); + + if (status != MagickFalse) { + array_init(return_value); + for (i = 0; i < map_size; i++) { + add_next_index_long(return_value, long_arrayi); + } + efree(long_array); + return; + } + break; + + case CharPixel: + char_array = emalloc(map_size * sizeof(char)); + status = MagickExportImagePixels(intern->magick_wand, x, y, width, height, map, CharPixel, (void *)char_array); + + if (status != MagickFalse) { + array_init(return_value); + for (i = 0; i < map_size; i++) { + add_next_index_long(return_value, (int)char_arrayi); + } + efree(char_array); + return; + } + break; + + case QuantumPixel: + quantum_array = emalloc(map_size * sizeof(Quantum)); + status = MagickExportImagePixels(intern->magick_wand, x, y, width, height, map, QuantumPixel, (void *)quantum_array); + + if (status != MagickFalse) { + array_init(return_value); + for (i = 0; i < map_size; i++) { +#if MAGICKCORE_HDRI_ENABLE + add_next_index_double(return_value, quantum_arrayi); +#else + add_next_index_long(return_value, quantum_arrayi); +#endif + } + efree(quantum_array); + return; + } + break; + + default: + php_imagick_throw_exception(IMAGICK_CLASS, "Unknown pixel type " TSRMLS_CC); + RETURN_THROWS(); + break; + } + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to export image pixels" TSRMLS_CC); + RETURN_THROWS(); + } +} +/* }}} */ +#endif + +#if MagickLibVersion > 0x648 +/* {{{ proto array Imagick::getImageChannelKurtosis(int CHANNEL) + Gets the kurtosis and skewness of one or more image channels +*/ +PHP_METHOD(Imagick, getImageChannelKurtosis) +{ + php_imagick_object *intern; + MagickBooleanType status; + double kurtosis, skewness; + im_long channel = DefaultChannels; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickGetImageChannelKurtosis(intern->magick_wand, channel, &kurtosis, &skewness); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image channel kurtosis" TSRMLS_CC); + RETURN_THROWS(); + } + + array_init(return_value); + add_assoc_double(return_value, "kurtosis", kurtosis); + add_assoc_double(return_value, "skewness", skewness); +} +/* }}} */ + +/* {{{ proto bool Imagick::functionImage(int FUNCTION, array arguments, int CHANNEL) + Applies an arithmetic, relational, or logical expression to an image +*/ +PHP_METHOD(Imagick, functionImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + zval *arguments; + im_long func, num_elements, channel = IM_DEFAULT_CHANNEL; + double *array; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "la|l", &func, &arguments, &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + array = php_imagick_zval_to_double_array(arguments, &num_elements TSRMLS_CC); + + if (!array) { + php_imagick_throw_exception(IMAGICK_CLASS, "The arguments array contains disallowed characters or is empty." TSRMLS_CC); + RETURN_THROWS(); + } + + status = MagickFunctionImageChannel(intern->magick_wand, channel, func, num_elements, array); + efree(array); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to execute function on the image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif + +#if MagickLibVersion > 0x651 +/* {{{ proto boolean Imagick::transformImageColorspace(int COLORSPACE) + Transform image colorspace +*/ +PHP_METHOD(Imagick, transformImageColorspace) +{ + php_imagick_object *intern; + im_long colorspace; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &colorspace) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickTransformImageColorspace(intern->magick_wand, colorspace); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to transform image colorspace" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ +#endif + +#if MagickLibVersion > 0x652 +/* {{{ proto boolean Imagick::haldClutImage(Imagick hald, int CHANNEL) + Replaces colors in the image from a Hald color lookup table +*/ +PHP_METHOD(Imagick, haldClutImage) +{ + zval *objvar; + MagickBooleanType status; + php_imagick_object *intern, *hald; + im_long channel = IM_DEFAULT_CHANNEL; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|l", &objvar, php_imagick_sc_entry, &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + hald = Z_IMAGICK_P(objvar); + IMAGICK_NOT_EMPTY(hald); + + status = MagickHaldClutImageChannel(intern->magick_wand, channel, hald->magick_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to hald clut image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ +#endif + +#if MagickLibVersion > 0x655 +/* {{{ proto boolean Imagick::autoLevelImage(int CHANNEL) + Adjusts the levels of a particular image channel by scaling the minimum and maximum values to the full quantum range. +*/ +PHP_METHOD(Imagick, autoLevelImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + im_long channel = IM_DEFAULT_CHANNEL; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickAutoLevelImageChannel(intern->magick_wand, channel); + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to autolevel image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto boolean Imagick::blueShiftImage(float $factor = 1.5) + Mutes the colors of the image to simulate a scene at nighttime in the moonlight. +*/ +PHP_METHOD(Imagick, blueShiftImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + double factor = 1.5; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|d", &factor) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickBlueShiftImage(intern->magick_wand, factor); + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to blue shift image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ +#endif + +#if MagickLibVersion > 0x656 +PHP_METHOD(Imagick, setImageArtifact) +{ + php_imagick_object *intern; + MagickBooleanType status; + char *artifact, *value; + IM_LEN_TYPE artifact_len, value_len; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss!", &artifact, &artifact_len, &value, &value_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSetImageArtifact(intern->magick_wand, artifact, value); + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image artifact" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} + + +PHP_METHOD(Imagick, getImageArtifact) +{ + php_imagick_object *intern; + char *artifact, *value; + IM_LEN_TYPE artifact_len; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &artifact, &artifact_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + value = MagickGetImageArtifact(intern->magick_wand, artifact); + + if (value == NULL) { + RETVAL_NULL(); + } + else { +#if PHP_VERSION_ID >= 70000 + RETVAL_STRING(value); +#else + RETVAL_STRING(value, 1); +#endif + IMAGICK_FREE_MAGICK_MEMORY(value); + } +} + +/* {{{ proto boolean Imagick::deleteImageArtifact(string $artifact) + Delete image artifact +*/ +PHP_METHOD(Imagick, deleteImageArtifact) +{ + php_imagick_object *intern; + MagickBooleanType status; + char *artifact; + IM_LEN_TYPE artifact_len; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &artifact, &artifact_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickDeleteImageArtifact(intern->magick_wand, artifact); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to delete image artifact" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto integer Imagick::getColorspace() + Get the object colorspace property +*/ +PHP_METHOD(Imagick, getColorspace) +{ + php_imagick_object *intern; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + RETURN_LONG(MagickGetColorspace(intern->magick_wand)); +} +/* }}} */ + +/* {{{ proto boolean Imagick::setColorspace(int COLORSPACE) + Set the object colorspace property +*/ +PHP_METHOD(Imagick, setColorspace) +{ + php_imagick_object *intern; + im_long colorspace; + MagickBooleanType status; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &colorspace) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + status = MagickSetColorspace(intern->magick_wand, colorspace); + + RETURN_BOOL(status == MagickTrue); +} +/* }}} */ + +/* {{{ proto boolean Imagick::clampImage(int CHANNEL) + Restricts the color range from 0 to the quantum depth. +*/ +PHP_METHOD(Imagick, clampImage) +{ + php_imagick_object *intern; + im_long channel = IM_DEFAULT_CHANNEL; + MagickBooleanType status; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickClampImageChannel(intern->magick_wand, channel); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to clamp image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif + +#if MagickLibVersion > 0x667 +/* {{{ proto Imagick Imagick::smushImages(boolean stack, int offset) + Takes all images from the current image pointer to the end of the image list and smushs + them to each other top-to-bottom if the stack parameter is true, otherwise left-to-right. +*/ +PHP_METHOD(Imagick, smushImages) +{ + php_imagick_object *intern, *intern_return; + zend_bool stack; + im_long offset; + MagickWand *retwand; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "bl", &stack, &offset) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + retwand = MagickSmushImages(intern->magick_wand, (stack ? MagickTrue : MagickFalse), offset); + + if (!retwand) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to smush images" TSRMLS_CC); + RETURN_THROWS(); + } + + object_init_ex(return_value, php_imagick_sc_entry); + intern_return = Z_IMAGICK_P(return_value); + php_imagick_replace_magickwand(intern_return, retwand); +} +/* }}} */ +#endif + +/* {{{ proto Imagick Imagick::__construct(mixed files ) + The Imagick constructor +*/ +#if PHP_VERSION_ID >= 70000 +PHP_METHOD(Imagick, __construct) +{ + php_imagick_object *intern; + zval *files = NULL; + + zval *pzval; + php_imagick_rw_result_t rc; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z!/", &files) == FAILURE) { + RETURN_THROWS(); + } + + /* No files given.. or null passed */ + if (!files) { + return; + } + intern = Z_IMAGICK_P(getThis()); + + if (Z_TYPE_P (files) == IS_LONG || Z_TYPE_P (files) == IS_DOUBLE) { + convert_to_string (files); + } + + /* A single file was given */ + if (Z_TYPE_P(files) == IS_STRING) { + struct php_imagick_file_t file = {0}; + + if (!php_imagick_file_init(&file, Z_STRVAL_P(files), Z_STRLEN_P(files) TSRMLS_CC)) { + php_imagick_throw_exception(IMAGICK_CLASS, "Invalid filename provided" TSRMLS_CC); + RETURN_THROWS(); + } + rc = php_imagick_read_file(intern, &file, ImagickReadImage TSRMLS_CC); + php_imagick_file_deinit(&file); + + if (rc != IMAGICK_RW_OK) { + php_imagick_rw_fail_to_exception (intern->magick_wand, rc, Z_STRVAL_P(files) TSRMLS_CC); + RETURN_THROWS(); + } + } + + /* an array of filenames was given */ + else + if (Z_TYPE_P(files) == IS_ARRAY) { + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(files), pzval) { + struct php_imagick_file_t file = {0}; + ZVAL_DEREF(pzval); + + if (!php_imagick_file_init(&file, Z_STRVAL_P(pzval), Z_STRLEN_P(pzval) TSRMLS_CC)) { + php_imagick_throw_exception(IMAGICK_CLASS, "Invalid filename provided" TSRMLS_CC); + RETURN_THROWS(); + } + + rc = php_imagick_read_file(intern, &file, ImagickReadImage TSRMLS_CC); + php_imagick_file_deinit(&file); + + if (rc != IMAGICK_RW_OK) { + php_imagick_rw_fail_to_exception (intern->magick_wand, rc, Z_STRVAL_P(pzval) TSRMLS_CC); + RETURN_THROWS(); + } + } ZEND_HASH_FOREACH_END(); + } + if (Z_TYPE_P(files) == IS_FALSE || Z_TYPE_P(files) == IS_TRUE) { + php_imagick_throw_exception(IMAGICK_CLASS, "Constructor shouldn't be called with a boolean as the filename"); + } + + RETURN_TRUE; +} +#else +PHP_METHOD(Imagick, __construct) +{ + php_imagick_object *intern; + zval *files = NULL; + HashPosition pos; + php_imagick_rw_result_t rc; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z!/", &files) == FAILURE) { + RETURN_THROWS(); + } + + /* No files given.. or null passed */ + if (!files) { + return; + } + intern = Z_IMAGICK_P(getThis()); + + if (Z_TYPE_P (files) == IS_LONG || Z_TYPE_P (files) == IS_DOUBLE) { + convert_to_string (files); + } + + /* A single file was given */ + if (Z_TYPE_P(files) == IS_STRING) { + struct php_imagick_file_t file = {0}; + + if (!php_imagick_file_init(&file, Z_STRVAL_P(files), Z_STRLEN_P(files) TSRMLS_CC)) { + php_imagick_throw_exception(IMAGICK_CLASS, "Invalid filename provided" TSRMLS_CC); + RETURN_THROWS(); + } + rc = php_imagick_read_file(intern, &file, ImagickReadImage TSRMLS_CC); + php_imagick_file_deinit(&file); + + if (rc != IMAGICK_RW_OK) { + php_imagick_rw_fail_to_exception (intern->magick_wand, rc, Z_STRVAL_P(files) TSRMLS_CC); + RETURN_THROWS(); + } + } + + /* an array of filenames was given */ + else + if (Z_TYPE_P(files) == IS_ARRAY) { + for(zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(files), &pos); + zend_hash_has_more_elements_ex(Z_ARRVAL_P(files), &pos) == SUCCESS; + zend_hash_move_forward_ex(Z_ARRVAL_P(files), &pos)) { + + struct php_imagick_file_t file = {0}; + zval **ppzval; + + if (zend_hash_get_current_data_ex(Z_ARRVAL_P(files), (void**)&ppzval, &pos) == FAILURE) { + continue; + } + + if (!php_imagick_file_init(&file, Z_STRVAL_PP(ppzval), Z_STRLEN_PP(ppzval) TSRMLS_CC)) { + php_imagick_throw_exception(IMAGICK_CLASS, "Invalid filename provided" TSRMLS_CC); + RETURN_THROWS(); + } + + rc = php_imagick_read_file(intern, &file, ImagickReadImage TSRMLS_CC); + php_imagick_file_deinit(&file); + + if (rc != IMAGICK_RW_OK) { + php_imagick_rw_fail_to_exception (intern->magick_wand, rc, Z_STRVAL_PP(ppzval) TSRMLS_CC); + RETURN_THROWS(); + } + } + } + + if (Z_TYPE_P(files) == IS_BOOL) { + php_imagick_throw_exception(IMAGICK_CLASS, "Constructor shouldn't be called with a boolean as the filename" TSRMLS_CC); + } + + RETURN_TRUE; +} +#endif +/* }}} */ + +/* {{{ proto string Imagick::__toString() + Returns the current image as string +*/ +PHP_METHOD(Imagick, __toString) +{ + php_imagick_object *intern; + unsigned char *image; + char *buffer; + size_t image_size; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + + if (MagickGetNumberImages(intern->magick_wand) == 0) { + IM_ZVAL_STRING(return_value, ""); + return; + } + + buffer = MagickGetImageFormat(intern->magick_wand); + + if (!buffer) { + IM_ZVAL_STRING(return_value, ""); + return; + } else { + IMAGICK_FREE_MAGICK_MEMORY(buffer); + } + + image = MagickGetImageBlob(intern->magick_wand, &image_size); + IM_ZVAL_STRINGL(return_value, (char *)image, image_size); + IMAGICK_FREE_MAGICK_MEMORY(image); +} +/* }}} */ + +/* {{{ proto string Imagick::count() + Returns the number of images +*/ +PHP_METHOD(Imagick, count) +{ + php_imagick_object *intern; + im_long mode = 0; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &mode) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + RETVAL_LONG (MagickGetNumberImages(intern->magick_wand)); +} +/* }}} */ + +/* {{{ proto array Imagick::queryFormats(string pattern ) + Returns formats supported by ImageMagick +*/ +PHP_METHOD(Imagick, queryFormats) +{ + char **supported_formats; + unsigned long i; + char *pattern = "*"; + IM_LEN_TYPE pattern_len = 1; + size_t num_formats = 0; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &pattern, &pattern_len) == FAILURE) { + RETURN_THROWS(); + } + + supported_formats = (char **) MagickQueryFormats(pattern, &num_formats); + array_init(return_value); + + for (i = 0 ; i < num_formats ; i++) { + IM_add_next_index_string(return_value, supported_formatsi); + IMAGICK_FREE_MAGICK_MEMORY(supported_formatsi); + } + + IMAGICK_FREE_MAGICK_MEMORY(supported_formats); +} +/* }}} */ + +/* {{{ proto array Imagick::queryFonts(string pattern ) + Returns fonts supported by ImageMagick +*/ +PHP_METHOD(Imagick, queryFonts) +{ + char **fonts; + unsigned long i; + char *pattern = "*"; + IM_LEN_TYPE pattern_len = 1; + size_t num_fonts; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &pattern, &pattern_len) == FAILURE) { + RETURN_THROWS(); + } + + fonts = (char **) MagickQueryFonts(pattern, &num_fonts); + array_init(return_value); + + for (i = 0 ; i < num_fonts ; i++) { + IM_add_next_index_string(return_value, fontsi); + IMAGICK_FREE_MAGICK_MEMORY(fontsi); + } + + IMAGICK_FREE_MAGICK_MEMORY(fonts); +} +/* }}} */ + +/* {{{ proto array Imagick::queryFontMetrics(ImagickDraw draw, string text, bool multiline ) + Returns a 13 element array representing the font metrics +*/ +PHP_METHOD(Imagick, queryFontMetrics) +{ + zval *objvar, *multiline; + zend_bool remove_canvas, query_multiline; + php_imagick_object *intern; + php_imagickdraw_object *internd; + char *text; + IM_LEN_TYPE text_len; + double *metrics; + + multiline = NULL; + remove_canvas = 0; + query_multiline = 0; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os|z!", &objvar, php_imagickdraw_sc_entry, &text, &text_len, &multiline) == FAILURE) { + RETURN_THROWS(); + } + + /* No parameter passed, this means we should autodetect */ + if (!multiline) { + if (strchr (text, '\n') != NULL) { + query_multiline = 1; + } + } else { + convert_to_boolean(multiline); +#if PHP_VERSION_ID >= 70000 + if (Z_TYPE_P(multiline) == IS_TRUE) { + query_multiline = 1; + } +#else + query_multiline = Z_BVAL_P(multiline); +#endif + } + + /* fetch the objects */ + intern = Z_IMAGICK_P(getThis()); + internd = Z_IMAGICKDRAW_P(objvar); + + /* If wand is empty, create a 1x1 pixel image to use as a temporary canvas */ + if (MagickGetNumberImages(intern->magick_wand) < 1) { + PixelWand *pixel_wand; + MagickBooleanType status; + + /* Empty bg color */ + pixel_wand = NewPixelWand(); + + if (!pixel_wand) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to allocate background color for the temporary canvas" TSRMLS_CC); + RETURN_THROWS(); + } + + /* 1x1 should be enough to get the metrics */ + status = MagickNewImage(intern->magick_wand, 1, 1, pixel_wand); + pixel_wand = DestroyPixelWand(pixel_wand); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to allocate temporary canvas" TSRMLS_CC); + RETURN_THROWS(); + } + remove_canvas = 1; + } + + /* Multiline testing */ + if (query_multiline) { + metrics = MagickQueryMultilineFontMetrics(intern->magick_wand, internd->drawing_wand, text); + } else { + metrics = MagickQueryFontMetrics(intern->magick_wand, internd->drawing_wand, text); + } + + /* Remove the image from the stack*/ + if (remove_canvas) { + MagickRemoveImage(intern->magick_wand); + } + + if (!metrics) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Failed to query the font metrics" TSRMLS_CC); + RETURN_THROWS(); + } else { + zval *pbounding; +#if PHP_VERSION_ID >= 70000 + zval bounding; + pbounding = &bounding; +#else + MAKE_STD_ZVAL(pbounding) +#endif + + array_init(return_value); + add_assoc_double(return_value, "characterWidth", metrics0); + add_assoc_double(return_value, "characterHeight", metrics1); + add_assoc_double(return_value, "ascender", metrics2); + add_assoc_double(return_value, "descender", metrics3); + add_assoc_double(return_value, "textWidth", metrics4); + add_assoc_double(return_value, "textHeight", metrics5); + add_assoc_double(return_value, "maxHorizontalAdvance", metrics6); + + array_init(pbounding); + add_assoc_double(pbounding, "x1", metrics7); + add_assoc_double(pbounding, "y1", metrics8); + add_assoc_double(pbounding, "x2", metrics9); + add_assoc_double(pbounding, "y2", metrics10); + add_assoc_zval(return_value, "boundingBox", pbounding); + add_assoc_double(return_value, "originX", metrics11); + add_assoc_double(return_value, "originY", metrics12); + + IMAGICK_FREE_MAGICK_MEMORY(metrics); + return; + } +} +/* }}} */ + +/* {{{ proto bool Imagick::valid() + Checks if the current item is valid +*/ +PHP_METHOD(Imagick, valid) +{ + php_imagick_object *intern; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + + IMAGICK_NOT_EMPTY(intern); + + if (intern->next_out_of_bound) { + RETURN_FALSE; + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto Imagick Imagick::current() + Returns reference to the current imagick object with image pointer at the correct sequence. +*/ +PHP_METHOD(Imagick, current) +{ + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + RETURN_ZVAL(getThis(), 1, 0); +} +/* }}} */ + +/* {{{ proto bool Imagick::readImage(string filename) + Reads image from filename +*/ +PHP_METHOD(Imagick, readImage) +{ + char *filename; + IM_LEN_TYPE filename_len; + php_imagick_object *intern; + struct php_imagick_file_t file = {0}; + php_imagick_rw_result_t rc; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + + if (!php_imagick_file_init(&file, filename, filename_len TSRMLS_CC)) { + php_imagick_throw_exception(IMAGICK_CLASS, "Invalid filename provided" TSRMLS_CC); + RETURN_THROWS(); + } + + rc = php_imagick_read_file(intern, &file, ImagickReadImage TSRMLS_CC); + php_imagick_file_deinit(&file); + + if (rc != IMAGICK_RW_OK) { + php_imagick_rw_fail_to_exception (intern->magick_wand, rc, filename TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::readImages(array files ) + Reads image from an array of filenames +*/ +#if PHP_VERSION_ID >= 70000 +PHP_METHOD(Imagick, readImages) +{ + + zval *value; + zval *files; + php_imagick_object *intern; + php_imagick_rw_result_t rc; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &files) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(files), value) { + struct php_imagick_file_t file = {0}; + ZVAL_DEREF(value); + + if (!php_imagick_file_init(&file, Z_STRVAL_P(value), Z_STRLEN_P(value) TSRMLS_CC)) { + php_imagick_throw_exception(IMAGICK_CLASS, "Invalid filename provided" TSRMLS_CC); + RETURN_THROWS(); + } + + rc = php_imagick_read_file(intern, &file, ImagickReadImage TSRMLS_CC); + php_imagick_file_deinit(&file); + + if (rc != IMAGICK_RW_OK) { + php_imagick_rw_fail_to_exception (intern->magick_wand, rc, Z_STRVAL_P(value) TSRMLS_CC); + RETURN_THROWS(); + } + } ZEND_HASH_FOREACH_END(); + RETURN_TRUE; +} +#else +PHP_METHOD(Imagick, readImages) +{ + zval *files; + php_imagick_object *intern; + HashPosition pos; + php_imagick_rw_result_t rc; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &files) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + + for(zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(files), &pos); + zend_hash_has_more_elements_ex(Z_ARRVAL_P(files), &pos) == SUCCESS; + zend_hash_move_forward_ex(Z_ARRVAL_P(files), &pos)) { + + struct php_imagick_file_t file = {0}; + zval **ppzval; + + if (zend_hash_get_current_data_ex(Z_ARRVAL_P(files), (void**)&ppzval, &pos) == FAILURE) { + continue; + } + + if (!php_imagick_file_init(&file, Z_STRVAL_PP(ppzval), Z_STRLEN_PP(ppzval) TSRMLS_CC)) { + php_imagick_throw_exception(IMAGICK_CLASS, "Invalid filename provided" TSRMLS_CC); + RETURN_THROWS(); + } + + rc = php_imagick_read_file(intern, &file, ImagickReadImage TSRMLS_CC); + php_imagick_file_deinit(&file); + + if (rc != IMAGICK_RW_OK) { + php_imagick_rw_fail_to_exception (intern->magick_wand, rc, Z_STRVAL_PP(ppzval) TSRMLS_CC); + RETURN_THROWS(); + } + } + RETURN_TRUE; +} +#endif + + +/* {{{ proto bool Imagick::pingImage(string filename ) + This method can be used to query image width, height, size, and format without reading the whole image in to memory. +*/ +PHP_METHOD(Imagick, pingImage) +{ + char *filename; + IM_LEN_TYPE filename_len; + php_imagick_object *intern; + struct php_imagick_file_t file = {0}; + php_imagick_rw_result_t rc; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + + if (!php_imagick_file_init(&file, filename, filename_len TSRMLS_CC)) { + php_imagick_throw_exception(IMAGICK_CLASS, "Invalid filename provided" TSRMLS_CC); + RETURN_THROWS(); + } + rc = php_imagick_read_file(intern, &file, ImagickPingImage TSRMLS_CC); + php_imagick_file_deinit(&file); + + if (rc != IMAGICK_RW_OK) { + php_imagick_rw_fail_to_exception (intern->magick_wand, rc, filename TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::readImageFile(resource filehandle, string filename) + Reads image from open filehandle +*/ +PHP_METHOD(Imagick, readImageFile) +{ + char *filename = NULL; + IM_LEN_TYPE filename_len; + php_imagick_object *intern; + zval *zstream; + zend_bool result; + php_stream *stream; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|s!", &zstream, &filename, &filename_len) == FAILURE) + { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + +#if PHP_VERSION_ID >= 70000 + php_stream_from_zval(stream, zstream); +#else + php_stream_from_zval(stream, &zstream); +#endif + result = php_imagick_stream_handler(intern, stream, ImagickReadImageFile TSRMLS_CC); + + if (result == 0) { + if (!EG(exception)) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to read image from the filehandle" TSRMLS_CC); + } + RETURN_THROWS(); + } + + if (filename) { + MagickSetImageFilename(intern->magick_wand, filename); + MagickSetLastIterator(intern->magick_wand); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::displayImage(string serverName ) + Displays an image +*/ +PHP_METHOD(Imagick, displayImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + char *server_name; + IM_LEN_TYPE server_name_len; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &server_name, &server_name_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickDisplayImage(intern->magick_wand, server_name); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to display image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::displayImages(string serverName ) + displays an image or image sequence +*/ +PHP_METHOD(Imagick, displayImages) +{ + php_imagick_object *intern; + MagickBooleanType status; + char *server_name; + IM_LEN_TYPE server_name_len; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &server_name, &server_name_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickDisplayImages(intern->magick_wand, server_name); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to display images" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::readBlob(string image ) + Reads image from a binary string +*/ +PHP_METHOD(Imagick, readImageBlob) +{ + char *image_string; + char *filename = NULL; + long filename_len; + IM_LEN_TYPE image_string_len; + MagickBooleanType status; + php_imagick_object *intern; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!", &image_string, &image_string_len, &filename, &filename_len) == FAILURE) { + RETURN_THROWS(); + } + + if (!image_string_len) { + php_imagick_throw_exception(IMAGICK_CLASS, "Zero size image string passed" TSRMLS_CC); + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + status = MagickReadImageBlob(intern->magick_wand, image_string, image_string_len); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to read image blob" TSRMLS_CC); + RETURN_THROWS(); + } + + /* Even if filename is null we need to give a name here. Otherwise segfaults will happen */ + MagickSetImageFilename(intern->magick_wand, filename); + MagickSetLastIterator(intern->magick_wand); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::blurImage(float radius, float sigma, int channel ) + Adds blur filter to image. Optional third parameter to blur a specific channel. +*/ +PHP_METHOD(Imagick, blurImage) +{ + double radius, sigma; + php_imagick_object *intern; + MagickBooleanType status; + /* Initialize channel type to all channels*/ + im_long channel = IM_DEFAULT_CHANNEL; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd|l", &radius, &sigma, &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickBlurImageChannel(intern->magick_wand, channel, radius, sigma); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to blur image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::waveImage(float amplitude, float length ) + Adds wave filter to the image. +*/ +PHP_METHOD(Imagick, waveImage) +{ + double amplitude, wave_length; + php_imagick_object *intern; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &litude, &wave_length) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + +#if MagickLibVersion >= 0x700 + { + //TODO allow PixelInterpolateMethod be set + PixelInterpolateMethod method = BilinearInterpolatePixel; + status = MagickWaveImage(intern->magick_wand, amplitude, wave_length, method); + } +#else + status = MagickWaveImage(intern->magick_wand, amplitude, wave_length); +#endif + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to wave image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + + + +#if MagickLibVersion >= 0x700 +/* {{{ proto bool Imagick::waveImageWithMethod(float amplitude, float length, int pixel_interpolate_method) + Adds wave filter to the image. +*/ +PHP_METHOD(Imagick, waveImageWithMethod) +{ + double amplitude, wave_length; + php_imagick_object *intern; + MagickBooleanType status; + im_long method; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddl", &litude, &wave_length, &method) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickWaveImage(intern->magick_wand, amplitude, wave_length, method); + + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to wave image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif //MagickLibVersion >= 0x700 + +/* {{{ proto bool Imagick::clear() + Clears all resources associated to Imagick object +*/ +PHP_METHOD(Imagick, clear) +{ + php_imagick_object *intern; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + + if (!intern->magick_wand) { + RETURN_FALSE; + } + + ClearMagickWand(intern->magick_wand); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::scaleImage(int width, int height, bool bestfit = false, bool legacy ) + Scales the size of an image to the given dimensions. Passing zero as either of + the arguments will preserve dimension while scaling. + If legacy is true, the calculations are done with the small rounding bug that existed in + Imagick before 3.4.0. If false, the calculations should produce the same results as + ImageMagick CLI does. +*/ +PHP_METHOD(Imagick, scaleImage) +{ + im_long width, height, new_width, new_height; + php_imagick_object *intern; + MagickBooleanType status; + zend_bool bestfit = 0; + zend_bool legacy = 0; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll|bb", &width, &height, &bestfit, &legacy) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + if (!php_imagick_thumbnail_dimensions(intern->magick_wand, bestfit, width, height, &new_width, &new_height, legacy)) { + php_imagick_throw_exception(IMAGICK_CLASS, "Invalid image geometry" TSRMLS_CC); + RETURN_THROWS(); + } + + status = MagickScaleImage(intern->magick_wand, new_width, new_height); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to scale image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::cropImage(int width, height, int x, int y ) + Extracts a region of the image. +*/ +PHP_METHOD(Imagick, cropImage) +{ + im_long width, height, x, y; + php_imagick_object *intern; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llll", &width, &height, &x, &y) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickCropImage(intern->magick_wand, width, height, x, y); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to crop image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::spreadImage(float radius ) + Special effects method that randomly displaces each pixel in a block defined by the radius parameter. +*/ +PHP_METHOD(Imagick, spreadImage) +{ + double radius; + php_imagick_object *intern; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &radius) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + +#if MagickLibVersion >= 0x700 + { + //TODO allow PixelInterpolateMethod be set + PixelInterpolateMethod method = BilinearInterpolatePixel; + status = MagickSpreadImage(intern->magick_wand, radius, method); + } +#else + status = MagickSpreadImage(intern->magick_wand, radius); +#endif + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to spread image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +#if MagickLibVersion >= 0x700 +/* {{{ proto bool Imagick::spreadImageWithMethod(float radius, int interpolate_method) + Special effects method that randomly displaces each pixel in a block defined by the radius parameter. +*/ +PHP_METHOD(Imagick, spreadImageWithMethod) +{ + double radius; + php_imagick_object *intern; + MagickBooleanType status; + im_long method; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dl", &radius, &method) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSpreadImage(intern->magick_wand, radius, method); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to spread image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif // MagickLibVersion >= 0x700 + +/* {{{ proto bool Imagick::swirlImage(float degrees ) + Swirls the pixels about the center of the image, where degrees indicates the sweep of the arc through which each pixel is moved. You get a more dramatic effect as the degrees move from 1 to 360. +*/ +PHP_METHOD(Imagick, swirlImage) +{ + double degrees; + php_imagick_object *intern; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", °rees) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + +#if MagickLibVersion >= 0x700 + { + //TODO allow PixelInterpolateMethod be set + PixelInterpolateMethod method = BilinearInterpolatePixel; + status = MagickSwirlImage(intern->magick_wand, degrees, method); + } +#else + status = MagickSwirlImage(intern->magick_wand, degrees); +#endif + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to swirl image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + + +#if MagickLibVersion >= 0x700 +/* {{{ proto bool Imagick::swirlImageWithMethod(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. +*/ +PHP_METHOD(Imagick, swirlImageWithMethod) +{ + double degrees; + php_imagick_object *intern; + MagickBooleanType status; + im_long method; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dl", °rees, &method) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSwirlImage(intern->magick_wand, degrees, method); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to swirl image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif //MagickLibVersion >= 0x700 + + +/* {{{ proto bool Imagick::stripImage() + Strips an image of all profiles and comments. +*/ +PHP_METHOD(Imagick, stripImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickStripImage(intern->magick_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to strip image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::trimImage(double fuzz) + Remove edges that are the background color from the image. +*/ +PHP_METHOD(Imagick, trimImage) +{ + double fuzz; + php_imagick_object *intern; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &fuzz) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickTrimImage(intern->magick_wand, fuzz); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to trim image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::chopImage(int width, int height, int x, int y) + Removes a region of an image and collapses the image to occupy the removed portion +*/ +PHP_METHOD(Imagick, chopImage) +{ + php_imagick_object *intern; + im_long width, height, x, y; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llll", &width, &height, &x, &y) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickChopImage(intern->magick_wand, width, height, x, y); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to chop image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; + +} +/* }}} */ + +/* {{{ proto bool Imagick::clipImage() + Clips along the first path from the 8BIM profile, if present. +*/ +PHP_METHOD(Imagick, clipImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickClipImage(intern->magick_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to clip image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::clipPathImage(string pathname, bool inside) + Clips along the named paths from the 8BIM profile, if present. Later operations take effect inside the path. Id may be a number if preceded with #, to work on a numbered path, e.g., "#1" to use the first path. +*/ +PHP_METHOD(Imagick, clipPathImage) +{ + php_imagick_object *intern; + char *clip_path; + IM_LEN_TYPE clip_path_len; + zend_bool inside; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sb", &clip_path, &clip_path_len, &inside) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); +#if MagickLibVersion > 0x636 + status = MagickClipImagePath(intern->magick_wand, clip_path, inside); +#else + status = MagickClipPathImage(intern->magick_wand, clip_path, inside); +#endif + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to clip path image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; + +} +/* }}} */ + +/* {{{ proto Imagick Imagick::coalesceImages() + Composites a set of images while respecting any page offsets and disposal methods. GIF, MIFF, and MNG animation sequences typically start with an image background and each subsequent image varies in size and offset. returns a new sequence where each image in the sequence is the same size as the first and composited with the next image in the sequence. +*/ +PHP_METHOD(Imagick, coalesceImages) +{ + MagickWand *tmp_wand; + php_imagick_object *intern, *intern_return; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + tmp_wand = MagickCoalesceImages(intern->magick_wand); + + if (tmp_wand == NULL) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Coalesce image failed" TSRMLS_CC); + RETURN_THROWS(); + } + + object_init_ex(return_value, php_imagick_sc_entry); + intern_return = Z_IMAGICK_P(return_value); + php_imagick_replace_magickwand(intern_return, tmp_wand); +} +/* }}} */ + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 +/* {{{ proto bool Imagick::colorFloodfillImage(ImagickPixel fill, double fuzz, ImagickPixel bordercolor, int x, int y) + Changes the color value of any pixel that matches target and is an immediate neighbor. +*/ +PHP_METHOD(Imagick, colorFloodfillImage) +{ + php_imagick_object *intern; + zval *fill_param, *border_param; + im_long x, y; + double fuzz; + MagickBooleanType status; + PixelWand *fill_wand, *border_wand; + zend_bool fill_allocated = 0, border_allocated = 0; + + IMAGICK_METHOD_DEPRECATED("Imagick", "colorFloodFillImage"); + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zdzll", &fill_param, &fuzz, &border_param, &x, &y) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + + IMAGICK_NOT_EMPTY(intern); + + fill_wand = php_imagick_zval_to_pixelwand (fill_param, IMAGICK_CLASS, &fill_allocated TSRMLS_CC); + if (!fill_wand) + return; + + border_wand = php_imagick_zval_to_pixelwand (border_param, IMAGICK_CLASS, &border_allocated TSRMLS_CC); + if (!border_wand) { + if (fill_allocated) + fill_wand = DestroyPixelWand (fill_wand); + return; + } + + status = MagickColorFloodfillImage(intern->magick_wand, fill_wand, fuzz, border_wand, x, y); + + if (fill_allocated) + fill_wand = DestroyPixelWand (fill_wand); + + if (border_allocated) + border_wand = DestroyPixelWand (border_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to color floodfill image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ +#endif // #if MagickLibVersion < 0x700 +#endif + +/* {{{ proto Imagick Imagick::combineImages() + Combines one or more images into a single image. The grayscale value of the pixels of each image in the sequence is assigned in order to the specified channels of the combined image. The typical ordering would be image 1 => Red, 2 => Green, 3 => Blue, etc. +*/ +PHP_METHOD(Imagick, combineImages) +{ + MagickWand *tmp_wand; + php_imagick_object *intern, *intern_return; + + // TODO - this is actuall ColorspaceType + // https://imagemagick.org/api/magick-image.php#MagickCombineImages + im_long channel_type; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &channel_type) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + + IMAGICK_NOT_EMPTY(intern); + tmp_wand = MagickCombineImages(intern->magick_wand, channel_type); + + if (tmp_wand == NULL) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Combine images failed" TSRMLS_CC); + RETURN_THROWS(); + } + + object_init_ex(return_value, php_imagick_sc_entry); + intern_return = Z_IMAGICK_P(return_value); + php_imagick_replace_magickwand(intern_return, tmp_wand); +} +/* }}} */ + +/* {{{ proto Imagick Imagick::setImage(Imagick replace ) + Replaces the current sequence +*/ +PHP_METHOD(Imagick, setImage) +{ + zval *objvar; + MagickBooleanType status; + php_imagick_object *intern, *replace; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &objvar, php_imagick_sc_entry) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + replace = Z_IMAGICK_P(objvar); + IMAGICK_NOT_EMPTY(replace); + + status = MagickSetImage(intern->magick_wand, replace->magick_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set the image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; + +} +/* }}} */ + +/* {{{ proto Imagick Imagick::getImage() + Returns a new Imagick object with the current image sequence. +*/ +PHP_METHOD(Imagick, getImage) +{ + MagickWand *tmp_wand; + php_imagick_object *intern, *intern_return; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + tmp_wand = MagickGetImage(intern->magick_wand); + + if (tmp_wand == NULL) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Get image failed" TSRMLS_CC); + RETURN_THROWS(); + } + + object_init_ex(return_value, php_imagick_sc_entry); + intern_return = Z_IMAGICK_P(return_value); + php_imagick_replace_magickwand(intern_return, tmp_wand); +} +/* }}} */ + +/* {{{ proto bool Imagick::addImage(Imagick source ) + Adds new image to Imagick object from the current position of the source object. +*/ +PHP_METHOD(Imagick, addImage) +{ + php_imagick_object *intern, *intern_add; + zval *add_obj; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &add_obj, php_imagick_sc_entry) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + intern_add = Z_IMAGICK_P(add_obj); + + IMAGICK_NOT_EMPTY(intern_add); + + status = MagickAddImage(intern->magick_wand, intern_add->magick_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to add image" TSRMLS_CC); + RETURN_THROWS(); + } + + MagickSetLastIterator(intern->magick_wand); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::newImage(int cols, int rows, ImagickPixel background, string format ) + Creates a new image and associates ImagickPixel value as background color +*/ +PHP_METHOD(Imagick, newImage) +{ + php_imagick_object *intern; + zval *param; + MagickBooleanType status; + im_long columns, rows; + char *format = NULL; + IM_LEN_TYPE format_len = 0; + PixelWand *color_wand; + zend_bool allocated; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llz|s!", &columns, &rows, ¶m, &format, &format_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + + color_wand = php_imagick_zval_to_pixelwand (param, IMAGICK_CLASS, &allocated TSRMLS_CC); + if (!color_wand) + return; + + status = MagickNewImage(intern->magick_wand, columns, rows, color_wand); + + if (allocated) + color_wand = DestroyPixelWand (color_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to create new image" TSRMLS_CC); + RETURN_THROWS(); + } + + /* If the optional fourth parameter was given + set the image format here */ + if (format != NULL && format_len > 0) { + + status = MagickSetImageFormat(intern->magick_wand, format); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set the image format" TSRMLS_CC); + RETURN_THROWS(); + } + } + + MagickSetLastIterator(intern->magick_wand); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::newPseudoImage(int cols, int rows, string pseudoString ) + Creates a new image using pseudo format +*/ +PHP_METHOD(Imagick, newPseudoImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + im_long columns, rows; + char *pseudo_string; + IM_LEN_TYPE pseudo_string_len; + struct php_imagick_file_t file = {0}; + php_imagick_rw_result_t rc; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lls", &columns, &rows, &pseudo_string, &pseudo_string_len) == FAILURE) { + RETURN_THROWS(); + } + + if (IMAGICK_G(allow_zero_dimension_images) == 0) { + if (columns == 0) { + php_error( + E_DEPRECATED, + "Creating images with zero columns is deprecated. If you think you need to " \ + "do this, please open an issue at https://phpimagick.com/issues" + ); + } + if (rows == 0) { + php_error( + E_DEPRECATED, + "Creating images with zero rows is deprecated. If you think you need to " \ + "do this, please open an issue at https://phpimagick.com/issues" + ); + } + } + + /* Allow only pseudo formats in this method */ + if (strchr (pseudo_string, ':') == NULL) { + php_imagick_throw_exception(IMAGICK_CLASS, "Invalid pseudo format string" TSRMLS_CC); + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + + /* Pseudo image needs a size set manually */ + status = MagickSetSize(intern->magick_wand, columns, rows); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to create new pseudo image" TSRMLS_CC); + RETURN_THROWS(); + } + + if (!php_imagick_file_init(&file, pseudo_string, pseudo_string_len TSRMLS_CC)) { + php_imagick_throw_exception(IMAGICK_CLASS, "Invalid filename provided" TSRMLS_CC); + RETURN_THROWS(); + } + rc = php_imagick_read_file(intern, &file, ImagickReadImage TSRMLS_CC); + php_imagick_file_deinit(&file); + + if (rc != IMAGICK_RW_OK) { + php_imagick_rw_fail_to_exception (intern->magick_wand, rc, pseudo_string TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::getImageTotalInkDensity() + Gets the image total ink density. +*/ +PHP_METHOD(Imagick, getImageTotalInkDensity) +{ + php_imagick_object *intern; + double ink_density; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + ink_density = MagickGetImageTotalInkDensity(intern->magick_wand); + RETVAL_DOUBLE(ink_density); +} +/* }}} */ + +/* {{{ proto bool Imagick::implodeImage(float radius ) + Creates a new image that is a copy of an existing one with the image pixels "implode" by the specified percentage. It allocates the memory necessary for the new Image structure and returns a pointer to the new image. +*/ +PHP_METHOD(Imagick, implodeImage) +{ + php_imagick_object *intern; + double radius; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &radius) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + +#if MagickLibVersion >= 0x700 + { + //TODO allow PixelInterpolateMethod be set + PixelInterpolateMethod method = BilinearInterpolatePixel; + status = MagickImplodeImage(intern->magick_wand, radius, method); + } +#else + status = MagickImplodeImage(intern->magick_wand, radius); +#endif + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to implode image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +#if MagickLibVersion >= 0x700 +/* {{{ proto bool Imagick::implodeImageWithMethod(float radius, int pixel_interpolate_method ) + Creates a new image that is a copy of an existing one with the image pixels "implode" by the specified percentage. It allocates the memory necessary for the new Image structure and returns a pointer to the new image. +*/ +PHP_METHOD(Imagick, implodeImageWithMethod) +{ + php_imagick_object *intern; + double radius; + im_long method; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dl", &radius, &method) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickImplodeImage(intern->magick_wand, radius, method); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to implode image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ +#endif // #if MagickLibVersion >= 0x700 + + +#if MagickLibVersion >= 0x658 +//Only stable as of 658 +//http://upstream-tracker.org/compat_reports/imagemagick/6.5.7.7_to_6.5.7.8/abi_compat_report.html + +/* {{{ proto bool Imagick::inverseFourierTransformImage(Imagick complement, bool magnitude) +*/ +PHP_METHOD(Imagick, inverseFourierTransformImage) +{ + php_imagick_object *intern, *intern_complement; + zval *complement_obj; + zend_bool magnitude; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ob", &complement_obj, php_imagick_sc_entry, &magnitude) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + intern_complement = Z_IMAGICK_P(complement_obj); + status = MagickInverseFourierTransformImage(intern->magick_wand, intern_complement->magick_wand, magnitude); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to inversefouriertransformimage image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ +#endif + +/* {{{ proto bool Imagick::levelImage(float blackPoint, float gamma, float whitePoint, int channel ) + 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. +*/ +PHP_METHOD(Imagick, levelImage) +{ + php_imagick_object *intern; + double black_point, gamma, white_point; + MagickBooleanType status; + im_long channel = IM_DEFAULT_CHANNEL; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddd|l", &black_point, &gamma, &white_point, &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickLevelImageChannel(intern->magick_wand, channel, black_point, gamma, white_point); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to level image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::magnifyImage() + Is a convenience method that scales an image proportionally to twice its original size. +*/ +PHP_METHOD(Imagick, magnifyImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickMagnifyImage(intern->magick_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to magnify image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 +/* {{{ proto bool Imagick::cycleColormapImage(Imagick map, bool dither) + Replaces the colors of an image with the closest color from a reference image. +*/ +PHP_METHOD(Imagick, mapImage) +{ + php_imagick_object *intern, *intern_map; + zval *map_obj; + zend_bool dither; + MagickBooleanType status; + + IMAGICK_METHOD_DEPRECATED ("Imagick", "mapImage"); + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ob", &map_obj, php_imagick_sc_entry, &dither) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + intern_map = Z_IMAGICK_P(map_obj); + status = MagickMapImage(intern->magick_wand, intern_map->magick_wand, dither); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to map image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ +#endif // #if MagickLibVersion < 0x700 + +#if MagickLibVersion < 0x700 +/* {{{ proto bool Imagick::matteFloodfillImage(float alpha,float fuzz,ImagickPixel bordercolor, int x, int y) + Changes the transparency value of any pixel that matches target and is an immediate neighbor +*/ +PHP_METHOD(Imagick, matteFloodfillImage) +{ + php_imagick_object *intern; + zval *param; + im_long x, y; + double alpha, fuzz; + MagickBooleanType status; + PixelWand *color_wand; + zend_bool allocated; + + IMAGICK_METHOD_DEPRECATED("Imagick", "matteFloodfillImage"); + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddzll", &alpha, &fuzz, ¶m, &x, &y) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + color_wand = php_imagick_zval_to_pixelwand (param, IMAGICK_CLASS, &allocated TSRMLS_CC); + if (!color_wand) + return; + + status = MagickMatteFloodfillImage(intern->magick_wand, alpha, fuzz, color_wand, x, y); + + if (allocated) + color_wand = DestroyPixelWand (color_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to matte floodfill image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ +#endif // #if MagickLibVersion < 0x700 +#endif + +#if MagickLibVersion < 0x700 +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +/* {{{ proto bool Imagick::medianFilterImage(float radius) + Applies a digital filter that improves the quality of a noisy image. Each pixel is replaced by the median in a set of neighboring pixels as defined by radius. +*/ +PHP_METHOD(Imagick, medianFilterImage) +{ + php_imagick_object *intern; + double radius; + MagickBooleanType status; + + IMAGICK_METHOD_DEPRECATED ("Imagick", "medianFilterImage"); + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &radius) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickMedianFilterImage(intern->magick_wand, radius); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to median filter image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ +#endif +#endif + +/* {{{ proto bool Imagick::negateImage(bool gray, int channel ) + Negates the colors in the reference image. The Grayscale option means that only grayscale values within the image are negated. +*/ +PHP_METHOD(Imagick, negateImage) +{ + php_imagick_object *intern; + zend_bool gray; + MagickBooleanType status; + im_long channel = IM_DEFAULT_CHANNEL; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b|l", &gray, &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickNegateImageChannel(intern->magick_wand, channel, gray); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to negate image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 +/* {{{ proto bool Imagick::paintOpaqueImage(ImagickPixel target, ImagickPixel fill, float fuzz, int channel) + Changes any pixel that matches color with the color defined by fill. Channel argument is supported in ImageMagick 6.2.8+. +*/ +PHP_METHOD(Imagick, paintOpaqueImage) +{ + php_imagick_object *intern; + zval *target_param, *fill_param; + double fuzz; + MagickBooleanType status; + im_long channel = DefaultChannels; + PixelWand *target_wand, *fill_wand; + zend_bool target_allocated = 0, fill_allocated = 0; + + IMAGICK_METHOD_DEPRECATED ("Imagick", "paintOpaqueImage"); + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zzd|l", &target_param, &fill_param, &fuzz, &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + + IMAGICK_NOT_EMPTY(intern); + + target_wand = php_imagick_zval_to_pixelwand (target_param, IMAGICK_CLASS, &target_allocated TSRMLS_CC); + if (!target_wand) + return; + + fill_wand = php_imagick_zval_to_pixelwand (fill_param, IMAGICK_CLASS, &fill_allocated TSRMLS_CC); + if (!fill_wand) { + if (target_allocated) + target_wand = DestroyPixelWand (target_wand); + return; + } + +#if MagickLibVersion > 0x628 + status = MagickPaintOpaqueImageChannel(intern->magick_wand, channel, target_wand, fill_wand, fuzz); +#else + status = MagickPaintOpaqueImage(intern->magick_wand, target_wand, fill_wand, fuzz); +#endif + + if (fill_allocated) + fill_wand = DestroyPixelWand (fill_wand); + + if (target_allocated) + target_wand = DestroyPixelWand (target_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable paint opaque image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ +#endif // #if MagickLibVersion < 0x700 +#endif + +#if MagickLibVersion > 0x628 +/* {{{ proto Imagick Imagick::optimizeImageLayers() + Compares each image the GIF disposed forms of the previous image in the sequence. From this it attempts to select the smallest cropped image to replace each frame, while preserving the results of the animation. +*/ +PHP_METHOD(Imagick, optimizeImageLayers) +{ + MagickWand *tmp_wand; + php_imagick_object *intern, *intern_return; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + tmp_wand = MagickOptimizeImageLayers(intern->magick_wand); + + if (tmp_wand == NULL) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Optimize image layers failed" TSRMLS_CC); + RETURN_THROWS(); + } + + object_init_ex(return_value, php_imagick_sc_entry); + intern_return = Z_IMAGICK_P(return_value); + php_imagick_replace_magickwand(intern_return, tmp_wand); +} +/* }}} */ + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 +/* {{{ proto bool Imagick::paintTransparentImage(ImagickPixel target, float alpha, float fuzz) + Changes any pixel that matches color with the color defined by fill. +*/ +PHP_METHOD(Imagick, paintTransparentImage) +{ + php_imagick_object *intern; + zval *param; + double alpha, fuzz; + MagickBooleanType status; + PixelWand *color_wand; + zend_bool allocated; + + IMAGICK_METHOD_DEPRECATED ("Imagick", "paintTransparentImage"); + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zdd", ¶m, &alpha, &fuzz) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + color_wand = php_imagick_zval_to_pixelwand (param, IMAGICK_CLASS, &allocated TSRMLS_CC); + if (!color_wand) + return; + + status = MagickPaintTransparentImage(intern->magick_wand, color_wand, alpha, fuzz); + + if (allocated) + color_wand = DestroyPixelWand (color_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to paint transparent image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ +#endif // #if MagickLibVersion < 0x700 +#endif +#endif + +/* {{{ proto Imagick Imagick::previewImages(int preview ) + Tiles 9 thumbnails of the specified image with an image processing operation applied at varying strengths. + This is helpful to quickly pin-point an appropriate parameter for an image processing operation. +*/ +PHP_METHOD(Imagick, previewImages) +{ + php_imagick_object *intern, *intern_return; + im_long preview; + MagickWand *tmp_wand; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &preview) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + tmp_wand = MagickPreviewImages(intern->magick_wand, preview); + + if (tmp_wand == NULL) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Preview images failed" TSRMLS_CC); + RETURN_THROWS(); + } + + object_init_ex(return_value, php_imagick_sc_entry); + intern_return = Z_IMAGICK_P(return_value); + php_imagick_replace_magickwand(intern_return, tmp_wand); +} +/* }}} */ + +/* {{{ proto bool Imagick::profileImage(string name, string|null 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. +*/ +PHP_METHOD(Imagick, profileImage) +{ + php_imagick_object *intern; + char *name, *profile; + IM_LEN_TYPE name_len, profile_len; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss!", &name, &name_len, &profile, &profile_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickProfileImage(intern->magick_wand, name, profile, profile_len); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to profile image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::quantizeImage(int numberColors, int colorspace, int treedepth, bool dither, + bool measureError) + Analyzes the colors within a reference image +*/ +PHP_METHOD(Imagick, quantizeImage) +{ + php_imagick_object *intern; + im_long number_colors, colorspace, tree_depth; + zend_bool dither, measure_error; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lllbb", &number_colors, &colorspace, &tree_depth, &dither, &measure_error) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickQuantizeImage(intern->magick_wand, number_colors, colorspace, tree_depth, dither, measure_error); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to quantize image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::quantizeImages(int number_colors, int colorspace, int treedepth, bool dither, + bool measure_error) + Analyzes the colors within a sequence of images +*/ +PHP_METHOD(Imagick, quantizeImages) +{ + php_imagick_object *intern; + im_long number_colors, colorspace, tree_depth; + zend_bool dither, measure_error; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lllbb", &number_colors, &colorspace, &tree_depth, &dither, &measure_error) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickQuantizeImages(intern->magick_wand, number_colors, colorspace, tree_depth, dither, measure_error); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to quantize images" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 +/* {{{ proto bool Imagick::reduceNoiseImage(float radius) + Smooths the contours of an image +*/ +PHP_METHOD(Imagick, reduceNoiseImage) +{ + php_imagick_object *intern; + double radius; + MagickBooleanType status; + + IMAGICK_METHOD_DEPRECATED ("Imagick", "reduceNoiseImage"); + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &radius) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickReduceNoiseImage(intern->magick_wand, radius); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to reduce image noise" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ +#endif +#endif + +/* {{{ proto string Imagick::removeImageProfile(string name) + Removes the named image profile and returns it +*/ +PHP_METHOD(Imagick, removeImageProfile) +{ + php_imagick_object *intern; + char *name; + unsigned char *profile; + IM_LEN_TYPE name_len; +#if MagickLibVersion < 0x628 + long profile_len; +#else + size_t profile_len; +#endif + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + profile = MagickRemoveImageProfile(intern->magick_wand, name, &profile_len); + + if (!profile) { + php_imagick_throw_exception(IMAGICK_CLASS, "The image profile does not exist" TSRMLS_CC); + RETURN_THROWS(); + } + + IM_ZVAL_STRING(return_value, (char *)profile); + IMAGICK_FREE_MAGICK_MEMORY(profile); +} +/* }}} */ + +/* {{{ proto bool Imagick::separateImageChannel(int channel) + Separates a channel from the image +*/ +PHP_METHOD(Imagick, separateImageChannel) +{ + php_imagick_object *intern; + im_long channel; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + +#if MagickLibVersion >= 0x700 + status = MagickSeparateImage(intern->magick_wand, channel); +#else + status = MagickSeparateImageChannel(intern->magick_wand, channel); +#endif + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to separate image channel" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::sepiaToneImage(float threshold) + Applies a special effect to the image +*/ +PHP_METHOD(Imagick, sepiaToneImage) +{ + php_imagick_object *intern; + double threshold; + double c_opacity; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &threshold) == FAILURE) { + RETURN_THROWS(); + } + + c_opacity = (threshold * QuantumRange) / 100; + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSepiaToneImage(intern->magick_wand, c_opacity); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to sepia tone image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +#if MagickLibVersion < 0x700 +/* {{{ proto bool Imagick::setImageBias(float bias) + Sets the image bias +*/ +static +void s_set_image_bias(INTERNAL_FUNCTION_PARAMETERS, zend_bool use_quantum) +{ + php_imagick_object *intern; + double bias; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &bias) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + if (use_quantum) { + bias *= QuantumRange; + } + + status = MagickSetImageBias(intern->magick_wand, bias); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image bias" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ +#endif // #if MagickLibVersion < 0x700 + + +/* {{{ proto bool Imagick::setImageBiasQuantum(float bias) + Sets the image bias. Bias should be scaled with 0 = no adjustment, 1 = quantum value +*/ +#if MagickLibVersion < 0x700 +PHP_METHOD(Imagick, setImageBiasQuantum) +{ + s_set_image_bias (INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); +} +#endif +/* }}} */ + + +/* {{{ proto bool Imagick::setImageBias(float bias) + Sets the image bias. Bias should be scaled with 0 = no adjustment, 2^^x = adjust black to white + where x = the quantum depth ImageMagick was compiled with +*/ +#if MagickLibVersion < 0x700 +PHP_METHOD(Imagick, setImageBias) +{ + s_set_image_bias (INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); +} +#endif +/* }}} */ + + + +/* {{{ proto bool Imagick::setImageBluePrimary(float x,float y) +For IM7 the prototype is +proto bool Imagick::setImageBluePrimary(float x, float y, float z) + + Sets the image chromaticity blue primary point +*/ +PHP_METHOD(Imagick, setImageBluePrimary) +{ + php_imagick_object *intern; + double x, y; +#if MagickLibVersion >= 0x700 + double z; +#endif + MagickBooleanType status; + + /* Parse parameters given to function */ +#if MagickLibVersion >= 0x700 + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddd", &x, &y, &z) == FAILURE) { +#else + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &x, &y) == FAILURE) { +#endif + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + +#if MagickLibVersion >= 0x700 + status = MagickSetImageBluePrimary(intern->magick_wand, x, y, z); +#else + status = MagickSetImageBluePrimary(intern->magick_wand, x, y); +#endif + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image blue primary" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::setImageBorderColor(ImagickPixel border) + Sets the image border color +*/ +PHP_METHOD(Imagick, setImageBorderColor) +{ + zval *param; + php_imagick_object *intern; + MagickBooleanType status; + PixelWand *color_wand; + zend_bool allocated; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", ¶m) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + + IMAGICK_NOT_EMPTY(intern); + + color_wand = php_imagick_zval_to_pixelwand (param, IMAGICK_CLASS, &allocated TSRMLS_CC); + if (!color_wand) + return; + + status = MagickSetImageBorderColor(intern->magick_wand, color_wand); + + if (allocated) + color_wand = DestroyPixelWand (color_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image border color" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::setImageChannelDepth(int channel, int depth) + Sets the depth of a particular image channel +*/ +PHP_METHOD(Imagick, setImageChannelDepth) +{ + php_imagick_object *intern; + im_long channel_type, depth; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &channel_type, &depth) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSetImageChannelDepth(intern->magick_wand, channel_type, depth); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image channel depth" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::setImageColormapColor(int index, ImagickPixel color) + Sets the color of the specified colormap index +*/ +PHP_METHOD(Imagick, setImageColormapColor) +{ + php_imagick_object *intern; + zval *param; + im_long index; + MagickBooleanType status; + PixelWand *color_wand; + zend_bool allocated; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lz", &index, ¶m) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + color_wand = php_imagick_zval_to_pixelwand (param, IMAGICK_CLASS, &allocated TSRMLS_CC); + if (!color_wand) + return; + + status = MagickSetImageColormapColor(intern->magick_wand, index, color_wand); + + if (allocated) + color_wand = DestroyPixelWand (color_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image color map color" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; + +} +/* }}} */ + +/* {{{ proto bool Imagick::setImageColorspace(int colorspace) + Sets the image colorspace +*/ +PHP_METHOD(Imagick, setImageColorspace) +{ + php_imagick_object *intern; + im_long colorspace; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &colorspace) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSetImageColorspace(intern->magick_wand, colorspace); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image colorspace" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::setImageDispose(int dispose) + Sets the image disposal method +*/ +PHP_METHOD(Imagick, setImageDispose) +{ + php_imagick_object *intern; + im_long dispose; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &dispose) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSetImageDispose(intern->magick_wand, dispose); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image dispose" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::setImageExtent(int columns, int rows) + Sets the image size +*/ +PHP_METHOD(Imagick, setImageExtent) +{ + php_imagick_object *intern; + im_long rows, columns; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &rows, &columns) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSetImageExtent(intern->magick_wand, rows, columns); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image extent" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::setImageGreenPrimary(float x, float y) +For IM7 the prototype is +proto bool Imagick::setImageGreenPrimary(float x, float y, float z) + Sets the image chromaticity green primary point +*/ +PHP_METHOD(Imagick, setImageGreenPrimary) +{ + php_imagick_object *intern; + double x, y; +#if MagickLibVersion >= 0x700 + double z; +#endif + MagickBooleanType status; + + + /* Parse parameters given to function */ +#if MagickLibVersion >= 0x700 + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddd", &x, &y, &z) == FAILURE) { +#else + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &x, &y) == FAILURE) { +#endif + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + +#if MagickLibVersion >= 0x700 + status = MagickSetImageGreenPrimary(intern->magick_wand, x, y, z); +#else + status = MagickSetImageGreenPrimary(intern->magick_wand, x, y); +#endif + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image green primary" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::setImageInterlaceScheme(int interlace_scheme) + Sets the image interlace scheme +*/ +PHP_METHOD(Imagick, setImageInterlaceScheme) +{ + php_imagick_object *intern; + im_long interlace; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &interlace) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSetImageInterlaceScheme(intern->magick_wand, interlace); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image interlace scheme" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::setImageProfile(string name, string profile) + Adds a named profile to the Imagick object +*/ +PHP_METHOD(Imagick, setImageProfile) +{ + php_imagick_object *intern; + char *name, *profile; + IM_LEN_TYPE profile_len, name_len; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &name_len, &profile, &profile_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSetImageProfile(intern->magick_wand, name, profile, profile_len); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image profile" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::setImageRedPrimary(float x,float y) +For IM7 the prototype is +proto bool Imagick::setImageRedPrimary(float x, float y, float z) + + Sets the image chromaticity red primary point. +*/ +PHP_METHOD(Imagick, setImageRedPrimary) +{ + php_imagick_object *intern; + double x, y; +#if MagickLibVersion >= 0x700 + double z; +#endif + MagickBooleanType status; + + /* Parse parameters given to function */ +#if MagickLibVersion >= 0x700 + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddd", &x, &y, &z) == FAILURE) { +#else + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &x, &y) == FAILURE) { +#endif + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + +#if MagickLibVersion >= 0x700 + status = MagickSetImageRedPrimary(intern->magick_wand, x, y, z); +#else + status = MagickSetImageRedPrimary(intern->magick_wand, x, y); +#endif + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image red primary" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::setImageRenderingIntent(int rendering_intent) + Sets the image rendering intent. +*/ +PHP_METHOD(Imagick, setImageRenderingIntent) +{ + php_imagick_object *intern; + im_long rendering_intent; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &rendering_intent) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSetImageRenderingIntent(intern->magick_wand, rendering_intent); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image rendering intent" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::setImageVirtualPixelMethod(int method) + Sets the image virtual pixel method. +*/ +PHP_METHOD(Imagick, setImageVirtualPixelMethod) +{ + php_imagick_object *intern; + im_long virtual_pixel; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &virtual_pixel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + MagickSetImageVirtualPixelMethod(intern->magick_wand, virtual_pixel); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::setImageWhitePoint(float x, float y) + +For IM7 the prototype is +proto bool Imagick::setImageWhitePoint(float x, float y, float z) + + Sets the image chromaticity white point. +*/ +PHP_METHOD(Imagick, setImageWhitePoint) +{ + php_imagick_object *intern; + double x, y; +#if MagickLibVersion >= 0x700 + double z; +#endif + MagickBooleanType status; + + /* Parse parameters given to function */ +#if MagickLibVersion >= 0x700 + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddd", &x, &y, &z) == FAILURE) { +#else + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &x, &y) == FAILURE) { +#endif + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + +#if MagickLibVersion >= 0x700 + status = MagickSetImageWhitePoint(intern->magick_wand, x, y, z); +#else + status = MagickSetImageWhitePoint(intern->magick_wand, x, y); +#endif + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image white point" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::sigmoidalContrastImage(bool sharpen, float contrast, float midpoint, int channel) + Adjusts the contrast of an image with a non-linear sigmoidal contrast algorithm. Increase the contrast of the image using a sigmoidal transfer function without saturating highlights or shadows. Contrast indicates how much to increase the contrast (0 is none; 3 is typical; 20 is pushing it); mid-point indicates where midtones fall in the resultant image (0 is white; 50 is middle-gray; 100 is black). Set sharpen to true to increase the image contrast otherwise the contrast is reduced. +*/ +PHP_METHOD(Imagick, sigmoidalContrastImage) +{ + php_imagick_object *intern; + zend_bool sharpen; + double contrast, midpoint; + MagickBooleanType status; + im_long channel = IM_DEFAULT_CHANNEL; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "bdd|l", &sharpen, &contrast, &midpoint, &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSigmoidalContrastImageChannel(intern->magick_wand, channel, sharpen, contrast, midpoint); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to sigmoidal contrast image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::stereoImage(Imagick offset_wand) + Composites two images and produces a single image that is the composite of a left and right image of a stereo pair +*/ +PHP_METHOD(Imagick, stereoImage) +{ + MagickWand *tmp_wand; + zval *magick_object; + php_imagick_object *intern, *intern_second, *intern_return; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &magick_object, php_imagick_sc_entry) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + intern_second = Z_IMAGICK_P(magick_object); + IMAGICK_NOT_EMPTY(intern_second); + + tmp_wand = MagickStereoImage(intern->magick_wand, intern_second->magick_wand); + + if (tmp_wand == NULL) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Stereo image failed" TSRMLS_CC); + RETURN_THROWS(); + } + + object_init_ex(return_value, php_imagick_sc_entry); + intern_return = Z_IMAGICK_P(return_value); + php_imagick_replace_magickwand(intern_return, tmp_wand); +} +/* }}} */ + +/* {{{ proto Imagick Imagick::textureImage(Imagick texture_wand) + Repeatedly tiles the texture image across and down the image canvas. +*/ +PHP_METHOD(Imagick, textureImage) +{ + MagickWand *tmp_wand; + zval *magick_object; + php_imagick_object *intern, *intern_second, *intern_return; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &magick_object, php_imagick_sc_entry) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + intern_second = Z_IMAGICK_P(magick_object); + IMAGICK_NOT_EMPTY(intern_second); + + tmp_wand = MagickTextureImage(intern->magick_wand, intern_second->magick_wand); + + if (!tmp_wand) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Texture image failed" TSRMLS_CC); + RETURN_THROWS(); + } + + object_init_ex(return_value, php_imagick_sc_entry); + intern_return = Z_IMAGICK_P(return_value); + php_imagick_replace_magickwand(intern_return, tmp_wand); +} +/* }}} */ + +/* {{{ proto bool Imagick::tintImage(ImagickPixel tint, ImagickPixel opacity, bool legacy = false) + Applies a color vector to each pixel in the image. The 'opacity' color is a per channel + strength factor for how strongly the color should be applied. If legacy is true, the behaviour + of this function is incorrect, but consistent with how it behaved before Imagick version 3.4.0 +*/ +PHP_METHOD(Imagick, tintImage) +{ + php_imagick_object *intern; + zval *tint_param, *opacity_param; + MagickBooleanType status; + PixelWand *tint_wand, *opacity_wand; + zend_bool tint_allocated, opacity_allocated; + zend_bool legacy = 0; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz|b", &tint_param, &opacity_param, &legacy) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + tint_wand = php_imagick_zval_to_pixelwand (tint_param, IMAGICK_CLASS, &tint_allocated TSRMLS_CC); + if (!tint_wand) + return; + + if (legacy) { + opacity_wand = php_imagick_zval_to_opacity(opacity_param, IMAGICK_CLASS, &opacity_allocated TSRMLS_CC); + } + else { + opacity_wand = php_imagick_zval_to_pixelwand(opacity_param, IMAGICK_CLASS, &opacity_allocated TSRMLS_CC); + } + + + if (!opacity_wand) { + if (tint_allocated) + tint_wand = DestroyPixelWand (tint_wand); + return; + } + + status = MagickTintImage(intern->magick_wand, tint_wand, opacity_wand); + + if (tint_allocated) + tint_wand = DestroyPixelWand (tint_wand); + + if (opacity_allocated) + opacity_wand = DestroyPixelWand (opacity_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable tint image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::unsharpMaskImage(float radius, float sigma, float amount, float threshold, int channel) + Sharpens an image. 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 Imagick::UnsharpMaskImage() selects a suitable radius for you. +*/ +PHP_METHOD(Imagick, unsharpMaskImage) +{ + php_imagick_object *intern; + double radius, sigma, amount, threshold; + MagickBooleanType status; + im_long channel = IM_DEFAULT_CHANNEL; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddd|l", &radius, &sigma, &amount, &threshold, &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickUnsharpMaskImageChannel(intern->magick_wand, channel, radius, sigma, amount, threshold); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to unsharp mask image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + + + + +#if MagickLibVersion >= 0x700 + +/* {{{ proto bool Imagick::convolveImage(ImagickKernel kernel, int channel) + Applies a custom convolution kernel to the image. +*/ +PHP_METHOD(Imagick, convolveImage) +{ + zval *objvar; + php_imagick_object *intern; + php_imagickkernel_object *kernel; + MagickBooleanType status; + im_long channel = IM_DEFAULT_CHANNEL; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|l", &objvar, php_imagickkernel_sc_entry, &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + kernel = Z_IMAGICKKERNEL_P(objvar); + + IMAGICK_KERNEL_NOT_NULL_EMPTY(kernel); + status = MagickConvolveImageChannel(intern->magick_wand, channel, kernel->kernel_info); + + // No magick is going to happen + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Failed to filter image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} + +#else + +/* {{{ proto bool Imagick::convolveImage(array kernel, int channel) + Applies a custom convolution kernel to the image. +*/ +PHP_METHOD(Imagick, convolveImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + zval *kernel_array; + double *kernel; + im_long channel = DefaultChannels; + unsigned long order = 0; + im_long num_elements = 0; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|l", &kernel_array, &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + kernel = php_imagick_zval_to_double_array(kernel_array, &num_elements TSRMLS_CC); + + if (!kernel) { + php_imagick_throw_exception(IMAGICK_CLASS, "Unable to read matrix array" TSRMLS_CC); + RETURN_THROWS(); + } + + order = (unsigned long) sqrt(num_elements); + status = MagickConvolveImageChannel(intern->magick_wand, channel, order, kernel); + efree(kernel); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to convolve image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif + +/* {{{ proto bool Imagick::cycleColormapImage(int displace) + Displaces an image's colormap by a given number of positions. If you cycle the colormap a number of times you can produce a psychodelic effect. +*/ +PHP_METHOD(Imagick, cycleColormapImage) +{ + php_imagick_object *intern; + im_long displace; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &displace) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickCycleColormapImage(intern->magick_wand, displace); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to cycle image colormap" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto Imagick Imagick::deconstructImages() + Compares each image with the next in a sequence and returns the maximum bounding region of any pixel differences it discovers. +*/ +PHP_METHOD(Imagick, deconstructImages) +{ + MagickWand *tmp_wand; + php_imagick_object *intern, *intern_return; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + tmp_wand = MagickDeconstructImages(intern->magick_wand); + + if (tmp_wand == NULL) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Deconstruct image failed" TSRMLS_CC); + RETURN_THROWS(); + } + + object_init_ex(return_value, php_imagick_sc_entry); + intern_return = Z_IMAGICK_P(return_value); + php_imagick_replace_magickwand(intern_return, tmp_wand); +} +/* }}} */ + +/* {{{ proto Imagick Imagick::getImageRegion(int width, int height, int x, int y) + Extracts a region of the image and returns it as a new image. +*/ +PHP_METHOD(Imagick, getImageRegion) +{ + MagickWand *tmp_wand; + php_imagick_object *intern, *intern_return; + im_long width, height, x, y; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llll", &width, &height, &x, &y) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + tmp_wand = MagickGetImageRegion(intern->magick_wand, width, height, x, y); + + if (tmp_wand == NULL) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Get image region failed" TSRMLS_CC); + RETURN_THROWS(); + } + + object_init_ex(return_value, php_imagick_sc_entry); + intern_return = Z_IMAGICK_P(return_value); + php_imagick_replace_magickwand(intern_return, tmp_wand); +} +/* }}} */ + +/* {{{ proto bool Imagick::despeckleImage() + Reduces the speckle noise in an image while perserving the edges of the original image. +*/ +PHP_METHOD(Imagick, despeckleImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickDespeckleImage(intern->magick_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to despeckle image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::edgeImage(float radius) + Enhance edges within the image with a convolution filter of the given radius. Use a radius of 0 and Edge() selects a suitable radius for you. +*/ +PHP_METHOD(Imagick, edgeImage) +{ + php_imagick_object *intern; + double radius; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &radius) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickEdgeImage(intern->magick_wand, radius); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to edge image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; + +} +/* }}} */ + +/* {{{ proto bool Imagick::embossImage(float radius, float sigma) + Returns a grayscale image with a three-dimensional effect. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, radius should be larger than sigma. Use a radius of 0 and it will choose a suitable radius for you. +*/ +PHP_METHOD(Imagick, embossImage) +{ + php_imagick_object *intern; + double radius, sigma; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &radius, &sigma) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickEmbossImage(intern->magick_wand, radius, sigma); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to emboss image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::enhanceImage() + Applies a digital filter that improves the quality of a noisy image. +*/ +PHP_METHOD(Imagick, enhanceImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickEnhanceImage(intern->magick_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to enhance image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::equalizeImage() + Equalizes the image histogram. +*/ +PHP_METHOD(Imagick, equalizeImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickEqualizeImage(intern->magick_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to equalize image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::evaluateImage(int op, float constant, int channel) + Applys an arithmetic, relational, or logical expression to an image. Use these operators to lighten or darken an image, to increase or decrease contrast in an image, or to produce the "negative" of an image. +*/ +PHP_METHOD(Imagick, evaluateImage) +{ + php_imagick_object *intern; + im_long evaluate_operator; + double constant; + MagickBooleanType status; + im_long channel = IM_DEFAULT_CHANNEL; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ld|l", &evaluate_operator, &constant, &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickEvaluateImageChannel(intern->magick_wand, channel, evaluate_operator, constant); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to evaluate image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + + +#if MagickLibVersion >= 0x687 +/* {{{ proto Imagick Imagick::evaluateImages(int EVALUATE_CONSTANT) + Merge multiple images of the same size together with the selected operator. +http://www.imagemagick.org/Usage/layers/#evaluate-sequence +*/ +PHP_METHOD(Imagick, evaluateImages) +{ + php_imagick_object *intern, *intern_return; + im_long evaluate_operator; + MagickBooleanType status; + MagickWand *evaluated_wand; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &evaluate_operator) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + +// MagickEvaluateImages appears to crash if index is not zero. +#if MagickLibVersion > 0x628 + /* Get the current iterator position */ + status = MagickSetIteratorIndex(intern->magick_wand, 0); +#else + status = MagickSetImageIndex(intern->magick_wand, 0); +#endif + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set iterator index" TSRMLS_CC); + RETURN_THROWS(); + } + + evaluated_wand = MagickEvaluateImages(intern->magick_wand, evaluate_operator); + + object_init_ex(return_value, php_imagick_sc_entry); + intern_return = Z_IMAGICK_P(return_value); + php_imagick_replace_magickwand(intern_return, evaluated_wand); +} +/* }}} */ +#endif //MagickLibVersion >= 0x687 + +#if MagickLibVersion > 0x655 + +/* {{{ proto bool Imagick::forwardfouriertransformimage(bool magnitude) + //http://www.fftw.org/ + yum install fftw-devel fftw + ./configure --enable-hdri +*/ +PHP_METHOD(Imagick, forwardFourierTransformImage) +{ + php_imagick_object *intern; + zend_bool magnitude; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &magnitude) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickForwardFourierTransformImage(intern->magick_wand, magnitude); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to forwardfouriertransformimage image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +#endif + + +/* {{{ proto array Imagick::getImageGeometry() + Returns the width and height as an associative array. +*/ +PHP_METHOD(Imagick, getImageGeometry) +{ + long width,height; + php_imagick_object *intern; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + + IMAGICK_NOT_EMPTY(intern); + + width = MagickGetImageWidth(intern->magick_wand); + height = MagickGetImageHeight(intern->magick_wand); + + array_init(return_value); + add_assoc_long(return_value, "width", width); + add_assoc_long(return_value, "height", height); +} +/* }}} */ + +#if MagickLibVersion < 0x700 +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +/* {{{ proto ImagickPixel Imagick::getImageAttribute(string key ) + Returns a named attribute +*/ +PHP_METHOD(Imagick, getImageAttribute) +{ + php_imagick_object *intern; + char *key, *attribute; + IM_LEN_TYPE key_len; + + IMAGICK_METHOD_DEPRECATED("Imagick", "getImageAttribute"); + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &key, &key_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + attribute = MagickGetImageAttribute(intern->magick_wand, key); + + if (!attribute) { + RETURN_FALSE; + } + + IM_ZVAL_STRING(return_value, attribute); + IMAGICK_FREE_MAGICK_MEMORY(attribute); +} +/* }}} */ +#endif +#endif + +/* {{{ proto ImagickPixel Imagick::getImageBackgroundColor() + Returns the image background color. +*/ +PHP_METHOD(Imagick, getImageBackgroundColor) +{ + php_imagick_object *intern; + php_imagickpixel_object *internp; + MagickBooleanType status; + PixelWand *tmp_wand; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + tmp_wand = NewPixelWand(); + status = MagickGetImageBackgroundColor(intern->magick_wand, tmp_wand); + + if (tmp_wand == (PixelWand *)NULL) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image background color" TSRMLS_CC); + RETURN_THROWS(); + } + + if (status == MagickFalse) { + tmp_wand = DestroyPixelWand(tmp_wand); + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image background color" TSRMLS_CC); + RETURN_THROWS(); + } + + object_init_ex(return_value, php_imagickpixel_sc_entry); + internp = Z_IMAGICKPIXEL_P(return_value); + php_imagick_replace_pixelwand(internp, tmp_wand); +} +/* }}} */ + +/* {{{ proto array Imagick::getImageBluePrimary() + Returns the chromaticy green primary point. IM6: Returns an array with the keys "x" and "y". + IM7: Returns an array with the keys "x", "y" and "z". +*/ +PHP_METHOD(Imagick, getImageBluePrimary) +{ + php_imagick_object *intern; + MagickBooleanType status; + double x, y; +#if MagickLibVersion >= 0x700 + double z; +#endif + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + +#if MagickLibVersion >= 0x700 + status = MagickGetImageBluePrimary(intern->magick_wand, &x, &y, &z); +#else + status = MagickGetImageBluePrimary(intern->magick_wand, &x, &y); +#endif + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image blue primary" TSRMLS_CC); + RETURN_THROWS(); + } + + array_init(return_value); + add_assoc_double(return_value, "x", x); + add_assoc_double(return_value, "y", y); +#if MagickLibVersion >= 0x700 + add_assoc_double(return_value, "z", z); +#endif +} +/* }}} */ + +/* {{{ proto ImagickPixel Imagick::getImageBorderColor() + Returns the image border color. +*/ +PHP_METHOD(Imagick, getImageBorderColor) +{ + php_imagick_object *intern; + php_imagickpixel_object *internp; + MagickBooleanType status; + PixelWand *tmp_wand; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + tmp_wand = NewPixelWand(); + status = MagickGetImageBorderColor(intern->magick_wand, tmp_wand); + + if (tmp_wand == (PixelWand *)NULL) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image border color" TSRMLS_CC); + RETURN_THROWS(); + } + + if (status == MagickFalse) { + tmp_wand = DestroyPixelWand(tmp_wand); + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image border color" TSRMLS_CC); + RETURN_THROWS(); + } + + object_init_ex(return_value, php_imagickpixel_sc_entry); + internp = Z_IMAGICKPIXEL_P(return_value); + php_imagick_replace_pixelwand(internp, tmp_wand); +} +/* }}} */ + +/* {{{ proto int Imagick::getImageChannelDepth() + Gets the depth for a particular image channel. +*/ +PHP_METHOD(Imagick, getImageChannelDepth) +{ + php_imagick_object *intern; + im_long channel_type, channel_depth; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &channel_type) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + channel_depth = MagickGetImageChannelDepth(intern->magick_wand, channel_type); + RETVAL_LONG(channel_depth); +} +/* }}} */ + +/* {{{ proto float Imagick::getImageChannelDistortion(Imagick reference, int channel, int metric) + Compares one or more image channels of an image to a reconstructed image and returns the specified distortion metric. +*/ +PHP_METHOD(Imagick, getImageChannelDistortion) +{ + zval *objvar; + php_imagick_object *intern, *intern_second; + im_long channel_type, metric_type; + double distortion; + MagickBooleanType status; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Oll", &objvar, php_imagick_sc_entry, &channel_type, &metric_type) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + intern_second = Z_IMAGICK_P(objvar); + IMAGICK_NOT_EMPTY(intern_second); + + status = MagickGetImageChannelDistortion(intern->magick_wand, intern_second->magick_wand, channel_type, metric_type, &distortion); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image channel distortion" TSRMLS_CC); + RETURN_THROWS(); + } + + RETVAL_DOUBLE(distortion); + +} +/* }}} */ + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 +/* {{{ proto array Imagick::getImageChannelExtrema(int channel) + Gets the extrema for one or more image channels. Return value is an associative array with the keys "minima" and "maxima". +*/ +PHP_METHOD(Imagick, getImageChannelExtrema) +{ + php_imagick_object *intern; + im_long channel_type; + size_t minima, maxima; + MagickBooleanType status; + + IMAGICK_METHOD_DEPRECATED ("Imagick", "getImageChannelExtrema"); + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &channel_type) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickGetImageChannelExtrema(intern->magick_wand, channel_type, &minima, &maxima); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image channel extrema" TSRMLS_CC); + RETURN_THROWS(); + } + + array_init(return_value); + add_assoc_long(return_value, "minima", minima); + add_assoc_long(return_value, "maxima", maxima); +} +/* }}} */ +#endif //#if MagickLibVersion < 0x700 +#endif + +/* {{{ proto array Imagick::getImageChannelMean(int channel) + Gets the mean and standard deviation of one or more image channels. Return value is an associative array with the keys "mean" and "standardDeviation". +*/ +PHP_METHOD(Imagick, getImageChannelMean) +{ + php_imagick_object *intern; + im_long channel_type; + double mean, standard_deviation; + MagickBooleanType status; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &channel_type) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickGetImageChannelMean(intern->magick_wand, channel_type, &mean, &standard_deviation); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image channel mean" TSRMLS_CC); + RETURN_THROWS(); + } + + array_init(return_value); + add_assoc_double(return_value, "mean", mean); + add_assoc_double(return_value, "standardDeviation", standard_deviation); +} +/* }}} */ + +/* {{{ proto array Imagick::getImageChannelStatistics() + Returns statistics for each channel in the image. The statistics incude the channel depth, its minima and maxima, the mean, and the standard deviation. You can access the red channel mean, for example, like this: +*/ +PHP_METHOD(Imagick, getImageChannelStatistics) +{ +#if PHP_VERSION_ID >= 70000 + zval tmp; +#else + zval *tmp; +#endif + + const long channels = { + UndefinedChannel, RedChannel, CyanChannel, + GreenChannel, MagentaChannel, BlueChannel, + YellowChannel, OpacityChannel, BlackChannel, +#if MagickLibVersion < 0x700 + MatteChannel +#endif + }; + php_imagick_object *intern; + ChannelStatistics *statistics; + unsigned int i; +#if MagickLibVersion < 0x700 + unsigned int elements = 10; +#endif // #if MagickLibVersion >= 0x700 + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + +#if MagickLibVersion >= 0x700 + statistics = MagickGetImageStatistics(intern->magick_wand); +#else + statistics = MagickGetImageChannelStatistics(intern->magick_wand); +#endif + + array_init(return_value); + +#if MagickLibVersion >= 0x700 + for (i=0; i < sizeof(channels)/sizeof(channels0); i++) { +#if PHP_VERSION_ID >= 70000 + array_init(&tmp); + add_assoc_double(&tmp, "mean", statisticsi.mean); + add_assoc_double(&tmp, "minima", statisticsi.minima); + add_assoc_double(&tmp, "maxima", statisticsi.maxima); + add_assoc_double(&tmp, "standardDeviation", statisticsi.standard_deviation); +#if MagickLibVersion < 0x635 + add_assoc_long(&tmp, "scale", statisticsi.scale); +#endif //0x635 + add_assoc_long(&tmp, "depth", statisticsi.depth); + add_index_zval(return_value, i, &tmp); +#else //not ZE3 + MAKE_STD_ZVAL(tmp); + array_init(tmp); + add_assoc_double(tmp, "mean", statisticsi.mean); + add_assoc_double(tmp, "minima", statisticsi.minima); + add_assoc_double(tmp, "maxima", statisticsi.maxima); + add_assoc_double(tmp, "standardDeviation", statisticsi.standard_deviation); +#if MagickLibVersion < 0x635 + add_assoc_long(&tmp, "scale", statisticsi.scale); +#endif //0x635 + add_assoc_long(tmp, "depth", statisticsi.depth); + add_index_zval(return_value, channelsi, tmp); +#endif //end ZE3 + } +#else //below MagickLibVersion>= 0x700 + for (i = 0; i < elements ; i++) { +#if PHP_VERSION_ID >= 70000 + array_init(&tmp); + add_assoc_double(&tmp, "mean", statisticschannelsi.mean); + add_assoc_double(&tmp, "minima", statisticschannelsi.minima); + add_assoc_double(&tmp, "maxima", statisticschannelsi.maxima); + add_assoc_double(&tmp, "standardDeviation", statisticschannelsi.standard_deviation); +#if MagickLibVersion < 0x635 + add_assoc_long(&tmp, "scale", statisticschannelsi.scale); +#endif + add_assoc_long(&tmp, "depth", statisticschannelsi.depth); + add_index_zval(return_value, channelsi, &tmp); +#else + MAKE_STD_ZVAL(tmp); + array_init(tmp); + add_assoc_double(tmp, "mean", statisticschannelsi.mean); + add_assoc_double(tmp, "minima", statisticschannelsi.minima); + add_assoc_double(tmp, "maxima", statisticschannelsi.maxima); + add_assoc_double(tmp, "standardDeviation", statisticschannelsi.standard_deviation); +#if MagickLibVersion < 0x635 + add_assoc_long(&tmp, "scale", statisticschannelsi.scale); +#endif + add_assoc_long(tmp, "depth", statisticschannelsi.depth); + add_index_zval(return_value, channelsi, tmp); +#endif + + } +#endif + +//etc. +// channel_statisticsi.sum_squared*=area; +// channel_statisticsi.sum_cubed*=area; +// channel_statisticsi.sum_fourth_power*=area; + + MagickRelinquishMemory(statistics); +} +/* }}} */ + +/* {{{ proto ImagickPixel Imagick::getImageColormapColor(int index, ImagickPixel color) + Returns the color of the specified colormap index. +*/ +PHP_METHOD(Imagick, getImageColormapColor) +{ + php_imagick_object *intern; + php_imagickpixel_object *internp; + MagickBooleanType status; + PixelWand *tmp_wand; + im_long index; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &index) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + tmp_wand = NewPixelWand(); + status = MagickGetImageColormapColor(intern->magick_wand, index , tmp_wand); + + if (tmp_wand == (PixelWand *)NULL) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image colormap color" TSRMLS_CC); + RETURN_THROWS(); + } + + if (status == MagickFalse) { + tmp_wand = DestroyPixelWand(tmp_wand); + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image colormap color" TSRMLS_CC); + RETURN_THROWS(); + } + + object_init_ex(return_value, php_imagickpixel_sc_entry); + internp = Z_IMAGICKPIXEL_P(return_value); + php_imagick_replace_pixelwand(internp, tmp_wand); +} +/* }}} */ + +/* {{{ proto int Imagick::getImageColorspace() + Gets the image colorspace. +*/ +PHP_METHOD(Imagick, getImageColorspace) +{ + php_imagick_object *intern; + long colorSpace; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + colorSpace = MagickGetImageColorspace(intern->magick_wand); + RETVAL_LONG(colorSpace); +} +/* }}} */ + +/* {{{ proto int Imagick::getImageCompose() + Returns the composite operator associated with the image. +*/ +PHP_METHOD(Imagick, getImageCompose) +{ + php_imagick_object *intern; + long composite; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + composite = MagickGetImageCompose(intern->magick_wand); + RETVAL_LONG(composite); +} +/* }}} */ + +/* {{{ proto int Imagick::getImageDelay() + Gets the image delay. +*/ +PHP_METHOD(Imagick, getImageDelay) +{ + php_imagick_object *intern; + long delay; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + delay = MagickGetImageDelay(intern->magick_wand); + RETVAL_LONG(delay); +} +/* }}} */ + +/* {{{ proto int Imagick::getImageDepth() + Gets the image depth. +*/ +PHP_METHOD(Imagick, getImageDepth) +{ + php_imagick_object *intern; + long depth; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + depth = MagickGetImageDepth(intern->magick_wand); + RETVAL_LONG(depth); +} +/* }}} */ + +/* {{{ proto float Imagick::getImageDistortion(MagickWand reference, int metric) + Compares an image to a reconstructed image and returns the specified distortion metric. +*/ +PHP_METHOD(Imagick, getImageDistortion) +{ + zval *objvar; + php_imagick_object *intern, *intern_second; + im_long metric_type; + double distortion; + MagickBooleanType status; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ol", &objvar, php_imagick_sc_entry, &metric_type) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + intern_second = Z_IMAGICK_P(objvar); + IMAGICK_NOT_EMPTY(intern_second); + + status = MagickGetImageDistortion(intern->magick_wand, intern_second->magick_wand, metric_type, &distortion); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image distortion" TSRMLS_CC); + RETURN_THROWS(); + } + + RETVAL_DOUBLE(distortion); +} +/* }}} */ + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 +/* {{{ proto array Imagick::getImageExtrema() + Gets the extrema for the image. Returns an associative array with the keys "min" and "max". +*/ +PHP_METHOD(Imagick, getImageExtrema) +{ + php_imagick_object *intern; + size_t min, max; + MagickBooleanType status; + + IMAGICK_METHOD_DEPRECATED ("Imagick", "getImageExtrema"); + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickGetImageExtrema(intern->magick_wand, &min, &max); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image extrema" TSRMLS_CC); + RETURN_THROWS(); + } + + array_init(return_value); + add_assoc_long(return_value, "min", min); + add_assoc_long(return_value, "max", max); +} +/* }}} */ +#endif //#if MagickLibVersion < 0x700 +#endif + +/* {{{ proto long Imagick::getImageDispose() + Gets the image disposal method. +*/ +PHP_METHOD(Imagick, getImageDispose) +{ + php_imagick_object *intern; + long dispose; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + dispose = MagickGetImageDispose(intern->magick_wand); + RETVAL_LONG(dispose); +} +/* }}} */ + +/* {{{ proto float Imagick::getImageGamma() + Gets the image gamma. +*/ +PHP_METHOD(Imagick, getImageGamma) +{ + php_imagick_object *intern; + double gamma; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + gamma = MagickGetImageGamma(intern->magick_wand); + RETVAL_DOUBLE(gamma); +} +/* }}} */ + +/* {{{ proto array Imagick::getImageGreenPrimary() + Returns the chromaticy green primary point. IM6: Returns an array with the keys "x" and "y". + IM7: Returns an array with the keys "x", "y" and "z". +*/ +PHP_METHOD(Imagick, getImageGreenPrimary) +{ + php_imagick_object *intern; + double x, y; +#if MagickLibVersion >= 0x700 + double z; +#endif + MagickBooleanType status; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + +#if MagickLibVersion >= 0x700 + status = MagickGetImageGreenPrimary(intern->magick_wand, &x, &y, &z); +#else + status = MagickGetImageGreenPrimary(intern->magick_wand, &x, &y); +#endif + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image green primary" TSRMLS_CC); + RETURN_THROWS(); + } + + array_init(return_value); + add_assoc_double(return_value, "x", x); + add_assoc_double(return_value, "y", y); +#if MagickLibVersion >= 0x700 + add_assoc_double(return_value, "z", z); +#endif +} +/* }}} */ + +/* {{{ proto int Imagick::getImageHeight() + Returns the image height. +*/ +PHP_METHOD(Imagick, getImageHeight) +{ + php_imagick_object *intern; + long height; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + height = MagickGetImageHeight(intern->magick_wand); + RETVAL_LONG(height); +} +/* }}} */ + +/* {{{ proto array Imagick::getImageHistogram() + Returns the image histogram as an array of ImagickPixel objects. +*/ +PHP_METHOD(Imagick, getImageHistogram) +{ + php_imagick_object *intern; + php_imagickpixel_object *internp; + PixelWand **wand_array; + size_t colors = 0; + unsigned long i; +#if PHP_VERSION_ID >= 70000 + zval tmp_pixelwand; +#else + zval *tmp_pixelwand; +#endif + + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + wand_array = MagickGetImageHistogram(intern->magick_wand, &colors); + array_init(return_value); + + for (i = 0; i < colors; i++) { + if (wand_arrayi) { +#if PHP_VERSION_ID >= 70000 + object_init_ex(&tmp_pixelwand, php_imagickpixel_sc_entry); + internp = Z_IMAGICKPIXEL_P(&tmp_pixelwand); + php_imagick_replace_pixelwand(internp, wand_arrayi); + add_next_index_zval(return_value, &tmp_pixelwand); +#else + MAKE_STD_ZVAL(tmp_pixelwand); + object_init_ex(tmp_pixelwand, php_imagickpixel_sc_entry); + internp = (php_imagickpixel_object *)zend_object_store_get_object(tmp_pixelwand TSRMLS_CC); + php_imagick_replace_pixelwand(internp, wand_arrayi); + add_next_index_zval(return_value, tmp_pixelwand); +#endif + } + } + + IMAGICK_FREE_MAGICK_MEMORY(wand_array); +} +/* }}} */ + +/* {{{ proto int Imagick::getImageInterlaceScheme() + Gets the image interlace scheme. +*/ +PHP_METHOD(Imagick, getImageInterlaceScheme) +{ + php_imagick_object *intern; + long interlace; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + interlace = MagickGetImageInterlaceScheme(intern->magick_wand); + RETVAL_LONG(interlace); +} +/* }}} */ + +/* {{{ proto int Imagick::getImageIterations() + Gets the image iterations. +*/ +PHP_METHOD(Imagick, getImageIterations) +{ + php_imagick_object *intern; + long iterations; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + iterations = MagickGetImageIterations(intern->magick_wand); + RETVAL_LONG(iterations); +} +/* }}} */ + +#if MagickLibVersion < 0x700 +/* {{{ proto ImagickPixel Imagick::getImageMatteColor() + Returns the image matte color. +*/ +PHP_METHOD(Imagick, getImageMatteColor) +{ + php_imagick_object *intern; + php_imagickpixel_object *internp; + MagickBooleanType status; + PixelWand *tmp_wand; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + tmp_wand = NewPixelWand(); + status = MagickGetImageMatteColor(intern->magick_wand, tmp_wand); + + if (tmp_wand == (PixelWand *)NULL) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image matte color" TSRMLS_CC); + RETURN_THROWS(); + } + + if (status == MagickFalse) { + tmp_wand = DestroyPixelWand(tmp_wand); + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable get image matter color" TSRMLS_CC); + RETURN_THROWS(); + } + + object_init_ex(return_value, php_imagickpixel_sc_entry); + internp = Z_IMAGICKPIXEL_P(return_value); + php_imagick_replace_pixelwand(internp, tmp_wand); +} +/* }}} */ +#endif //#if MagickLibVersion < 0x700 + +/* {{{ proto array Imagick::getImagePage() + Returns the page geometry associated with the image in an array with the keys "width", "height", "x", and "y". +*/ +PHP_METHOD(Imagick, getImagePage) +{ + php_imagick_object *intern; + MagickBooleanType status; + size_t width, height; + ssize_t x, y; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickGetImagePage(intern->magick_wand, &width, &height, &x, &y); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image page" TSRMLS_CC); + RETURN_THROWS(); + } + + array_init(return_value); + + add_assoc_long(return_value, "width", width); + add_assoc_long(return_value, "height", height); + add_assoc_long(return_value, "x", x); + add_assoc_long(return_value, "y", y); +} +/* }}} */ + +/* {{{ proto ImagickPixel Imagick::getImagePixelColor(int x, int y) + Returns the color of the specified pixel. +*/ +PHP_METHOD(Imagick, getImagePixelColor) +{ + php_imagick_object *intern; + php_imagickpixel_object *internp; + MagickBooleanType status; + PixelWand *tmp_wand; + im_long x, y; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &x, &y) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + tmp_wand = NewPixelWand(); + + if (!tmp_wand) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Failed to allocate new PixelWand" TSRMLS_CC); + RETURN_THROWS(); + } + + status = MagickGetImagePixelColor(intern->magick_wand, x, y , tmp_wand); + + if (status == MagickFalse) { + tmp_wand = DestroyPixelWand(tmp_wand); + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable get image pixel color" TSRMLS_CC); + RETURN_THROWS(); + } + + object_init_ex(return_value, php_imagickpixel_sc_entry); + internp = Z_IMAGICKPIXEL_P(return_value); + php_imagick_replace_pixelwand(internp, tmp_wand); +} +/* }}} */ + + +#if IM_HAVE_IMAGICK_SETIMAGEPIXELCOLOR +/* {{{ proto void setImagePixelColor(int $x, int $y, ImagickPixel|string $color) + Returns the color of the specified pixel. +*/ +PHP_METHOD(Imagick, setImagePixelColor) +{ + php_imagick_object *intern; + zval *param; + MagickBooleanType status; + im_long x, y; + PixelWand *color_wand; + zend_bool allocated; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llz", &x, &y, ¶m) == FAILURE) { + RETURN_THROWS(); + } + + color_wand = php_imagick_zval_to_pixelwand (param, IMAGICK_CLASS, &allocated TSRMLS_CC); + if (!color_wand) + return; + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSetImagePixelColor(intern->magick_wand, x, y , color_wand); + + if (allocated) + color_wand = DestroyPixelWand (color_wand); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image pixel color" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_NULL(); +} +/* }}} */ +#endif + +/* {{{ proto string Imagick::getImageProfile(string name) + Returns the named image profile. +*/ +PHP_METHOD(Imagick, getImageProfile) +{ + php_imagick_object *intern; + char *profile, *name; + IM_LEN_TYPE name_len; +#if MagickLibVersion < 0x628 + long length; +#else + size_t length; +#endif + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + profile = (char *)MagickGetImageProfile(intern->magick_wand, name, &length); + + if (profile) { + IM_ZVAL_STRINGL(return_value, profile, length); + IMAGICK_FREE_MAGICK_MEMORY(profile); + return; + } + + php_imagick_throw_exception(IMAGICK_CLASS, "Can not get image profile" TSRMLS_CC); + RETURN_THROWS(); +} +/* }}} */ + +/* {{{ proto array Imagick::getImageRedPrimary() + Returns the chromaticy red primary point as an array. IM6: with the keys "x" and "y". + IM7: Returns an array with the keys "x", "y" and "z". +*/ +PHP_METHOD(Imagick, getImageRedPrimary) +{ + php_imagick_object *intern; + MagickBooleanType status; + double x, y; +#if MagickLibVersion >= 0x700 + double z; +#endif + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + +#if MagickLibVersion >= 0x700 + status = MagickGetImageRedPrimary(intern->magick_wand, &x, &y, &z); +#else + status = MagickGetImageRedPrimary(intern->magick_wand, &x, &y); +#endif + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image red primary" TSRMLS_CC); + RETURN_THROWS(); + } + + array_init(return_value); + add_assoc_double(return_value, "x", x); + add_assoc_double(return_value, "y", y); +#if MagickLibVersion >= 0x700 + add_assoc_double(return_value, "z", z); +#endif +} +/* }}} */ + +/* {{{ proto int Imagick::getImageRenderingIntent() + Gets the image rendering intent. +*/ +PHP_METHOD(Imagick, getImageRenderingIntent) +{ + php_imagick_object *intern; + long renderingIntent; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + renderingIntent = MagickGetImageRenderingIntent(intern->magick_wand); + RETVAL_LONG(renderingIntent); +} +/* }}} */ + +/* {{{ proto array Imagick::getImageResolution() + Gets the image X and Y resolution. +*/ +PHP_METHOD(Imagick, getImageResolution) +{ + php_imagick_object *intern; + MagickBooleanType status; + double x, y; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickGetImageResolution(intern->magick_wand, &x, &y); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image resolution" TSRMLS_CC); + RETURN_THROWS(); + } + + array_init(return_value); + add_assoc_double(return_value, "x", x); + add_assoc_double(return_value, "y", y); +} +/* }}} */ + +/* {{{ proto int Imagick::getImageScene() + Gets the image scene. +*/ +PHP_METHOD(Imagick, getImageScene) +{ + php_imagick_object *intern; + unsigned long scene; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + scene = MagickGetImageScene(intern->magick_wand); + RETVAL_LONG(scene); +} +/* }}} */ + +/* {{{ proto string Imagick::getImageSignature() + Generates an SHA-256 message digest for the image pixel stream. +*/ +PHP_METHOD(Imagick, getImageSignature) +{ + php_imagick_object *intern; + char *signature; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + signature = MagickGetImageSignature(intern->magick_wand); + IM_ZVAL_STRING(return_value, signature); + IMAGICK_FREE_MAGICK_MEMORY(signature); +} +/* }}} */ + +/* {{{ proto int Imagick::getImageTicksPerSecond() + Gets the image ticks-per-second. +*/ +PHP_METHOD(Imagick, getImageTicksPerSecond) +{ + php_imagick_object *intern; + unsigned long ticks; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + ticks = MagickGetImageTicksPerSecond(intern->magick_wand); + RETVAL_LONG(ticks); +} +/* }}} */ + +/* {{{ proto int Imagick::getImageType() + Gets the potential image type: +*/ +PHP_METHOD(Imagick, getImageType) +{ + php_imagick_object *intern; + long imageType; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + imageType = MagickGetImageType(intern->magick_wand); + RETVAL_LONG(imageType); +} +/* }}} */ + +/* {{{ proto int Imagick::getImageUnits() + Gets the image units of resolution. +*/ +PHP_METHOD(Imagick, getImageUnits) +{ + php_imagick_object *intern; + long resolutionType; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + resolutionType = MagickGetImageUnits(intern->magick_wand); + RETVAL_LONG(resolutionType); +} +/* }}} */ + +/* {{{ proto int Imagick::getImageVirtualPixelMethod() + Returns the virtual pixel method for the sepcified image. +*/ +PHP_METHOD(Imagick, getImageVirtualPixelMethod) +{ + php_imagick_object *intern; + long pixelMethod; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + pixelMethod = MagickGetImageVirtualPixelMethod(intern->magick_wand); + RETVAL_LONG(pixelMethod); +} +/* }}} */ + +/* {{{ proto array Imagick::getImageWhitePoint() + Returns the chromaticy white point as an associative array. IM6: with the keys "x" and "y". + IM7: with the keys "x", "y" and "z". +*/ +PHP_METHOD(Imagick, getImageWhitePoint) +{ + php_imagick_object *intern; + MagickBooleanType status; + double x, y; +#if MagickLibVersion >= 0x700 + double z; +#endif + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + +#if MagickLibVersion >= 0x700 + status = MagickGetImageWhitePoint(intern->magick_wand, &x, &y, &z); +#else + status = MagickGetImageWhitePoint(intern->magick_wand, &x, &y); +#endif + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image white point" TSRMLS_CC); + RETURN_THROWS(); + } + + array_init(return_value); + add_assoc_double(return_value, "x", x); + add_assoc_double(return_value, "y", y); +#if MagickLibVersion >= 0x700 + add_assoc_double(return_value, "z", z); +#endif +} +/* }}} */ + +/* {{{ proto int Imagick::getImageWidth() + Returns the image width. +*/ +PHP_METHOD(Imagick, getImageWidth) +{ + php_imagick_object *intern; + unsigned long width; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + width = MagickGetImageWidth(intern->magick_wand); + RETVAL_LONG(width); +} +/* }}} */ + +/* {{{ proto int Imagick::getNumberImages() + Returns the number of images associated with Imagick object. +*/ +PHP_METHOD(Imagick, getNumberImages) +{ + php_imagick_object *intern; + unsigned long num_images; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + + num_images = MagickGetNumberImages(intern->magick_wand); + RETVAL_LONG(num_images); +} +/* }}} */ + +/* + Resizes an image so that it is 'bestfit' for the bounding box + If the image does not fill the box completely the box is filled with + image's background color. The background color can be set using MagickSetImageBackgroundColor +*/ +#if MagickLibVersion > 0x631 +static +zend_bool s_resize_bounding_box(MagickWand *magick_wand, im_long box_width, im_long box_height, zend_bool fill, zend_bool legacy) +{ + im_long new_width, new_height; + im_long extent_x, extent_y; + + /* Calculate dimensions */ + if (!php_imagick_thumbnail_dimensions(magick_wand, 1, box_width, box_height, &new_width, &new_height, legacy)) { + return 0; + } + + /* Resize the image to the new size */ + if (MagickThumbnailImage(magick_wand, new_width, new_height) == MagickFalse) { + return 0; + } + + /* If user does not want to fill we are all done here */ + if (!fill) { + return 1; + } + + /* In case user wants to fill use extent for it rather than creating a new canvas */ + extent_x = (box_width > new_width) ? ((box_width - new_width) / 2) : 0; + extent_y = (box_height > new_height) ? ((box_height - new_height) / 2) : 0; + + if (MagickExtentImage(magick_wand, box_width, box_height, extent_x * -1, extent_y * -1) == MagickFalse) { + return 0; + } + return 1; +} +#endif + +/* {{{ proto bool Imagick::thumbnailImage(int columns, int rows, bool bestfit = false, bool fill = false, bool legacy = false) + Changes the size of an image to the given dimensions and removes any associated profiles. + If legacy is true, the calculations are done with the small rounding bug that existed in + Imagick before 3.4.0. If false, the calculations should produce the same results as + ImageMagick CLI does. +*/ +PHP_METHOD(Imagick, thumbnailImage) +{ + im_long width = 0, height = 0, new_width, new_height; + php_imagick_object *intern; + zend_bool bestfit = 0, fill = 0; + zend_bool legacy = 0; + +#if PHP_VERSION_ID < 80100 + // This uses an implicit conversion of null to 0 for longs + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll|bbb", &width, &height, &bestfit, &fill, &legacy) == FAILURE) { + RETURN_THROWS(); + } +#else + // Changing longs to be nullable "l!", means that zpp + // wants to write whether they were null to a variable. + bool width_is_null = 0; + bool height_is_null = 0; + + /* Parse parameters given to function */ + if (zend_parse_parameters( + ZEND_NUM_ARGS() TSRMLS_CC, + "l!l!|bbb", + &width, &width_is_null, + &height, &height_is_null, + &bestfit, &fill, &legacy) == FAILURE) { + RETURN_THROWS(); + } +#endif + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + if (bestfit && fill) { +#if MagickLibVersion > 0x631 + if (!s_resize_bounding_box(intern->magick_wand, width, height, fill, legacy)) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to resize and fill image" TSRMLS_CC); + RETURN_THROWS(); + } +#else + php_imagick_throw_exception(IMAGICK_CLASS, "Fill parameter is only supported with ImageMagick 6.3.2+" TSRMLS_CC); + RETURN_THROWS(); +#endif + } else { + if (!php_imagick_thumbnail_dimensions(intern->magick_wand, bestfit, width, height, &new_width, &new_height, legacy)) { + php_imagick_throw_exception(IMAGICK_CLASS, "Invalid image geometry" TSRMLS_CC); + RETURN_THROWS(); + } + /* No magick is going to happen */ + if (MagickThumbnailImage(intern->magick_wand, new_width, new_height) == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to thumbnail image" TSRMLS_CC); + RETURN_THROWS(); + } + } + RETURN_TRUE; +} +/* }}} */ + +/* This is not universally safe to use, but is safe enough for values that will + be encountered for image dimensions. +*/ +static inline double im_round_helper_class(double value) { + if (value >= 0.0) { + return floor(value + 0.5); + } else { + return ceil(value - 0.5); + } +} + +static +void s_calculate_crop( + im_long orig_width, im_long orig_height, + im_long desired_width, im_long desired_height, + im_long *new_width, im_long *new_height, + im_long *offset_x, im_long *offset_y, + zend_bool legacy +) { + double ratio_x, ratio_y; + long temp_new_width, temp_new_height; + + ratio_x = ((double) desired_width / (double) orig_width); + ratio_y = ((double) desired_height / (double) orig_height); + + if (ratio_x > ratio_y) { + temp_new_width = desired_width; + + if (legacy) { + temp_new_height = (long)(ratio_x * (double)orig_height); + } + else { + temp_new_height = im_round_helper_class(ratio_x * (double)orig_height); + } + } else { + temp_new_height = desired_height; + if (legacy) { + temp_new_width = (long)(ratio_y * (double)orig_width); + } + else { + temp_new_width = im_round_helper_class(ratio_y * (double)orig_width); + } + } + + *new_width = temp_new_width; + *new_height = temp_new_height; + + *offset_x = (long) ((temp_new_width - desired_width) / 2); + *offset_y = (long) ((temp_new_height - desired_height) / 2); +} + + +/* {{{ proto array Imagick::calculateCrop(long orig_width, long orig_height, long desired_width, long desired_height, bool legacy = false) + Calculates the cropping values that will be used by a crop operation. +*/ +PHP_METHOD(Imagick, calculateCrop) +{ + im_long orig_width, orig_height; + im_long desired_width, desired_height; + im_long new_width, new_height; + im_long offset_x, offset_y; + zend_bool legacy = 0; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llll|b", + &orig_width, &orig_height, &desired_width, &desired_height, &legacy) == FAILURE) { + RETURN_THROWS(); + } + + if (orig_width <= 0 || orig_height <= 0 || + desired_width <= 0 || desired_height <= 0) { + php_imagick_throw_exception(IMAGICK_CLASS, "All values must be above zero." TSRMLS_CC); + } + + s_calculate_crop( + orig_width, orig_height, + desired_width, desired_height, + &new_width, &new_height, + &offset_x, &offset_y, + legacy + ); + + array_init(return_value); + add_assoc_long(return_value, "width", new_width); + add_assoc_long(return_value, "height", new_height); + + add_assoc_long(return_value, "offset_x", offset_x); + add_assoc_long(return_value, "offset_y", offset_y); +} +/* }}} */ + + +static +zend_bool s_crop_thumbnail_image(MagickWand *magick_wand, im_long desired_width, im_long desired_height, zend_bool legacy TSRMLS_DC) +{ + im_long offset_x = 0, offset_y = 0, new_width, new_height; + im_long orig_width = (im_long)MagickGetImageWidth(magick_wand); + im_long orig_height = (im_long)MagickGetImageHeight(magick_wand); + + /* Already at the size, just strip profiles */ + if ((orig_width == desired_width) && (orig_height == desired_height)) { + if (!MagickStripImage(magick_wand)) { + return 0; + } + return 1; + } + + s_calculate_crop( + orig_width, orig_height, + desired_width, desired_height, + &new_width, &new_height, + &offset_x, &offset_y, + legacy + ); + + if (MagickThumbnailImage(magick_wand, new_width, new_height) == MagickFalse) { + return 0; + } + + /* all done here */ + if ((new_width == desired_width) && (new_height == desired_height)) { + return 1; + } + + if (MagickCropImage(magick_wand, desired_width, desired_height, offset_x, offset_y) == MagickFalse) { + return 0; + } + + MagickSetImagePage(magick_wand, desired_width, desired_height, 0, 0); + return 1; +} + +// +/* {{{ proto bool Imagick::cropthumbnailImage(int columns, int rows, bool legacy = false ) + Creates a cropped thumbnail at the requested size. If legacy is true, uses the + incorrect behaviour that was present until Imagick 3.4.0. If false it uses the correct + behaviour. +*/ +PHP_METHOD(Imagick, cropThumbnailImage) +{ + im_long crop_width, crop_height; + zend_bool legacy = 0; + php_imagick_object *intern; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll|b", &crop_width, &crop_height, &legacy) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + /* The world collapses.. */ + if (!s_crop_thumbnail_image(intern->magick_wand, crop_width, crop_height, legacy TSRMLS_CC)) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to crop-thumbnail image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto void Imagick::resetIterator(); + Resets the iterator. Use it in conjunction with Imagick::nextImage() to iterate over all the images in a wand container. +*/ +PHP_METHOD(Imagick, resetIterator) +{ + php_imagick_object *intern; + intern = Z_IMAGICK_P(getThis()); + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + (void)return_value; // fix -Werror=unused-parameter + + /* No magick is going to happen */ + if (intern->magick_wand == NULL) { + return; + } + intern->next_out_of_bound = 0; + MagickResetIterator(intern->magick_wand); +} +/* }}} */ + +/* {{{ proto void Imagick::rewind() + Sets the wand iterator to the first image. +*/ +PHP_METHOD(Imagick, rewind) +{ + php_imagick_object *intern; + intern = Z_IMAGICK_P(getThis()); + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + (void)return_value; // fix -Werror=unused-parameter + + /* No magick is going to happen */ + if (intern->magick_wand == NULL) { + return; + } + intern->next_out_of_bound = 0; + MagickSetFirstIterator(intern->magick_wand); +} +/* }}} */ + +/* {{{ proto bool Imagick::setFirstIterator() + Sets the wand iterator to the first image. +*/ +PHP_METHOD(Imagick, setFirstIterator) +{ + php_imagick_object *intern; + intern = Z_IMAGICK_P(getThis()); + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + /* No magick is going to happen */ + if (intern->magick_wand == NULL) { + RETURN_FALSE; + } + intern->next_out_of_bound = 0; + MagickSetFirstIterator(intern->magick_wand); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::setLastIterator() + Sets the wand iterator to the last image. +*/ +PHP_METHOD(Imagick, setLastIterator) +{ + php_imagick_object *intern; + intern = Z_IMAGICK_P(getThis()); + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + /* No magick is going to happen */ + if (intern->magick_wand == NULL) { + RETURN_FALSE; + } + intern->next_out_of_bound = 0; + MagickSetLastIterator(intern->magick_wand); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::previousImage() + Assocates the previous image in an image list with the Imagick object. +*/ +PHP_METHOD(Imagick, previousImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + status = MagickPreviousImage(intern->magick_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + RETURN_FALSE; + } + intern->next_out_of_bound = 0; + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto void Imagick::next() + Associates the next image in the image list with an Imagick object. +*/ +PHP_METHOD(Imagick, next) +{ + php_imagick_object *intern; + MagickBooleanType status; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + (void)return_value; // fix -Werror=unused-parameter + + intern = Z_IMAGICK_P(getThis()); + status = MagickNextImage(intern->magick_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + intern->next_out_of_bound = 1; + } +} +/* }}} */ + +/* {{{ proto bool Imagick::nextImage() + Associates the next image in the image list with an Imagick object. +*/ +PHP_METHOD(Imagick, nextImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + status = MagickNextImage(intern->magick_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + intern->next_out_of_bound = 1; + RETURN_FALSE; + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::hasPreviousImage() + Returns true if the wand has more images when traversing the list in the reverse direction +*/ +PHP_METHOD(Imagick, hasPreviousImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + status = MagickHasPreviousImage(intern->magick_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + RETURN_FALSE; + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::hasNextImage() + Returns true if the wand has more images when traversing the list in the forward direction +*/ +PHP_METHOD(Imagick, hasNextImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + status = MagickHasNextImage(intern->magick_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + RETURN_FALSE; + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto int Imagick::getImageIndex() + Returns the index of the current active image, within the Imagick object. +*/ +PHP_METHOD(Imagick, getImageIndex) +{ + MagickBooleanType status; + php_imagick_object *intern; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + +#if MagickLibVersion >= 0x700 + status = MagickGetIteratorIndex(intern->magick_wand); +#else + status = MagickGetImageIndex(intern->magick_wand); +#endif + + ZVAL_LONG(return_value, (long)status); +} +/* }}} */ + + +/* {{{ proto bool Imagick::setImageIndex(int index) + Returns the index of the current active image, within the Imagick object. +*/ +PHP_METHOD(Imagick, setImageIndex) +{ + im_long index; + MagickBooleanType status; + php_imagick_object *intern; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &index) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); +#if MagickLibVersion > 0x628 + /* Get the current iterator position */ + status = MagickSetIteratorIndex(intern->magick_wand, index); +#else + status = MagickSetImageIndex(intern->magick_wand, index); +#endif + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image index" TSRMLS_CC); + RETURN_THROWS(); + } + intern->next_out_of_bound = 0; + RETURN_TRUE; + +} +/* }}} */ + +/* {{{ proto bool Imagick::removeImage() + Removes an image from the image list. +*/ +PHP_METHOD(Imagick, removeImage) +{ + MagickBooleanType status; + php_imagick_object *intern; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickRemoveImage(intern->magick_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to remove image" TSRMLS_CC); + RETURN_THROWS(); + } + intern->next_out_of_bound = 0; + MagickSetLastIterator(intern->magick_wand); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto string Imagick::getImageFilename() + Returns the filename of a particular image in a sequence +*/ +PHP_METHOD(Imagick, getImageFilename) +{ + php_imagick_object *intern; + char *filename; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + filename = MagickGetImageFilename(intern->magick_wand); + + if (filename == (char *)NULL) { + return; + } + + IM_ZVAL_STRING(return_value, filename); + IMAGICK_FREE_MAGICK_MEMORY(filename); +} +/* }}} */ + +/* {{{ proto int Imagick::getImageSize() + returns the image length in bytes +*/ +PHP_METHOD(Imagick, getImageSize) +{ + php_imagick_object *intern; +#if MagickLibVersion >= 0x700 + MagickSizeType length; + MagickBooleanType status; +#endif + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + +#if MagickLibVersion >= 0x700 + status = MagickGetImageLength(intern->magick_wand, &length); + if (status == MagickFalse) { + php_imagick_throw_exception(IMAGICK_CLASS, "Unable to acquire image length" TSRMLS_CC); + RETURN_THROWS(); + } + ZVAL_LONG(return_value, (long)length); +#else + ZVAL_LONG(return_value, (long)MagickGetImageSize(intern->magick_wand)); +#endif +} +/* }}} */ + +static +zend_bool s_image_has_format (MagickWand *magick_wand) +{ + char *buffer; + zend_bool ret; + buffer = MagickGetImageFormat(magick_wand); + ret = buffer && *buffer != '\0'; + if (buffer) { + MagickRelinquishMemory (buffer); + } + return ret; +} + +/* {{{ proto string Imagick::getImageBlob() + Returns the current image sequence as a string +*/ +PHP_METHOD(Imagick, getImageBlob) +{ + php_imagick_object *intern; + unsigned char *image_contents; + size_t image_size; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + if (!s_image_has_format (intern->magick_wand)) { + php_imagick_throw_exception(IMAGICK_CLASS, "Image has no format" TSRMLS_CC); + RETURN_THROWS(); + } + + image_contents = MagickGetImageBlob(intern->magick_wand, &image_size); + if (!image_contents) { + php_imagick_throw_exception(IMAGICK_CLASS, "Failed to get the image contents (empty or invalid image?)" TSRMLS_CC); + RETURN_THROWS(); + } + + IM_ZVAL_STRINGL(return_value, (char *)image_contents, image_size); + IMAGICK_FREE_MAGICK_MEMORY(image_contents); +} +/* }}} */ + +/* {{{ proto string Imagick::getImagesBlob() + Returns all image sequences as a string +*/ +PHP_METHOD(Imagick, getImagesBlob) +{ + php_imagick_object *intern; + unsigned char *image_contents; + size_t image_size; + int current; + MagickBooleanType status; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + +#if MagickLibVersion > 0x628 + /* Get the current iterator position */ + current = MagickGetIteratorIndex(intern->magick_wand); +#else + /* Get the current iterator position */ + current = MagickGetImageIndex(intern->magick_wand); +#endif + + /* Reset the iterator */ + MagickResetIterator(intern->magick_wand); + + /* Loop all images to make sure they have a format */ + while (MagickNextImage(intern->magick_wand)) { + if (!s_image_has_format (intern->magick_wand)) { + php_imagick_throw_exception(IMAGICK_CLASS, "Image has no format" TSRMLS_CC); + RETURN_THROWS(); + } + } + +#if MagickLibVersion > 0x628 + /* Get the current iterator position */ + status = MagickSetIteratorIndex(intern->magick_wand, current); +#else + /* Get the current iterator position */ + status = MagickSetImageIndex(intern->magick_wand, current); +#endif + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set the iterator index" TSRMLS_CC); + RETURN_THROWS(); + } + + image_contents = MagickGetImagesBlob(intern->magick_wand, &image_size); + if (!image_contents) { + return; + } + + IM_ZVAL_STRINGL(return_value, (char *)image_contents, image_size); + IMAGICK_FREE_MAGICK_MEMORY(image_contents); +} +/* }}} */ + +/* {{{ proto string Imagick::getImageFormat() + Returns the format of a particular image in a sequence. +*/ +PHP_METHOD(Imagick, getImageFormat) +{ + php_imagick_object *intern; + char *format; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + intern = Z_IMAGICK_P(getThis()); + + IMAGICK_NOT_EMPTY(intern); + if (!s_image_has_format (intern->magick_wand)) { + php_imagick_throw_exception(IMAGICK_CLASS, "Image has no format" TSRMLS_CC); + RETURN_THROWS(); + } + + format = MagickGetImageFormat (intern->magick_wand); + IM_ZVAL_STRING(return_value, format); + IMAGICK_FREE_MAGICK_MEMORY(format); +} +/* }}} */ + +/* {{{ proto string Imagick::getImageMimeType() + Returns the image mime-type +*/ +PHP_METHOD(Imagick, getImageMimeType) +{ + php_imagick_object *intern; + char *format = NULL, *mime_type = NULL; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + if (!s_image_has_format (intern->magick_wand)) { + php_imagick_throw_exception(IMAGICK_CLASS, "Image has no format" TSRMLS_CC); + RETURN_THROWS(); + } + + format = MagickGetImageFormat (intern->magick_wand); + + mime_type = (char *) MagickToMime(format); + IMAGICK_FREE_MAGICK_MEMORY(format); + + if (!mime_type) { + php_imagick_throw_exception(IMAGICK_CLASS, "Unable to get image mime-type" TSRMLS_CC); + RETURN_THROWS(); + } + + IM_ZVAL_STRING(return_value, mime_type); + IMAGICK_FREE_MAGICK_MEMORY(mime_type); +} +/* }}} */ + + +static +void s_add_assoc_str (zval *array, const char *key, const char *value) +{ + //add_assoc_string (array, key, (char *)(value ? value : ""), copy); + IM_add_assoc_string (array, key, (char *)(value ? value : "")); + //TODO - if copy == 0 free the string? +} + +static +void s_add_named_strings (zval *array, const char *haystack TSRMLS_DC) +{ + unsigned int i, found; + char *last_ptr = NULL, *buffer; + size_t num_keys; + +#if PHP_VERSION_ID >= 70000 + zend_string *trim; + zend_string *line_string; +#else + char *trim; +#endif + + char *line; + + const char *str_keys = { + "Format: ", + "Units: ", + "Type: ", + "Colorspace: ", + "Filesize: ", + "Compression: " + }; + + const char *arr_keys = { + "format", + "units", + "type", + "colorSpace", + "fileSize", + "compression" + }; + + found = 0; + + + buffer = estrdup (haystack); + + num_keys = sizeof (str_keys) / sizeof (str_keys0); + line = php_strtok_r (buffer, "\r\n", &last_ptr); + + while ((found < num_keys) && line) { + // Break the line further into tokens + +#if PHP_VERSION_ID >= 70000 + line_string = zend_string_init(line, strlen(line), 0); + //str, what, what_len, mode + trim = php_trim(line_string, NULL, 0, 3); + if (trim != NULL) { + for (i = 0; i < num_keys; i++) { + if (strncmp(ZSTR_VAL(trim), str_keysi, strlen(str_keysi)) == 0) { + // This should be our line + IM_add_assoc_string(array, arr_keysi, ZSTR_VAL(trim) + strlen(str_keysi)); + found++; + } + } + } + zend_string_release(line_string); + zend_string_release(trim); + line = php_strtok_r (NULL, "\r\n", &last_ptr); +#else + trim = php_trim(line, strlen(line), NULL, 0, NULL, 3 TSRMLS_CC); + for (i = 0; i < num_keys; i++) { + if (strncmp (trim, str_keys i, strlen (str_keys i)) == 0) { + // This should be our line + IM_add_assoc_string (array, arr_keys i, trim + strlen (str_keys i)); + found++; + } + } + efree (trim); + line = php_strtok_r (NULL, "\r\n", &last_ptr); +#endif + } + efree (buffer); +} + +/* {{{ proto array Imagick::identifyImage(bool appendRawOutput ) + Identifies an image and returns the attributes. Attributes include the image width, height, size, and others. + If true is passed as argument, then the raw output is appended to the array. +*/ +PHP_METHOD(Imagick, identifyImage) +{ + char *format, *identify, *filename, *signature; + php_imagick_object *intern; + zend_bool append_raw_string = 0; + double x, y; + +#if PHP_VERSION_ID >= 70000 + zval array; +#else + zval *array; +#endif + + zval *pArray; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &append_raw_string) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + // This is to parse some string options, ugly hack but easier than using CommandOptionToMNemonic + // or MagickOptionToMnemonic and FormatMagickSize, which have changed names and signatures between + // versions that we support + identify = MagickIdentifyImage (intern->magick_wand); + + // Actually generate the array ourselves + array_init(return_value); + + // Name of the image + filename = MagickGetImageFilename (intern->magick_wand); + s_add_assoc_str (return_value, "imageName", filename); + IMAGICK_FREE_MAGICK_MEMORY(filename); + + format = MagickGetImageFormat (intern->magick_wand); + if (format) { + char *mime_type = MagickToMime(format); + if (mime_type) { + s_add_assoc_str (return_value, "mimetype", mime_type); + IMAGICK_FREE_MAGICK_MEMORY(mime_type); + } else + s_add_assoc_str (return_value, "mimetype", "unknown"); + + IMAGICK_FREE_MAGICK_MEMORY(format); + } + else + s_add_assoc_str (return_value, "mimetype", "unknown"); + + s_add_named_strings (return_value, identify TSRMLS_CC); + + // Geometry is an associative array + +#if PHP_VERSION_ID >= 70000 + array_init(&array); + pArray = &array; +#else + MAKE_STD_ZVAL(array); + pArray = array; + array_init(pArray); +#endif + + add_assoc_long (pArray, "width", MagickGetImageWidth (intern->magick_wand)); + add_assoc_long (pArray, "height", MagickGetImageHeight (intern->magick_wand)); + add_assoc_zval (return_value, "geometry", pArray); + + if (MagickGetImageResolution(intern->magick_wand, &x, &y) == MagickTrue) { +#if PHP_VERSION_ID >= 70000 + zval geometry_array; + array_init(&geometry_array); + add_assoc_double(&geometry_array, "x", x); + add_assoc_double(&geometry_array, "y", y); + add_assoc_zval(return_value, "resolution", &geometry_array); +#else + zval *p_geometry_array; + MAKE_STD_ZVAL(p_geometry_array); + array_init(p_geometry_array); + add_assoc_double(p_geometry_array, "x", x); + add_assoc_double(p_geometry_array, "y", y); + add_assoc_zval(return_value, "resolution", p_geometry_array); +#endif + } + + signature = MagickGetImageSignature(intern->magick_wand); + s_add_assoc_str (return_value, "signature", signature); + IMAGICK_FREE_MAGICK_MEMORY(signature); + + if (append_raw_string == 1) + IM_add_assoc_string (return_value, "rawOutput", identify); + + IMAGICK_FREE_MAGICK_MEMORY(identify); +} +/* }}} */ + +#undef imagick_option_to_string + +/* {{{ proto int Imagick::getImageColors() + Gets the number of unique colors in the image. +*/ +PHP_METHOD(Imagick, getImageColors) +{ + php_imagick_object *intern; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + ZVAL_LONG(return_value, (long)MagickGetImageColors(intern->magick_wand)); +} +/* }}} */ + +/* {{{ proto bool Imagick::commentImage(string comment) + Adds a comment to your image. +*/ +PHP_METHOD(Imagick, commentImage) +{ + php_imagick_object *intern; + char *comment; + IM_LEN_TYPE comment_len; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &comment, &comment_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickCommentImage(intern->magick_wand, comment); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to comment image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::setImageFilename(string filename) + Sets the filename of a particular image in a sequence. +*/ +PHP_METHOD(Imagick, setImageFilename) +{ + php_imagick_object *intern; + char *filename; + IM_LEN_TYPE filename_len; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSetImageFilename(intern->magick_wand, filename); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image filename" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 +/* PS, DEPRECATED please remove: http://www.imagemagick.org/discourse-server/viewtopic.php?f=6&t=8196 */ +PHP_METHOD(Imagick, setImageAttribute) +{ + php_imagick_object *intern; + char *key, *attribute; + IM_LEN_TYPE key_len, attribute_len; + MagickBooleanType status; + + /* Tell user that this method has been deprecated. */ + IMAGICK_METHOD_DEPRECATED("Imagick", "setImageAttribute"); + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &key, &key_len, &attribute, &attribute_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSetImageAttribute(intern->magick_wand, key, attribute); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image attribute" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +#endif // #if MagickLibVersion < 0x700 +#endif + +/* {{{ proto bool Imagick::setImageBackgroundColor(ImagickPixel background) + Sets the image background color. +*/ +PHP_METHOD(Imagick, setImageBackgroundColor) +{ + zval *param; + php_imagick_object *intern; + MagickBooleanType status; + PixelWand *color_wand; + zend_bool allocated; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", ¶m) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + color_wand = php_imagick_zval_to_pixelwand (param, IMAGICK_CLASS, &allocated TSRMLS_CC); + if (!color_wand) + return; + + status = MagickSetImageBackgroundColor(intern->magick_wand, color_wand); + + if (allocated) + color_wand = DestroyPixelWand (color_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image background color" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +#if MagickLibVersion >= 0x700 +/* {{{ proto int Imagick::setImageChannelMask(int channel) + Sets the image channel mask. Returns the previous set channel mask. +*/ +PHP_METHOD(Imagick, setImageChannelMask) +{ + php_imagick_object *intern; + im_long channel; + ChannelType previous_channel_type; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + previous_channel_type = MagickSetImageChannelMask(intern->magick_wand, channel); + + RETURN_LONG(previous_channel_type); +} +/* }}} */ +#endif + + +/* {{{ proto bool Imagick::setImageCompose(int compose) + Sets the image composite operator, useful for specifying how to composite the image thumbnail when using the Imagick::montageImage() method. +*/ +PHP_METHOD(Imagick, setImageCompose) +{ + php_imagick_object *intern; + im_long compose; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &compose) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSetImageCompose(intern->magick_wand, compose); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image composite operator" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto int Imagick::getImageCompression() + Gets the image compression type +*/ +PHP_METHOD(Imagick, getImageCompression) +{ + php_imagick_object *intern; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + RETVAL_LONG(MagickGetImageCompression(intern->magick_wand)); +} +/* }}} */ + +/* {{{ proto bool Imagick::setImageCompression(int compression) + Sets the image compression. +*/ +PHP_METHOD(Imagick, setImageCompression) +{ + php_imagick_object *intern; + im_long compression; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &compression) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSetImageCompression(intern->magick_wand, compression); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image compression" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::setImageDelay(int delay) + Sets the image delay. +*/ +PHP_METHOD(Imagick, setImageDelay) +{ + php_imagick_object *intern; + im_long delay; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &delay) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSetImageDelay(intern->magick_wand, delay); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image delay" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::colorizeImage(ImagickPixel colorize, ImagickPixel opacity, bool legacy) + Blends the fill color with each pixel in the image. The 'opacity' color is a + per channel strength factor for how strongly the color should be applied. If + legacy is true, the behaviour of this function is incorrect, but consistent + with how it behaved before Imagick version 3.4.0 +*/ +PHP_METHOD(Imagick, colorizeImage) +{ + PixelWand *param_wand = NULL; + php_imagick_object *intern; + zval *color_param, *opacity_param; + MagickBooleanType status; + PixelWand *color_wand, *opacity_wand; + zend_bool color_allocated, opacity_allocated; + zend_bool legacy = 0; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz|b", &color_param, &opacity_param, &legacy) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + color_wand = php_imagick_zval_to_pixelwand (color_param, IMAGICK_CLASS, &color_allocated TSRMLS_CC); + if (!color_wand) + return; + + if (legacy) { + opacity_wand = php_imagick_zval_to_opacity (opacity_param, IMAGICK_CLASS, &opacity_allocated TSRMLS_CC); + } + else { + opacity_wand = php_imagick_zval_to_pixelwand(opacity_param, IMAGICK_CLASS, &opacity_allocated TSRMLS_CC); + } + + if (!opacity_wand) { + if (color_allocated) + color_wand = DestroyPixelWand (color_wand); + + return; + } + + if (legacy) { + /* Colorize wants both wands to be of same instance */ + param_wand = php_imagick_clone_pixelwand (color_wand); + if (!param_wand) { + php_imagick_throw_exception (IMAGICK_CLASS, "Failed to allocate" TSRMLS_CC); + RETURN_THROWS(); + } +#if MagickLibVersion < 0x700 + PixelSetOpacity(param_wand, PixelGetOpacity(opacity_wand)); +#endif + PixelSetAlpha(param_wand, PixelGetAlpha(opacity_wand)); + status = MagickColorizeImage(intern->magick_wand, param_wand, param_wand); + param_wand = DestroyPixelWand(param_wand); + } else { + status = MagickColorizeImage(intern->magick_wand, color_wand, opacity_wand); + } + + if (color_allocated) + color_wand = DestroyPixelWand (color_wand); + + if (opacity_allocated) + opacity_wand = DestroyPixelWand (opacity_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to colorize image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto Imagick Imagick::compareImageChannels(Imagick reference, int channel, int metric) + Compares one or more image channels of an image to a reconstructed image and returns the difference image. +*/ +PHP_METHOD(Imagick, compareImageChannels) +{ + MagickWand *tmp_wand; + zval *objvar; + php_imagick_object *intern, *intern_second, *intern_return; + im_long channel_type, metric_type; + double distortion; +#if PHP_VERSION_ID >= 70000 + zval new_wand; +#else + zval *new_wand; +#endif + + zval *pNewWand; + + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Oll", &objvar, php_imagick_sc_entry, &channel_type, &metric_type) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + intern_second = Z_IMAGICK_P(objvar); + IMAGICK_NOT_EMPTY(intern_second); + + tmp_wand = MagickCompareImageChannels(intern->magick_wand, intern_second->magick_wand, channel_type, metric_type, &distortion); + + if (!tmp_wand) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Compare image channels failed" TSRMLS_CC); + RETURN_THROWS(); + } + +#if PHP_VERSION_ID >= 70000 + pNewWand = &new_wand; +#else + MAKE_STD_ZVAL(new_wand); + pNewWand = new_wand; +#endif + array_init(return_value); + + object_init_ex(pNewWand, php_imagick_sc_entry); + intern_return = Z_IMAGICK_P(pNewWand); + php_imagick_replace_magickwand(intern_return, tmp_wand); + + add_next_index_zval(return_value, pNewWand); + add_next_index_double(return_value, distortion); +} +/* }}} */ +#if MagickLibVersion > 0x628 +/* {{{ proto Imagick Imagick::compareImageLayers(int method) + Compares each image with the next in a sequence and returns the maximum bounding region of any pixel differences it discovers. +*/ +PHP_METHOD(Imagick, compareImageLayers) +{ + MagickWand *tmp_wand; + php_imagick_object *intern, *intern_return; + im_long compare_method; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &compare_method) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + +#if MagickLibVersion >= 0x700 + tmp_wand = (MagickWand *)MagickCompareImagesLayers(intern->magick_wand, compare_method); +#else + tmp_wand = (MagickWand *)MagickCompareImageLayers(intern->magick_wand, compare_method); +#endif + + if (tmp_wand == NULL) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Compare image layers failed" TSRMLS_CC); + RETURN_THROWS(); + } + + object_init_ex(return_value, php_imagick_sc_entry); + intern_return = Z_IMAGICK_P(return_value); + php_imagick_replace_magickwand(intern_return, tmp_wand); +} +/* }}} */ +#endif + +/* {{{ proto Imagick Imagick::flattenImages() + Merges a sequence of images. This is useful for combining Photoshop layers into a single image. +*/ +PHP_METHOD(Imagick, flattenImages) +{ + php_imagick_object *intern, *intern_return; + MagickWand *tmp_wand; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + /* TODO: SHOULD THIS BE HERE? */ + (void)MagickSetFirstIterator(intern->magick_wand); + +#if MagickLibVersion >= 0x700 + tmp_wand = MagickMergeImageLayers(intern->magick_wand, FlattenLayer); +#else + tmp_wand = MagickFlattenImages(intern->magick_wand); +#endif + + if (tmp_wand == NULL) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Flatten images failed" TSRMLS_CC); + RETURN_THROWS(); + } + + object_init_ex(return_value, php_imagick_sc_entry); + intern_return = Z_IMAGICK_P(return_value); + php_imagick_replace_magickwand(intern_return, tmp_wand); +} +/* }}} */ + + +/* {{{ proto bool Imagick::flipImage() + Creates a vertical mirror image by reflecting the pixels around the central x-axis. +*/ +PHP_METHOD(Imagick, flipImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickFlipImage(intern->magick_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to flip image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::flopImage() + Creates a horizontal mirror image by reflecting the pixels around the central y-axis. +*/ +PHP_METHOD(Imagick, flopImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickFlopImage(intern->magick_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to flop image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::frameImage(ImagickPixel matte_color, int width, int height, int inner_bevel, int outer_bevel) + Adds a simulated three-dimensional border around the image +*/ +PHP_METHOD(Imagick, frameImage) +{ + zval *param; + php_imagick_object *intern; + MagickBooleanType status; + im_long width, height, inner_bevel, outer_bevel; + PixelWand *color_wand; + zend_bool allocated; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zllll", ¶m, &width, &height, &inner_bevel, &outer_bevel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + color_wand = php_imagick_zval_to_pixelwand (param, IMAGICK_CLASS, &allocated TSRMLS_CC); + if (!color_wand) + return; + +#if MagickLibVersion >= 0x700 + { + status = MagickFrameImage( + intern->magick_wand, + color_wand, width, + height, + inner_bevel, + outer_bevel, + OverCompositeOp // Over is the default https://imagemagick.org/script/command-line-options.php#frame + ); + } +#else + status = MagickFrameImage(intern->magick_wand, color_wand, width, height, inner_bevel, outer_bevel); +#endif + + if (allocated) + color_wand = DestroyPixelWand (color_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to frame image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +#if MagickLibVersion >= 0x700 +/* {{{ proto bool Imagick::frameImageWithComposite(ImagickPixel matte_color, int width, int height, int inner_bevel, int outer_bevel, int composite) + Adds a simulated three-dimensional border around the image with chosen composite option +*/ +PHP_METHOD(Imagick, frameImageWithComposite) +{ + zval *param; + php_imagick_object *intern; + MagickBooleanType status; + im_long width, height, inner_bevel, outer_bevel; + PixelWand *color_wand; + zend_bool allocated; + im_long composite = OverCompositeOp; // Over is the default https://imagemagick.org/script/command-line-options.php#frame + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zlllll", ¶m, &width, &height, &inner_bevel, &outer_bevel, &composite) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + color_wand = php_imagick_zval_to_pixelwand (param, IMAGICK_CLASS, &allocated TSRMLS_CC); + if (!color_wand) + return; + +#if MagickLibVersion >= 0x700 + { + status = MagickFrameImage( + intern->magick_wand, + color_wand, width, + height, + inner_bevel, + outer_bevel, + composite + ); + } +#else + status = MagickFrameImage(intern->magick_wand, color_wand, width, height, inner_bevel, outer_bevel); +#endif + + if (allocated) + color_wand = DestroyPixelWand (color_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to frame image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ +#endif + +/* {{{ proto Imagick Imagick::fxImage(string expression, int channel) + Evaluate expression for each pixel in the image. +*/ +PHP_METHOD(Imagick, fxImage) +{ + MagickWand *tmp_wand; + php_imagick_object *intern, *intern_return; + char *expression; + IM_LEN_TYPE expression_len; + im_long channel = IM_DEFAULT_CHANNEL; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &expression, &expression_len, &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + tmp_wand = MagickFxImageChannel(intern->magick_wand, channel, expression); + + if (tmp_wand == NULL) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Fx image failed" TSRMLS_CC); + RETURN_THROWS(); + } + + object_init_ex(return_value, php_imagick_sc_entry); + intern_return = Z_IMAGICK_P(return_value); + php_imagick_replace_magickwand(intern_return, tmp_wand); +} +/* }}} */ + +/* {{{ proto bool Imagick::gammaImage(float gamma, int channel) + 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. +*/ +PHP_METHOD(Imagick, gammaImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + double gamma; + im_long channel = IM_DEFAULT_CHANNEL; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d|l", &gamma, &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickGammaImageChannel(intern->magick_wand, channel, gamma); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to gamma image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::gaussianBlurImage(float radius, float sigma, int channel) + Blurs an image. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, the radius should be larger than sigma. Use a radius of 0 and selects a suitable radius for you. +*/ +PHP_METHOD(Imagick, gaussianBlurImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + double radius, sigma; + im_long channel = IM_DEFAULT_CHANNEL; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd|l", &radius, &sigma, &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickGaussianBlurImageChannel(intern->magick_wand, channel, radius, sigma); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to gaussian blur image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto Imagick Imagick::compareImageChannels(int metric, int distortion) + Compares one or more images and returns the difference image. +*/ +PHP_METHOD(Imagick, compareImages) +{ + MagickWand *tmp_wand; + zval *objvar; + php_imagick_object *intern, *intern_second, *intern_return; + im_long metric_type; + double distortion; +#if PHP_VERSION_ID >= 70000 + zval new_wand; +#else + zval *new_wand; +#endif + + zval *pNewWand; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ol", &objvar, php_imagick_sc_entry, &metric_type) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + intern_second = Z_IMAGICK_P(objvar); + IMAGICK_NOT_EMPTY(intern_second); + +#if PHP_VERSION_ID >= 70000 + pNewWand = &new_wand; +#else + MAKE_STD_ZVAL(new_wand); + pNewWand = new_wand; +#endif + array_init(return_value); + + tmp_wand = MagickCompareImages(intern->magick_wand, intern_second->magick_wand, metric_type, &distortion); + + if (!tmp_wand) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Compare images failed" TSRMLS_CC); + RETURN_THROWS(); + } + + object_init_ex(pNewWand, php_imagick_sc_entry); + intern_return = Z_IMAGICK_P(pNewWand); + php_imagick_replace_magickwand(intern_return, tmp_wand); + + add_next_index_zval(return_value, pNewWand); + add_next_index_double(return_value, distortion); +} +/* }}} */ + +/* {{{ proto bool Imagick::contrastImage(bool sharpen) + Enhances the intensity differences between the lighter and darker elements of the image. Set sharpen to a value other than 0 to increase the image contrast otherwise the contrast is reduced. +*/ +PHP_METHOD(Imagick, contrastImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + zend_bool contrast; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &contrast) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickContrastImage(intern->magick_wand, contrast); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to contrast image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::setImageDepth(int depth) + Sets the image depth. +*/ +PHP_METHOD(Imagick, setImageDepth) +{ + php_imagick_object *intern; + im_long depth; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &depth) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSetImageDepth(intern->magick_wand, depth); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image depth" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::setImageGamma(float gamma) + Sets the image gamma. +*/ +PHP_METHOD(Imagick, setImageGamma) +{ + php_imagick_object *intern; + double gamma; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &gamma) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSetImageGamma(intern->magick_wand, gamma); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image gamma" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::setImageIterations(int iterations) + Sets the image iterations. +*/ +PHP_METHOD(Imagick, setImageIterations) +{ + php_imagick_object *intern; + im_long iterations; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &iterations) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSetImageIterations(intern->magick_wand, iterations); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image iterations" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +#if MagickLibVersion < 0x700 || MagickLibVersion >= 0x705 +/* {{{ proto bool Imagick::setImageMatteColor(ImagickPixel matte) + Sets the image matte color. +*/ +PHP_METHOD(Imagick, setImageMatteColor) +{ + zval *param; + php_imagick_object *intern; + MagickBooleanType status; + PixelWand *color_wand; + zend_bool allocated; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", ¶m) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + color_wand = php_imagick_zval_to_pixelwand (param, IMAGICK_CLASS, &allocated TSRMLS_CC); + if (!color_wand) + return; + + status = MagickSetImageMatteColor(intern->magick_wand, color_wand); + + if (allocated) + color_wand = DestroyPixelWand (color_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image matte color" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif + +/* {{{ proto bool Imagick::setImagePage(int width, int height, int x, int y) + Sets the page geometry of the image. +*/ +PHP_METHOD(Imagick, setImagePage) +{ + php_imagick_object *intern; + im_long width, height, x, y; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llll", &width, &height, &x, &y) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSetImagePage(intern->magick_wand, width, height, x, y); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image page" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::setImageResolution(float x_resolution,const float y_resolution) + Sets the image resolution. +*/ +PHP_METHOD(Imagick, setImageResolution) +{ + php_imagick_object *intern; + double x_res, y_res; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &x_res, &y_res) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSetImageResolution(intern->magick_wand, x_res, y_res); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image resolution" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::setImageScene(int scene) + Sets the image scene. +*/ +PHP_METHOD(Imagick, setImageScene) +{ + php_imagick_object *intern; + im_long scene; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &scene) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSetImageScene(intern->magick_wand, scene); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image scene" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::setImageTicksPerSecond(int ticks_per-second) + Sets the image ticks-per-second. +*/ +PHP_METHOD(Imagick, setImageTicksPerSecond) +{ + php_imagick_object *intern; + im_long ticks_per_second; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &ticks_per_second) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSetImageTicksPerSecond(intern->magick_wand, ticks_per_second); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image ticks per second" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::setImageType(int image_type) + Sets the image type. +*/ +PHP_METHOD(Imagick, setImageType) +{ + php_imagick_object *intern; + im_long image_type; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &image_type) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSetImageType(intern->magick_wand, image_type); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image type" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::setImageUnits(int units) + Sets the image units of resolution. +*/ +PHP_METHOD(Imagick, setImageUnits) +{ + php_imagick_object *intern; + im_long units; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &units) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSetImageUnits(intern->magick_wand, units); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image units" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::setImageFormat(string format) + Sets the format of a particular image in a sequence. +*/ +PHP_METHOD(Imagick, setImageFormat) +{ + char *format; + IM_LEN_TYPE format_len; + MagickBooleanType status; + php_imagick_object *intern; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &format, &format_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSetImageFormat(intern->magick_wand, format); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image format" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::charcoalImage(float radius, float sigma) + Simulates a charcoal drawing. +*/ +PHP_METHOD(Imagick, charcoalImage) +{ + double sigma, radius; + MagickBooleanType status; + php_imagick_object *intern; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &radius, &sigma) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickCharcoalImage(intern->magick_wand, sigma, radius); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to charcoal image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::oilPaintImage(float radius) + Applies a special effect filter that simulates an oil painting. Each pixel is replaced by the most frequent color occurring in a circular region defined by radius. +*/ +PHP_METHOD(Imagick, oilPaintImage) +{ + double radius; + MagickBooleanType status; + php_imagick_object *intern; +#if MagickLibVersion >= 0x700 + double sigma = 1.0; +#endif // #if MagickLibVersion >= 0x700 + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &radius) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + +#if MagickLibVersion >= 0x700 + status = MagickOilPaintImage(intern->magick_wand, radius, sigma); +#else + status = MagickOilPaintImage(intern->magick_wand, radius); +#endif + + /* No magick is going to happen */ + if (status == MagickFalse) + { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to oilpaint image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +#if MagickLibVersion >= 0x700 +/* {{{ proto bool Imagick::oilPaintImageWithSigma(float radius, float sigma) + 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. +*/ +PHP_METHOD(Imagick, oilPaintImageWithSigma) +{ + double radius; + double sigma; + MagickBooleanType status; + php_imagick_object *intern; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &radius, &sigma) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickOilPaintImage(intern->magick_wand, radius, sigma); + + /* No magick is going to happen */ + if (status == MagickFalse) + { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to oilPaintImageWithSigma image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ +#endif // #if MagickLibVersion >= 0x700 + +/* {{{ proto bool Imagick::normalizeImage(int channel) + Enhances the contrast of a color image by adjusting the pixels color to span the entire range of colors available, Channel parameter is ignored in ImageMagick below 6.2.8 +*/ +PHP_METHOD(Imagick, normalizeImage) +{ + MagickBooleanType status; + php_imagick_object *intern; + im_long channel = IM_DEFAULT_CHANNEL; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + +#if MagickLibVersion > 0x628 + status = MagickNormalizeImageChannel(intern->magick_wand, channel); +#else + status = MagickNormalizeImage(intern->magick_wand); +#endif + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to normalize image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::labelImage(string label) + Adds a label to your image. +*/ +PHP_METHOD(Imagick, labelImage) +{ + char *label; + IM_LEN_TYPE label_len; + MagickBooleanType status; + php_imagick_object *intern; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &label, &label_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickLabelImage(intern->magick_wand, label); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to label image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::writeImage(string filename) + Writes an image to the specified filename +*/ +PHP_METHOD(Imagick, writeImage) +{ + char *filename = NULL; + IM_LEN_TYPE filename_len = 0; + zend_bool free_filename = 0; + php_imagick_object *intern; + struct php_imagick_file_t file = {0}; + php_imagick_rw_result_t rc; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!", &filename, &filename_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + if (!filename) { + filename = MagickGetImageFilename(intern->magick_wand); + + if (!filename) { + php_imagick_throw_exception(IMAGICK_CLASS, "No image filename specified" TSRMLS_CC); + RETURN_THROWS(); + } + filename_len = strlen(filename); + free_filename = 1; + } + + if (!filename_len) { + php_imagick_throw_exception(IMAGICK_CLASS, "Can not use empty string as a filename" TSRMLS_CC); + RETURN_THROWS(); + } + + if (!php_imagick_file_init(&file, filename, filename_len TSRMLS_CC)) { + php_imagick_throw_exception(IMAGICK_CLASS, "Invalid filename provided" TSRMLS_CC); + RETURN_THROWS(); + } + rc = php_imagick_write_file(intern, &file, ImagickWriteImage, 0 TSRMLS_CC); + php_imagick_file_deinit(&file); + + if (rc != IMAGICK_RW_OK) { + php_imagick_rw_fail_to_exception (intern->magick_wand, rc, filename TSRMLS_CC); + if (free_filename) { + IMAGICK_FREE_MAGICK_MEMORY(filename); + } + RETURN_THROWS(); + } + + if (free_filename) { + IMAGICK_FREE_MAGICK_MEMORY(filename); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::writeImages(string filename, bool adjoin) + Writes an image or image sequence. +*/ +PHP_METHOD(Imagick, writeImages) +{ + char *filename; + zend_bool adjoin; + IM_LEN_TYPE filename_len; + php_imagick_object *intern; + struct php_imagick_file_t file = {0}; + php_imagick_rw_result_t rc; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sb", &filename, &filename_len, &adjoin) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + if (!filename_len) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Can not use empty string as a filename" TSRMLS_CC); + RETURN_THROWS(); + } + + if (!php_imagick_file_init(&file, filename, filename_len TSRMLS_CC)) { + php_imagick_throw_exception(IMAGICK_CLASS, "Invalid filename provided" TSRMLS_CC); + RETURN_THROWS(); + } + rc = php_imagick_write_file(intern, &file, ImagickWriteImages, adjoin TSRMLS_CC); + php_imagick_file_deinit(&file); + + if (rc != IMAGICK_RW_OK) { + php_imagick_rw_fail_to_exception (intern->magick_wand, rc, filename TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; + +} +/* }}} */ + +/* {{{ proto bool Imagick::drawImage(ImagickDraw drawing_wand) + Renders the ImagickDrawing object on the current image. +*/ +PHP_METHOD(Imagick, drawImage) +{ + zval *objvar; + php_imagick_object *intern; + MagickBooleanType status; + php_imagickdraw_object *internd; + char *old_locale; + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &objvar, php_imagickdraw_sc_entry) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(objvar); + + old_locale = php_imagick_set_locale (TSRMLS_C); + + status = MagickDrawImage(intern->magick_wand, internd->drawing_wand); + + php_imagick_restore_locale (old_locale); + + if (old_locale) + efree (old_locale); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to draw image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::annotateImage(ImagickDraw drawing_wand, float x, float y, float angle, string text) + Annotates an image with text. +*/ +PHP_METHOD(Imagick, annotateImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + php_imagickdraw_object *internd; + double x, y, angle; + char *text; + IM_LEN_TYPE text_len; + zval *objvar; +#if MagickLibVersion < 0x632 + char *font; +#endif + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Oddds", &objvar, php_imagickdraw_sc_entry, &x, &y, &angle, &text, &text_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + internd = Z_IMAGICKDRAW_P(objvar); + +#if MagickLibVersion < 0x632 + font = DrawGetFont(internd->drawing_wand); + + /* Fixes PECL Bug #11328 */ + if (!font) { + php_imagick_throw_exception(IMAGICK_CLASS, "Font needs to be set before annotating an image" TSRMLS_CC); + RETURN_THROWS(); + } +#endif + + status = MagickAnnotateImage(intern->magick_wand, internd->drawing_wand, x, y, angle, text); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to annotate image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::getImageCompressionQuality(int quality) + Gets the image compression quality +*/ +PHP_METHOD(Imagick, getImageCompressionQuality) +{ + php_imagick_object *intern; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + RETVAL_LONG(MagickGetImageCompressionQuality(intern->magick_wand)); +} +/* }}} */ + +/* {{{ proto bool Imagick::setImageCompressionQuality(int quality) + Sets the image compression quality +*/ +PHP_METHOD(Imagick, setImageCompressionQuality) +{ + im_long quality; + php_imagick_object *intern; + MagickBooleanType status; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &quality) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSetImageCompressionQuality(intern->magick_wand, quality); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set image compression quality" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + + +/* {{{ proto bool Imagick::compositeImage(Imagick composite_wand, int compose, int x, int y, int channel ) + Composite one image onto another at the specified offset. Channel parameter is ignored in ImageMagick below 6.2.8 +*/ +PHP_METHOD(Imagick, compositeImage) +{ + zval *objvar; + php_imagick_object *intern; + php_imagick_object *intern_second; + im_long x, y; + im_long composite_id = 0; + im_long channel = IM_DEFAULT_CHANNEL; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Olll|l", &objvar, php_imagick_sc_entry, &composite_id, &x, &y, &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + intern_second = Z_IMAGICK_P(objvar); + IMAGICK_NOT_EMPTY(intern_second); + +#if MagickLibVersion > 0x628 + MagickCompositeImageChannel(intern->magick_wand, channel, intern_second->magick_wand, composite_id, x, y); +#else + MagickCompositeImage(intern->magick_wand, intern_second->magick_wand, composite_id, x, y); +#endif + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::modulateImage(float brightness, float saturation, float hue) + Lets you control the brightness, saturation, and hue of an image. Hue is the percentage of absolute rotation from the current position. For example 50 results in a counter-clockwise rotation of 90 degrees, 150 results in a clockwise rotation of 90 degrees, with 0 and 200 both resulting in a rotation of 180 degrees. +*/ +PHP_METHOD(Imagick, modulateImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + double brightness, saturation, hue; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddd", &brightness, &saturation, &hue) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickModulateImage(intern->magick_wand, brightness, saturation, hue); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to modulate image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::addNoiseImage(int noise_type, int channel) + Adds random noise to the image. Channel parameter is ignored in ImageMagick below 6.2.8 +*/ +PHP_METHOD(Imagick, addNoiseImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + im_long noise; + im_long channel = IM_DEFAULT_CHANNEL; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l", &noise, &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + +#if MagickLibVersion > 0x628 + status = MagickAddNoiseImageChannel(intern->magick_wand, channel, noise); +#else + status = MagickAddNoiseImage(intern->magick_wand, noise); +#endif + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to add image noise" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + + +#if IM_HAVE_IMAGICK_ADD_NOISE_WITH_ATTENUATE +/* {{{ proto bool Imagick::addNoiseImageWithAttenuate(int noise_type, float attenuate, int channel) + Adds random noise to the image. +*/ +PHP_METHOD(Imagick, addNoiseImageWithAttenuate) +{ + php_imagick_object *intern; + MagickBooleanType status; + im_long noise; + im_long channel = IM_DEFAULT_CHANNEL; + double attenuate; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ld|l", &noise, &attenuate, &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickAddNoiseImageChannelWithAttenuate( + intern->magick_wand, + channel, + noise, + attenuate + ); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to add image noise" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif //IM_HAVE_IMAGICK_ADD_NOISE_WITH_ATTENUATE + +/* {{{ proto Imagick Imagick::montageImage(ImagickDraw drawing_wand, string tile_geometry, string thumbnail_geometry, int mode, string frame) + Creates a composite image by combining several separate images. The images are tiled on the composite image with the name of the image optionally appearing just below the individual tile. +*/ + +PHP_METHOD(Imagick, montageImage) +{ + MagickWand *tmp_wand; + zval *objvar; + php_imagick_object *intern, *intern_return; + php_imagickdraw_object *internd; + char *tile_geometry, *thumbnail_geometry, *frame; + IM_LEN_TYPE tile_geometry_len, thumbnail_geometry_len, frame_len; + im_long montage_mode = 0; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ossls", &objvar, php_imagickdraw_sc_entry, + &tile_geometry, &tile_geometry_len, + &thumbnail_geometry, &thumbnail_geometry_len, + &montage_mode, + &frame, &frame_len) == FAILURE) + { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + internd = Z_IMAGICKDRAW_P(objvar); + + tmp_wand = MagickMontageImage(intern->magick_wand, internd->drawing_wand, tile_geometry, thumbnail_geometry, montage_mode, frame); + + if (tmp_wand == NULL) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Montage image failed" TSRMLS_CC); + RETURN_THROWS(); + } + + object_init_ex(return_value, php_imagick_sc_entry); + intern_return = Z_IMAGICK_P(return_value); + php_imagick_replace_magickwand(intern_return, tmp_wand); +} +/* }}} */ + +/* {{{ proto bool Imagick::affineTransformImage(ImagickDraw drawing_wand) + Transforms an image as dictated by the affine matrix of the drawing wand. +*/ +PHP_METHOD(Imagick, affineTransformImage) +{ + zval *objvar; + php_imagick_object *intern; + php_imagickdraw_object *internd; + MagickBooleanType status; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &objvar, php_imagickdraw_sc_entry) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + internd = Z_IMAGICKDRAW_P(objvar); + status = MagickAffineTransformImage(intern->magick_wand, internd->drawing_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to affine transform image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto Imagick Imagick::averageImages() + Average a set of images. +*/ +PHP_METHOD(Imagick, averageImages) +{ + MagickWand *tmp_wand; + php_imagick_object *intern, *intern_return; +#if MagickLibVersion > 0x700 + MagickBooleanType status; +#endif + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + +#if MagickLibVersion > 0x700 + // MagickEvaluateImages appears to crash if index is not zero. + status = MagickSetIteratorIndex(intern->magick_wand, 0); + if (status == MagickFalse) { + php_imagick_convert_imagick_exception( + intern->magick_wand, + "Averaging images failed, images are empty?" TSRMLS_CC + ); + RETURN_THROWS(); + } + + tmp_wand = MagickEvaluateImages(intern->magick_wand, MeanEvaluateOperator); +#else + tmp_wand = MagickAverageImages(intern->magick_wand); +#endif + + if (tmp_wand == NULL) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Averaging images failed" TSRMLS_CC); + RETURN_THROWS(); + } + + object_init_ex(return_value, php_imagick_sc_entry); + intern_return = Z_IMAGICK_P(return_value); + php_imagick_replace_magickwand(intern_return, tmp_wand); +} +/* }}} */ + +/* {{{ proto bool Imagick::borderImage(ImagickPixel bordercolor, int width, int height) + Surrounds the image with a border of the color defined by the bordercolor pixel wand. +*/ +PHP_METHOD(Imagick, borderImage) +{ + zval *param; + php_imagick_object *intern; + MagickBooleanType status; + im_long width, height; + PixelWand *color_wand; + zend_bool allocated; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zll", ¶m, &width, &height) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + color_wand = php_imagick_zval_to_pixelwand (param, IMAGICK_CLASS, &allocated TSRMLS_CC); + if (!color_wand) + return; + +#if MagickLibVersion >= 0x700 + status = MagickBorderImage(intern->magick_wand, color_wand, width, height, OverCompositeOp); +#else + status = MagickBorderImage(intern->magick_wand, color_wand, width, height); +#endif + + if (allocated) + color_wand = DestroyPixelWand (color_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to border image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + + +#if MagickLibVersion >= 0x700 +/* {{{ proto bool Imagick::borderImageWithComposite(ImagickPixel bordercolor, int width, int height, int composite) + Surrounds the image with a border of the color defined by the bordercolor pixel wand, or does a similar action with the composite operator supplied. + + MagickBorderImage only allows you to set the composite operator in > IM7 +*/ +PHP_METHOD(Imagick, borderImageWithComposite) +{ + zval *param; + php_imagick_object *intern; + MagickBooleanType status; + im_long width, height; + PixelWand *color_wand; + zend_bool allocated; + im_long composite; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zlll", ¶m, &width, &height, &composite) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + color_wand = php_imagick_zval_to_pixelwand (param, IMAGICK_CLASS, &allocated TSRMLS_CC); + if (!color_wand) + return; + + status = MagickBorderImage(intern->magick_wand, color_wand, width, height, composite); + + if (allocated) + color_wand = DestroyPixelWand (color_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to border image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +#endif + +/* {{{ proto bool Imagick::thresholdImage(float threshold, int channel ) + Changes the value of individual pixels based on the intensity of each pixel compared to threshold. The result is a high-contrast, two color image. +*/ +PHP_METHOD(Imagick, thresholdImage) +{ + php_imagick_object *intern; + double threshold; + MagickBooleanType status; + im_long channel = DefaultChannels; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d|l", &threshold, &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickThresholdImageChannel(intern->magick_wand, channel, threshold); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to threshold image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::adaptiveThresholdImage(int width, int height, int offset) + Selects an individual threshold for each pixel based on the range of intensity values in its local neighborhood. This allows for thresholding of an image whose global intensity histogram doesn't contain distinctive peaks. +*/ +PHP_METHOD(Imagick, adaptiveThresholdImage) +{ + php_imagick_object *intern; + im_long width, height, offset; + MagickBooleanType status; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &width, &height, &offset) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickAdaptiveThresholdImage(intern->magick_wand, width, height, offset); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to adaptive threshold image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::sharpenImage(float radius, float sigma, int channel) + Sharpens an image. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, the radius should be larger than sigma. Use a radius of 0 and selects a suitable radius for you. +*/ +PHP_METHOD(Imagick, sharpenImage) +{ + double sigma, radius; + MagickBooleanType status; + php_imagick_object *intern; + im_long channel = IM_DEFAULT_CHANNEL; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd|l", &radius, &sigma, &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSharpenImageChannel(intern->magick_wand, channel, radius, sigma); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to sharpen image" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::shaveImage(int columns, int rows) + Shaves pixels from the image edges. It allocates the memory necessary for the new Image structure and returns a pointer to the new image. +*/ +PHP_METHOD(Imagick, shaveImage) +{ + php_imagick_object *intern; + im_long columns, rows; + MagickBooleanType status; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &columns, &rows) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickShaveImage(intern->magick_wand, columns, rows); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to shave image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::shearImage(ImagickPixel background, float x_shear, float y_shear) + Slides one edge of an image along the X or Y axis +*/ +PHP_METHOD(Imagick, shearImage) +{ + zval *param; + php_imagick_object *intern; + double x_shear, y_shear; + MagickBooleanType status; + PixelWand *color_wand; + zend_bool allocated; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zdd", ¶m, &x_shear, &y_shear) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + color_wand = php_imagick_zval_to_pixelwand (param, IMAGICK_CLASS, &allocated TSRMLS_CC); + if (!color_wand) + return; + + status = MagickShearImage(intern->magick_wand, color_wand, x_shear, y_shear); + + if (allocated) + color_wand = DestroyPixelWand (color_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to shear image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::spliceImage(int width, int height, int x, int y) + Splices a solid color into the image. +*/ +PHP_METHOD(Imagick, spliceImage) +{ + im_long width, height, x, y; + php_imagick_object *intern; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llll", &width, &height, &x, &y) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSpliceImage(intern->magick_wand, width, height, x, y); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to splice image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto Imagick Imagick::steganoImage(Imagick watermark_wand, int offset) + Hides a digital watermark within the image. Recover the hidden watermark later to prove that the authenticity of an image. Offset defines the start position within the image to hide the watermark. +*/ +PHP_METHOD(Imagick, steganoImage) +{ + zval *objvar; + php_imagick_object *intern, *intern_second, *intern_return; + im_long offset; + MagickWand *tmp_wand; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ol", &objvar, php_imagick_sc_entry, &offset) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + intern_second = Z_IMAGICK_P(objvar); + IMAGICK_NOT_EMPTY(intern_second); + + tmp_wand = MagickSteganoImage(intern->magick_wand, intern_second->magick_wand, offset); + + if (!tmp_wand) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Stegano image failed" TSRMLS_CC); + RETURN_THROWS(); + } + + object_init_ex(return_value, php_imagick_sc_entry); + intern_return = Z_IMAGICK_P(return_value); + php_imagick_replace_magickwand(intern_return, tmp_wand); +} +/* }}} */ + +/* {{{ proto Imagick Imagick::clone() + Makes an exact copy of the Imagick object. +*/ +PHP_METHOD(Imagick, clone) +{ + php_imagick_object *intern, *intern_return; + MagickWand *tmp_wand; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + IMAGICK_METHOD_DEPRECATED("Imagick", "clone"); + intern = Z_IMAGICK_P(getThis()); + tmp_wand = CloneMagickWand(intern->magick_wand); + + if (tmp_wand == NULL) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Cloning Imagick object failed" TSRMLS_CC); + RETURN_THROWS(); + } + + object_init_ex(return_value, php_imagick_sc_entry); + intern_return = Z_IMAGICK_P(return_value); + php_imagick_replace_magickwand(intern_return, tmp_wand); +} +/* }}} */ + +/* {{{ proto bool Imagick::rotateImage(ImagickPixel background, float degrees) + Rotates an image the specified number of degrees. Empty triangles left over from rotating the image are filled with the background color. +*/ +PHP_METHOD(Imagick, rotateImage) +{ + zval *param; + php_imagick_object *intern; + double degrees; + MagickBooleanType status; + PixelWand *color_wand; + zend_bool allocated; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zd", ¶m, °rees) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + color_wand = php_imagick_zval_to_pixelwand (param, IMAGICK_CLASS, &allocated TSRMLS_CC); + if (!color_wand) + return; + + status = MagickRotateImage(intern->magick_wand, color_wand, degrees); + + if (allocated) + color_wand = DestroyPixelWand (color_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to rotate image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::sampleImage(int columns, int rows) + Scales an image to the desired dimensions with pixel sampling. Unlike other scaling methods, this method does not introduce any additional color into the scaled image. +*/ +PHP_METHOD(Imagick, sampleImage) +{ + php_imagick_object *intern; + im_long columns, rows; + MagickBooleanType status; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &columns, &rows) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSampleImage(intern->magick_wand, columns, rows); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to sample image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::solarizeImage(float 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. +*/ +PHP_METHOD(Imagick, solarizeImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + im_long threshold; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &threshold) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSolarizeImage(intern->magick_wand, threshold); + + /* No magick is going to happen */ + if (status == MagickFalse) + { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to solarize image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::shadowImage(float opacity, float sigma, int x, int y) + Simulates an image shadow. +*/ +PHP_METHOD(Imagick, shadowImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + double opacity, sigma; + im_long x, y; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddll", &opacity, &sigma, &x, &y) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickShadowImage(intern->magick_wand, opacity, sigma, x, y); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to shadow image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::motionBlurImage(float radius, float sigma, float angle, int CHANNEL) + 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. +*/ +PHP_METHOD(Imagick, motionBlurImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + double radius, sigma, angle; + im_long channel = IM_DEFAULT_CHANNEL; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddd|l", &radius, &sigma, &angle, &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + +#if MagickLibVersion > 0x643 + status = MagickMotionBlurImageChannel(intern->magick_wand, channel, radius, sigma, angle); +#else + status = MagickMotionBlurImage(intern->magick_wand, radius, sigma, angle); +#endif + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to motion blur image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; + + +} +/* }}} */ + +#if MagickLibVersion < 0x700 +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +/* {{{ proto Imagick Imagick::mosaicImages() + Inlays an image sequence to form a single coherent picture. It returns a wand with each image in the sequence composited at the location defined by the page offset of the image. +*/ +PHP_METHOD(Imagick, mosaicImages) +{ + MagickWand *tmp_wand = NULL; + php_imagick_object *intern, *intern_return; + + IMAGICK_METHOD_DEPRECATED ("Imagick", "mosaicImages"); + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + /* TODO: should this be here? */ + MagickSetFirstIterator(intern->magick_wand); + tmp_wand = MagickMosaicImages(intern->magick_wand); + + if (!tmp_wand) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Mosaic image failed" TSRMLS_CC); + RETURN_THROWS(); + } + + object_init_ex(return_value, php_imagick_sc_entry); + intern_return = Z_IMAGICK_P(return_value); + php_imagick_replace_magickwand(intern_return, tmp_wand); + +} +/* }}} */ +#endif +#endif +/* {{{ proto Imagick Imagick::morphImages(int number_frames) + Method morphs a set of images. Both the image pixels and size are linearly interpolated to give the appearance of a meta-morphosis from one image to the next. +*/ +PHP_METHOD(Imagick, morphImages) +{ + MagickWand *tmp_wand; + php_imagick_object *intern, *intern_return; + im_long frames; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &frames) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + tmp_wand = MagickMorphImages(intern->magick_wand, frames); + + if (!tmp_wand) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Morphing images failed" TSRMLS_CC); + RETURN_THROWS(); + } + + object_init_ex(return_value, php_imagick_sc_entry); + intern_return = Z_IMAGICK_P(return_value); + php_imagick_replace_magickwand(intern_return, tmp_wand); + +} +/* }}} */ + +/* {{{ proto bool Imagick::minifyImage() + Is a convenience method that scales an image proportionally to one-half its original size +*/ +PHP_METHOD(Imagick, minifyImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickMinifyImage(intern->magick_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to minify image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; + +} +/* }}} */ + +/* {{{ proto bool Imagick::posterizeImage(int levels, bool dither) + Reduces the image to a limited number of color level. +*/ +PHP_METHOD(Imagick, posterizeImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + im_long levels; + zend_bool dither; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lb", &levels, &dither) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickPosterizeImage(intern->magick_wand, levels, dither); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to posterize image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; + +} +/* }}} */ + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 +/* {{{ proto bool Imagick::radialBlurImage(float angle, int channel) + Radial blurs an image. +*/ +PHP_METHOD(Imagick, radialBlurImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + double angle; + im_long channel = DefaultChannels; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d|l", &angle, &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickRadialBlurImageChannel(intern->magick_wand, channel, angle); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to radial blur image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif +#endif + +/* {{{ proto bool Imagick::raiseImage(int width, int height, int x, int y, bool raise) + Creates a simulated three-dimensional button-like effect by lightening and darkening the edges of the image. Members width and height of raise_info define the width of the vertical and horizontal edge of the effect. +*/ +PHP_METHOD(Imagick, raiseImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + im_long width, height, x, y; + zend_bool raise; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llllb", &width, &height, &x, &y, &raise) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickRaiseImage(intern->magick_wand, width, height, x, y, raise); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to raise image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::blackThresholdImage(ImagickPixel threshold) + Is like MagickThresholdImage() but forces all pixels below the threshold into black while leaving all pixels above the threshold unchanged. +*/ +PHP_METHOD(Imagick, blackThresholdImage) +{ + php_imagick_object *intern; + zval *param; + MagickBooleanType status; + PixelWand *color_wand; + zend_bool allocated; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", ¶m) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + color_wand = php_imagick_zval_to_pixelwand (param, IMAGICK_CLASS, &allocated TSRMLS_CC); + if (!color_wand) + return; + + status = MagickBlackThresholdImage(intern->magick_wand, color_wand); + + if (allocated) + color_wand = DestroyPixelWand (color_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to black threshold image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::resampleImage(float x_resolution, float y_resolution, int filter, float blur) + Resample image to desired resolution. +*/ +PHP_METHOD(Imagick, resampleImage) +{ + double xRes, yRes, blur; + im_long filter = 0; + php_imagick_object *intern; + MagickBooleanType status; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddld", &xRes, &yRes, &filter, &blur) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + +#if MagickLibVersion >= 0x700 + //TODO - allow filter to be set. + //TODO - figure out what to do about blur. + status = MagickResampleImage(intern->magick_wand, xRes, yRes, LanczosFilter); +#else + status = MagickResampleImage(intern->magick_wand, xRes, yRes, filter, blur); +#endif + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to resample image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::resizeImage(int width, int height, int filter, float blur, bool bestfit = false, bool legacy) + Scales an image to the desired dimensions with one of these filters: + If legacy is true, the calculations are done with the small rounding bug that existed in + Imagick before 3.4.0. If false, the calculations should produce the same results as + ImageMagick CLI does. +*/ +PHP_METHOD(Imagick, resizeImage) +{ + double blur; + im_long width, height, new_width, new_height, filter = 0; + php_imagick_object *intern; + MagickBooleanType status; + zend_bool bestfit = 0; + zend_bool legacy = 0; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llld|bb", &width, &height, &filter, &blur, &bestfit, &legacy) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + if (!php_imagick_thumbnail_dimensions(intern->magick_wand, bestfit, width, height, &new_width, &new_height, legacy)) { + php_imagick_throw_exception(IMAGICK_CLASS, "Invalid image geometry" TSRMLS_CC); + RETURN_THROWS(); + } + +#if MagickLibVersion >= 0x700 + //TODO - remove blur from params + status = MagickResizeImage(intern->magick_wand, new_width, new_height, filter); +#else + status = MagickResizeImage(intern->magick_wand, new_width, new_height, filter, blur); +#endif + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to resize image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::rollImage(int x, int y) + Offsets an image as defined by x and y. +*/ +PHP_METHOD(Imagick, rollImage) +{ + im_long x, y; + php_imagick_object *intern; + MagickBooleanType status; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &x, &y) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + status = MagickRollImage(intern->magick_wand, x, y); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to roll image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto Imagick Imagick::appendImages(bool stack) + Append a set of images. +*/ +PHP_METHOD(Imagick, appendImages) +{ + php_imagick_object *intern, *intern_return; + MagickWand *tmp_wand; + zend_bool stack; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &stack) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + tmp_wand = MagickAppendImages(intern->magick_wand, stack); + + if (!tmp_wand) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to append images" TSRMLS_CC); + RETURN_THROWS(); + } + + object_init_ex(return_value, php_imagick_sc_entry); + intern_return = Z_IMAGICK_P(return_value); + php_imagick_replace_magickwand(intern_return, tmp_wand); +} +/* }}} */ + +/* {{{ proto bool Imagick::whiteThresholdImage(ImagickPixel threshold) + Is like ThresholdImage() but force all pixels above the threshold into white while leaving all pixels below the threshold unchanged. +*/ +PHP_METHOD(Imagick, whiteThresholdImage) +{ + php_imagick_object *intern; + zval *param; + MagickBooleanType status; + PixelWand *color_wand; + zend_bool allocated; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", ¶m) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + color_wand = php_imagick_zval_to_pixelwand (param, IMAGICK_CLASS, &allocated TSRMLS_CC); + if (!color_wand) + return; + + status = MagickWhiteThresholdImage(intern->magick_wand, color_wand); + + if (allocated) + color_wand = DestroyPixelWand (color_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to white threshold image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto ImagickPixelIterator Imagick::getPixelIterator() + Returns a MagickPixelIterator. +*/ +PHP_METHOD(Imagick, getPixelIterator) +{ + PixelIterator *pixel_it; + php_imagick_object *intern; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + pixel_it = NewPixelIterator(intern->magick_wand); + + if (!pixel_it) { + php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "Can not allocate ImagickPixelIterator" TSRMLS_CC); + RETURN_THROWS(); + } + + php_imagick_pixel_iterator_new (pixel_it, return_value TSRMLS_CC); +} +/* }}} */ + +/* {{{ proto ImagickPixelIterator Imagick::getPixelRegionIterator(long x, long y, long columns, long rows) + Returns a subset of pixels in a MagickPixelIterator object. +*/ +PHP_METHOD(Imagick, getPixelRegionIterator) +{ + PixelIterator *pixel_it; + php_imagick_object *intern; + im_long x, y, columns, rows; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llll", &x, &y, &columns, &rows) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + pixel_it = NewPixelRegionIterator(intern->magick_wand, x, y, columns, rows); + + if (!pixel_it) { + php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "Can not allocate ImagickPixelIterator" TSRMLS_CC); + RETURN_THROWS(); + } + + php_imagick_pixel_iterator_new (pixel_it, return_value TSRMLS_CC); +} +/* }}} */ + +/* {{{ proto int Imagick::getCompression() + Gets the wand compression type. +*/ +PHP_METHOD(Imagick, getCompression) +{ + php_imagick_object *intern; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + RETVAL_LONG(MagickGetCompression(intern->magick_wand)); +} +/* }}} */ + +/* {{{ proto int Imagick::getCompressionQuality() + Gets the wand compression quality. +*/ +PHP_METHOD(Imagick, getCompressionQuality) +{ + php_imagick_object *intern; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + RETVAL_LONG(MagickGetCompressionQuality(intern->magick_wand)); +} +/* }}} */ + +/* {{{ proto string Imagick::getCopyright() + Returns the ImageMagick API copyright as a string constant. +*/ +PHP_METHOD(Imagick, getCopyright) +{ + char *copyright; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + copyright = (char *)MagickGetCopyright(); + IM_ZVAL_STRING(return_value, copyright); +} +/* }}} */ + + +/* {{{ proto string Imagick::getConfigureOptions() + Returns any ImageMagick configure options that match the specified pattern (e.g. "*" for all). Options include NAME, VERSION, LIB_VERSION, etc. +*/ +PHP_METHOD(Imagick, getConfigureOptions) +{ + size_t number_options; + + char *pattern = "*"; + IM_LEN_TYPE pattern_len; + char **result; + char *option_value; + unsigned int i; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &pattern, &pattern_len) == FAILURE) { + RETURN_THROWS(); + } + + result = MagickQueryConfigureOptions(pattern, &number_options); + + array_init(return_value); + + for (i=0; i<number_options; i++) { + option_value = MagickQueryConfigureOption(resulti); + IM_add_assoc_string(return_value, resulti, option_value); + DestroyString(resulti); + DestroyString(option_value); + } + RelinquishMagickMemory(result); +} +/* }}} */ + +#if MagickLibVersion > 0x660 +/* {{{ proto string Imagick::getFeatures() + GetFeatures() returns the ImageMagick features that have been compiled into the runtime. +*/ +PHP_METHOD(Imagick, getFeatures) +{ + const char *features; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + features = GetMagickFeatures(); + + IM_ZVAL_STRING(return_value, features); +} +/* }}} */ +#endif + + + +/* {{{ proto string Imagick::getFilename() + Returns the filename associated with an image sequence. +*/ +PHP_METHOD(Imagick, getFilename) +{ + php_imagick_object *intern; + char *filename; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + filename = (char *)MagickGetFilename(intern->magick_wand); + + if (filename) { + IM_ZVAL_STRING(return_value, filename); + IMAGICK_FREE_MAGICK_MEMORY(filename); + } +} +/* }}} */ + +/* {{{ proto string Imagick::getFormat() + Returns the format of the Imagick object. +*/ +PHP_METHOD(Imagick, getFormat) +{ + php_imagick_object *intern; + char *format; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + format = (char *)MagickGetFormat(intern->magick_wand); + + if (format) { + IM_ZVAL_STRING(return_value, format); + IMAGICK_FREE_MAGICK_MEMORY(format); + } +} +/* }}} */ + +/* {{{ proto string Imagick::getHomeURL() + Returns the ImageMagick home URL. +*/ +PHP_METHOD(Imagick, getHomeURL) +{ + char *home_url; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + home_url = (char *)MagickGetHomeURL(); + if (home_url) { + IM_ZVAL_STRING(return_value, home_url); + IMAGICK_FREE_MAGICK_MEMORY(home_url); + } +} +/* }}} */ + +/* {{{ proto int Imagick::getInterlaceScheme() + Gets the wand interlace scheme. +*/ +PHP_METHOD(Imagick, getInterlaceScheme) +{ + php_imagick_object *intern; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + RETVAL_LONG(MagickGetInterlaceScheme(intern->magick_wand)); +} +/* }}} */ + +/* {{{ proto string Imagick::getOption(string key) + Returns a value associated with a wand and the specified key. Use MagickRelinquishMemory() to free the value when you are finished with it. +*/ +PHP_METHOD(Imagick, getOption) +{ + php_imagick_object *intern; + char *key, *value; + IM_LEN_TYPE key_len; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &key, &key_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + + value = MagickGetOption(intern->magick_wand, key); + + if (value) { + IM_ZVAL_STRING(return_value, value); + IMAGICK_FREE_MAGICK_MEMORY(value); + } +} +/* }}} */ + +/* {{{ proto string Imagick::getPackageName() + Returns the ImageMagick package name as a string constant. +*/ +PHP_METHOD(Imagick, getPackageName) +{ + char *package_name; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + package_name = (char *)MagickGetPackageName(); + IM_ZVAL_STRING(return_value, package_name); +} +/* }}} */ + +/* {{{ proto array Imagick::getPage() + Returns the page geometry associated with the Imagick object in an associative array with the keys "width", "height", "x", and "y". +*/ +PHP_METHOD(Imagick, getPage) +{ + php_imagick_object *intern; + MagickBooleanType status; + size_t width, height; + ssize_t x, y; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + status = MagickGetPage(intern->magick_wand, &width, &height, &x, &y); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get page" TSRMLS_CC); + RETURN_THROWS(); + } + + array_init(return_value); + add_assoc_long(return_value, "width", width); + add_assoc_long(return_value, "height", height); + add_assoc_long(return_value, "x", x); + add_assoc_long(return_value, "y", y); +} +/* }}} */ + +/* {{{ proto int Imagick::getHDRIEnabled() + Returns true if Imagick was compiled against a HDRI verison of ImageMagick. +*/ +PHP_METHOD(Imagick, getHdriEnabled) +{ + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + +#if MAGICKCORE_HDRI_ENABLE + RETURN_TRUE; +#else + RETURN_FALSE; +#endif +} +/* }}} */ + + +/* {{{ proto int Imagick::getQuantum() + Returns the ImageMagick quantum range as an integer. +*/ +PHP_METHOD(Imagick, getQuantum) +{ + size_t range; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + MagickGetQuantumRange(&range); + ZVAL_LONG(return_value, range); + +//#ifdef MAGICKCORE_HDRI_ENABLE +// RETVAL_DOUBLE(color_value); +//#else +// RETVAL_LONG(color_value); +//#endif +} +/* }}} */ + + +/* {{{ proto array Imagick::getQuantumDepth() + Returns the ImageMagick quantum depth as a string constant. +*/ +PHP_METHOD(Imagick, getQuantumDepth) +{ + const char *quantum_depth; + size_t depth; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + quantum_depth = MagickGetQuantumDepth(&depth); + + array_init(return_value); + add_assoc_long(return_value, "quantumDepthLong", depth); + IM_add_assoc_string(return_value, "quantumDepthString", (char *)quantum_depth); +} +/* }}} */ + +/* {{{ proto array Imagick::getQuantumRange() + Returns the ImageMagick quantum range as a string constant. +*/ +PHP_METHOD(Imagick, getQuantumRange) +{ + const char *quantum_range; + size_t range; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + quantum_range = MagickGetQuantumRange(&range); + array_init(return_value); + + add_assoc_long(return_value, "quantumRangeLong", range); + IM_add_assoc_string(return_value, "quantumRangeString", (char *)quantum_range); +} +/* }}} */ + +/* {{{ proto string Imagick::getReleaseDate() + Returns the ImageMagick release date as a string constant. +*/ +PHP_METHOD(Imagick, getReleaseDate) +{ + char *release_date; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + release_date = (char *)MagickGetReleaseDate(); + IM_ZVAL_STRING(return_value, release_date); +} +/* }}} */ + +/* {{{ proto int Imagick::getResource(int type) + Returns the specified resource in megabytes. +*/ +PHP_METHOD(Imagick, getResource) +{ + im_long resource_type; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &resource_type) == FAILURE) { + RETURN_THROWS(); + } + + RETVAL_LONG(MagickGetResource(resource_type)); +} +/* }}} */ + +/* {{{ proto float Imagick::getResourceLimit(int type) + Returns the specified resource limit in megabytes. +*/ +PHP_METHOD(Imagick, getResourceLimit) +{ + im_long resource_type; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &resource_type) == FAILURE) { + RETURN_THROWS(); + } + + RETVAL_DOUBLE(MagickGetResourceLimit(resource_type)); +} +/* }}} */ + +/* {{{ proto array Imagick::getSamplingFactors() + Gets the horizontal and vertical sampling factor. +*/ +PHP_METHOD(Imagick, getSamplingFactors) +{ + php_imagick_object *intern; + double *sampling_factors; + unsigned long i; + size_t number_factors = 0; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + + sampling_factors = (double *)MagickGetSamplingFactors(intern->magick_wand, &number_factors); + + array_init(return_value); + + for (i = 0 ; i < number_factors; i++) { + add_next_index_double(return_value, sampling_factorsi); + } + + MagickRelinquishMemory(sampling_factors); +} +/* }}} */ + +/* {{{ proto array Imagick::getSize() + Returns the size associated with the Imagick object as an array with the keys "columns" and "rows". +*/ +PHP_METHOD(Imagick, getSize) +{ + php_imagick_object *intern; + size_t columns, rows; + MagickBooleanType status; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + status = MagickGetSize(intern->magick_wand, &columns, &rows); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get size" TSRMLS_CC); + RETURN_THROWS(); + } + + array_init(return_value); + add_assoc_long(return_value, "columns", columns); + add_assoc_long(return_value, "rows", rows); +} +/* }}} */ + +/* {{{ proto array Imagick::getVersion() + Returns the ImageMagick API version as a string constant and as a number. +*/ +PHP_METHOD(Imagick, getVersion) +{ + char *version_string; + size_t version_number; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + version_string = (char *)MagickGetVersion(&version_number); + array_init(return_value); + + add_assoc_long(return_value, "versionNumber", (long) version_number); + IM_add_assoc_string(return_value, "versionString", version_string); +} +/* }}} */ + +/* {{{ proto bool Imagick::setBackgroundColor(ImagickPixel background) + Sets the wand background color. +*/ +PHP_METHOD(Imagick, setBackgroundColor) +{ + zval *param; + php_imagick_object *intern; + MagickBooleanType status; + PixelWand *background_wand; + zend_bool allocated = 0; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", ¶m) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + + background_wand = php_imagick_zval_to_pixelwand (param, IMAGICK_CLASS, &allocated TSRMLS_CC); + if (!background_wand) + return; + + status = MagickSetBackgroundColor(intern->magick_wand, background_wand); + + if (allocated) + background_wand = DestroyPixelWand (background_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set background color" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::setCompression(COMPRESSIONTYPE compression) + Sets the wand compression type. +*/ +PHP_METHOD(Imagick, setCompression) +{ + php_imagick_object *intern; + im_long compression; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &compression) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + status = MagickSetCompression(intern->magick_wand, compression); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set compression" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::setCompressionQuality(int quality) + Sets the wand compression quality. +*/ +PHP_METHOD(Imagick, setCompressionQuality) +{ + php_imagick_object *intern; + im_long quality; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &quality) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + status = MagickSetCompressionQuality(intern->magick_wand, quality); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set compression quality" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::setFilename(string filename) + Sets the filename before you read or write an image file. +*/ +PHP_METHOD(Imagick, setFilename) +{ + php_imagick_object *intern; + char *filename; + IM_LEN_TYPE filename_len; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + status = MagickSetFilename(intern->magick_wand, filename); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set filename" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::setFormat(string format) + Sets the format of the Imagick object. +*/ +PHP_METHOD(Imagick, setFormat) +{ + php_imagick_object *intern; + char *format; + IM_LEN_TYPE format_len; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &format, &format_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + status = MagickSetFormat(intern->magick_wand, format); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set format" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::setInterlaceScheme(INTERLACETYPE interlace_scheme) + Sets the image compression. +*/ +PHP_METHOD(Imagick, setInterlaceScheme) +{ + php_imagick_object *intern; + im_long schema; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &schema) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + status = MagickSetInterlaceScheme(intern->magick_wand, schema); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set interlace scheme" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::setOption(string key, string value) + Associates one or options with the wand (.e.g MagickSetOption(wand,"jpeg:perserve","yes")). +*/ +PHP_METHOD(Imagick, setOption) +{ + php_imagick_object *intern; + MagickBooleanType status; + char *key, *value; + IM_LEN_TYPE key_len, value_len; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &key, &key_len, &value, &value_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + status = MagickSetOption(intern->magick_wand, key, value); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set option" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::setPage(int width, int height, int x, int y) + Sets the page geometry of the Imagick object. +*/ +PHP_METHOD(Imagick, setPage) +{ + php_imagick_object *intern; + MagickBooleanType status; + im_long width, height, x, y; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llll", &width, &height, &x, &y) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + status = MagickSetPage(intern->magick_wand, width, height, x, y); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set page" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +PHP_METHOD(Imagick, setImageProgressMonitor) +{ + char *filename; + IM_LEN_TYPE filename_len; + php_imagick_object *intern; + php_imagick_rw_result_t rc; + + if (!IMAGICK_G(progress_monitor)) { + php_imagick_throw_exception(IMAGICK_CLASS, "Progress monitoring is disabled in ini-settings" TSRMLS_CC); + RETURN_THROWS(); + } + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + + if ((rc = php_imagick_file_access_check (filename TSRMLS_CC)) != IMAGICK_RW_OK) { + php_imagick_rw_fail_to_exception (intern->magick_wand, rc, filename TSRMLS_CC); + RETURN_THROWS(); + } + + if (intern->progress_monitor_name) { + efree(intern->progress_monitor_name); + } + + intern->progress_monitor_name = estrdup(filename); + MagickSetImageProgressMonitor(intern->magick_wand, php_imagick_progress_monitor, intern); + RETURN_TRUE; +} + +/* {{{ proto bool Imagick::setProgressMonitor(callable callback) + Set a callback that will be called during the processing of the Imagick image. +*/ +#if MagickLibVersion > 0x653 +PHP_METHOD(Imagick, setProgressMonitor) +{ + zval *user_callback; + + php_imagick_object *intern; + php_imagick_callback *callback; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &user_callback) == FAILURE) { + RETURN_FALSE; + } + + // Check whether the callback is valid now, rather than failing later + if (!user_callback || !zend_is_callable(user_callback, 0, NULL TSRMLS_CC)) { + php_imagick_throw_exception(IMAGICK_CLASS, "First argument to setProgressMonitor is expected to be a valid callback" TSRMLS_CC); + RETURN_FALSE; + } + + callback = (php_imagick_callback *) emalloc(sizeof(php_imagick_callback)); + + TSRMLS_SET_CTX(callback->thread_ctx); + //We can't free the previous callback as we can't guarantee that + //ImageMagick won't use it at some point. There is no 'unbind' function + //for previously set 'MagickSetImageProgressMonitor' + callback->previous_callback = IMAGICK_G(progress_callback); + + //Add a ref and store the user's callback +#if PHP_VERSION_ID >= 70000 + Z_TRY_ADDREF_P(user_callback); + ZVAL_COPY_VALUE(&callback->user_callback, user_callback); +#else + Z_ADDREF_P(user_callback); + callback->user_callback = user_callback; +#endif + + //The callback is now valid, store it in the global + IMAGICK_G(progress_callback) = callback; + intern = Z_IMAGICK_P(getThis()); + + MagickSetImageProgressMonitor(intern->magick_wand, php_imagick_progress_monitor_callable, callback); + RETURN_TRUE; +} +#endif + +/* {{{ proto bool Imagick::setResourceLimit(RESOURCETYPE type, int limit) + Sets the limit for a particular resource in megabytes. +*/ +PHP_METHOD(Imagick, setResourceLimit) +{ + MagickBooleanType status; + im_long type; + double limit; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ld", &type, &limit) == FAILURE) { + RETURN_THROWS(); + } + + status = MagickSetResourceLimit(type, (MagickSizeType)limit); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_throw_exception(IMAGICK_CLASS, "Unable to set resource limit" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::setResolution(float x_resolution, float y_resolution) + Sets the image resolution. +*/ +PHP_METHOD(Imagick, setResolution) +{ + php_imagick_object *intern; + MagickBooleanType status; + double x_resolution, y_resolution; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &x_resolution, &y_resolution) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + status = MagickSetResolution(intern->magick_wand, x_resolution, y_resolution); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set resolution" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::setSamplingFactors(array factors) + Sets the image sampling factors. +*/ +PHP_METHOD(Imagick, setSamplingFactors) +{ + php_imagick_object *intern; + MagickBooleanType status; + zval *factors; + double *double_array; + im_long elements = 0; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &factors) == FAILURE) { + RETURN_THROWS(); + } + + double_array = php_imagick_zval_to_double_array(factors, &elements TSRMLS_CC); + + if (!double_array) { + php_imagick_throw_exception(IMAGICK_CLASS, "Can't read array" TSRMLS_CC); + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + + status = MagickSetSamplingFactors(intern->magick_wand, elements, double_array); + efree(double_array); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set sampling factors" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::setSize(int columns, int rows) + Sets the size of the Imagick object. Set it before you read a raw image format such as RGB, GRAY, or CMYK. +*/ +PHP_METHOD(Imagick, setSize) +{ + php_imagick_object *intern; + im_long columns, rows; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &columns, &rows) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + status = MagickSetSize(intern->magick_wand, columns, rows); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set size" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::setType(IMAGETYPE image_type) + Sets the image type attribute. +*/ +PHP_METHOD(Imagick, setType) +{ + php_imagick_object *intern; + im_long type; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &type) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + status = MagickSetType(intern->magick_wand, type); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to set type" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +#if MagickLibVersion >= 0x659 +/* {{{ proto bool Imagick::brightnessContrastImage(float brigthness, float contrast, int channel) + Change the brightness and/or contrast of an image. It converts the brightness and contrast parameters into slope and intercept and calls a polynomical function to apply to the image. +*/ +PHP_METHOD(Imagick, brightnessContrastImage) +{ + php_imagick_object *intern; + double brightness, contrast; + MagickBooleanType status; + im_long channel = IM_DEFAULT_CHANNEL; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd|l", &brightness, &contrast, &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickBrightnessContrastImageChannel(intern->magick_wand, channel, brightness, contrast); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to brightnesscontrastimage" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif + + +#if MagickLibVersion > 0x661 + +static KernelInfo *php_imagick_getKernelInfo(const double *color_matrix, const size_t order) +{ + KernelInfo *kernel_info; + +#if MagickLibVersion >= 0x700 + ExceptionInfo *ex_info = NULL; + //TODO - inspect exception info + kernel_info=AcquireKernelInfo(NULL, ex_info); +#else + kernel_info=AcquireKernelInfo(NULL); +#endif + if (kernel_info == (KernelInfo *) NULL) { + return NULL; + } + + kernel_info->width = order; + kernel_info->height = order; +#if MagickLibVersion >= 0x700 + { + unsigned int i; + kernel_info->values = (MagickRealType *)AcquireAlignedMemory(order, order*sizeof(MagickRealType)); + for (i=0 ; i<order*order ; i++) { + kernel_info->valuesi = color_matrixi; + } + } +#else + kernel_info->values = (double *)AcquireAlignedMemory(order, order*sizeof(double)); + memcpy(kernel_info->values, color_matrix, order * order * sizeof(double)); +#endif + + return kernel_info; +} + + +/* {{{ proto bool Imagick::colorMatrixImage(array kernel) + apply color transformation to an image. The method permits saturation changes, hue rotation, luminance to alpha, and various other effects. Although variable-sized transformation matrices can be used, typically one uses a 5x5 matrix for an RGBA image and a 6x6 for CMYKA (or RGBA with offsets). The matrix is similar to those used by Adobe Flash except offsets are in column 6 rather than 5 (in support of CMYKA images) and offsets are normalized (divide Flash offset by 255). +*/ +PHP_METHOD(Imagick, colorMatrixImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + zval *color_matrix_array; + double *colors; + size_t order = 0; + im_long num_elements = 0; + KernelInfo *kernel_color_matrix; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &color_matrix_array) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + colors = php_imagick_zval_to_double_array(color_matrix_array, &num_elements TSRMLS_CC); + + if (!colors) { + php_imagick_throw_exception(IMAGICK_CLASS, "Unable to read color matrix array" TSRMLS_CC); + RETURN_THROWS(); + } + + if (num_elements == 25) { + order = 5; + } + else if (num_elements == 36) { + order = 6; + } + else { + efree(colors); + php_imagick_throw_exception(IMAGICK_CLASS, "Color matrix array must be 5x5 or 6x6" TSRMLS_CC); + RETURN_THROWS(); + } + + kernel_color_matrix = php_imagick_getKernelInfo(colors, order); + + //TODO - add check that matrix is 5x5 or 6x6? + status = MagickColorMatrixImage(intern->magick_wand, kernel_color_matrix); + + //Free the memory +#if MagickLibVersion >= 0x700 + kernel_color_matrix->values = (MagickRealType *) NULL; +#else + kernel_color_matrix->values = (double *) NULL; +#endif + kernel_color_matrix = DestroyKernelInfo(kernel_color_matrix); + efree(colors); + + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to colormatriximage" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif + +/* {{{ proto bool Imagick::selectiveBlurImage(float radius, float sigma, float threshold, int channel) + Selectively blur an image within a contrast threshold. It is similar to the unsharpen mask that sharpens everything with contrast above a certain threshold. +*/ +PHP_METHOD(Imagick, selectiveBlurImage) +{ + php_imagick_object *intern; + double brightness, contrast, threshold; + MagickBooleanType status; + im_long channel = IM_DEFAULT_CHANNEL; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddd|l", &brightness, &contrast, &threshold, &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSelectiveBlurImageChannel(intern->magick_wand, channel, brightness, contrast, threshold); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to selectiveblurimage" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + + + +#if MagickLibVersion >= 0x689 +/* {{{ proto bool Imagick::rotationalblurimage(float angle, int channel) + Rotational blurs an image. +*/ +PHP_METHOD(Imagick, rotationalBlurImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + double angle; + im_long channel = IM_DEFAULT_CHANNEL; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d|l", &angle, &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickRotationalBlurImageChannel(intern->magick_wand, channel, angle); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to rotational blur image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif + +#if MagickLibVersion >= 0x683 + +//Technically, this version is available in 0x682. However there was an incompatible +//change to the methods signature in a bug release. So only expose it for stable +//versions. +// +//6.8.2.8 - MagickStatisticImage ( MagickWand* p1, enum ChannelType const p2, enum StatisticType const p3, size_t const p4, size_t const p5 ) (6) +//6.8.2.9 - MagickStatisticImage ( MagickWand* p1, enum StatisticType const p2, size_t const p3, size_t const p4 ) + + +/* {{{ proto bool Imagick::statisticImage(int type, int width, int height, int channel ) + Replace each pixel with corresponding statistic from the neighborhood of the specified width and height. +*/ +PHP_METHOD(Imagick, statisticImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + im_long type; + im_long width, height; + im_long channel = IM_DEFAULT_CHANNEL; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll|l", &type, &width, &height, &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickStatisticImageChannel(intern->magick_wand, channel, type, width, height); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to statisticImage" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +#endif + +#if MagickLibVersion >= 0x652 +/* {{{ proto Imagick Imagick::subimageMatch(Imagick subimage, array &$bestMatch, float &similarity, float similarity_threshold = 0, int metric = ) + Searches for a subimage in the current image and returns a similarity image such that an exact match location is completely white and if none of the pixels match, black, otherwise some gray level in-between. + You can also pass in the optional parameters bestMatch and similarity. After calling the function similarity will be + set to the 'score' of the similarity between the subimage and the matching position in the larger image, bestMatch will + contain an associative array with elements x, y, width, height that describe the matching region. +*/ +PHP_METHOD(Imagick, subimageMatch) +{ + php_imagick_object *intern; + RectangleInfo best_match_offset; + double similarity; + double similarity_threshold = 0.0; + + zval *reference_obj; + php_imagick_object *reference_intern; + php_imagick_object *intern_return; + zval *z_similarity = NULL; + zval *z_best_match_offset = NULL; + + //http://devzone.zend.com/317/extension-writing-part-ii-parameters-arrays-and-zvals/ + MagickWand *new_wand; + + +#if MagickLibVersion >= 0x700 + im_long metric = RootMeanSquaredErrorMetric; +#else + im_long metric = 0; +#endif + +#if PHP_VERSION_ID >= 70000 + char *param_string = "O|z/z/dl"; +#else + char *param_string = "O|zzdl"; + +#endif + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, param_string, &reference_obj, php_imagick_sc_entry, &z_best_match_offset, &z_similarity, &similarity_threshold, &metric) == FAILURE) { + RETURN_THROWS(); + } + reference_intern = Z_IMAGICK_P(reference_obj); + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + +#if MagickLibVersion >= 0x700 + new_wand = MagickSimilarityImage(intern->magick_wand, reference_intern->magick_wand, + metric, similarity_threshold, + &best_match_offset, &similarity); +#else + new_wand = MagickSimilarityImage(intern->magick_wand, reference_intern->magick_wand, &best_match_offset, &similarity); +#endif + + if (new_wand == NULL) { + php_imagick_convert_imagick_exception(intern->magick_wand, "subimagematch failed" TSRMLS_CC); + RETURN_THROWS(); + } + + if (z_similarity) { + ZVAL_DOUBLE(z_similarity, similarity); + } + + if (z_best_match_offset) { + array_init(z_best_match_offset); + add_assoc_long(z_best_match_offset, "x", best_match_offset.x); + add_assoc_long(z_best_match_offset, "y", best_match_offset.y); + add_assoc_long(z_best_match_offset, "width", best_match_offset.width); + add_assoc_long(z_best_match_offset, "height", best_match_offset.height); + } + + object_init_ex(return_value, php_imagick_sc_entry); + intern_return = Z_IMAGICK_P(return_value); + php_imagick_replace_magickwand(intern_return, new_wand); +} +/* }}} */ +#endif + + +/* {{{ proto bool Imagick::setRegistry(string key, string value) + Sets the ImageMagick registry entry named key to value. This is most + useful for setting "temporary-path" which controls where ImageMagick + creates temporary images e.g. while processing PDFs. +*/ +PHP_METHOD(Imagick, setRegistry) +{ + MagickBooleanType status; + char *key, *value; + IM_LEN_TYPE key_len, value_len; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &key, &key_len, &value, &value_len) == FAILURE) { + RETURN_THROWS(); + } + + status = SetImageRegistry(StringRegistryType, key, value, NULL); + + /* No magick is going to happen */ + if (status == MagickFalse) { + RETURN_FALSE; + } + + RETURN_TRUE; +} +/* }}} */ + + +/* {{{ proto string|false Imagick::getRegistry(string key) + Get the StringRegistry entry for the named key or false if not set. +*/ +PHP_METHOD(Imagick, getRegistry) +{ + char *key, *value; + IM_LEN_TYPE key_len; + ExceptionInfo *ex_info; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &key, &key_len) == FAILURE) { + RETURN_THROWS(); + } + + ex_info = AcquireExceptionInfo(); + + value = GetImageRegistry(StringRegistryType, key, ex_info); + + if (ex_info->severity != 0) { + zend_throw_exception_ex(php_imagick_exception_class_entry, 1 TSRMLS_CC, "Imagick::getRegistry exception (%s) ", ex_info->reason); + ex_info = DestroyExceptionInfo(ex_info); + RETURN_THROWS(); + } + + ex_info = DestroyExceptionInfo(ex_info); + + if (value != NULL) { + IM_ZVAL_STRING(return_value, value); + IMAGICK_FREE_MAGICK_MEMORY(value); + return; + } + + RETURN_FALSE; +} +/* }}} */ + + +/* {{{ proto array Imagick::listRegistry() + List all the registry settings calls GetImageRegistry. returns an array of all the key/value pairs in the registry +*/ +PHP_METHOD(Imagick, listRegistry) +{ + char *registry = NULL; + char *value = NULL; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + array_init(return_value); + + ResetImageRegistryIterator(); + while ((registry = GetNextImageRegistry())) { + value = GetImageRegistry(StringRegistryType, registry, NULL); + //should this be add_assoc_string(return_value, estrdup(registry), value, 1); + IM_add_assoc_string(return_value, registry, value); + IMAGICK_FREE_MAGICK_MEMORY(value); + } +} +/* }}} */ + +#if MagickLibVersion >= 0x680 +/* {{{ proto bool Imagick::morphology(int morphologyMethod, int iterations, ImagickKernel kernel, int CHANNEL ) + Applies a user supplied kernel to the image according to the given morphology method. + iterations - A value of -1 means loop until no change found. How this is applied may depend on the morphology method. Typically this is a value of 1. +*/ +PHP_METHOD(Imagick, morphology) +{ + zval *objvar; + php_imagick_object *intern; + php_imagickkernel_object *kernel; + im_long morphologyMethod, iterations; + MagickBooleanType status; + im_long channel = IM_DEFAULT_CHANNEL; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llO|l", &morphologyMethod, &iterations, &objvar, php_imagickkernel_sc_entry, &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + kernel = Z_IMAGICKKERNEL_P(objvar); + IMAGICK_KERNEL_NOT_NULL_EMPTY(kernel); + + status = MagickMorphologyImageChannel( + intern->magick_wand, + channel, + morphologyMethod, + iterations, + kernel->kernel_info + ); + + // No magick is going to happen + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to morphology image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif //#if MagickLibVersion >= 0x680 + +#ifdef IMAGICK_WITH_KERNEL +#if MagickLibVersion < 0x700 +/* {{{ proto bool Imagick::filter(ImagickKernel kernel, int CHANNEL ) + Applies a custom convolution kernel to the image. +*/ +PHP_METHOD(Imagick, filter) +{ + zval *objvar; + php_imagick_object *intern; + php_imagickkernel_object *kernel; + MagickBooleanType status; + ChannelType channel = UndefinedChannel; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|l", &objvar, php_imagickkernel_sc_entry, &channel) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + kernel = Z_IMAGICKKERNEL_P(objvar); + + if ((kernel->kernel_info->width % 2) != 1) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Only odd-sized, square kernels can be applied as a filter." TSRMLS_CC); + RETURN_THROWS(); + } + + if (kernel->kernel_info->width != kernel->kernel_info->height) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Only odd-sized, square kernels can be applied as a filter." TSRMLS_CC); + RETURN_THROWS(); + } + + if (channel == 0) { + status = MagickFilterImage(intern->magick_wand, kernel->kernel_info); + } + else { + status = MagickFilterImageChannel(intern->magick_wand, channel, kernel->kernel_info); + } + + // No magick is going to happen + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Failed to filter image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif //#if MagickLibVersion < 0x700 +#endif // #ifdef IMAGICK_WITH_KERNEL + +/* {{{ proto void Imagick::setAntiAlias(bool antialias) + Set whether antialiasing should be used for operations. On by default. +*/ +PHP_METHOD(Imagick, setAntialias) +{ + php_imagick_object *intern; + zend_bool antialias; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &antialias) == FAILURE) { + RETURN_THROWS(); + } + (void)return_value; // fix -Werror=unused-parameter + + intern = Z_IMAGICK_P(getThis()); + status = MagickSetAntialias(intern->magick_wand, antialias); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to setAntiAlias" TSRMLS_CC); + RETURN_THROWS(); + } +} +/* }}} */ + +/* {{{ proto bool Imagick::getAntiAlias() + get whether antialiasing would be used for operations. +*/ +PHP_METHOD(Imagick, getAntialias) +{ + php_imagick_object *intern; + MagickBooleanType antialias; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + antialias = MagickGetAntialias(intern->magick_wand); + + if (antialias == MagickTrue) { + RETURN_TRUE; + } else { + RETURN_FALSE; + } +} +/* }}} */ + +#if MagickLibVersion > 0x676 +/* {{{ proto bool Imagick::colorDecisionListImage(string color_correction_collection) + Set whether antialiasing should be used for operations. On by default. +*/ +PHP_METHOD(Imagick, colorDecisionListImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + + char *color_correction_collection; + IM_LEN_TYPE ccc_len; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &color_correction_collection, &ccc_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + status = MagickColorDecisionListImage(intern->magick_wand, color_correction_collection); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to colorDecisionListImage" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif + +#if MagickLibVersion >= 0x687 +/* {{{ proto void Imagick::optimizeimagetransparency() + Takes a frame optimized GIF animation, and compares the overlayed pixels against the disposal image resulting fr +*/ +PHP_METHOD(Imagick, optimizeImageTransparency) +{ + php_imagick_object *intern; + MagickBooleanType status; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + (void)return_value; // fix -Werror=unused-parameter + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickOptimizeImageTransparency(intern->magick_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Optimize image transparency failed" TSRMLS_CC); + RETURN_THROWS(); + } +} +/* }}} */ +#endif + +#if MagickLibVersion >= 0x660 +/* {{{ proto void Imagick::autoGammaImage(int channel = CHANNEL_ALL) + Extracts the 'mean' from the image and adjust the image to try make set its gamma appropriately. +*/ +PHP_METHOD(Imagick, autoGammaImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + im_long channel = IM_DEFAULT_CHANNEL; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &channel) == FAILURE) { + RETURN_THROWS(); + } + (void)return_value; // fix -Werror=unused-parameter + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickAutoGammaImageChannel(intern->magick_wand, channel); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "autoGammaImage" TSRMLS_CC); + RETURN_THROWS(); + } +} +/* }}} */ +#endif //#if MagickLibVersion >= 0x660 + +#if MagickLibVersion >= 0x692 +/* {{{ proto void Imagick::autoOrient() + Adjusts an image so that its orientation is suitable $ for viewing (i.e. top-left orientation). +*/ +PHP_METHOD(Imagick, autoOrient) +{ + php_imagick_object *intern; + MagickBooleanType status; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + (void)return_value; // fix -Werror=unused-parameter + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickAutoOrientImage(intern->magick_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable autoOrient image" TSRMLS_CC); + RETURN_THROWS(); + } +} +/* }}} */ +#endif // #if MagickLibVersion >= 0x692 + +#if MagickLibVersion >= 0x692 +/* {{{ proto bool Imagick::compositeImageGravity(Imagick $image, int COMPOSITE_CONSTANT, int GRAVITY_CONSTANT) + Composite one image onto another using the specified gravity. +*/ +PHP_METHOD(Imagick, compositeImageGravity) +{ + zval *objvar; + php_imagick_object *intern, *image_to_composite; + MagickBooleanType status; + im_long composite, gravity; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Oll", &objvar, php_imagick_sc_entry, &composite, &gravity) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + image_to_composite = Z_IMAGICK_P(objvar); + IMAGICK_NOT_EMPTY(image_to_composite); + + status = MagickCompositeImageGravity(intern->magick_wand, image_to_composite->magick_wand, composite, gravity); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to compositeImageGravity" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif + +#if MagickLibVersion >= 0x693 +/* {{{ proto void Imagick::localContrastImage(float radius, float strength) +Attempts to increase the appearance of large-scale light-dark transitions. +Local contrast enhancement works similarly to sharpening with an unsharp mask, +however the mask is instead created using an image with a greater blur distance. +*/ +PHP_METHOD(Imagick, localContrastImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + double radius, strength; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &radius, &strength) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickLocalContrastImage(intern->magick_wand, radius, strength); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Failed to localContrastImage" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif // #if MagickLibVersion >= 0x693 + + +#if MagickLibVersion >= 0x700 +/* {{{ proto int Imagick::identifyImageType() + Identifies the potential image type, returns one of the Imagick::IMGTYPE_* constants +*/ +PHP_METHOD(Imagick, identifyImageType) +{ + php_imagick_object *intern; + long imageType; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + imageType = MagickIdentifyImageType(intern->magick_wand); + + RETVAL_LONG(imageType); +} +/* }}} */ +#endif // #if MagickLibVersion >= 0x700 + + +#if IM_HAVE_IMAGICK_GETSETIMAGEMASK +/* {{{ proto Imagick Imagick::getImageMask() + returns one of the Imagick::PIXELMASK_* constants +*/ +PHP_METHOD(Imagick, getImageMask) +{ + php_imagick_object *intern; + php_imagick_object *intern_return; + im_long pixelmask_type; + MagickWand *tmp_wand; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &pixelmask_type) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + tmp_wand = MagickGetImageMask(intern->magick_wand, pixelmask_type); + + /* No magick is going to happen */ + if (!tmp_wand) { + RETURN_NULL(); + +// php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to get image clip mask" TSRMLS_CC); +// RETURN_THROWS(); + + } + + object_init_ex(return_value, php_imagick_sc_entry); + intern_return = Z_IMAGICK_P(return_value); + + php_imagick_replace_magickwand(intern_return, tmp_wand); +} +/* }}} */ + +/* {{{ proto void Imagick::setImageMask(Imagick $clip_mask, int $pixelmask_type) + returns one of the Imagick::PIXELMASK_* constants +*/ +PHP_METHOD(Imagick, setImageMask) +{ + php_imagick_object *intern; + php_imagick_object *clip_mask; + zval *objvar; + im_long pixelmask_type; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ol", &objvar, php_imagick_sc_entry, &pixelmask_type) == FAILURE) { + RETURN_THROWS(); + } + (void)return_value; // fix -Werror=unused-parameter + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + clip_mask = Z_IMAGICK_P(objvar); + IMAGICK_NOT_EMPTY(clip_mask); + + MagickSetImageMask( + intern->magick_wand, + pixelmask_type, + clip_mask->magick_wand + ); + + // TODO - check that + // wand->exception + // You want ei->severity. ei->error_number + // the Go Imagick library does something like: + //return &MagickWandException{ExceptionType(C.int(et)), C.GoString(csdescription)} +} +/* }}} */ +#endif // IM_HAVE_IMAGICK_GETSETIMAGEMASK + + + +#if IM_HAVE_IMAGICK_CANNYEDGEIMAGE +/* {{{ proto void Imagick::cannyEdgeImage(float $radius, float $sigma, float $lower_percent, float $upper_percent +*/ +PHP_METHOD(Imagick, cannyEdgeImage) +{ + php_imagick_object *intern; + double radius, sigma, lower_percent, upper_percent; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddd", &radius, &sigma, &lower_percent, &upper_percent) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickCannyEdgeImage( + intern->magick_wand, + radius, + sigma, + lower_percent, + upper_percent + ); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to cannyEdgeImage" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif // IM_HAVE_IMAGICK_CANNYEDGEIMAGE + +#if IM_HAVE_IMAGICK_SETSEED +/* {{{ proto void Imagick::setSeed(int seed) + Set the random number seed for ImageMagick +*/ +PHP_METHOD(Imagick, setSeed) +{ + im_long seed; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &seed) == FAILURE) { + RETURN_THROWS(); + } + + MagickSetSeed(seed); + + RETURN_NULL(); +} +/* }}} */ +#endif // IM_HAVE_IMAGICK_SETSEED + +#if IM_HAVE_IMAGICK_WAVELETDENOISEIMAGE +/* {{{ proto bool Imagick::waveletDenoiseImage(float $threshold, float $softness +*/ +PHP_METHOD(Imagick, waveletDenoiseImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + double threshold, softness; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &threshold, &softness) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickWaveletDenoiseImage( + intern->magick_wand, + threshold, + softness + ); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to waveletDenoiseImage" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif // IM_HAVE_IMAGICK_WAVELETDENOISEIMAGE + +#if IM_HAVE_IMAGICK_MEANSHIFTIMAGE +/* {{{ proto bool Imagick::meanShiftImage(int $width, int $height, float $color_distance +*/ +PHP_METHOD(Imagick, meanShiftImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + im_long width, height; + double color_distance; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lld", &width, &height, &color_distance) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickMeanShiftImage( + intern->magick_wand, + width, + height, + color_distance + ); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to meanShiftImage" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif // IM_HAVE_IMAGICK_MEANSHIFTIMAGE + +#if IM_HAVE_IMAGICK_KMEANSIMAGE +/* {{{ proto bool Imagick::kmeansImage(int $number_colors, int $max_iterations, float $tolerance +*/ +PHP_METHOD(Imagick, kmeansImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + im_long number_colors, max_iterations; + double tolerance; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lld", &number_colors, &max_iterations, &tolerance) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickKmeansImage( + intern->magick_wand, + number_colors, + max_iterations, + tolerance + ); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to kmeansImage" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif // IM_HAVE_IMAGICK_KMEANSIMAGE + +#if IM_HAVE_IMAGICK_RANGETHRESHOLDIMAGE +/* {{{ proto void Imagick::rangeThresholdImage(float $low_black, float $low_white, float $high_white, float $high_black +*/ +PHP_METHOD(Imagick, rangeThresholdImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + double low_black, low_white, high_white, high_black; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddd", &low_black, &low_white, &high_white, &high_black) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickRangeThresholdImage( + intern->magick_wand, + low_black, + low_white, + high_white, + high_black + ); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to rangeThresholdImage" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif // IM_HAVE_IMAGICK_RANGETHRESHOLDIMAGE + +#if IM_HAVE_IMAGICK_AUTOTHRESHOLDIMAGE +/* {{{ proto bool Imagick::autoThresholdImage(int $auto_threshold_method +*/ +PHP_METHOD(Imagick, autoThresholdImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + im_long auto_threshold_method; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &auto_threshold_method) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickAutoThresholdImage( + intern->magick_wand, + auto_threshold_method + ); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to autoThresholdImage" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif // IM_HAVE_IMAGICK_AUTOTHRESHOLDIMAGE + +#if IM_HAVE_IMAGICK_BILATERALBLURIMAGE +/* {{{ proto void Imagick::bilateralBlurImage(float $radius, float $sigma, float $intensity_sigma, float $spatial_sigma +*/ +PHP_METHOD(Imagick, bilateralBlurImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + double radius, sigma, intensity_sigma, spatial_sigma; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddd", &radius, &sigma, &intensity_sigma, &spatial_sigma) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickBilateralBlurImage( + intern->magick_wand, + radius, + sigma, + intensity_sigma, + spatial_sigma + ); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to bilateralBlurImage" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif // IM_HAVE_IMAGICK_BILATERALBLURIMAGE + +#if IM_HAVE_IMAGICK_CLAHEIMAGE +/* {{{ proto void Imagick::claheImage(int $width, int $height, int $number_bins, float $clip_limit +*/ +PHP_METHOD(Imagick, claheImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + im_long width, height, number_bins; + double clip_limit; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llld", &width, &height, &number_bins, &clip_limit) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickCLAHEImage( + intern->magick_wand, + width, + height, + number_bins, + clip_limit + ); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to claheImage" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif //IM_HAVE_IMAGICK_CLAHEIMAGE + +#if IM_HAVE_IMAGICK_CHANNELFXIMAGE +/* {{{ proto bool Imagick::channelFxImage(string $expression) +*/ +PHP_METHOD(Imagick, channelFxImage) +{ + php_imagick_object *intern; + MagickWand *fx_image; + php_imagick_object *intern_return; + + char *expression; + IM_LEN_TYPE expression_len; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &expression, &expression_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + fx_image = MagickChannelFxImage(intern->magick_wand, expression); + + if (!fx_image) { + php_imagick_convert_imagick_exception(intern->magick_wand, "channelFxImage failed" TSRMLS_CC); + RETURN_THROWS(); + } + + object_init_ex(return_value, php_imagick_sc_entry); + intern_return = Z_IMAGICK_P(return_value); + + php_imagick_replace_magickwand(intern_return, fx_image); +} +/* }}} */ +#endif // IM_HAVE_IMAGICK_CHANNELFXIMAGE + +#if IM_HAVE_IMAGICK_COLORTHRESHOLDIMAGE +/* {{{ proto bool colorThresholdImage(ImagickPixel|string $start_color, ImagickPixel|string $stop_color): +*/ +PHP_METHOD(Imagick, colorThresholdImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + zval *start_color_param, *stop_color_param; + PixelWand *start_color_wand, *stop_color_wand; + zend_bool start_color_allocated = 0, stop_color_allocated = 0; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &start_color_param, &stop_color_param) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + start_color_wand = php_imagick_zval_to_pixelwand (start_color_param, IMAGICK_CLASS, &start_color_allocated TSRMLS_CC); + if (!start_color_wand) + return; + + stop_color_wand = php_imagick_zval_to_pixelwand (stop_color_param, IMAGICK_CLASS, &stop_color_allocated TSRMLS_CC); + if (!stop_color_wand) + return; + + status = MagickColorThresholdImage( + intern->magick_wand, + start_color_wand, + stop_color_wand + ); + + if (start_color_allocated) + start_color_wand = DestroyPixelWand (start_color_wand); + + if (stop_color_allocated) + stop_color_wand = DestroyPixelWand (stop_color_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to colorThresholdImage" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif //IM_HAVE_IMAGICK_COLORTHRESHOLDIMAGE + + +#if IM_HAVE_IMAGICK_COMPLEXIMAGES +/* {{{ proto Imagick complexImages(int $complex_operator) +*/ +PHP_METHOD(Imagick, complexImages) +{ + im_long complex_operator; + MagickBooleanType status; + php_imagick_object *intern; + MagickWand *complexed; + php_imagick_object *intern_return; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &complex_operator) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSetIteratorIndex(intern->magick_wand, 0); + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "complexImages failed to set iterator index to 0" TSRMLS_CC); + RETURN_THROWS(); + } + + complexed = MagickComplexImages( + intern->magick_wand, + complex_operator + ); + + if (!complexed) { + php_imagick_convert_imagick_exception(intern->magick_wand, "complexImages failed" TSRMLS_CC); + RETURN_THROWS(); + } + + object_init_ex(return_value, php_imagick_sc_entry); + intern_return = Z_IMAGICK_P(return_value); + + php_imagick_replace_magickwand(intern_return, complexed); +} +/* }}} */ +#endif //IM_HAVE_IMAGICK_COMPLEXIMAGES + + +#if IM_HAVE_IMAGICK_INTERPOLATIVERESIZEIMAGE +/* {{{ proto bool interpolativeResizeImage(int $columns, int $rows, int $interpolate) +*/ +PHP_METHOD(Imagick, interpolativeResizeImage) +{ + im_long columns, rows, interpolate; + MagickBooleanType status; + php_imagick_object *intern; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &columns, &rows, &interpolate) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickInterpolativeResizeImage( + intern->magick_wand, + columns, + rows, + interpolate + ); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to interpolativeResizeImage" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif //IM_HAVE_IMAGICK_INTERPOLATIVERESIZEIMAGE + + +#if IM_HAVE_IMAGICK_LEVELIMAGECOLORS +/* {{{ proto bool levelImageColors(ImagickPixel|string $black_color,ImagickPixel|string $white_color,bool $invert): +*/ +PHP_METHOD(Imagick, levelImageColors) +{ + php_imagick_object *intern; + MagickBooleanType status; + zend_bool invert; + zval *black_color_param, *white_color_param; + PixelWand *black_color_wand, *white_color_wand; + zend_bool black_color_allocated = 0, white_color_allocated = 0; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zzb", &black_color_param, &white_color_param, &invert) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + black_color_wand = php_imagick_zval_to_pixelwand (black_color_param, IMAGICK_CLASS, &black_color_allocated TSRMLS_CC); + if (!black_color_wand) + return; + + white_color_wand = php_imagick_zval_to_pixelwand (white_color_param, IMAGICK_CLASS, &white_color_allocated TSRMLS_CC); + if (!white_color_wand) + return; + + status = MagickLevelImageColors( + intern->magick_wand, + black_color_wand, + white_color_wand, + invert + ); + + if (black_color_allocated) + black_color_wand = DestroyPixelWand (black_color_wand); + + if (white_color_allocated) + white_color_wand = DestroyPixelWand (white_color_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to levelImageColors" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif //IM_HAVE_IMAGICK_LEVELIMAGECOLORS + + + +#if IM_HAVE_IMAGICK_LEVELIZEIMAGE +/* {{{ proto bool Imagick::levelizeImage(float $black_point, float $gamma, float $white_point) +*/ +PHP_METHOD(Imagick, levelizeImage) +{ + double black_point, gamma, white_point; + MagickBooleanType status; + php_imagick_object *intern; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddd", &black_point, &gamma, &white_point) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickLevelizeImage( + intern->magick_wand, + black_point, + gamma, + white_point + ); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to levelizeImage" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif //IM_HAVE_IMAGICK_LEVELIZEIMAGE + + +#if IM_HAVE_IMAGICK_ORDEREDDITHERIMAGE +/* {{{ proto void Imagick::orderedDitherImage(string $dither_format) +*/ +PHP_METHOD(Imagick, orderedDitherImage) +{ + char *dither_format; + IM_LEN_TYPE dither_format_len; + MagickBooleanType status; + php_imagick_object *intern; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &dither_format, &dither_format_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickOrderedDitherImage( + intern->magick_wand, + dither_format + ); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to orderedDitherImage" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif //IM_HAVE_IMAGICK_ORDEREDDITHERIMAGE + +#if IM_HAVE_IMAGICK_WHITEBALANCEIMAGE +/* {{{ proto bool Imagick::whiteBalanceImage() +*/ +PHP_METHOD(Imagick, whiteBalanceImage) +{ + php_imagick_object *intern; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + + RETURN_BOOL(MagickWhiteBalanceImage(intern->magick_wand)); + +} +/* }}} */ +#endif //IM_HAVE_IMAGICK_WHITEBALANCEIMAGE + + +#if IM_HAVE_IMAGICK_DELETE_OPTION +/* {{{ proto boolean Imagick::deleteOption(string $option) +*/ +PHP_METHOD(Imagick, deleteOption) +{ + php_imagick_object *intern; + MagickBooleanType status; + char *option; + IM_LEN_TYPE option_len; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &option, &option_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickDeleteOption(intern->magick_wand, option); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to deleteOption" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif + +#if IM_HAVE_IMAGICK_GET_BACKGROUND_COLOR +/* {{{ proto int Imagick::getBackgroundColor() +*/ +PHP_METHOD(Imagick, getBackgroundColor) +{ + php_imagick_object *intern; + php_imagickpixel_object *imagickpixel_object; + PixelWand *pixel_wand; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + pixel_wand = MagickGetBackgroundColor(intern->magick_wand); + + if (pixel_wand == NULL) { + php_imagick_convert_imagick_exception(intern->magick_wand, "getBackgroundColor" TSRMLS_CC); + RETURN_THROWS(); + } + + object_init_ex(return_value, php_imagickpixel_sc_entry); + imagickpixel_object = Z_IMAGICKPIXEL_P(return_value); + php_imagick_replace_pixelwand(imagickpixel_object, pixel_wand); +} +/* }}} */ +#endif + +#if IM_HAVE_IMAGICK_GET_IMAGE_ARTIFACTS +/* {{{ proto array Imagick::getImageArtifacts(string $pattern = "*") +*/ +PHP_METHOD(Imagick, getImageArtifacts) +{ + php_imagick_object *intern; + size_t number_artifacts; + char *pattern = "*"; + IM_LEN_TYPE pattern_len; + char **artifacts; + char *artifact_value; + unsigned int i; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &pattern, &pattern_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + + artifacts = MagickGetImageArtifacts( + intern->magick_wand, + pattern, + &number_artifacts + ); + + array_init(return_value); + for (i=0; i<number_artifacts; i++) { + artifact_value = MagickGetImageArtifact(intern->magick_wand, artifactsi); + if (artifact_value == NULL) { + add_assoc_null(return_value, artifactsi); + } + else { + IM_add_assoc_string(return_value, artifactsi, artifact_value); + MagickRelinquishMemory(artifact_value); + DestroyString(artifact_value); + } + DestroyString(artifactsi); + } + RelinquishMagickMemory(artifacts); +} +/* }}} */ +#endif + + +#if IM_HAVE_IMAGICK_GET_IMAGE_DISTORTIONS + +#endif + +#if IM_HAVE_IMAGICK_GET_IMAGE_KURTOSIS +/* {{{ proto int Imagick::getImageKurtosis() + kurtosis: float, skewness: float +*/ +PHP_METHOD(Imagick, getImageKurtosis) +{ + php_imagick_object *intern; + + MagickBooleanType status; + double kurtosis; + double skewness; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + status = MagickGetImageKurtosis(intern->magick_wand, &kurtosis, &skewness); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to getImageKurtosis" TSRMLS_CC); + RETURN_THROWS(); + } + + array_init(return_value); + add_assoc_double(return_value, "kurtosis", kurtosis); + add_assoc_double(return_value, "skewness", skewness); +} +/* }}} */ +#endif + +#if IM_HAVE_IMAGICK_GET_IMAGE_MEAN +/* {{{ proto int Imagick::getImageMean() + mean: float, standard_deviation: float +*/ +PHP_METHOD(Imagick, getImageMean) +{ + php_imagick_object *intern; + + MagickBooleanType status; + double mean; + double standard_deviation; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + status = MagickGetImageMean(intern->magick_wand, &mean, &standard_deviation); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to getImageMean" TSRMLS_CC); + RETURN_THROWS(); + } + + array_init(return_value); + add_assoc_double(return_value, "mean", mean); + add_assoc_double(return_value, "standard_deviation", standard_deviation); +} +/* }}} */ +#endif + +#if IM_HAVE_IMAGICK_GET_IMAGE_RANGE +/* {{{ proto int Imagick::getImageRange() + minima: float, maxima: float +*/ +PHP_METHOD(Imagick, getImageRange) +{ + php_imagick_object *intern; + MagickBooleanType status; + double minima; + double maxima; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + status = MagickGetImageRange(intern->magick_wand, &minima, &maxima); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to getImageRange" TSRMLS_CC); + RETURN_THROWS(); + } + + array_init(return_value); + add_assoc_double(return_value, "minima", minima); + add_assoc_double(return_value, "maxima", maxima); +} +/* }}} */ +#endif + +#if IM_HAVE_IMAGICK_GET_INTERPOLATE_METHOD +/* {{{ proto int Imagick::getInterpolateMethod() +*/ +PHP_METHOD(Imagick, getInterpolateMethod) +{ + php_imagick_object *intern; + PixelInterpolateMethod pixelInterpolateMethod; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + pixelInterpolateMethod = MagickGetInterpolateMethod(intern->magick_wand); + + RETVAL_LONG(pixelInterpolateMethod); +} +/* }}} */ +#endif + + +#if IM_HAVE_IMAGICK_GET_OPTIONS +/* {{{ proto array Imagick::getOptions(string $pattern = "*") +*/ +PHP_METHOD(Imagick, getOptions) +{ + php_imagick_object *intern; + size_t number_options; + char *pattern = "*"; + IM_LEN_TYPE pattern_len; + char **options; + char *option_value; + unsigned int i; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &pattern, &pattern_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + options = MagickGetOptions( + intern->magick_wand, + pattern, + &number_options + ); + + array_init(return_value); + + for (i=0; i<number_options; i++) { + option_value = MagickGetOption(intern->magick_wand, optionsi); + IM_add_assoc_string(return_value, optionsi, option_value); + MagickRelinquishMemory(option_value); + DestroyString(optionsi); + } + RelinquishMagickMemory(options); +} +/* }}} */ +#endif + + +#if IM_HAVE_IMAGICK_GET_ORIENTATION +/* {{{ proto int Imagick::getOrientation() +*/ +PHP_METHOD(Imagick, getOrientation) +{ + php_imagick_object *intern; + OrientationType orientation; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + orientation = MagickGetOrientation(intern->magick_wand); + + RETVAL_LONG(orientation); +} +/* }}} */ +#endif + +#if IM_HAVE_IMAGICK_GET_RESOLUTION +/* {{{ proto int Imagick::getSizeOffset() + x: float, y: float +*/ +PHP_METHOD(Imagick, getResolution) +{ + php_imagick_object *intern; + + MagickBooleanType status; + double x; + double y; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + status = MagickGetResolution(intern->magick_wand, &x, &y); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to getResolution" TSRMLS_CC); + RETURN_THROWS(); + } + + array_init(return_value); + add_assoc_double(return_value, "x", x); + add_assoc_double(return_value, "y", y); +} +/* }}} */ +#endif + +#if IM_HAVE_IMAGICK_GET_TYPE +/* {{{ proto int Imagick::getType() +*/ +PHP_METHOD(Imagick, getType) +{ + php_imagick_object *intern; + ImageType type; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + type = MagickGetType(intern->magick_wand); + + RETVAL_LONG(type); +} +/* }}} */ +#endif + +#if IM_HAVE_IMAGICK_POLYNOMIAL_IMAGE +/* {{{ proto Imagick Imagick::polynomialImage(array $terms) + number_terms: the number of terms in the list. The actual list length + //% is 2 x number_terms + 1 (the constant). +*/ +PHP_METHOD(Imagick, polynomialImage) +{ + php_imagick_object *intern; + zval *terms; + double *terms_double_array; + MagickBooleanType status; + im_long terms_count = 0; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &terms) == FAILURE) { + RETURN_THROWS(); + } + + terms_double_array = php_imagick_zval_to_double_array(terms, &terms_count TSRMLS_CC); + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSetIteratorIndex(intern->magick_wand, 0); + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to polynomialImage, failed to set iterator to zero" TSRMLS_CC); + RETURN_THROWS(); + } + + // TODO - sanity check terms_count + + status = MagickPolynomialImage( + intern->magick_wand, + terms_count, + terms_double_array + ); + + efree(terms_double_array); + + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to polynomialImage" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif + +#if IM_HAVE_IMAGICK_SET_DEPTH +/* {{{ proto bool Imagick::setDepth(int depth) + Sets the depth +*/ +PHP_METHOD(Imagick, setDepth) +{ + php_imagick_object *intern; + im_long depth; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &depth) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + + status = MagickSetDepth(intern->magick_wand, depth); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to setDepth" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ +#endif + + +#if IM_HAVE_IMAGICK_SET_EXTRACT +/* {{{ proto bool Imagick::setExtract(string $geometry) + Use it for inline cropping (e.g. 200x200+0+0) +*/ +PHP_METHOD(Imagick, setExtract) +{ + char *geometry_string; + IM_LEN_TYPE geometry_string_len; + MagickBooleanType status; + php_imagick_object *intern; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &geometry_string, &geometry_string_len) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); +// IMAGICK_NOT_EMPTY(intern); + + status = MagickSetExtract(intern->magick_wand, geometry_string); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to setExtract" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ +#endif + +#if IM_HAVE_IMAGICK_SET_INTERPOLATE_METHOD +/* {{{ proto bool Imagick::setInterpolateMethod(int method) + Sets the interpolate pixel method. +*/ +PHP_METHOD(Imagick, setInterpolateMethod) +{ + php_imagick_object *intern; + im_long interpolate; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &interpolate) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); +// IMAGICK_NOT_EMPTY(intern); + + status = MagickSetInterpolateMethod(intern->magick_wand, interpolate); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to setInterpolateMethod" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ +#endif + +#if IM_HAVE_IMAGICK_SET_ORIENTATION +/* {{{ proto bool Imagick::setOrientation(int orientation) +*/ +PHP_METHOD(Imagick, setOrientation) +{ + php_imagick_object *intern; + MagickBooleanType status; + im_long orientation_type; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &orientation_type) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickSetOrientation(intern->magick_wand, orientation_type); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to setOrientation" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ +#endif + +/* end of Imagick */
View file
imagick-3.8.0.tgz/imagick-3.8.0/imagick_file.c
Added
@@ -0,0 +1,369 @@ +/* + +----------------------------------------------------------------------+ + | PHP Version 5 / Imagick | + +----------------------------------------------------------------------+ + | Copyright (c) 2006-2013 Mikko Koppanen, Scott MacVicar | + | ImageMagick (c) ImageMagick Studio LLC | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Mikko Kopppanen <mkoppanen@php.net> | + | Scott MacVicar <scottmac@php.net> | + +----------------------------------------------------------------------+ +*/ + +#include "php_imagick.h" +#include "php_imagick_file.h" +#include "php_imagick_macros.h" +#include "php_imagick_defs.h" + +#if ZEND_MODULE_API_NO > 20060613 +# define IMAGICK_INIT_ERROR_HANDLING zend_error_handling error_handling +# define IMAGICK_SET_ERROR_HANDLING_THROW zend_replace_error_handling(EH_THROW, php_imagick_exception_class_entry, &error_handling TSRMLS_CC) +# define IMAGICK_RESTORE_ERROR_HANDLING zend_restore_error_handling(&error_handling TSRMLS_CC) +#else +# define IMAGICK_INIT_ERROR_HANDLING +# define IMAGICK_SET_ERROR_HANDLING_THROW php_set_error_handling(EH_THROW, php_imagick_exception_class_entry TSRMLS_CC) +# define IMAGICK_RESTORE_ERROR_HANDLING php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC) +#endif + +#ifndef S_ISDIR +# define S_ISDIR(mode) (((mode)&S_IFMT) == S_IFDIR) +#endif + +static +zend_bool php_imagick_is_virtual_format(const char *format) +{ + int i, elements; + + const char *virtual_fmt = { + "CANVAS", + "CAPTION", + "CLIPBOARD", + "FRACTAL", + "GRADIENT", + "GRANITE", + "HALD", // Identity Hald CLUT Image Select levels like this: hald:8 for level 8. + "INLINE", // Base64-encoded inline image + "LABEL", + "LOGO", + "MAGICK", + "MAP", // Colormap intensities and indices Set -depth to set the sample size of the intensities; indices are 16-bit if colors > 256. + "MASK", // Image mask + "MATTE", + "NETSCAPE", + "NULL", + "PANGO", // Image caption + "PLASMA", + "PRINT", + "RADIAL-GRADIENT", + "RADIAL_GRADIENT", + "ROSE", + "SCAN", + "SCANX", + "TILE", // Tiled image + "UNIQUE", + "WIN", +#ifndef PHP_WIN32 + "X", +#endif + "XC", + }; + + elements = sizeof (virtual_fmt) / sizeof (virtual_fmt 0); + + for (i = 0; i < elements; i++) { + if (strcasecmp(format, virtual_fmti) == 0) { + return 1; + } + } + return 0; +} + +static +zend_bool php_imagick_is_url(const char *filename TSRMLS_DC) +{ + const char *path_for_open; + + if (php_stream_locate_url_wrapper(filename, &path_for_open, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC)) { + return 1; + } + return 0; +} + +zend_bool php_imagick_file_init(struct php_imagick_file_t *file, const char *filename, size_t filename_len TSRMLS_DC) +{ + char magick_pathMaxTextExtent, head_pathMaxTextExtent, tail_pathMaxTextExtent, bufferMaxTextExtent; + + if (!filename_len) { + return 0; + } + + /* Undefined for now */ + file->type = ImagickUndefinedType; + + if (filename_len >= MaxTextExtent) { + return 0; + } + + /* Take a copy of the original string */ + strlcpy(file->filename, filename, MaxTextExtent); + file->filename_len = filename_len; + + /* Break the path into pieces */ + memset(magick_path, 0, MaxTextExtent); + GetPathComponent(file->filename, MagickPath, magick_path); + + /* The path has a format identifier, check for url and virtual format */ + if (strlen(magick_path) > 0) { + /* Virtual format? */ + if (php_imagick_is_virtual_format(magick_path)) { + file->type = ImagickVirtualFormat; + file->absolute_path = estrdup(""); + return 1; + } + /* Is it an url? */ + else if (php_imagick_is_url(filename TSRMLS_CC)) { + file->type = ImagickUri; + file->absolute_path = estrdup(""); + return 1; + } + } + + /* This is a normal file path */ + file->type = ImagickFile; + + memset(head_path, 0, MaxTextExtent); + memset(tail_path, 0, MaxTextExtent); + + GetPathComponent(file->filename, HeadPath, head_path); + GetPathComponent(file->filename, TailPath, tail_path); + + (void) snprintf(buffer, MaxTextExtent, "%s/%s", head_path, tail_path); + + /* The full path to the file */ + file->absolute_path = expand_filepath(buffer, NULL TSRMLS_CC); + + /* Failed to resolve absolute path */ + if (!file->absolute_path) { + file->absolute_path = estrdup(""); + } + return 1; +} + +void php_imagick_file_deinit(struct php_imagick_file_t *file) +{ + if (file->absolute_path) { + efree(file->absolute_path); + file->absolute_path = NULL; + } +} + +static +int php_imagick_read_image_using_imagemagick(php_imagick_object *intern, struct php_imagick_file_t *file, ImagickOperationType type TSRMLS_DC) +{ + +#if PHP_VERSION_ID < 70000 +#if PHP_VERSION_ID >= 50600 +#ifdef ZTS + // This suppresses an 'unused parameter' warning. + (void)tsrm_ls; +#endif +#endif +#endif + + if (type == ImagickReadImage) { + if (MagickReadImage(intern->magick_wand, file->filename) == MagickFalse) { + +#if PHP_VERSION_ID >= 70000 + zend_stat_t st; +#else + struct stat st; +#endif + + /* Resolved to a filename. Check that it's not a dir */ + if (php_sys_stat(file->absolute_path, &st) == 0 && S_ISDIR(st.st_mode)) { + return IMAGICK_RW_PATH_IS_DIR; + } + return IMAGICK_RW_UNDERLYING_LIBRARY; + } + } else if (type == ImagickPingImage){ + if (MagickPingImage(intern->magick_wand, file->filename) == MagickFalse) { + return IMAGICK_RW_UNDERLYING_LIBRARY; + } + } else { + return IMAGICK_RW_UNDERLYING_LIBRARY; + } + + MagickSetImageFilename(intern->magick_wand, file->absolute_path); + MagickSetLastIterator(intern->magick_wand); + return IMAGICK_RW_OK; +} + +static +int php_imagick_read_image_using_php_streams(php_imagick_object *intern, struct php_imagick_file_t *file, ImagickOperationType type TSRMLS_DC) +{ + php_stream *stream; + MagickBooleanType status; + FILE *fp; + IMAGICK_INIT_ERROR_HANDLING; + IMAGICK_SET_ERROR_HANDLING_THROW; + +#if PHP_VERSION_ID >= 70000 + stream = php_stream_open_wrapper(file->filename, "rb", (IGNORE_PATH) & ~REPORT_ERRORS, NULL); +#else + stream = php_stream_open_wrapper(file->filename, "rb", (ENFORCE_SAFE_MODE|IGNORE_PATH) & ~REPORT_ERRORS, NULL); +#endif + + if (!stream) { + IMAGICK_RESTORE_ERROR_HANDLING; + return IMAGICK_RW_UNDERLYING_LIBRARY; + } + + if (php_stream_can_cast(stream, PHP_STREAM_AS_STDIO|PHP_STREAM_CAST_INTERNAL) == FAILURE || + php_stream_cast(stream, PHP_STREAM_AS_STDIO|PHP_STREAM_CAST_INTERNAL, (void*)&fp, 0) == FAILURE) { + + php_stream_close(stream); + IMAGICK_RESTORE_ERROR_HANDLING; + return IMAGICK_RW_UNDERLYING_LIBRARY; + } + + IMAGICK_RESTORE_ERROR_HANDLING; + + if (type == ImagickReadImage) { + status = MagickReadImageFile(intern->magick_wand, fp); + } else if (type == ImagickPingImage){ + status = MagickPingImageFile(intern->magick_wand, fp); + } else { + php_stream_close(stream); + return IMAGICK_RW_UNDERLYING_LIBRARY; + } + + if (status == MagickFalse) { + php_stream_close(stream); + return IMAGICK_RW_UNDERLYING_LIBRARY; + } + + MagickSetImageFilename(intern->magick_wand, file->absolute_path); + php_stream_close(stream); + + if (status == MagickFalse) { + return IMAGICK_RW_UNDERLYING_LIBRARY; + } + + MagickSetLastIterator(intern->magick_wand); + return IMAGICK_RW_OK; +} + +int php_imagick_safe_mode_check(const char *filename TSRMLS_DC) +{ +#if defined(CHECKUID_CHECK_FILE_AND_DIR) + if (PG(safe_mode) && (!php_checkuid_ex(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR, CHECKUID_NO_ERRORS))) { + return IMAGICK_RW_SAFE_MODE_ERROR; + } +#endif + if (PG(open_basedir) && php_check_open_basedir_ex(filename, 0 TSRMLS_CC)) { + return IMAGICK_RW_OPEN_BASEDIR_ERROR; + } + + return IMAGICK_RW_OK; +} + +php_imagick_rw_result_t php_imagick_read_file(php_imagick_object *intern, struct php_imagick_file_t *file, ImagickOperationType type TSRMLS_DC) +{ + php_imagick_rw_result_t rc; + + if (file->type == ImagickFile) { + rc = php_imagick_safe_mode_check(file->absolute_path TSRMLS_CC); + + if (rc != IMAGICK_RW_OK) { + return rc; + } + } + + if (file->type == ImagickUri) { + return php_imagick_read_image_using_php_streams(intern, file, type TSRMLS_CC); + } else { + return php_imagick_read_image_using_imagemagick(intern, file, type TSRMLS_CC); + } +} + +php_imagick_rw_result_t php_imagick_write_file(php_imagick_object *intern, struct php_imagick_file_t *file, ImagickOperationType type, zend_bool adjoin TSRMLS_DC) +{ + php_imagick_rw_result_t rc; + MagickBooleanType status = MagickFalse; + + if (file->type == ImagickFile) { + rc = php_imagick_safe_mode_check(file->absolute_path TSRMLS_CC); + if (rc != IMAGICK_RW_OK) { + return rc; + } + } + if (type == ImagickWriteImage) { + status = MagickWriteImage(intern->magick_wand, file->filename); + } else if (type == ImagickWriteImages) { + status = MagickWriteImages(intern->magick_wand, file->filename, adjoin); + } + + /* Write succeded ? */ + if (status == MagickFalse) { + return IMAGICK_RW_UNDERLYING_LIBRARY; + } + /* All went well it seems */ + return IMAGICK_RW_OK; +} + +zend_bool php_imagick_stream_handler(php_imagick_object *intern, php_stream *stream, ImagickOperationType type TSRMLS_DC) +{ + FILE *fp; + MagickBooleanType status = MagickFalse; + + IMAGICK_INIT_ERROR_HANDLING; + IMAGICK_SET_ERROR_HANDLING_THROW; + + if (php_stream_can_cast(stream, PHP_STREAM_AS_STDIO | PHP_STREAM_CAST_INTERNAL) == FAILURE || + php_stream_cast(stream, PHP_STREAM_AS_STDIO | PHP_STREAM_CAST_INTERNAL, (void **)&fp, 0) == FAILURE) { + IMAGICK_RESTORE_ERROR_HANDLING; + return 0; + } + + IMAGICK_RESTORE_ERROR_HANDLING; + + /* php_stream_cast returns warning on some streams but still does not return FAILURE */ + if (EG(exception)) { + return 0; + } + + switch (type) { + case ImagickWriteImageFile: + status = MagickWriteImageFile(intern->magick_wand, fp); + break; + + case ImagickWriteImagesFile: + status = MagickWriteImagesFile(intern->magick_wand, fp); + break; + + case ImagickReadImageFile: + status = MagickReadImageFile(intern->magick_wand, fp); + break; + + case ImagickPingImageFile: + status = MagickPingImageFile(intern->magick_wand, fp); + break; + + default: + return 0; + break; + } + if (status == MagickFalse) { + return 0; + } + return 1; +} +
View file
imagick-3.8.0.tgz/imagick-3.8.0/imagick_helpers.c
Added
@@ -0,0 +1,2039 @@ +/* + +----------------------------------------------------------------------+ + | PHP Version 5 / Imagick | + +----------------------------------------------------------------------+ + | Copyright (c) 2006-2013 Mikko Koppanen, Scott MacVicar | + | ImageMagick (c) ImageMagick Studio LLC | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Mikko Kopppanen <mkoppanen@php.net> | + | Scott MacVicar <scottmac@php.net> | + +----------------------------------------------------------------------+ +*/ + +#include "php_imagick.h" +#include "php_imagick_defs.h" +#include "php_imagick_macros.h" +#include "php_imagick_helpers.h" + +MagickBooleanType php_imagick_progress_monitor(const char *text, const MagickOffsetType offset, const MagickSizeType span, void *client_data) +{ + FILE *fp; + php_imagick_object *intern = (php_imagick_object *)client_data; + + if (!intern) { + return MagickFalse; + } + + if (!intern->progress_monitor_name) { + return MagickFalse; + } + + fp = fopen(intern->progress_monitor_name, "a+"); + + if (!fp) { + return MagickFalse; + } + + fprintf(fp, "text: %s, offset: %lld, span: %llu\n", text, offset, span); + fclose(fp); + return MagickTrue; +} + +void php_imagick_cleanup_progress_callback(php_imagick_callback* progress_callback TSRMLS_DC) { + + if (progress_callback) { + if (progress_callback->previous_callback) { + php_imagick_cleanup_progress_callback(progress_callback->previous_callback TSRMLS_CC); + efree(progress_callback->previous_callback); + } + +#if PHP_VERSION_ID >= 70000 + zval_ptr_dtor(&progress_callback->user_callback); +#else + zval_ptr_dtor(&progress_callback->user_callback); +#endif + } +} + +MagickBooleanType php_imagick_progress_monitor_callable(const char *text, const MagickOffsetType offset, const MagickSizeType span, void *userData) +{ + int error; + zend_fcall_info fci; + zend_fcall_info_cache fci_cache; + +#if PHP_VERSION_ID >= 70000 + zval zargs2; + zval retval; +#else + zval **zargs2; + zval *retval_ptr; +#endif + + //We can get the data both via the passed param and via + //IMAGICK_G(progress_callback) - this should be quicker + php_imagick_callback *callback = (php_imagick_callback*)userData; + + // This suppresses an 'unused parameter' warning. + // We could maybe use text. + (void)text; + +#if PHP_VERSION_ID >= 70000 && defined(ZTS) + if( NULL == tsrm_get_ls_cache() ) { + return MagickTrue; + } +#endif + +#if PHP_VERSION_ID < 70000 + TSRMLS_FETCH_FROM_CTX(callback->thread_ctx); +#endif + fci_cache = empty_fcall_info_cache; + + fci = empty_fcall_info; + fci.size = sizeof(fci); + +#if PHP_VERSION_ID < 70100 + fci.function_table = EG(function_table); +#endif +#if PHP_VERSION_ID >= 70000 + //fci.function_name = *callback->user_callback; + ZVAL_COPY_VALUE(&fci.function_name, &callback->user_callback); + fci.retval = &retval; +#else + retval_ptr = NULL; + fci.function_name = callback->user_callback; + fci.retval_ptr_ptr = &retval_ptr; +#endif + fci.param_count = 2; + fci.params = zargs; + +#if PHP_VERSION_ID >= 70000 + ZVAL_LONG(&zargs0, offset); + ZVAL_LONG(&zargs1, span); +#else + zargs0 = emalloc(sizeof(zval *)); + MAKE_STD_ZVAL(*zargs0); + ZVAL_LONG(*zargs0, offset); + + zargs1 = emalloc(sizeof(zval *)); + MAKE_STD_ZVAL(*zargs1); + ZVAL_LONG(*zargs1, span); +#endif + + error = zend_call_function(&fci, &fci_cache TSRMLS_CC); + + if (error == FAILURE) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred while invoking the callback"); + //Abort processing as user callback is no longer callable + return MagickFalse; + } +#if PHP_VERSION_ID >= 70000 + if (Z_TYPE(retval) == IS_FALSE) { + //User returned false - tell Imagick to abort processing. + return MagickFalse; + } +#else + zval_ptr_dtor(zargs0); + zval_ptr_dtor(zargs1); + + if (retval_ptr) { + if (Z_TYPE_P(retval_ptr) == IS_BOOL) { + if (Z_LVAL_P(retval_ptr) == 0) { + //User returned false - tell Imagick to abort processing. + return MagickFalse; + } + } + } +#endif + + return MagickTrue; +} + +/* This is not universally safe to use, but is safe enough for values that will + be encountered for image dimensions. +*/ +static inline double im_round_helper(double value) { + if (value >= 0.0) { + // Prevent zero width/height images + if (value < 1) { + return 1; + } + return floor(value + 0.5); + } else { + return ceil(value - 0.5); + } +} + + +zend_bool php_imagick_thumbnail_dimensions(MagickWand *magick_wand, zend_bool bestfit, im_long desired_width, im_long desired_height, im_long *new_width, im_long *new_height, zend_bool legacy) +{ + im_long orig_width, orig_height; + + orig_width = MagickGetImageWidth(magick_wand); + orig_height = MagickGetImageHeight(magick_wand); + + if ((orig_width == desired_width) && (orig_height == desired_height)) { + *new_width = desired_width; + *new_height = desired_height; + return 1; + } + + if (bestfit) { + double ratio_x, ratio_y; + + if (desired_width <= 0 || desired_height <= 0) { + return 0; + } + + ratio_x = (double) desired_width / (double) orig_width; + ratio_y = (double) desired_height / (double) orig_height; + + //in the case of square images there should be no rounding error + if (ratio_x == ratio_y) { + *new_width = desired_width; + *new_height = desired_height; + } else if (ratio_x < ratio_y) { + *new_width = desired_width; + if (legacy) { + *new_height = ratio_x * ((double) orig_height); + } + else { + *new_height = im_round_helper(ratio_x * ((double) orig_height)); + } + } else { + *new_height = desired_height; + if (legacy) { + *new_width = ratio_y * ((double) orig_width); + } + else { + *new_width = im_round_helper(ratio_y * ((double) orig_width)); + } + } + *new_width = (*new_width < 1) ? 1 : *new_width; + *new_height = (*new_height < 1) ? 1 : *new_height; + + } else { + double ratio; + + if (desired_width <= 0 && desired_height <= 0) { + return 0; + } + + if (desired_width <= 0 || desired_height <= 0) { + if (desired_width <= 0) { + ratio = (double) orig_height / (double) desired_height; + if (legacy) { + *new_width = ((double) orig_width) / ratio; + } + else { + *new_width = im_round_helper(((double) orig_width) / ratio); + } + *new_height = desired_height; + } else { + ratio = (double) orig_width / (double) desired_width; + if (legacy) { + *new_height = ((double) orig_height) / ratio; + } + else { + *new_height = im_round_helper(((double) orig_height) / ratio); + } + *new_width = desired_width; + } + } else { + *new_width = desired_width; + *new_height = desired_height; + } + } + return 1; +} + +zend_bool php_imagick_validate_map(const char *map TSRMLS_DC) +{ + zend_bool match; + const char *p = map; + char allow_map = { 'R', 'G', 'B', + 'A', 'O', 'C', + 'Y', 'M', 'K', + 'I', 'P' }; + + while (*p != '\0') { + char *it = allow_map; + match = 0; + while(*it != '\0') { + if (*(it++) == *p) { + match = 1; + break; + } + } + if (!match) { + return 0; + } + p++; + } + return 1; +} + +double *php_imagick_zval_to_double_array(zval *param_array, im_long *num_elements TSRMLS_DC) +{ + double *double_array; + long i = 0; + +#if PHP_VERSION_ID >= 70000 + zval *pzvalue; +#else + zval **ppzval; +#endif + + *num_elements = zend_hash_num_elements(Z_ARRVAL_P(param_array)); + + if (*num_elements == 0) { + return NULL; + } + + double_array = ecalloc(*num_elements, sizeof(double)); + +#if PHP_VERSION_ID >= 70000 + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(param_array), pzvalue) { + ZVAL_DEREF(pzvalue); + double_arrayi = zval_get_double(pzvalue); + i++; + } ZEND_HASH_FOREACH_END(); +#else + for (zend_hash_internal_pointer_reset(Z_ARRVAL_P(param_array)); + zend_hash_get_current_data(Z_ARRVAL_P(param_array), (void **) &ppzval) == SUCCESS; + zend_hash_move_forward(Z_ARRVAL_P(param_array)), i++) + { + zval tmp_zval, *tmp_pzval; + double value = 0.0; + + if (Z_TYPE_PP(ppzval) == IS_DOUBLE) { + value = Z_DVAL_PP(ppzval); + } + else { + tmp_zval = **ppzval; + zval_copy_ctor(&tmp_zval); + tmp_pzval = &tmp_zval; + convert_to_double(tmp_pzval); + + value = Z_DVAL_P(tmp_pzval); + zval_dtor (tmp_pzval); + } + double_arrayi = value; + } +#endif + return double_array; +} + +im_long *php_imagick_zval_to_long_array(zval *param_array, im_long *num_elements TSRMLS_DC) +{ + im_long *long_array; + im_long i = 0; + +#if PHP_VERSION_ID >= 70000 + zval *pzvalue; +#else + zval **ppzval; +#endif + + *num_elements = zend_hash_num_elements(Z_ARRVAL_P(param_array)); + + if (*num_elements == 0) { + return NULL; + } + + long_array = ecalloc(*num_elements, sizeof(im_long)); + +#if PHP_VERSION_ID >= 70000 + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(param_array), pzvalue) { + ZVAL_DEREF(pzvalue); + long_arrayi = zval_get_long(pzvalue); + i++; + } ZEND_HASH_FOREACH_END(); +#else + for (zend_hash_internal_pointer_reset(Z_ARRVAL_P(param_array)); + zend_hash_get_current_data(Z_ARRVAL_P(param_array), (void **) &ppzval) == SUCCESS; + zend_hash_move_forward(Z_ARRVAL_P(param_array)), i++) + { + zval tmp_zval, *tmp_pzval; + im_long value = 0; + + if (Z_TYPE_PP(ppzval) == IS_DOUBLE) { + value = Z_LVAL_PP(ppzval); + } + else { + tmp_zval = **ppzval; + zval_copy_ctor(&tmp_zval); + tmp_pzval = &tmp_zval; + convert_to_long(tmp_pzval); + + value = Z_LVAL_P(tmp_pzval); + zval_dtor (tmp_pzval); + } + long_arrayi = value; + } +#endif + + return long_array; +} + +unsigned char *php_imagick_zval_to_char_array(zval *param_array, im_long *num_elements TSRMLS_DC) +{ + unsigned char *char_array; + im_long i = 0; + +#if PHP_VERSION_ID >= 70000 + zval *pzvalue; +#else + zval **ppzval; +#endif + + *num_elements = zend_hash_num_elements(Z_ARRVAL_P(param_array)); + + if (*num_elements == 0) { + return NULL; + } + + char_array = ecalloc(*num_elements, sizeof(unsigned char)); + +#if PHP_VERSION_ID >= 70000 + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(param_array), pzvalue) { + ZVAL_DEREF(pzvalue); + char_arrayi = zval_get_long(pzvalue); + i++; + } ZEND_HASH_FOREACH_END(); +#else + for (zend_hash_internal_pointer_reset(Z_ARRVAL_P(param_array)); + zend_hash_get_current_data(Z_ARRVAL_P(param_array), (void **) &ppzval) == SUCCESS; + zend_hash_move_forward(Z_ARRVAL_P(param_array)), i++) + { + zval tmp_zval, *tmp_pzval; + im_long value = 0; + if (Z_TYPE_PP(ppzval) == IS_DOUBLE) { + value = Z_LVAL_PP(ppzval); + } + else { + tmp_zval = **ppzval; + zval_copy_ctor(&tmp_zval); + tmp_pzval = &tmp_zval; + convert_to_long(tmp_pzval); + + value = Z_LVAL_P(tmp_pzval); + zval_dtor (tmp_pzval); + } + char_arrayi = value; + } +#endif + + return char_array; +} + +zend_bool php_imagick_check_font(char *font, int font_len TSRMLS_DC) +{ + zend_bool retval = 0; + char **fonts; + unsigned long i = 0; + size_t num_fonts = 0; + + /* Check that user is only able to set a proper font */ + fonts = MagickQueryFonts("*", &num_fonts); + + for(i = 0 ; i < num_fonts ; i++) { + /* Let's see if the font is among configured fonts */ + if (strncasecmp(fontsi, font, font_len) == 0) { + retval = 1; + break; + } + } + + IMAGICK_FREE_MAGICK_MEMORY(fonts); + return retval; +} + +php_imagick_rw_result_t php_imagick_file_access_check (const char *filename TSRMLS_DC) +{ + if (strlen(filename) >= MAXPATHLEN) + return IMAGICK_RW_FILENAME_TOO_LONG; + +#if defined(CHECKUID_CHECK_FILE_AND_DIR) + if (PG(safe_mode) && (!php_checkuid_ex(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR, CHECKUID_NO_ERRORS))) + return IMAGICK_RW_SAFE_MODE_ERROR; +#endif + + if (php_check_open_basedir_ex(filename, 0 TSRMLS_CC)) + return IMAGICK_RW_OPEN_BASEDIR_ERROR; + + if (VCWD_ACCESS(filename, F_OK) != 0) + return IMAGICK_RW_PATH_DOES_NOT_EXIST; + + if (VCWD_ACCESS(filename, R_OK) != 0) + return IMAGICK_RW_PERMISSION_DENIED; + + return IMAGICK_RW_OK; +} + +static +void s_rw_fail_to_exception (php_imagick_rw_result_t rc, const char *filename TSRMLS_DC) +{ + switch (rc) { + + case IMAGICK_RW_SAFE_MODE_ERROR: + zend_throw_exception_ex(php_imagick_exception_class_entry, 1 TSRMLS_CC, "Safe mode restricts user to read the file: %s", filename); + break; + + case IMAGICK_RW_OPEN_BASEDIR_ERROR: + zend_throw_exception_ex(php_imagick_exception_class_entry, 1 TSRMLS_CC, "open_basedir restriction in effect. File(%s) is not within the allowed path(s)", filename); + break; + + case IMAGICK_RW_PERMISSION_DENIED: + zend_throw_exception_ex(php_imagick_exception_class_entry, 1 TSRMLS_CC, "Permission denied to: %s", filename); + break; + + case IMAGICK_RW_FILENAME_TOO_LONG: + zend_throw_exception_ex(php_imagick_exception_class_entry, 1 TSRMLS_CC, "Filename too long: %s", filename); + break; + + case IMAGICK_RW_PATH_DOES_NOT_EXIST: + zend_throw_exception_ex(php_imagick_exception_class_entry, 1 TSRMLS_CC, "The path does not exist: %s", filename); + break; + + case IMAGICK_RW_PATH_IS_DIR: + zend_throw_exception_ex(php_imagick_exception_class_entry, 1 TSRMLS_CC, "The path is a directory: %s", filename); + break; + + default: + zend_throw_exception_ex(php_imagick_exception_class_entry, 1 TSRMLS_CC, "Unknown error"); + break; + } +} + +void php_imagick_rw_fail_to_exception (MagickWand *magick_wand, php_imagick_rw_result_t rc, const char *filename TSRMLS_DC) +{ + if (rc == IMAGICK_RW_UNDERLYING_LIBRARY) { + php_imagick_convert_imagick_exception (magick_wand, "Failed to read the file" TSRMLS_CC); + return; + } + s_rw_fail_to_exception (rc, filename TSRMLS_CC); +} + +void php_imagick_imagickdraw_rw_fail_to_exception (DrawingWand *drawing_wand, php_imagick_rw_result_t rc, const char *filename TSRMLS_DC) +{ + if (rc == IMAGICK_RW_UNDERLYING_LIBRARY) { + php_imagick_convert_imagickdraw_exception (drawing_wand, "Failed to read the file" TSRMLS_CC); + return; + } + s_rw_fail_to_exception (rc, filename TSRMLS_CC); +} + + +PointInfo *php_imagick_zval_to_pointinfo_array(zval *coordinate_array, int *num_elements TSRMLS_DC) +{ + PointInfo *coordinates; + long elements, sub_elements, i; + HashTable *sub_array; + +#if PHP_VERSION_ID >= 70000 + zval *pzvalue; +#else + HashTable *coords; + zval **ppzval; +#endif + + i = 0; + + elements = zend_hash_num_elements(Z_ARRVAL_P(coordinate_array)); + + if (elements < 1) { + coordinates = (PointInfo *)NULL; + *num_elements = 0; + return coordinates; + } + + *num_elements = elements; + coordinates = emalloc(sizeof(PointInfo) * elements); + +#if PHP_VERSION_ID >= 70000 + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(coordinate_array), pzvalue) { + zval *pz_x, *pz_y; + ZVAL_DEREF(pzvalue); + + /* If its something than array lets error here */ + if(Z_TYPE_P(pzvalue) != IS_ARRAY) { + efree(coordinates); + *num_elements = 0; + return NULL; + } + + /* Subarray should have two elements. X and Y */ + sub_elements = zend_hash_num_elements(Z_ARRVAL_P(pzvalue)); + + /* Exactly two elements */ + if (sub_elements != 2) { + efree(coordinates); + *num_elements = 0; + return NULL; + } + + /* Subarray values */ + sub_array = Z_ARRVAL_P(pzvalue); + + /* Get X */ + if ((pz_x = zend_hash_str_find(sub_array, "x", sizeof("x")-1)) == NULL) { + efree(coordinates); + *num_elements = 0; + return NULL; + } + + /* Get Y */ + if ((pz_y = zend_hash_str_find(sub_array, "y", sizeof("y")-1)) == NULL) { + efree(coordinates); + *num_elements = 0; + return NULL; + } + + /* Assign X and Y */ + coordinatesi.x = zval_get_double(pz_x); + coordinatesi.y = zval_get_double(pz_y); + i++; + } ZEND_HASH_FOREACH_END(); + +#else + coords = Z_ARRVAL_P(coordinate_array); + zend_hash_internal_pointer_reset_ex(coords, (HashPosition *) 0); + + for (i = 0, zend_hash_internal_pointer_reset(coords); + zend_hash_get_current_data(coords, (void **) &ppzval) == SUCCESS; + zend_hash_move_forward(coords), i++ + ) { + zval **ppz_x, **ppz_y; + zval tmp_zx, *tmp_pzx, tmp_zy, *tmp_pzy; + + /* If its something than array lets error here */ + if(Z_TYPE_PP(ppzval) != IS_ARRAY) { + efree(coordinates); + *num_elements = 0; + return NULL; + } + + /* Subarray should have two elements. X and Y */ + sub_elements = zend_hash_num_elements(Z_ARRVAL_PP(ppzval)); + + /* Exactly two elements */ + if (sub_elements != 2) { + efree(coordinates); + *num_elements = 0; + return NULL; + } + + /* Subarray values */ + sub_array = Z_ARRVAL_PP(ppzval); + + /* Get X */ + if (zend_hash_find(sub_array, "x", sizeof("x"), (void**)&ppz_x) == FAILURE) { + efree(coordinates); + *num_elements = 0; + return NULL; + } + + tmp_zx = **ppz_x; + zval_copy_ctor(&tmp_zx); + tmp_pzx = &tmp_zx; + convert_to_double(tmp_pzx); + + /* Get Y */ + if (zend_hash_find(sub_array, "y", sizeof("y"), (void**)&ppz_y) == FAILURE) { + efree(coordinates); + *num_elements = 0; + return NULL; + } + + tmp_zy = **ppz_y; + zval_copy_ctor(&tmp_zy); + tmp_pzy = &tmp_zy; + convert_to_double(tmp_pzy); + + /* Assign X and Y */ + coordinatesi.x = Z_DVAL(tmp_zx); + coordinatesi.y = Z_DVAL(tmp_zy); + } +#endif + + return coordinates; +} + +void php_imagick_throw_exception (php_imagick_class_type_t type, const char *description TSRMLS_DC) +{ + int code; + zend_class_entry *ce = NULL; + + switch (type) { + case IMAGICK_CLASS: + default: + ce = php_imagick_exception_class_entry; + code = 1; + break; + + case IMAGICKDRAW_CLASS: + ce = php_imagickdraw_exception_class_entry; + code = 2; + break; + + case IMAGICKPIXELITERATOR_CLASS: + ce = php_imagickpixeliterator_exception_class_entry; + code = 3; + break; + + case IMAGICKPIXEL_CLASS: + ce = php_imagickpixel_exception_class_entry; + code = 4; + break; +#ifdef IMAGICK_WITH_KERNEL + case IMAGICKKERNEL_CLASS: + ce = php_imagickkernel_exception_class_entry; + code = 5; + break; +#endif + } + zend_throw_exception(ce, description, code TSRMLS_CC); +} + +static +void s_convert_exception (char *description, const char *default_message, long severity, int code TSRMLS_DC) +{ + // No description provided or empty one + if (!description || (strlen (description) == 0)) { + if (description) { + description = MagickRelinquishMemory (description); + } + zend_throw_exception(php_imagick_exception_class_entry, default_message, code TSRMLS_CC); + return; + } + zend_throw_exception(php_imagick_exception_class_entry, description, severity TSRMLS_CC); + MagickRelinquishMemory (description); +} + +/** + Convert ImageMagick MagickWand exception to PHP exception +*/ +void php_imagick_convert_imagick_exception (MagickWand *magick_wand, const char *default_message TSRMLS_DC) +{ + ExceptionType severity; + char *description; + + description = MagickGetException(magick_wand, &severity); + MagickClearException (magick_wand); + + s_convert_exception (description, default_message, severity, 1 TSRMLS_CC); +} + +void php_imagick_convert_imagickdraw_exception (DrawingWand *drawing_wand, const char *default_message TSRMLS_DC) +{ + ExceptionType severity; + char *description; + + description = DrawGetException(drawing_wand, &severity); + DrawClearException (drawing_wand); + + s_convert_exception (description, default_message, severity, 2 TSRMLS_CC); +} + +void php_imagick_convert_imagickpixeliterator_exception (PixelIterator *pixel_iterator, const char *default_message TSRMLS_DC) +{ + ExceptionType severity; + char *description; + + description = PixelGetIteratorException(pixel_iterator, &severity); + PixelClearIteratorException (pixel_iterator); + + s_convert_exception (description, default_message, severity, 3 TSRMLS_CC); +} + +void php_imagick_convert_imagickpixel_exception (PixelWand *pixel_wand, const char *default_message TSRMLS_DC) +{ + ExceptionType severity; + char *description; + + description = PixelGetException(pixel_wand, &severity); + PixelClearException (pixel_wand); + + s_convert_exception (description, default_message, severity, 4 TSRMLS_CC); +} + +PixelWand *php_imagick_zval_to_pixelwand (zval *param, php_imagick_class_type_t caller, zend_bool *allocated TSRMLS_DC) +{ + PixelWand *pixel_wand = NULL; + *allocated = 0; + +#if PHP_VERSION_ID >= 70000 + ZVAL_DEREF(param); +#endif + + if (Z_TYPE_P(param) == IS_STRING || Z_TYPE_P(param) == IS_LONG || Z_TYPE_P(param) == IS_DOUBLE) { + zval var; + + if (Z_TYPE_P(param) != IS_STRING) { + var = *param; + zval_copy_ctor(&var); + convert_to_string(&var); + param = &var; + } + + pixel_wand = NewPixelWand(); + if (!pixel_wand) { + zend_error(E_ERROR, "Failed to allocate PixelWand structure"); + } + *allocated = 1; + + if (PixelSetColor (pixel_wand, Z_STRVAL_P(param)) == MagickFalse) { + pixel_wand = DestroyPixelWand(pixel_wand); + php_imagick_throw_exception (caller, "Unrecognized color string" TSRMLS_CC); + return NULL; + } + } else if (Z_TYPE_P(param) == IS_OBJECT) { + if (instanceof_function(Z_OBJCE_P(param), php_imagickpixel_sc_entry TSRMLS_CC)) { + php_imagickpixel_object *intern = Z_IMAGICKPIXEL_P(param); + pixel_wand = intern->pixel_wand; + } else { + php_imagick_throw_exception(caller, "The parameter must be an instance of ImagickPixel or a string" TSRMLS_CC); + } + } else { + php_imagick_throw_exception(caller, "Invalid color parameter provided" TSRMLS_CC); + } + + return pixel_wand; +} + +PixelWand *php_imagick_zval_to_opacity (zval *param, php_imagick_class_type_t caller, zend_bool *allocated TSRMLS_DC) +{ + PixelWand *pixel_wand = NULL; + *allocated = 0; + +#if PHP_VERSION_ID >= 70000 + ZVAL_DEREF(param); +#endif + if (Z_TYPE_P(param) == IS_STRING || Z_TYPE_P(param) == IS_LONG || Z_TYPE_P(param) == IS_DOUBLE) { + zval var; + + if (Z_TYPE_P (param) == IS_STRING) { + var = *param; + zval_copy_ctor(&var); + convert_to_double(&var); + param = &var; + } + + pixel_wand = NewPixelWand(); + if (!pixel_wand) { + zend_error(E_ERROR, "Failed to allocate PixelWand structure"); + } +#if MagickLibVersion >= 0x700 + //TOOD - this should be one minus? Or should we just make a BC break + // and make users do it in user land? + PixelSetAlpha(pixel_wand, Z_DVAL_P(param)); +#else + PixelSetOpacity(pixel_wand, Z_DVAL_P(param)); +#endif + *allocated = 1; + } else if (Z_TYPE_P(param) == IS_OBJECT) { + if (instanceof_function(Z_OBJCE_P(param), php_imagickpixel_sc_entry TSRMLS_CC)) { + php_imagickpixel_object *intern = Z_IMAGICKPIXEL_P(param); + pixel_wand = intern->pixel_wand; + } else { + php_imagick_throw_exception(caller, "The parameter must be an instance of ImagickPixel or a string" TSRMLS_CC); + } + } else { + php_imagick_throw_exception(caller, "Invalid color parameter provided" TSRMLS_CC); + } + + return pixel_wand; +} + +/** + * Changes the locale to IMAGICK_LC_NUMERIC_LOCALE if imagick.locale_fix is on + * and returns the locale set before calling this function. + * If locale is not changed, NULL is returned + * + */ +char *php_imagick_set_locale (TSRMLS_D) +{ + char *current_locale; + + if (!IMAGICK_G(locale_fix)) + return NULL; + + current_locale = setlocale(LC_NUMERIC, NULL); + if (current_locale != NULL) { + if (strcmp (current_locale, IMAGICK_LC_NUMERIC_LOCALE) != 0) { + setlocale (LC_NUMERIC, IMAGICK_LC_NUMERIC_LOCALE); + return estrdup (current_locale); + } + } + return NULL; +} + +void php_imagick_restore_locale (const char *old_locale) +{ + if (!old_locale) + return; + + if (strcmp (old_locale, IMAGICK_LC_NUMERIC_LOCALE) != 0) + setlocale (LC_NUMERIC, old_locale); +} + +PixelWand *php_imagick_clone_pixelwand (PixelWand *source) +{ +#if MagickLibVersion >= 0x635 + return ClonePixelWand(source); +#else + PixelWand *target = NewPixelWand (); + if (!target) + return NULL; + + PixelSetColorCount (target, PixelGetColorCount (source)); + PixelSetRed (target, PixelGetRed (source)); + PixelSetGreen (target, PixelGetGreen (source)); + PixelSetBlue (target, PixelGetBlue (source)); + PixelSetOpacity (target, PixelGetOpacity (source)); + PixelSetAlpha (target, PixelGetAlpha (source)); + + return target; +#endif +} + +void php_imagick_replace_magickwand (php_imagick_object *obj, MagickWand *new_wand) +{ + if (!obj->magick_wand) + obj->magick_wand = new_wand; + else { + obj->magick_wand = DestroyMagickWand(obj->magick_wand); + obj->magick_wand = new_wand; + } +} + +void php_imagick_replace_drawingwand (php_imagickdraw_object *obj, DrawingWand *new_wand) +{ + if (!obj->drawing_wand) + obj->drawing_wand = new_wand; + else { + obj->drawing_wand = DestroyDrawingWand(obj->drawing_wand); + obj->drawing_wand = new_wand; + } +} + +void php_imagick_replace_pixelwand (php_imagickpixel_object *obj, PixelWand *new_wand) +{ + if (obj->pixel_wand && obj->initialized_via_iterator != 1) { + obj->pixel_wand = DestroyPixelWand(obj->pixel_wand); + obj->pixel_wand = new_wand; + } else + obj->pixel_wand = new_wand; +} + +zend_bool php_imagick_ensure_not_empty (MagickWand *magick_wand) +{ + if (MagickGetNumberImages(magick_wand) == 0) { + TSRMLS_FETCH (); + php_imagick_throw_exception (IMAGICK_CLASS, "Can not process empty Imagick object" TSRMLS_CC); + return 0; + } + return 1; +} + +zend_bool php_imagickpixel_ensure_not_null(PixelWand *pixel_wand) +{ + if (pixel_wand == NULL) { + TSRMLS_FETCH (); + php_imagick_throw_exception (IMAGICKPIXEL_CLASS, "Can not process empty ImagickPixel object" TSRMLS_CC); + return 0; + } + return 1; +} + +void php_imagick_initialize_constants(TSRMLS_D) +{ +#define IMAGICK_REGISTER_CONST_LONG(const_name, value)\ + zend_declare_class_constant_long(php_imagick_sc_entry, const_name, sizeof(const_name)-1, (long)value TSRMLS_CC); + +#define IMAGICK_REGISTER_CONST_STRING(const_name, value)\ + zend_declare_class_constant_string(php_imagick_sc_entry, const_name, sizeof(const_name)-1, value TSRMLS_CC); + + /* Constants defined in php_imagick.h */ + IMAGICK_REGISTER_CONST_LONG("COLOR_BLACK", PHP_IMAGICK_COLOR_BLACK); + IMAGICK_REGISTER_CONST_LONG("COLOR_BLUE", PHP_IMAGICK_COLOR_BLUE); + IMAGICK_REGISTER_CONST_LONG("COLOR_CYAN", PHP_IMAGICK_COLOR_CYAN); + IMAGICK_REGISTER_CONST_LONG("COLOR_GREEN", PHP_IMAGICK_COLOR_GREEN); + IMAGICK_REGISTER_CONST_LONG("COLOR_RED", PHP_IMAGICK_COLOR_RED); + IMAGICK_REGISTER_CONST_LONG("COLOR_YELLOW", PHP_IMAGICK_COLOR_YELLOW); + IMAGICK_REGISTER_CONST_LONG("COLOR_MAGENTA", PHP_IMAGICK_COLOR_MAGENTA); +#if MagickLibVersion < 0x700 + IMAGICK_REGISTER_CONST_LONG("COLOR_OPACITY", PHP_IMAGICK_COLOR_OPACITY); +#endif + IMAGICK_REGISTER_CONST_LONG("COLOR_ALPHA", PHP_IMAGICK_COLOR_ALPHA); + IMAGICK_REGISTER_CONST_LONG("COLOR_FUZZ", PHP_IMAGICK_COLOR_FUZZ); + + /* Returning the version as a constant string */ + IMAGICK_REGISTER_CONST_LONG("IMAGICK_EXTNUM", PHP_IMAGICK_EXTNUM); + IMAGICK_REGISTER_CONST_STRING("IMAGICK_EXTVER", PHP_IMAGICK_VERSION); + +#if defined(MagickQuantumRange) + IMAGICK_REGISTER_CONST_LONG("QUANTUM_RANGE", atoi (MagickQuantumRange)); +#endif + + /* Are we using PHP allocations */ +#ifdef PHP_IMAGICK_ZEND_MM + IMAGICK_REGISTER_CONST_LONG("USE_ZEND_MM", 1); +#else + IMAGICK_REGISTER_CONST_LONG("USE_ZEND_MM", 0); +#endif + + /* ImageMagick defined constants */ + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_DEFAULT", OverCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_UNDEFINED", UndefinedCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_NO", NoCompositeOp); +#if MagickLibVersion < 0x700 + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_ADD", AddCompositeOp); +#endif + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_ATOP", AtopCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_BLEND", BlendCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_BUMPMAP", BumpmapCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_CLEAR", ClearCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_COLORBURN", ColorBurnCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_COLORDODGE", ColorDodgeCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_COLORIZE", ColorizeCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_COPYBLACK", CopyBlackCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_COPYBLUE", CopyBlueCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_COPY", CopyCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_COPYCYAN", CopyCyanCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_COPYGREEN", CopyGreenCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_COPYMAGENTA", CopyMagentaCompositeOp); +#if MagickLibVersion >= 0x700 + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_COPYALPHA", CopyAlphaCompositeOp); + //TOOD - is this semantically correct? + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_COPYOPACITY", CopyAlphaCompositeOp); +#else + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_COPYOPACITY", CopyOpacityCompositeOp); +#endif + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_COPYRED", CopyRedCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_COPYYELLOW", CopyYellowCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_DARKEN", DarkenCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_DSTATOP", DstAtopCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_DST", DstCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_DSTIN", DstInCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_DSTOUT", DstOutCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_DSTOVER", DstOverCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_DIFFERENCE", DifferenceCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_DISPLACE", DisplaceCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_DISSOLVE", DissolveCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_EXCLUSION", ExclusionCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_HARDLIGHT", HardLightCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_HUE", HueCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_IN", InCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_LIGHTEN", LightenCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_LUMINIZE", LuminizeCompositeOp); +#if MagickLibVersion < 0x700 + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_MINUS", MinusCompositeOp); +#endif + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_MODULATE", ModulateCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_MULTIPLY", MultiplyCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_OUT", OutCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_OVER", OverCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_OVERLAY", OverlayCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_PLUS", PlusCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_REPLACE", ReplaceCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_SATURATE", SaturateCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_SCREEN", ScreenCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_SOFTLIGHT", SoftLightCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_SRCATOP", SrcAtopCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_SRC", SrcCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_SRCIN", SrcInCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_SRCOUT", SrcOutCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_SRCOVER", SrcOverCompositeOp); +#if MagickLibVersion < 0x700 + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_SUBTRACT", SubtractCompositeOp); +#endif + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_THRESHOLD", ThresholdCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_XOR", XorCompositeOp); +#if MagickLibVersion >= 0x634 + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_CHANGEMASK", ChangeMaskCompositeOp); +#endif +#if MagickLibVersion >= 0x636 + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_LINEARLIGHT", LinearLightCompositeOp); +#if MagickLibVersion < 0x700 + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_DIVIDE", DivideCompositeOp); +#endif +#endif +#if MagickLibVersion >= 0x654 + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_DISTORT", DistortCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_BLUR", BlurCompositeOp); +#endif +#if MagickLibVersion >= 0x655 + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_PEGTOPLIGHT", PegtopLightCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_VIVIDLIGHT", VividLightCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_PINLIGHT", PinLightCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_LINEARDODGE", LinearDodgeCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_LINEARBURN", LinearBurnCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_MATHEMATICS", MathematicsCompositeOp); +#endif +#if MagickLibVersion >= 0x662 + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_MODULUSADD", ModulusAddCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_MODULUSSUBTRACT", ModulusSubtractCompositeOp); +#endif +#if MagickLibVersion >= 0x670 + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_MINUSDST", MinusDstCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_DIVIDEDST", DivideDstCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_DIVIDESRC", DivideSrcCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_MINUSSRC", MinusSrcCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_DARKENINTENSITY", DarkenIntensityCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_LIGHTENINTENSITY", LightenIntensityCompositeOp); +#endif +#if MagickLibVersion >= 0x690 + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_HARDMIX", HardMixCompositeOp); +#endif + +#if (MagickLibVersion >= 0x700 && MagickLibVersion >= 0x708) || (MagickLibVersion < 0x700 && MagickLibVersion >= 0x69A) + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_STEREO", StereoCompositeOp); +#endif + +#if MagickLibVersion >= 0x70A + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_FREEZE", FreezeCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_INTERPOLATE", InterpolateCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_NEGATE", NegateCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_REFLECT", ReflectCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_SOFTBURN", SoftBurnCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_SOFTDODGE", SoftDodgeCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_STAMP", StampCompositeOp); +#endif + +#if MagickLibVersion >= 0x70B + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_RMSE", RMSECompositeOp); +#endif + +#if MagickLibVersion >= 0x711 + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_SALIENCY_BLEND", SaliencyBlendCompositeOp); + IMAGICK_REGISTER_CONST_LONG("COMPOSITE_SEAMLESS_BLEND", SeamlessBlendCompositeOp); +#endif + + IMAGICK_REGISTER_CONST_LONG("MONTAGEMODE_FRAME", FrameMode); + IMAGICK_REGISTER_CONST_LONG("MONTAGEMODE_UNFRAME", UnframeMode); + IMAGICK_REGISTER_CONST_LONG("MONTAGEMODE_CONCATENATE", ConcatenateMode); + IMAGICK_REGISTER_CONST_LONG("STYLE_NORMAL", NormalStyle); + IMAGICK_REGISTER_CONST_LONG("STYLE_ITALIC", ItalicStyle); + IMAGICK_REGISTER_CONST_LONG("STYLE_OBLIQUE", ObliqueStyle); + IMAGICK_REGISTER_CONST_LONG("STYLE_ANY", AnyStyle); +#if (MagickLibVersion >= 0x700 && MagickLibVersion >= 0x709) || (MagickLibVersion < 0x700 && MagickLibVersion >= 0x69B) + IMAGICK_REGISTER_CONST_LONG("STYLE_BOLD", BoldStyle); +#endif + + IMAGICK_REGISTER_CONST_LONG("FILTER_UNDEFINED", UndefinedFilter); + IMAGICK_REGISTER_CONST_LONG("FILTER_POINT", PointFilter); + IMAGICK_REGISTER_CONST_LONG("FILTER_BOX", BoxFilter); + IMAGICK_REGISTER_CONST_LONG("FILTER_TRIANGLE", TriangleFilter); + IMAGICK_REGISTER_CONST_LONG("FILTER_HERMITE", HermiteFilter); +#if MagickLibVersion >= 0x701 + IMAGICK_REGISTER_CONST_LONG("FILTER_HANNING", HannFilter); + IMAGICK_REGISTER_CONST_LONG("FILTER_HANN", HannFilter); +#else + IMAGICK_REGISTER_CONST_LONG("FILTER_HANNING", HanningFilter); +#endif + IMAGICK_REGISTER_CONST_LONG("FILTER_HAMMING", HammingFilter); + IMAGICK_REGISTER_CONST_LONG("FILTER_BLACKMAN", BlackmanFilter); + IMAGICK_REGISTER_CONST_LONG("FILTER_GAUSSIAN", GaussianFilter); + IMAGICK_REGISTER_CONST_LONG("FILTER_QUADRATIC", QuadraticFilter); + IMAGICK_REGISTER_CONST_LONG("FILTER_CUBIC", CubicFilter); + IMAGICK_REGISTER_CONST_LONG("FILTER_CATROM", CatromFilter); + IMAGICK_REGISTER_CONST_LONG("FILTER_MITCHELL", MitchellFilter); + IMAGICK_REGISTER_CONST_LONG("FILTER_LANCZOS", LanczosFilter); + IMAGICK_REGISTER_CONST_LONG("FILTER_BESSEL", BesselFilter); + IMAGICK_REGISTER_CONST_LONG("FILTER_SINC", SincFilter); +#if MagickLibVersion >= 0x637 + IMAGICK_REGISTER_CONST_LONG("FILTER_KAISER", KaiserFilter); +#if MagickLibVersion >= 0x701 + IMAGICK_REGISTER_CONST_LONG("FILTER_WELSH", WelshFilter); + IMAGICK_REGISTER_CONST_LONG("FILTER_WELCH", WelchFilter); +#else + IMAGICK_REGISTER_CONST_LONG("FILTER_WELSH", WelshFilter); +#endif + IMAGICK_REGISTER_CONST_LONG("FILTER_PARZEN", ParzenFilter); + IMAGICK_REGISTER_CONST_LONG("FILTER_LAGRANGE", LagrangeFilter); + IMAGICK_REGISTER_CONST_LONG("FILTER_SENTINEL", SentinelFilter); +#endif +#if MagickLibVersion >= 0x638 + IMAGICK_REGISTER_CONST_LONG("FILTER_BOHMAN", BohmanFilter); + IMAGICK_REGISTER_CONST_LONG("FILTER_BARTLETT", BartlettFilter); +#endif +#if MagickLibVersion >= 0x666 + IMAGICK_REGISTER_CONST_LONG("FILTER_JINC", JincFilter); + IMAGICK_REGISTER_CONST_LONG("FILTER_SINCFAST", SincFastFilter); + IMAGICK_REGISTER_CONST_LONG("FILTER_ROBIDOUX", RobidouxFilter); + IMAGICK_REGISTER_CONST_LONG("FILTER_LANCZOSSHARP", LanczosSharpFilter); + IMAGICK_REGISTER_CONST_LONG("FILTER_LANCZOS2", Lanczos2Filter); + IMAGICK_REGISTER_CONST_LONG("FILTER_LANCZOS2SHARP", Lanczos2SharpFilter); +#endif +#if MagickLibVersion >= 0x677 + IMAGICK_REGISTER_CONST_LONG("FILTER_ROBIDOUXSHARP", RobidouxSharpFilter); + IMAGICK_REGISTER_CONST_LONG("FILTER_COSINE", CosineFilter); +#endif +#if MagickLibVersion >= 0x678 + IMAGICK_REGISTER_CONST_LONG("FILTER_SPLINE", SplineFilter); +#endif +#if MagickLibVersion >= 0x681 + IMAGICK_REGISTER_CONST_LONG("FILTER_LANCZOSRADIUS", LanczosRadiusFilter); +#endif +#if MagickLibVersion >= 0x707 + IMAGICK_REGISTER_CONST_LONG("FILTER_CUBIC_SPLINE", CubicSplineFilter); +#endif +#if MAGICK_LIB_VERSION_GTE(7, 1, 1, 40) + IMAGICK_REGISTER_CONST_LONG("FILTER_MAGIC_KERNEL_SHARP_2013", MagicKernelSharp2013Filter); + IMAGICK_REGISTER_CONST_LONG("FILTER_MAGIC_KERNEL_SHARP_2021", MagicKernelSharp2021Filter); +#endif + + IMAGICK_REGISTER_CONST_LONG("IMGTYPE_UNDEFINED", UndefinedType); + IMAGICK_REGISTER_CONST_LONG("IMGTYPE_BILEVEL", BilevelType); + IMAGICK_REGISTER_CONST_LONG("IMGTYPE_GRAYSCALE", GrayscaleType); +#if MagickLibVersion < 0x700 + IMAGICK_REGISTER_CONST_LONG("IMGTYPE_GRAYSCALEMATTE", GrayscaleMatteType); +#else + IMAGICK_REGISTER_CONST_LONG("IMGTYPE_GRAYSCALEALPHA", GrayscaleAlphaType); + //@TODO - this is only here for legacy support + IMAGICK_REGISTER_CONST_LONG("IMGTYPE_GRAYSCALEMATTE", GrayscaleAlphaType); +#endif + IMAGICK_REGISTER_CONST_LONG("IMGTYPE_PALETTE", PaletteType); +#if MagickLibVersion < 0x700 + IMAGICK_REGISTER_CONST_LONG("IMGTYPE_PALETTEMATTE", PaletteMatteType); +#else + IMAGICK_REGISTER_CONST_LONG("IMGTYPE_PALETTEMATTE", PaletteAlphaType); + //@TODO - this is only here for legacy support + IMAGICK_REGISTER_CONST_LONG("IMGTYPE_PALETTEALPHA", PaletteAlphaType); +#endif + IMAGICK_REGISTER_CONST_LONG("IMGTYPE_TRUECOLOR", TrueColorType); +#if MagickLibVersion < 0x700 + IMAGICK_REGISTER_CONST_LONG("IMGTYPE_TRUECOLORMATTE", TrueColorMatteType); +#else + IMAGICK_REGISTER_CONST_LONG("IMGTYPE_TRUECOLORALPHA", TrueColorAlphaType); + //@TODO - this is only here for legacy support + IMAGICK_REGISTER_CONST_LONG("IMGTYPE_TRUECOLORMATTE", TrueColorAlphaType); + +#endif + IMAGICK_REGISTER_CONST_LONG("IMGTYPE_COLORSEPARATION", ColorSeparationType); +#if MagickLibVersion < 0x700 + IMAGICK_REGISTER_CONST_LONG("IMGTYPE_COLORSEPARATIONMATTE", ColorSeparationMatteType); +#else + IMAGICK_REGISTER_CONST_LONG("IMGTYPE_COLORSEPARATIONALPHA", ColorSeparationAlphaType); + //@TODO - this is only here for legacy support + IMAGICK_REGISTER_CONST_LONG("IMGTYPE_COLORSEPARATIONMATTE", ColorSeparationAlphaType); +#endif + IMAGICK_REGISTER_CONST_LONG("IMGTYPE_OPTIMIZE", OptimizeType); +#if MagickLibVersion < 0x700 + IMAGICK_REGISTER_CONST_LONG("IMGTYPE_PALETTEBILEVELMATTE", PaletteBilevelMatteType); +#else + IMAGICK_REGISTER_CONST_LONG("IMGTYPE_PALETTEBILEVELALPHA", PaletteBilevelAlphaType); + //@TODO - this is only here for legacy support + IMAGICK_REGISTER_CONST_LONG("IMGTYPE_PALETTEBILEVELMATTE", PaletteBilevelAlphaType); +#endif + IMAGICK_REGISTER_CONST_LONG("RESOLUTION_UNDEFINED", UndefinedResolution); + IMAGICK_REGISTER_CONST_LONG("RESOLUTION_PIXELSPERINCH", PixelsPerInchResolution); + IMAGICK_REGISTER_CONST_LONG("RESOLUTION_PIXELSPERCENTIMETER", PixelsPerCentimeterResolution); + IMAGICK_REGISTER_CONST_LONG("COMPRESSION_UNDEFINED", UndefinedCompression); + IMAGICK_REGISTER_CONST_LONG("COMPRESSION_NO", NoCompression); + IMAGICK_REGISTER_CONST_LONG("COMPRESSION_BZIP", BZipCompression); + IMAGICK_REGISTER_CONST_LONG("COMPRESSION_FAX", FaxCompression); + IMAGICK_REGISTER_CONST_LONG("COMPRESSION_GROUP4", Group4Compression); + IMAGICK_REGISTER_CONST_LONG("COMPRESSION_JPEG", JPEGCompression); + IMAGICK_REGISTER_CONST_LONG("COMPRESSION_JPEG2000", JPEG2000Compression); + IMAGICK_REGISTER_CONST_LONG("COMPRESSION_LOSSLESSJPEG", LosslessJPEGCompression); + IMAGICK_REGISTER_CONST_LONG("COMPRESSION_LZW", LZWCompression); + IMAGICK_REGISTER_CONST_LONG("COMPRESSION_RLE", RLECompression); + IMAGICK_REGISTER_CONST_LONG("COMPRESSION_ZIP", ZipCompression); +#if MagickLibVersion > 0x639 + IMAGICK_REGISTER_CONST_LONG("COMPRESSION_DXT1", DXT1Compression); + IMAGICK_REGISTER_CONST_LONG("COMPRESSION_DXT3", DXT3Compression); + IMAGICK_REGISTER_CONST_LONG("COMPRESSION_DXT5", DXT5Compression); +#endif +#if MagickLibVersion >= 0x656 + IMAGICK_REGISTER_CONST_LONG("COMPRESSION_ZIPS", ZipSCompression); + IMAGICK_REGISTER_CONST_LONG("COMPRESSION_PIZ", PizCompression); + IMAGICK_REGISTER_CONST_LONG("COMPRESSION_PXR24", Pxr24Compression); + IMAGICK_REGISTER_CONST_LONG("COMPRESSION_B44", B44Compression); + IMAGICK_REGISTER_CONST_LONG("COMPRESSION_B44A", B44ACompression); +#endif +#if MagickLibVersion >= 0x667 + IMAGICK_REGISTER_CONST_LONG("COMPRESSION_LZMA", LZMACompression); +#endif +#if MagickLibVersion >= 0x670 + IMAGICK_REGISTER_CONST_LONG("COMPRESSION_JBIG1", JBIG1Compression); + IMAGICK_REGISTER_CONST_LONG("COMPRESSION_JBIG2", JBIG2Compression); +#endif + +#if MagickLibVersion >= 0x709 + IMAGICK_REGISTER_CONST_LONG("COMPRESSION_ZSTD", ZstdCompression); + IMAGICK_REGISTER_CONST_LONG("COMPRESSION_WEBP", WebPCompression); +#endif + +#if MAGICK_LIB_VERSION_GTE(7, 1, 0, 13) + IMAGICK_REGISTER_CONST_LONG("COMPRESSION_BC5", BC5Compression); + IMAGICK_REGISTER_CONST_LONG("COMPRESSION_BC7", BC7Compression); +#endif + +#if MagickLibVersion >= 0x70C + IMAGICK_REGISTER_CONST_LONG("COMPRESSION_DWAA", DWAACompression); + IMAGICK_REGISTER_CONST_LONG("COMPRESSION_DWAB", DWABCompression); +#endif + +#if MAGICK_LIB_VERSION_GTE(7, 1, 1, 16) + IMAGICK_REGISTER_CONST_LONG("COMPRESSION_LERC", LERCCompression); +#endif + + IMAGICK_REGISTER_CONST_LONG("PAINT_POINT", PointMethod); + IMAGICK_REGISTER_CONST_LONG("PAINT_REPLACE", ReplaceMethod); + IMAGICK_REGISTER_CONST_LONG("PAINT_FLOODFILL", FloodfillMethod); + IMAGICK_REGISTER_CONST_LONG("PAINT_FILLTOBORDER", FillToBorderMethod); + IMAGICK_REGISTER_CONST_LONG("PAINT_RESET", ResetMethod); + IMAGICK_REGISTER_CONST_LONG("GRAVITY_NORTHWEST", NorthWestGravity); + IMAGICK_REGISTER_CONST_LONG("GRAVITY_NORTH", NorthGravity); + IMAGICK_REGISTER_CONST_LONG("GRAVITY_NORTHEAST", NorthEastGravity); + IMAGICK_REGISTER_CONST_LONG("GRAVITY_WEST", WestGravity); + IMAGICK_REGISTER_CONST_LONG("GRAVITY_CENTER", CenterGravity); + IMAGICK_REGISTER_CONST_LONG("GRAVITY_EAST", EastGravity); + IMAGICK_REGISTER_CONST_LONG("GRAVITY_SOUTHWEST", SouthWestGravity); + IMAGICK_REGISTER_CONST_LONG("GRAVITY_SOUTH", SouthGravity); + IMAGICK_REGISTER_CONST_LONG("GRAVITY_SOUTHEAST", SouthEastGravity); + IMAGICK_REGISTER_CONST_LONG("GRAVITY_FORGET", ForgetGravity); +#if MagickLibVersion < 0x700 + IMAGICK_REGISTER_CONST_LONG("GRAVITY_STATIC", StaticGravity); +#endif + + IMAGICK_REGISTER_CONST_LONG("STRETCH_NORMAL", NormalStretch); + IMAGICK_REGISTER_CONST_LONG("STRETCH_ULTRACONDENSED", UltraCondensedStretch); + IMAGICK_REGISTER_CONST_LONG("STRETCH_EXTRACONDENSED", ExtraCondensedStretch); + IMAGICK_REGISTER_CONST_LONG("STRETCH_CONDENSED", CondensedStretch); + IMAGICK_REGISTER_CONST_LONG("STRETCH_SEMICONDENSED", SemiCondensedStretch); + IMAGICK_REGISTER_CONST_LONG("STRETCH_SEMIEXPANDED", SemiExpandedStretch); + IMAGICK_REGISTER_CONST_LONG("STRETCH_EXPANDED", ExpandedStretch); + IMAGICK_REGISTER_CONST_LONG("STRETCH_EXTRAEXPANDED", ExtraExpandedStretch); + IMAGICK_REGISTER_CONST_LONG("STRETCH_ULTRAEXPANDED", UltraExpandedStretch); + IMAGICK_REGISTER_CONST_LONG("STRETCH_ANY", AnyStretch); + IMAGICK_REGISTER_CONST_LONG("ALIGN_UNDEFINED", UndefinedAlign); + IMAGICK_REGISTER_CONST_LONG("ALIGN_LEFT", LeftAlign); + IMAGICK_REGISTER_CONST_LONG("ALIGN_CENTER", CenterAlign); + IMAGICK_REGISTER_CONST_LONG("ALIGN_RIGHT", RightAlign); + IMAGICK_REGISTER_CONST_LONG("DECORATION_NO", NoDecoration); + IMAGICK_REGISTER_CONST_LONG("DECORATION_UNDERLINE", UnderlineDecoration); + IMAGICK_REGISTER_CONST_LONG("DECORATION_OVERLINE", OverlineDecoration); + IMAGICK_REGISTER_CONST_LONG("DECORATION_LINETROUGH", LineThroughDecoration); //TODO remove? + IMAGICK_REGISTER_CONST_LONG("DECORATION_LINETHROUGH", LineThroughDecoration); + IMAGICK_REGISTER_CONST_LONG("NOISE_UNIFORM", UniformNoise); + IMAGICK_REGISTER_CONST_LONG("NOISE_GAUSSIAN", GaussianNoise); + IMAGICK_REGISTER_CONST_LONG("NOISE_MULTIPLICATIVEGAUSSIAN", MultiplicativeGaussianNoise); + IMAGICK_REGISTER_CONST_LONG("NOISE_IMPULSE", ImpulseNoise); + IMAGICK_REGISTER_CONST_LONG("NOISE_LAPLACIAN", LaplacianNoise); + IMAGICK_REGISTER_CONST_LONG("NOISE_POISSON", PoissonNoise); +#if MagickLibVersion > 0x635 + IMAGICK_REGISTER_CONST_LONG("NOISE_RANDOM", RandomNoise); +#endif + IMAGICK_REGISTER_CONST_LONG("CHANNEL_UNDEFINED", UndefinedChannel); + IMAGICK_REGISTER_CONST_LONG("CHANNEL_RED", RedChannel); + IMAGICK_REGISTER_CONST_LONG("CHANNEL_GRAY", GrayChannel); + IMAGICK_REGISTER_CONST_LONG("CHANNEL_CYAN", CyanChannel); + IMAGICK_REGISTER_CONST_LONG("CHANNEL_GREEN", GreenChannel); + IMAGICK_REGISTER_CONST_LONG("CHANNEL_MAGENTA", MagentaChannel); + IMAGICK_REGISTER_CONST_LONG("CHANNEL_BLUE", BlueChannel); + IMAGICK_REGISTER_CONST_LONG("CHANNEL_YELLOW", YellowChannel); + IMAGICK_REGISTER_CONST_LONG("CHANNEL_ALPHA", AlphaChannel); + IMAGICK_REGISTER_CONST_LONG("CHANNEL_OPACITY", OpacityChannel); +#if MagickLibVersion < 0x700 + IMAGICK_REGISTER_CONST_LONG("CHANNEL_MATTE", MatteChannel); /* deprecated, needs to throw E_STRICT if used */ +#endif + IMAGICK_REGISTER_CONST_LONG("CHANNEL_BLACK", BlackChannel); + IMAGICK_REGISTER_CONST_LONG("CHANNEL_INDEX", IndexChannel); + IMAGICK_REGISTER_CONST_LONG("CHANNEL_ALL", AllChannels); + IMAGICK_REGISTER_CONST_LONG("CHANNEL_DEFAULT", DefaultChannels); + IMAGICK_REGISTER_CONST_LONG("CHANNEL_RGBA", RedChannel | GreenChannel | BlueChannel | AlphaChannel); +#if MagickLibVersion >= 0x644 + IMAGICK_REGISTER_CONST_LONG("CHANNEL_TRUEALPHA", TrueAlphaChannel); + IMAGICK_REGISTER_CONST_LONG("CHANNEL_RGBS", RGBChannels); +#endif +#if MagickLibVersion >= 0x655 + IMAGICK_REGISTER_CONST_LONG("CHANNEL_GRAY_CHANNELS", GrayChannels); +#endif +#if MagickLibVersion >= 0x656 + IMAGICK_REGISTER_CONST_LONG("CHANNEL_SYNC", SyncChannels); +#endif + +#if MagickLibVersion >= 0x700 + IMAGICK_REGISTER_CONST_LONG("CHANNEL_READ_MASK", ReadMaskChannel); /* Pixel is Not Readable? */ + IMAGICK_REGISTER_CONST_LONG("CHANNEL_WRITE_MASK", WriteMaskChannel); /* Pixel is Write Protected? */ + IMAGICK_REGISTER_CONST_LONG("CHANNEL_META", MetaChannel); /* ???? */ +#endif + +#if MagickLibVersion >= 0x708 + IMAGICK_REGISTER_CONST_LONG("CHANNEL_COMPOSITE_MASK", CompositeMaskChannel); /* SVG mask */ +#endif + +#if MagickLibVersion >= 0x670 + IMAGICK_REGISTER_CONST_LONG("CHANNEL_COMPOSITES", CompositeChannels); +#endif +#if MagickLibVersion < 0x700 + IMAGICK_REGISTER_CONST_LONG("METRIC_UNDEFINED", UndefinedMetric); +#endif + IMAGICK_REGISTER_CONST_LONG("METRIC_ABSOLUTEERRORMETRIC", AbsoluteErrorMetric); + IMAGICK_REGISTER_CONST_LONG("METRIC_MEANABSOLUTEERROR", MeanAbsoluteErrorMetric); +#if MagickLibVersion < 0x700 + IMAGICK_REGISTER_CONST_LONG("METRIC_MEANERRORPERPIXELMETRIC", MeanErrorPerPixelMetric); +#else + IMAGICK_REGISTER_CONST_LONG("METRIC_MEANERRORPERPIXELMETRIC", MeanErrorPerPixelErrorMetric); +#endif + + IMAGICK_REGISTER_CONST_LONG("METRIC_MEANSQUAREERROR", MeanSquaredErrorMetric); + IMAGICK_REGISTER_CONST_LONG("METRIC_PEAKABSOLUTEERROR", PeakAbsoluteErrorMetric); +#if MagickLibVersion < 0x700 + IMAGICK_REGISTER_CONST_LONG("METRIC_PEAKSIGNALTONOISERATIO", PeakSignalToNoiseRatioMetric); +#else + IMAGICK_REGISTER_CONST_LONG("METRIC_PEAKSIGNALTONOISERATIO", PeakSignalToNoiseRatioErrorMetric); +#endif + IMAGICK_REGISTER_CONST_LONG("METRIC_ROOTMEANSQUAREDERROR", RootMeanSquaredErrorMetric); +#if MagickLibVersion >= 0x687 + IMAGICK_REGISTER_CONST_LONG("METRIC_NORMALIZEDCROSSCORRELATIONERRORMETRIC", NormalizedCrossCorrelationErrorMetric); + IMAGICK_REGISTER_CONST_LONG("METRIC_FUZZERROR", FuzzErrorMetric); +#endif +#if MagickLibVersion >= 0x690 + IMAGICK_REGISTER_CONST_LONG("METRIC_PERCEPTUALHASH_ERROR", PerceptualHashErrorMetric); +#endif + +#if MagickLibVersion >= 0x707 + IMAGICK_REGISTER_CONST_LONG("METRIC_STRUCTURAL_SIMILARITY_ERROR", StructuralSimilarityErrorMetric); + IMAGICK_REGISTER_CONST_LONG("METRIC_STRUCTURAL_DISSIMILARITY_ERROR", StructuralDissimilarityErrorMetric); +#endif + +#if MAGICK_LIB_VERSION_GTE(7, 1, 1, 44) + IMAGICK_REGISTER_CONST_LONG("METRIC_PHASE_CORRELATION_ERROR", PhaseCorrelationErrorMetric); + IMAGICK_REGISTER_CONST_LONG("METRIC_PRODUCT_CORRELATION_ERROR", DotProductCorrelationErrorMetric); +#endif + + IMAGICK_REGISTER_CONST_LONG("PIXEL_CHAR", CharPixel); + IMAGICK_REGISTER_CONST_LONG("PIXELSTORAGE_CHAR", CharPixel); + IMAGICK_REGISTER_CONST_LONG("PIXEL_DOUBLE", DoublePixel); + IMAGICK_REGISTER_CONST_LONG("PIXELSTORAGE_DOUBLE", DoublePixel); + IMAGICK_REGISTER_CONST_LONG("PIXEL_FLOAT", FloatPixel); + IMAGICK_REGISTER_CONST_LONG("PIXELSTORAGE_FLOAT", FloatPixel); +#if MagickLibVersion < 0x700 + IMAGICK_REGISTER_CONST_LONG("PIXEL_INTEGER", IntegerPixel); + IMAGICK_REGISTER_CONST_LONG("PIXELSTORAGE_INTEGER", IntegerPixel); +#endif + IMAGICK_REGISTER_CONST_LONG("PIXEL_LONG", LongPixel); + IMAGICK_REGISTER_CONST_LONG("PIXELSTORAGE_LONG", LongPixel); + IMAGICK_REGISTER_CONST_LONG("PIXEL_QUANTUM", QuantumPixel); + IMAGICK_REGISTER_CONST_LONG("PIXELSTORAGE_QUANTUM", QuantumPixel); + IMAGICK_REGISTER_CONST_LONG("PIXEL_SHORT", ShortPixel); + IMAGICK_REGISTER_CONST_LONG("PIXELSTORAGE_SHORT", ShortPixel); + //For now we deliberately DO NOT support the longlong pixel type. + //64 bit integers and PHP do not play nicely. + //IMAGICK_REGISTER_CONST_LONG("PIXEL_LONGLONG", ..); + //IMAGICK_REGISTER_CONST_LONG("PIXELSTORAGE_LONGLONG", ..); + + IMAGICK_REGISTER_CONST_LONG("EVALUATE_UNDEFINED", UndefinedEvaluateOperator); + IMAGICK_REGISTER_CONST_LONG("EVALUATE_ADD", AddEvaluateOperator); + IMAGICK_REGISTER_CONST_LONG("EVALUATE_AND", AndEvaluateOperator); + IMAGICK_REGISTER_CONST_LONG("EVALUATE_DIVIDE", DivideEvaluateOperator); + IMAGICK_REGISTER_CONST_LONG("EVALUATE_LEFTSHIFT", LeftShiftEvaluateOperator); + IMAGICK_REGISTER_CONST_LONG("EVALUATE_MAX", MaxEvaluateOperator); + IMAGICK_REGISTER_CONST_LONG("EVALUATE_MIN", MinEvaluateOperator); + IMAGICK_REGISTER_CONST_LONG("EVALUATE_MULTIPLY", MultiplyEvaluateOperator); + IMAGICK_REGISTER_CONST_LONG("EVALUATE_OR", OrEvaluateOperator); + IMAGICK_REGISTER_CONST_LONG("EVALUATE_RIGHTSHIFT", RightShiftEvaluateOperator); + IMAGICK_REGISTER_CONST_LONG("EVALUATE_SET", SetEvaluateOperator); + IMAGICK_REGISTER_CONST_LONG("EVALUATE_SUBTRACT", SubtractEvaluateOperator); + IMAGICK_REGISTER_CONST_LONG("EVALUATE_XOR", XorEvaluateOperator); +#if MagickLibVersion > 0x643 + IMAGICK_REGISTER_CONST_LONG("EVALUATE_POW", PowEvaluateOperator); + IMAGICK_REGISTER_CONST_LONG("EVALUATE_LOG", LogEvaluateOperator); + IMAGICK_REGISTER_CONST_LONG("EVALUATE_THRESHOLD", ThresholdEvaluateOperator); + IMAGICK_REGISTER_CONST_LONG("EVALUATE_THRESHOLDBLACK", ThresholdBlackEvaluateOperator); + IMAGICK_REGISTER_CONST_LONG("EVALUATE_THRESHOLDWHITE", ThresholdWhiteEvaluateOperator); + IMAGICK_REGISTER_CONST_LONG("EVALUATE_GAUSSIANNOISE", GaussianNoiseEvaluateOperator); + IMAGICK_REGISTER_CONST_LONG("EVALUATE_IMPULSENOISE", ImpulseNoiseEvaluateOperator); + IMAGICK_REGISTER_CONST_LONG("EVALUATE_LAPLACIANNOISE", LaplacianNoiseEvaluateOperator); + IMAGICK_REGISTER_CONST_LONG("EVALUATE_MULTIPLICATIVENOISE", MultiplicativeNoiseEvaluateOperator); + IMAGICK_REGISTER_CONST_LONG("EVALUATE_POISSONNOISE", PoissonNoiseEvaluateOperator); + IMAGICK_REGISTER_CONST_LONG("EVALUATE_UNIFORMNOISE", UniformNoiseEvaluateOperator); +#endif +#if MagickLibVersion > 0x648 + IMAGICK_REGISTER_CONST_LONG("EVALUATE_COSINE", CosineEvaluateOperator); + IMAGICK_REGISTER_CONST_LONG("EVALUATE_SINE", SineEvaluateOperator); + IMAGICK_REGISTER_CONST_LONG("EVALUATE_ADDMODULUS", AddModulusEvaluateOperator); +#endif +#if MagickLibVersion >= 0x661 + IMAGICK_REGISTER_CONST_LONG("EVALUATE_MEAN", MeanEvaluateOperator); +#endif +#if MagickLibVersion >= 0x664 + IMAGICK_REGISTER_CONST_LONG("EVALUATE_ABS", AbsEvaluateOperator); +#endif +#if MagickLibVersion >= 0x666 + IMAGICK_REGISTER_CONST_LONG("EVALUATE_EXPONENTIAL", ExponentialEvaluateOperator); + IMAGICK_REGISTER_CONST_LONG("EVALUATE_MEDIAN", MedianEvaluateOperator); +#endif +#if MagickLibVersion >= 0x676 + IMAGICK_REGISTER_CONST_LONG("EVALUATE_SUM", SumEvaluateOperator); +#endif +#if MagickLibVersion >= 0x690 + IMAGICK_REGISTER_CONST_LONG("EVALUATE_ROOT_MEAN_SQUARE", RootMeanSquareEvaluateOperator); +#endif + +#if MagickLibVersion >= 0x70B + IMAGICK_REGISTER_CONST_LONG("EVALUATE_INVERSE_LOG", InverseLogEvaluateOperator); +#endif + + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_UNDEFINED", UndefinedColorspace); + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_RGB", RGBColorspace); + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_GRAY", GRAYColorspace); + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_TRANSPARENT", TransparentColorspace); + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_OHTA", OHTAColorspace); +#if MagickLibVersion < 0x700 +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_LAB", LABColorspace); +#endif +#endif + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_XYZ", XYZColorspace); + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_YCBCR", YCbCrColorspace); + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_YCC", YCCColorspace); + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_YIQ", YIQColorspace); + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_YPBPR", YPbPrColorspace); + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_YUV", YUVColorspace); + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_CMYK", CMYKColorspace); + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_SRGB", sRGBColorspace); + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_HSB", HSBColorspace); + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_HSL", HSLColorspace); + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_HWB", HWBColorspace); +#if MagickLibVersion < 0x700 + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_REC601LUMA", Rec601LumaColorspace); + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_REC709LUMA", Rec709LumaColorspace); +#endif + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_LOG", LogColorspace); +#if MagickLibVersion >= 0x642 + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_CMY", CMYColorspace); +#endif +#if MagickLibVersion >= 0X679 + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_LUV", LuvColorspace); + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_HCL", HCLColorspace); +#endif +#if MagickLibVersion >= 0x680 + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_LCH", LCHColorspace); + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_LMS", LMSColorspace); +#endif +#if MagickLibVersion >= 0x686 + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_LCHAB", LCHabColorspace); + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_LCHUV", LCHuvColorspace); + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_SCRGB", scRGBColorspace); + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_HSI", HSIColorspace); + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_HSV", HSVColorspace); + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_HCLP", HCLpColorspace); + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_YDBDR", YDbDrColorspace); +#endif + + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_REC601YCBCR", Rec601YCbCrColorspace); + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_REC709YCBCR", Rec709YCbCrColorspace); +#if MagickLibVersion >= 0x690 + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_XYY", xyYColorspace); +#endif + + +#if (MagickLibVersion >= 0x700 && MagickLibVersion >= 0x708) || (MagickLibVersion < 0x700 && MagickLibVersion >= 0x699) + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_LINEARGRAY", LinearGRAYColorspace); +#endif + +#if MagickLibVersion >= 0x70B + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_DISPLAYP3", DisplayP3Colorspace); + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_ADOBE98", Adobe98Colorspace); + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_PROPHOTO", ProPhotoColorspace); +#endif + +#if MAGICK_LIB_VERSION_GTE(7, 1, 1, 9) + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_OKLAB", OklabColorspace); + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_OKLCH", OklchColorspace); +#endif + +#if MAGICK_LIB_VERSION_GTE(7, 1, 1, 44) + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_CAT02LMS", CAT02LMSColorspace); +#endif + +#if MagickLibVersion >= 0x70A + IMAGICK_REGISTER_CONST_LONG("COLORSPACE_JZAZBZ", JzazbzColorspace); +#endif + + + IMAGICK_REGISTER_CONST_LONG("VIRTUALPIXELMETHOD_UNDEFINED", UndefinedVirtualPixelMethod); + IMAGICK_REGISTER_CONST_LONG("VIRTUALPIXELMETHOD_BACKGROUND", BackgroundVirtualPixelMethod); +#if MagickLibVersion < 0x700 + IMAGICK_REGISTER_CONST_LONG("VIRTUALPIXELMETHOD_CONSTANT", ConstantVirtualPixelMethod); /* deprecated */ +#endif + IMAGICK_REGISTER_CONST_LONG("VIRTUALPIXELMETHOD_EDGE", EdgeVirtualPixelMethod); + IMAGICK_REGISTER_CONST_LONG("VIRTUALPIXELMETHOD_MIRROR", MirrorVirtualPixelMethod); + IMAGICK_REGISTER_CONST_LONG("VIRTUALPIXELMETHOD_TILE", TileVirtualPixelMethod); + IMAGICK_REGISTER_CONST_LONG("VIRTUALPIXELMETHOD_TRANSPARENT", TransparentVirtualPixelMethod); +#if MagickLibVersion > 0x641 + IMAGICK_REGISTER_CONST_LONG("VIRTUALPIXELMETHOD_MASK", MaskVirtualPixelMethod); + IMAGICK_REGISTER_CONST_LONG("VIRTUALPIXELMETHOD_BLACK", BlackVirtualPixelMethod); + IMAGICK_REGISTER_CONST_LONG("VIRTUALPIXELMETHOD_GRAY", GrayVirtualPixelMethod); + IMAGICK_REGISTER_CONST_LONG("VIRTUALPIXELMETHOD_WHITE", WhiteVirtualPixelMethod); +#endif +#if MagickLibVersion > 0x642 + IMAGICK_REGISTER_CONST_LONG("VIRTUALPIXELMETHOD_HORIZONTALTILE", HorizontalTileVirtualPixelMethod); + IMAGICK_REGISTER_CONST_LONG("VIRTUALPIXELMETHOD_VERTICALTILE", VerticalTileVirtualPixelMethod); +#endif +#if MagickLibVersion >= 0x651 + IMAGICK_REGISTER_CONST_LONG("VIRTUALPIXELMETHOD_HORIZONTALTILEEDGE", HorizontalTileEdgeVirtualPixelMethod); + IMAGICK_REGISTER_CONST_LONG("VIRTUALPIXELMETHOD_VERTICALTILEEDGE", VerticalTileEdgeVirtualPixelMethod); + IMAGICK_REGISTER_CONST_LONG("VIRTUALPIXELMETHOD_CHECKERTILE", CheckerTileVirtualPixelMethod); +#endif + + // These were missed, but have been present for 12 years, so assuming + // they are going to be available in all version of ImageMagick people + // are using. + IMAGICK_REGISTER_CONST_LONG("VIRTUALPIXELMETHOD_DITHER", DitherVirtualPixelMethod); + IMAGICK_REGISTER_CONST_LONG("VIRTUALPIXELMETHOD_RANDOM", RandomVirtualPixelMethod); + + IMAGICK_REGISTER_CONST_LONG("PREVIEW_UNDEFINED", UndefinedPreview); + IMAGICK_REGISTER_CONST_LONG("PREVIEW_ROTATE", RotatePreview); + IMAGICK_REGISTER_CONST_LONG("PREVIEW_SHEAR", ShearPreview); + IMAGICK_REGISTER_CONST_LONG("PREVIEW_ROLL", RollPreview); + IMAGICK_REGISTER_CONST_LONG("PREVIEW_HUE", HuePreview); + IMAGICK_REGISTER_CONST_LONG("PREVIEW_SATURATION", SaturationPreview); + IMAGICK_REGISTER_CONST_LONG("PREVIEW_BRIGHTNESS", BrightnessPreview); + IMAGICK_REGISTER_CONST_LONG("PREVIEW_GAMMA", GammaPreview); + IMAGICK_REGISTER_CONST_LONG("PREVIEW_SPIFF", SpiffPreview); + IMAGICK_REGISTER_CONST_LONG("PREVIEW_DULL", DullPreview); + IMAGICK_REGISTER_CONST_LONG("PREVIEW_GRAYSCALE", GrayscalePreview); + IMAGICK_REGISTER_CONST_LONG("PREVIEW_QUANTIZE", QuantizePreview); + IMAGICK_REGISTER_CONST_LONG("PREVIEW_DESPECKLE", DespecklePreview); + IMAGICK_REGISTER_CONST_LONG("PREVIEW_REDUCENOISE", ReduceNoisePreview); + IMAGICK_REGISTER_CONST_LONG("PREVIEW_ADDNOISE", AddNoisePreview); + IMAGICK_REGISTER_CONST_LONG("PREVIEW_SHARPEN", SharpenPreview); + IMAGICK_REGISTER_CONST_LONG("PREVIEW_BLUR", BlurPreview); + IMAGICK_REGISTER_CONST_LONG("PREVIEW_THRESHOLD", ThresholdPreview); + IMAGICK_REGISTER_CONST_LONG("PREVIEW_EDGEDETECT", EdgeDetectPreview); + IMAGICK_REGISTER_CONST_LONG("PREVIEW_SPREAD", SpreadPreview); + IMAGICK_REGISTER_CONST_LONG("PREVIEW_SOLARIZE", SolarizePreview); + IMAGICK_REGISTER_CONST_LONG("PREVIEW_SHADE", ShadePreview); + IMAGICK_REGISTER_CONST_LONG("PREVIEW_RAISE", RaisePreview); + IMAGICK_REGISTER_CONST_LONG("PREVIEW_SEGMENT", SegmentPreview); + IMAGICK_REGISTER_CONST_LONG("PREVIEW_SWIRL", SwirlPreview); + IMAGICK_REGISTER_CONST_LONG("PREVIEW_IMPLODE", ImplodePreview); + IMAGICK_REGISTER_CONST_LONG("PREVIEW_WAVE", WavePreview); + IMAGICK_REGISTER_CONST_LONG("PREVIEW_OILPAINT", OilPaintPreview); + IMAGICK_REGISTER_CONST_LONG("PREVIEW_CHARCOALDRAWING", CharcoalDrawingPreview); + IMAGICK_REGISTER_CONST_LONG("PREVIEW_JPEG", JPEGPreview); + IMAGICK_REGISTER_CONST_LONG("RENDERINGINTENT_UNDEFINED", UndefinedIntent); + IMAGICK_REGISTER_CONST_LONG("RENDERINGINTENT_SATURATION", SaturationIntent); + IMAGICK_REGISTER_CONST_LONG("RENDERINGINTENT_PERCEPTUAL", PerceptualIntent); + IMAGICK_REGISTER_CONST_LONG("RENDERINGINTENT_ABSOLUTE", AbsoluteIntent); + IMAGICK_REGISTER_CONST_LONG("RENDERINGINTENT_RELATIVE", RelativeIntent); + IMAGICK_REGISTER_CONST_LONG("INTERLACE_UNDEFINED", UndefinedInterlace); + IMAGICK_REGISTER_CONST_LONG("INTERLACE_NO", NoInterlace); + IMAGICK_REGISTER_CONST_LONG("INTERLACE_LINE", LineInterlace); + IMAGICK_REGISTER_CONST_LONG("INTERLACE_PLANE", PlaneInterlace); + IMAGICK_REGISTER_CONST_LONG("INTERLACE_PARTITION", PartitionInterlace); +#if MagickLibVersion > 0x633 + IMAGICK_REGISTER_CONST_LONG("INTERLACE_GIF", GIFInterlace); + IMAGICK_REGISTER_CONST_LONG("INTERLACE_JPEG", JPEGInterlace); + IMAGICK_REGISTER_CONST_LONG("INTERLACE_PNG", PNGInterlace); +#endif + IMAGICK_REGISTER_CONST_LONG("FILLRULE_UNDEFINED", UndefinedRule); + IMAGICK_REGISTER_CONST_LONG("FILLRULE_EVENODD", EvenOddRule); + IMAGICK_REGISTER_CONST_LONG("FILLRULE_NONZERO", NonZeroRule); + IMAGICK_REGISTER_CONST_LONG("PATHUNITS_UNDEFINED", UndefinedPathUnits); + IMAGICK_REGISTER_CONST_LONG("PATHUNITS_USERSPACE", UserSpace); + IMAGICK_REGISTER_CONST_LONG("PATHUNITS_USERSPACEONUSE", UserSpaceOnUse); + IMAGICK_REGISTER_CONST_LONG("PATHUNITS_OBJECTBOUNDINGBOX", ObjectBoundingBox); + IMAGICK_REGISTER_CONST_LONG("LINECAP_UNDEFINED", UndefinedCap); + IMAGICK_REGISTER_CONST_LONG("LINECAP_BUTT", ButtCap); + IMAGICK_REGISTER_CONST_LONG("LINECAP_ROUND", RoundCap); + IMAGICK_REGISTER_CONST_LONG("LINECAP_SQUARE", SquareCap); + IMAGICK_REGISTER_CONST_LONG("LINEJOIN_UNDEFINED", UndefinedJoin); + IMAGICK_REGISTER_CONST_LONG("LINEJOIN_MITER", MiterJoin); + IMAGICK_REGISTER_CONST_LONG("LINEJOIN_ROUND", RoundJoin); + IMAGICK_REGISTER_CONST_LONG("LINEJOIN_BEVEL", BevelJoin); + IMAGICK_REGISTER_CONST_LONG("RESOURCETYPE_UNDEFINED", UndefinedResource); + IMAGICK_REGISTER_CONST_LONG("RESOURCETYPE_AREA", AreaResource); + IMAGICK_REGISTER_CONST_LONG("RESOURCETYPE_DISK", DiskResource); + IMAGICK_REGISTER_CONST_LONG("RESOURCETYPE_FILE", FileResource); + IMAGICK_REGISTER_CONST_LONG("RESOURCETYPE_MAP", MapResource); + IMAGICK_REGISTER_CONST_LONG("RESOURCETYPE_MEMORY", MemoryResource); +#if MagickLibVersion >= 0x675 + IMAGICK_REGISTER_CONST_LONG("RESOURCETYPE_TIME", TimeResource); + IMAGICK_REGISTER_CONST_LONG("RESOURCETYPE_THROTTLE", ThrottleResource); +#endif +#if MagickLibVersion > 0x678 + IMAGICK_REGISTER_CONST_LONG("RESOURCETYPE_THREAD", ThreadResource); +#endif +#if MagickLibVersion > 0x691 + IMAGICK_REGISTER_CONST_LONG("RESOURCETYPE_WIDTH", WidthResource); + IMAGICK_REGISTER_CONST_LONG("RESOURCETYPE_HEIGHT", HeightResource); +#endif + +#if (MagickLibVersion >= 0x700 && MagickLibVersion >= 0x708) || (MagickLibVersion < 0x700 && MagickLibVersion >= 0x69A) + IMAGICK_REGISTER_CONST_LONG("RESOURCETYPE_LISTLENGTH", ListLengthResource); +#endif + + IMAGICK_REGISTER_CONST_LONG("DISPOSE_UNRECOGNIZED", UnrecognizedDispose); + IMAGICK_REGISTER_CONST_LONG("DISPOSE_UNDEFINED", UndefinedDispose); + IMAGICK_REGISTER_CONST_LONG("DISPOSE_NONE", NoneDispose); + IMAGICK_REGISTER_CONST_LONG("DISPOSE_BACKGROUND", BackgroundDispose); + IMAGICK_REGISTER_CONST_LONG("DISPOSE_PREVIOUS", PreviousDispose); +#if MagickLibVersion > 0x631 + IMAGICK_REGISTER_CONST_LONG("INTERPOLATE_UNDEFINED", UndefinedInterpolatePixel); + + IMAGICK_REGISTER_CONST_LONG("INTERPOLATE_AVERAGE", AverageInterpolatePixel); /* Average 4 nearest neighbours */ +#if MagickLibVersion < 0x700 + IMAGICK_REGISTER_CONST_LONG("INTERPOLATE_BICUBIC", BicubicInterpolatePixel); /* Catmull-Rom interpolation */ +#endif + IMAGICK_REGISTER_CONST_LONG("INTERPOLATE_BILINEAR", BilinearInterpolatePixel); /* Triangular filter interpolation */ +#if MagickLibVersion < 0x700 + IMAGICK_REGISTER_CONST_LONG("INTERPOLATE_FILTER", FilterInterpolatePixel); /* Use resize filter - (very slow) */ +#endif + IMAGICK_REGISTER_CONST_LONG("INTERPOLATE_INTEGER", IntegerInterpolatePixel); /* Integer (floor) interpolation */ + IMAGICK_REGISTER_CONST_LONG("INTERPOLATE_MESH", MeshInterpolatePixel); /* Triangular mesh interpolation */ +#if MagickLibVersion < 0x700 + IMAGICK_REGISTER_CONST_LONG("INTERPOLATE_NEARESTNEIGHBOR", NearestNeighborInterpolatePixel); +#endif +#endif +#if MagickLibVersion > 0x634 + IMAGICK_REGISTER_CONST_LONG("INTERPOLATE_SPLINE", SplineInterpolatePixel); /* Cubic Spline (blurred) interpolation */ +#endif +#if MagickLibVersion > 0x690 + IMAGICK_REGISTER_CONST_LONG("INTERPOLATE_AVERAGE_9", Average9InterpolatePixel); /* Average 9 nearest neighbours */ + IMAGICK_REGISTER_CONST_LONG("INTERPOLATE_AVERAGE_16", Average16InterpolatePixel); /* Average 16 nearest neighbours */ + IMAGICK_REGISTER_CONST_LONG("INTERPOLATE_BLEND", BlendInterpolatePixel); /* blend of nearest 1, 2 or 4 pixels */ + IMAGICK_REGISTER_CONST_LONG("INTERPOLATE_BACKGROUND_COLOR", BackgroundInterpolatePixel); /* just return background color */ +#if MagickLibVersion >= 0x687 + IMAGICK_REGISTER_CONST_LONG("INTERPOLATE_CATROM", CatromInterpolatePixel); /* Catmull-Rom interpolation */ +#endif +#endif + +#if MagickLibVersion >= 0x701 + IMAGICK_REGISTER_CONST_LONG("INTERPOLATE_NEAREST_PIXEL", NearestInterpolatePixel); /* NearestInterpolatePixel */ +#endif + +#if MagickLibVersion > 0x628 + IMAGICK_REGISTER_CONST_LONG("LAYERMETHOD_UNDEFINED", UndefinedLayer); + IMAGICK_REGISTER_CONST_LONG("LAYERMETHOD_COALESCE", CoalesceLayer); + IMAGICK_REGISTER_CONST_LONG("LAYERMETHOD_COMPAREANY", CompareAnyLayer); + IMAGICK_REGISTER_CONST_LONG("LAYERMETHOD_COMPARECLEAR", CompareClearLayer); + IMAGICK_REGISTER_CONST_LONG("LAYERMETHOD_COMPAREOVERLAY", CompareOverlayLayer); + IMAGICK_REGISTER_CONST_LONG("LAYERMETHOD_DISPOSE", DisposeLayer); + IMAGICK_REGISTER_CONST_LONG("LAYERMETHOD_OPTIMIZE", OptimizeLayer); + IMAGICK_REGISTER_CONST_LONG("LAYERMETHOD_OPTIMIZEPLUS", OptimizePlusLayer); +#endif +#if MagickLibVersion > 0x632 + IMAGICK_REGISTER_CONST_LONG("LAYERMETHOD_OPTIMIZETRANS", OptimizeTransLayer); + IMAGICK_REGISTER_CONST_LONG("LAYERMETHOD_COMPOSITE", CompositeLayer); + IMAGICK_REGISTER_CONST_LONG("LAYERMETHOD_OPTIMIZEIMAGE", OptimizeImageLayer); + IMAGICK_REGISTER_CONST_LONG("LAYERMETHOD_REMOVEDUPS", RemoveDupsLayer); + IMAGICK_REGISTER_CONST_LONG("LAYERMETHOD_REMOVEZERO", RemoveZeroLayer); +#endif +#if MagickLibVersion >= 0x644 + IMAGICK_REGISTER_CONST_LONG("LAYERMETHOD_TRIMBOUNDS", TrimBoundsLayer); +#endif +#if MagickLibVersion > 0x629 + IMAGICK_REGISTER_CONST_LONG("ORIENTATION_UNDEFINED", UndefinedOrientation); + IMAGICK_REGISTER_CONST_LONG("ORIENTATION_TOPLEFT", TopLeftOrientation); + IMAGICK_REGISTER_CONST_LONG("ORIENTATION_TOPRIGHT", TopRightOrientation); + IMAGICK_REGISTER_CONST_LONG("ORIENTATION_BOTTOMRIGHT", BottomRightOrientation); + IMAGICK_REGISTER_CONST_LONG("ORIENTATION_BOTTOMLEFT", BottomLeftOrientation); + IMAGICK_REGISTER_CONST_LONG("ORIENTATION_LEFTTOP", LeftTopOrientation); + IMAGICK_REGISTER_CONST_LONG("ORIENTATION_RIGHTTOP", RightTopOrientation); + IMAGICK_REGISTER_CONST_LONG("ORIENTATION_RIGHTBOTTOM", RightBottomOrientation); + IMAGICK_REGISTER_CONST_LONG("ORIENTATION_LEFTBOTTOM", LeftBottomOrientation); +#endif +#if MagickLibVersion > 0x635 + IMAGICK_REGISTER_CONST_LONG("DISTORTION_UNDEFINED", UndefinedDistortion); + IMAGICK_REGISTER_CONST_LONG("DISTORTION_AFFINE", AffineDistortion); + IMAGICK_REGISTER_CONST_LONG("DISTORTION_AFFINEPROJECTION", AffineProjectionDistortion); + IMAGICK_REGISTER_CONST_LONG("DISTORTION_ARC", ArcDistortion); + IMAGICK_REGISTER_CONST_LONG("DISTORTION_BILINEAR", BilinearDistortion); + IMAGICK_REGISTER_CONST_LONG("DISTORTION_PERSPECTIVE", PerspectiveDistortion); + IMAGICK_REGISTER_CONST_LONG("DISTORTION_PERSPECTIVEPROJECTION", PerspectiveProjectionDistortion); + IMAGICK_REGISTER_CONST_LONG("DISTORTION_SCALEROTATETRANSLATE", ScaleRotateTranslateDistortion); +#endif +#if MagickLibVersion > 0x645 + IMAGICK_REGISTER_CONST_LONG("DISTORTION_POLYNOMIAL", PolynomialDistortion); + IMAGICK_REGISTER_CONST_LONG("DISTORTION_POLAR", PolarDistortion); + IMAGICK_REGISTER_CONST_LONG("DISTORTION_DEPOLAR", DePolarDistortion); + IMAGICK_REGISTER_CONST_LONG("DISTORTION_BARREL", BarrelDistortion); + IMAGICK_REGISTER_CONST_LONG("DISTORTION_SHEPARDS", ShepardsDistortion); + + // SentinelDistortion is not a real distortion type. It is a guard value + // that shouldn't have been exposed in Imagick. TODO remove at next + // minor version. + IMAGICK_REGISTER_CONST_LONG("DISTORTION_SENTINEL", SentinelDistortion); +#endif + +#if MagickLibVersion >= 0x70B + IMAGICK_REGISTER_CONST_LONG("DISTORTION_RIGID_AFFINE", RigidAffineDistortion); +#endif + +#if MagickLibVersion >= 0x644 + IMAGICK_REGISTER_CONST_LONG("DISTORTION_BARRELINVERSE", BarrelInverseDistortion); +#endif +#if MagickLibVersion >= 0x654 + IMAGICK_REGISTER_CONST_LONG("DISTORTION_BILINEARFORWARD", BilinearForwardDistortion); + IMAGICK_REGISTER_CONST_LONG("DISTORTION_BILINEARREVERSE", BilinearReverseDistortion); +#endif +#if MagickLibVersion >= 0x670 + IMAGICK_REGISTER_CONST_LONG("DISTORTION_RESIZE", ResizeDistortion); +#endif +#if MagickLibVersion >= 0x671 + IMAGICK_REGISTER_CONST_LONG("DISTORTION_CYLINDER2PLANE", Cylinder2PlaneDistortion); + IMAGICK_REGISTER_CONST_LONG("DISTORTION_PLANE2CYLINDER", Plane2CylinderDistortion); +#endif +#if MagickLibVersion > 0x636 + IMAGICK_REGISTER_CONST_LONG("LAYERMETHOD_MERGE", MergeLayer); + IMAGICK_REGISTER_CONST_LONG("LAYERMETHOD_FLATTEN", FlattenLayer); + IMAGICK_REGISTER_CONST_LONG("LAYERMETHOD_MOSAIC", MosaicLayer); +#endif +#if MagickLibVersion > 0x637 + IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_ACTIVATE", ActivateAlphaChannel); +#if MagickLibVersion >= 0x700 + IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_ON", OnAlphaChannel); +#else + IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_RESET", ResetAlphaChannel); +#endif + IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_SET", SetAlphaChannel); +#endif +#if MagickLibVersion > 0x645 + IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_UNDEFINED", UndefinedAlphaChannel); +#if MagickLibVersion >= 0x700 + IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_DISCRETE", DiscreteAlphaChannel); +#endif + IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_COPY", CopyAlphaChannel); + IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_DEACTIVATE", DeactivateAlphaChannel); + IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_EXTRACT", ExtractAlphaChannel); +#if MagickLibVersion >= 0x700 + IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_OFF", OffAlphaChannel); +#endif + IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_OPAQUE", OpaqueAlphaChannel); + IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_SHAPE", ShapeAlphaChannel); + IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_TRANSPARENT", TransparentAlphaChannel); +#if MagickLibVersion >= 0x690 + IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_ASSOCIATE", AssociateAlphaChannel); + IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_DISSOCIATE", DisassociateAlphaChannel); +#endif + +#if MAGICK_LIB_VERSION_GTE(7, 1, 1, 26) + IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_OFF_IF_OPAQUE", OffIfOpaqueAlphaChannel); +#endif + + /* + DiscreteAlphaChannel, CopyAlphaChannel, + DisassociateAlphaChannel, DeactivateAlphaChannel, + ExtractAlphaChannel, ExtractAlphaChannel, + OffAlphaChannel, OpaqueAlphaChannel, + OnAlphaChannel, ResetAlphaChannel, // deprecated + */ + + IMAGICK_REGISTER_CONST_LONG("SPARSECOLORMETHOD_UNDEFINED", UndefinedColorInterpolate); + IMAGICK_REGISTER_CONST_LONG("SPARSECOLORMETHOD_BARYCENTRIC", BarycentricColorInterpolate); + IMAGICK_REGISTER_CONST_LONG("SPARSECOLORMETHOD_BILINEAR", BilinearColorInterpolate); + IMAGICK_REGISTER_CONST_LONG("SPARSECOLORMETHOD_POLYNOMIAL", PolynomialColorInterpolate); + IMAGICK_REGISTER_CONST_LONG("SPARSECOLORMETHOD_SPEPARDS", ShepardsColorInterpolate); + IMAGICK_REGISTER_CONST_LONG("SPARSECOLORMETHOD_VORONOI", VoronoiColorInterpolate); +#if MagickLibVersion >= 0x687 + IMAGICK_REGISTER_CONST_LONG("SPARSECOLORMETHOD_INVERSE", InverseColorInterpolate); +#endif +#if MagickLibVersion >= 0x693 + IMAGICK_REGISTER_CONST_LONG("SPARSECOLORMETHOD_MANHATTAN", ManhattanColorInterpolate); +#endif + IMAGICK_REGISTER_CONST_LONG("DITHERMETHOD_UNDEFINED", UndefinedDitherMethod); + IMAGICK_REGISTER_CONST_LONG("DITHERMETHOD_NO", NoDitherMethod); + IMAGICK_REGISTER_CONST_LONG("DITHERMETHOD_RIEMERSMA", RiemersmaDitherMethod); + IMAGICK_REGISTER_CONST_LONG("DITHERMETHOD_FLOYDSTEINBERG", FloydSteinbergDitherMethod); +#endif +#if MagickLibVersion > 0x648 + IMAGICK_REGISTER_CONST_LONG("FUNCTION_UNDEFINED", UndefinedFunction); + IMAGICK_REGISTER_CONST_LONG("FUNCTION_POLYNOMIAL", PolynomialFunction); + IMAGICK_REGISTER_CONST_LONG("FUNCTION_SINUSOID", SinusoidFunction); +#endif +#if MagickLibVersion >= 0x653 + IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_BACKGROUND", BackgroundAlphaChannel); + IMAGICK_REGISTER_CONST_LONG("FUNCTION_ARCSIN", ArcsinFunction); + IMAGICK_REGISTER_CONST_LONG("FUNCTION_ARCTAN", ArctanFunction); +#endif +#if MagickLibVersion >= 0x678 +#if MagickLibVersion < 0x700 + IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_FLATTEN", FlattenAlphaChannel); +#endif + IMAGICK_REGISTER_CONST_LONG("ALPHACHANNEL_REMOVE", RemoveAlphaChannel); +#endif + +#if MagickLibVersion > 0x683 + IMAGICK_REGISTER_CONST_LONG("STATISTIC_GRADIENT", GradientStatistic); + IMAGICK_REGISTER_CONST_LONG("STATISTIC_MAXIMUM", MaximumStatistic); + IMAGICK_REGISTER_CONST_LONG("STATISTIC_MEAN", MeanStatistic); + IMAGICK_REGISTER_CONST_LONG("STATISTIC_MEDIAN", MedianStatistic); + IMAGICK_REGISTER_CONST_LONG("STATISTIC_MINIMUM", MinimumStatistic); + IMAGICK_REGISTER_CONST_LONG("STATISTIC_MODE", ModeStatistic); + IMAGICK_REGISTER_CONST_LONG("STATISTIC_NONPEAK", NonpeakStatistic); + IMAGICK_REGISTER_CONST_LONG("STATISTIC_STANDARD_DEVIATION", StandardDeviationStatistic); +#endif +#if MagickLibVersion >= 0x690 + IMAGICK_REGISTER_CONST_LONG("STATISTIC_ROOT_MEAN_SQUARE", RootMeanSquareStatistic); +#endif + +#if MagickLibVersion >= 0x70C + IMAGICK_REGISTER_CONST_LONG("STATISTIC_CONTRAST", ContrastStatistic); +#endif + +#ifdef IMAGICK_WITH_KERNEL +/* Convolve / Correlate weighted sums */ +IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_CONVOLVE", ConvolveMorphology); /* Weighted Sum with reflected kernel */ +IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_CORRELATE", CorrelateMorphology); /* Weighted Sum using a sliding window */ +/* Low-level Morphology methods */ +IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_ERODE", ErodeMorphology); /* Minimum Value in Neighbourhood */ +IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_DILATE", DilateMorphology); /* Maximum Value in Neighbourhood */ +IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_ERODE_INTENSITY", ErodeIntensityMorphology); /* Pixel Pick using GreyScale Erode */ +IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_DILATE_INTENSITY", DilateIntensityMorphology); /* Pixel Pick using GreyScale Dialate */ +IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_DISTANCE", DistanceMorphology); /* Add Kernel Value, take Minimum */ +/* Second-level Morphology methods */ +IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_OPEN", OpenMorphology); /* Dilate then Erode */ +IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_CLOSE", CloseMorphology); /* Erode then Dilate */ +IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_OPEN_INTENSITY", OpenIntensityMorphology); /* Pixel Pick using GreyScale Open */ +IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_CLOSE_INTENSITY", CloseIntensityMorphology); /* Pixel Pick using GreyScale Close */ +IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_SMOOTH", SmoothMorphology); /* Open then Close */ +/* Difference Morphology methods */ +IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_EDGE_IN", EdgeInMorphology); /* Dilate difference from Original */ +IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_EDGE_OUT", EdgeOutMorphology); /* Erode difference from Original */ +IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_EDGE", EdgeMorphology); /* Dilate difference with Erode */ +IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_TOP_HAT", TopHatMorphology); /* Close difference from Original */ +IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_BOTTOM_HAT", BottomHatMorphology); /* Open difference from Original */ +/* Recursive Morphology methods */ +IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_HIT_AND_MISS", HitAndMissMorphology); /* Foreground/Background pattern matching */ +IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_THINNING", ThinningMorphology); /* Remove matching pixels from image */ +IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_THICKEN", ThickenMorphology); /* Add matching pixels from image */ +/* Experimental Morphology methods */ +IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_VORONOI", VoronoiMorphology); /* distance matte channel copy nearest color */ +IMAGICK_REGISTER_CONST_LONG("MORPHOLOGY_ITERATIVE", IterativeDistanceMorphology); /* Add Kernel Value, take Minimum */ + + +/* The no-op or 'original image' kernel */ +IMAGICK_REGISTER_CONST_LONG("KERNEL_UNITY", UnityKernel); +/* Convolution Kernels, Gaussian Based */ +IMAGICK_REGISTER_CONST_LONG("KERNEL_GAUSSIAN", GaussianKernel); +IMAGICK_REGISTER_CONST_LONG("KERNEL_DIFFERENCE_OF_GAUSSIANS", DoGKernel); +IMAGICK_REGISTER_CONST_LONG("KERNEL_LAPLACIAN_OF_GAUSSIANS", LoGKernel); +IMAGICK_REGISTER_CONST_LONG("KERNEL_BLUR", BlurKernel); +IMAGICK_REGISTER_CONST_LONG("KERNEL_COMET", CometKernel); +/* Convolution Kernels, by Name */ +IMAGICK_REGISTER_CONST_LONG("KERNEL_LAPLACIAN", LaplacianKernel); +IMAGICK_REGISTER_CONST_LONG("KERNEL_SOBEL", SobelKernel); +IMAGICK_REGISTER_CONST_LONG("KERNEL_FREI_CHEN", FreiChenKernel); +IMAGICK_REGISTER_CONST_LONG("KERNEL_ROBERTS", RobertsKernel); +IMAGICK_REGISTER_CONST_LONG("KERNEL_PREWITT", PrewittKernel); +IMAGICK_REGISTER_CONST_LONG("KERNEL_COMPASS", CompassKernel); +IMAGICK_REGISTER_CONST_LONG("KERNEL_KIRSCH", KirschKernel); +/* Shape Kernels */ +IMAGICK_REGISTER_CONST_LONG("KERNEL_DIAMOND", DiamondKernel); +IMAGICK_REGISTER_CONST_LONG("KERNEL_SQUARE", SquareKernel); +IMAGICK_REGISTER_CONST_LONG("KERNEL_RECTANGLE", RectangleKernel); +IMAGICK_REGISTER_CONST_LONG("KERNEL_OCTAGON", OctagonKernel); +IMAGICK_REGISTER_CONST_LONG("KERNEL_DISK", DiskKernel); +IMAGICK_REGISTER_CONST_LONG("KERNEL_PLUS", PlusKernel); +IMAGICK_REGISTER_CONST_LONG("KERNEL_CROSS", CrossKernel); +IMAGICK_REGISTER_CONST_LONG("KERNEL_RING", RingKernel); +/* Hit And Miss Kernels */ +IMAGICK_REGISTER_CONST_LONG("KERNEL_PEAKS", PeaksKernel); +IMAGICK_REGISTER_CONST_LONG("KERNEL_EDGES", EdgesKernel); +IMAGICK_REGISTER_CONST_LONG("KERNEL_CORNERS", CornersKernel); +IMAGICK_REGISTER_CONST_LONG("KERNEL_DIAGONALS", DiagonalsKernel); +IMAGICK_REGISTER_CONST_LONG("KERNEL_LINE_ENDS", LineEndsKernel); +IMAGICK_REGISTER_CONST_LONG("KERNEL_LINE_JUNCTIONS", LineJunctionsKernel); +IMAGICK_REGISTER_CONST_LONG("KERNEL_RIDGES", RidgesKernel); +IMAGICK_REGISTER_CONST_LONG("KERNEL_CONVEX_HULL", ConvexHullKernel); +IMAGICK_REGISTER_CONST_LONG("KERNEL_THIN_SE", ThinSEKernel); +IMAGICK_REGISTER_CONST_LONG("KERNEL_SKELETON", SkeletonKernel); +/* Distance Measuring Kernels */ +IMAGICK_REGISTER_CONST_LONG("KERNEL_CHEBYSHEV", ChebyshevKernel); +IMAGICK_REGISTER_CONST_LONG("KERNEL_MANHATTAN", ManhattanKernel); +IMAGICK_REGISTER_CONST_LONG("KERNEL_OCTAGONAL", OctagonalKernel); +IMAGICK_REGISTER_CONST_LONG("KERNEL_EUCLIDEAN", EuclideanKernel); +/* User Specified Kernel Array */ +IMAGICK_REGISTER_CONST_LONG("KERNEL_USER_DEFINED", UserDefinedKernel); +IMAGICK_REGISTER_CONST_LONG("KERNEL_BINOMIAL", BinomialKernel); + +/* Draw directions */ +IMAGICK_REGISTER_CONST_LONG("DIRECTION_LEFT_TO_RIGHT", LeftToRightDirection); +IMAGICK_REGISTER_CONST_LONG("DIRECTION_RIGHT_TO_LEFT", RightToLeftDirection); + +#if MAGICK_LIB_VERSION_GTE(7, 1, 1, 14) + IMAGICK_REGISTER_CONST_LONG("DIRECTION_TOP_TO_BOTTOM", TopToBottomDirection); +#endif + +// The kernel is scaled directly using given scaling factor without change. +IMAGICK_REGISTER_CONST_LONG("NORMALIZE_KERNEL_NONE", 0); +// Kernel normalization ('normalize_flags' given) is designed to ensure +// that any use of the kernel scaling factor with 'Convolve' or 'Correlate' +// morphology methods will fall into -1.0 to +1.0 range. +IMAGICK_REGISTER_CONST_LONG("NORMALIZE_KERNEL_VALUE", NormalizeValue); +// For special kernels designed for locating shapes using 'Correlate', (often +// only containing +1 and -1 values, representing foreground/brackground +// matching) a special normalization method is provided to scale the positive +// values separately to those of the negative values, so the kernel will be +// forced to become a zero-sum kernel better suited to such searches. +IMAGICK_REGISTER_CONST_LONG("NORMALIZE_KERNEL_CORRELATE", CorrelateNormalizeValue); +// Scale the kernel by a percent. +IMAGICK_REGISTER_CONST_LONG("NORMALIZE_KERNEL_PERCENT", PercentValue); +#endif + + +#if IM_HAVE_IMAGICK_GETSETIMAGEMASK +IMAGICK_REGISTER_CONST_LONG("PIXELMASK_READ", ReadPixelMask); +IMAGICK_REGISTER_CONST_LONG("PIXELMASK_WRITE", WritePixelMask); +#endif + + +#if MagickLibVersion >= 0x708 +IMAGICK_REGISTER_CONST_LONG("PIXELMASK_COMPOSITE", CompositePixelMask); +#endif + + +#if MagickLibVersion >= 0x707 +// AutoThresholdMethod +IMAGICK_REGISTER_CONST_LONG("AUTO_THRESHOLD_KAPUR", KapurThresholdMethod); +IMAGICK_REGISTER_CONST_LONG("AUTO_THRESHOLD_OTSU", OTSUThresholdMethod); +IMAGICK_REGISTER_CONST_LONG("AUTO_THRESHOLD_TRIANGLE", TriangleThresholdMethod); +#endif + +#if MagickLibVersion >= 0x702 +// ComplexOperator +IMAGICK_REGISTER_CONST_LONG("COMPLEX_OPERATOR_ADD", AddComplexOperator); +IMAGICK_REGISTER_CONST_LONG("COMPLEX_OPERATOR_CONJUGATE", ConjugateComplexOperator); +IMAGICK_REGISTER_CONST_LONG("COMPLEX_OPERATOR_DIVIDE", DivideComplexOperator); +IMAGICK_REGISTER_CONST_LONG("COMPLEX_OPERATOR_MAGNITUDEPHASE", MagnitudePhaseComplexOperator); +IMAGICK_REGISTER_CONST_LONG("COMPLEX_OPERATOR_MULTIPLY", MultiplyComplexOperator); +IMAGICK_REGISTER_CONST_LONG("COMPLEX_OPERATOR_REALIMAGINARY", RealImaginaryComplexOperator); +IMAGICK_REGISTER_CONST_LONG("COMPLEX_OPERATOR_SUBTRACT", SubtractComplexOperator); +#endif + +#if MagickLibVersion >= 0x702 +// ImageType +IMAGICK_REGISTER_CONST_LONG("IMAGE_TYPE_BILEVEL", BilevelType); +IMAGICK_REGISTER_CONST_LONG("IMAGE_TYPE_GRAYSCALE", GrayscaleType); +IMAGICK_REGISTER_CONST_LONG("IMAGE_TYPE_GRAYSCALE_ALPHA", GrayscaleAlphaType); +IMAGICK_REGISTER_CONST_LONG("IMAGE_TYPE_PALETTE", PaletteType); +IMAGICK_REGISTER_CONST_LONG("IMAGE_TYPE_PALETTE_ALPHA", PaletteAlphaType); +IMAGICK_REGISTER_CONST_LONG("IMAGE_TYPE_TRUE_COLOR", TrueColorType); +IMAGICK_REGISTER_CONST_LONG("IMAGE_TYPE_TRUE_COLOR_ALPHA", TrueColorAlphaType); +IMAGICK_REGISTER_CONST_LONG("IMAGE_TYPE_COLOR_SEPARATION", ColorSeparationType); +IMAGICK_REGISTER_CONST_LONG("IMAGE_TYPE_COLOR_SEPARATION_ALPHA", ColorSeparationAlphaType); +IMAGICK_REGISTER_CONST_LONG("IMAGE_TYPE_OPTIMIZE", OptimizeType); +IMAGICK_REGISTER_CONST_LONG("IMAGE_TYPE_PALETTE_BILEVEL_ALPHA", PaletteBilevelAlphaType); + +#endif + + + +#undef IMAGICK_REGISTER_CONST_LONG +#undef IMAGICK_REGISTER_CONST_STRING +}
View file
imagick-3.8.0.tgz/imagick-3.8.0/imagickdraw_class.c
Added
@@ -0,0 +1,3080 @@ +/* + +----------------------------------------------------------------------+ + | PHP Version 5 / Imagick | + +----------------------------------------------------------------------+ + | Copyright (c) 2006-2013 Mikko Koppanen, Scott MacVicar | + | ImageMagick (c) ImageMagick Studio LLC | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Mikko Kopppanen <mkoppanen@php.net> | + | Scott MacVicar <scottmac@php.net> | + +----------------------------------------------------------------------+ +*/ + +#include "php_imagick.h" +#include "php_imagick_defs.h" +#include "php_imagick_macros.h" +#include "php_imagick_helpers.h" + +#if MagickLibVersion > 0x628 +/* {{{ proto bool ImagickDraw::resetvectorgraphics() + Resets the vector graphics +*/ +PHP_METHOD(ImagickDraw, resetVectorGraphics) +{ + php_imagickdraw_object *internd; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + DrawResetVectorGraphics(internd->drawing_wand); + RETURN_TRUE; +} +/* }}} */ +#endif + +#if MagickLibVersion > 0x649 +/* {{{ proto bool ImagickDraw::getTextKerning() + Gets the text kerning +*/ +PHP_METHOD(ImagickDraw, getTextKerning) +{ + php_imagickdraw_object *internd; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + RETURN_DOUBLE(DrawGetTextKerning(internd->drawing_wand)); +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::setTextKerning(float kerning) + Sets the text kerning +*/ +PHP_METHOD(ImagickDraw, setTextKerning) +{ + php_imagickdraw_object *internd; + double kerning; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &kerning) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + DrawSetTextKerning(internd->drawing_wand, kerning); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::getTextInterwordSpacing() + Gets the text interword spacing +*/ +PHP_METHOD(ImagickDraw, getTextInterwordSpacing) +{ + php_imagickdraw_object *internd; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + RETURN_DOUBLE(DrawGetTextInterwordSpacing(internd->drawing_wand)); +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::setTextInterwordSpacing(float spacing) + Sets the text interword spacing +*/ +PHP_METHOD(ImagickDraw, setTextInterwordSpacing) +{ + php_imagickdraw_object *internd; + double spacing; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &spacing) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + DrawSetTextInterwordSpacing(internd->drawing_wand, spacing); + RETURN_TRUE; +} +/* }}} */ +#endif + +#if MagickLibVersion > 0x655 +/* {{{ proto bool ImagickDraw::getTextInterlineSpacing() + Gets the text interword spacing +*/ +PHP_METHOD(ImagickDraw, getTextInterlineSpacing) +{ + php_imagickdraw_object *internd; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + RETURN_DOUBLE(DrawGetTextInterlineSpacing(internd->drawing_wand)); +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::setTextInterlineSpacing(float spacing) + Sets the text interword spacing +*/ +PHP_METHOD(ImagickDraw, setTextInterlineSpacing) +{ + php_imagickdraw_object *internd; + double spacing; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &spacing) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + DrawSetTextInterlineSpacing(internd->drawing_wand, spacing); + RETURN_TRUE; +} +/* }}} */ +#endif + +/* {{{ proto ImagickDraw ImagickDraw::__construct() + The ImagickDraw constructor +*/ +PHP_METHOD(ImagickDraw, __construct) +{ + /* Empty constructor for possible future uses */ + +#if PHP_VERSION_ID >= 70000 + // This suppresses an 'unused parameter' warning. + (void)execute_data; + (void)return_value; +#endif +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::circle(float ox, float oy, float px, float py) + Draws a circle on the image. +*/ +PHP_METHOD(ImagickDraw, circle) +{ + double ox, oy, px, py; + php_imagickdraw_object *internd; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddd", &ox, &oy, &px, &py) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + + DrawCircle(internd->drawing_wand, ox, oy, px, py); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::rectangle(float x1, float y1, float x2, float y2) + Draws a rectangle given two coordinates and using the current stroke, stroke width, and fill settings. +*/ +PHP_METHOD(ImagickDraw, rectangle) +{ + double x1, y1, x2, y2; + php_imagickdraw_object *internd; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddd", &x1, &y1, &x2, &y2) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + DrawRectangle(internd->drawing_wand, x1, y1, x2, y2); + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::roundRectangle(float x1, float y1, float x2, float y2, float rx, float ry) + Draws a rounted rectangle given two coordinates, x & y corner radiuses and using the current stroke, stroke width, and fill settings. +*/ +PHP_METHOD(ImagickDraw, roundRectangle) +{ + double x1, y1, x2, y2, rx, ry; + php_imagickdraw_object *internd; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddddd", &x1, &y1, &x2, &y2, &rx, &ry) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + + DrawRoundRectangle(internd->drawing_wand, x1, y1, x2, y2, rx, ry); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::ellipse(float ox, float oy, float rx, float ry, float start, float end) + Draws an ellipse on the image. +*/ +PHP_METHOD(ImagickDraw, ellipse) +{ + double ox, oy, rx, ry, start, end; + php_imagickdraw_object *internd; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddddd", &ox, &oy, &rx, &ry, &start, &end) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + + DrawEllipse(internd->drawing_wand, ox, oy, rx, ry, start, end); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::skewX(float degrees) + Skews the current coordinate system in the horizontal direction. +*/ +PHP_METHOD(ImagickDraw, skewX) +{ + double degrees; + php_imagickdraw_object *internd; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", °rees) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + + DrawSkewX(internd->drawing_wand, degrees); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::skewY(float degrees) + Skews the current coordinate system in the vertical direction. +*/ +PHP_METHOD(ImagickDraw, skewY) +{ + double degrees; + php_imagickdraw_object *internd; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", °rees) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + + DrawSkewY(internd->drawing_wand, degrees); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::translate(float x, float y) + Applies a translation to the current coordinate system which moves the coordinate system origin to the specified coordinate. +*/ +PHP_METHOD(ImagickDraw, translate) +{ + double x, y; + php_imagickdraw_object *internd; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &x, &y) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + + DrawTranslate(internd->drawing_wand, x, y); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::setFillColor(PixelWand fill_wand) + Sets the fill color to be used for drawing filled objects. +*/ +PHP_METHOD(ImagickDraw, setFillColor) +{ + zval *param; + php_imagickdraw_object *internd; + PixelWand *color_wand; + zend_bool allocated; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", ¶m) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + + color_wand = php_imagick_zval_to_pixelwand(param, IMAGICKDRAW_CLASS, &allocated TSRMLS_CC); + if (!color_wand) + RETURN_FALSE; + + DrawSetFillColor(internd->drawing_wand, color_wand); + if (allocated) + color_wand = DestroyPixelWand (color_wand); + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::setResolution(float x, float y) + Sets the resolution +*/ +PHP_METHOD(ImagickDraw, setResolution) +{ +#if MagickLibVersion < 0x693 + char *density = NULL; +#endif + char *buf = NULL; + double x, y; + php_imagickdraw_object *internd; + DrawInfo *draw_info; + DrawingWand *d_wand; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &x, &y) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + + spprintf(&buf, 512, "%fx%f", x, y); + + draw_info = PeekDrawingWand(internd->drawing_wand); +#if MagickLibVersion >= 0x693 + d_wand = AcquireDrawingWand(draw_info, NULL); + + if (!DrawSetDensity(d_wand, buf)) { + efree(buf); + php_imagick_throw_exception(IMAGICKDRAW_CLASS, "Failed to SetDensity" TSRMLS_CC); + RETURN_THROWS(); + } +#else + density = AcquireString(buf); + + if (!density) { + efree(buf); + php_imagick_throw_exception(IMAGICKDRAW_CLASS, "Failed to allocate memory" TSRMLS_CC); + RETURN_THROWS(); + } + + + draw_info->density = density; + + d_wand = (DrawingWand *) DrawAllocateWand(draw_info, NULL); +#endif + efree(buf); + draw_info = DestroyDrawInfo(draw_info); + + if (!d_wand) { + php_imagick_throw_exception(IMAGICKDRAW_CLASS, "Failed to allocate new DrawingWand structure" TSRMLS_CC); + RETURN_THROWS(); + } + + php_imagick_replace_drawingwand(internd, d_wand); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::setStrokeColor(PixelWand stroke_wand) + Sets the color used for stroking object outlines. +*/ +PHP_METHOD(ImagickDraw, setStrokeColor) +{ + zval *param; + php_imagickdraw_object *internd; + PixelWand *color_wand; + zend_bool allocated; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", ¶m) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + + color_wand = php_imagick_zval_to_pixelwand (param, IMAGICKDRAW_CLASS, &allocated TSRMLS_CC); + if (!color_wand) + RETURN_FALSE; + + DrawSetStrokeColor(internd->drawing_wand, color_wand); + if (allocated) + color_wand = DestroyPixelWand (color_wand); + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::setFillAlpha(float opacity) + Sets the opacity to use when drawing using the fill color or fill texture. Fully opaque is 1.0. +*/ +PHP_METHOD(ImagickDraw, setFillAlpha) +{ + php_imagickdraw_object *internd; + double opacity; + + IMAGICK_METHOD_DEPRECATED("ImagickDraw", "setFillAlpha"); + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &opacity) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + +#if MagickLibVersion >= 0x635 + DrawSetFillOpacity(internd->drawing_wand, opacity); +#else + DrawSetFillAlpha(internd->drawing_wand, opacity); +#endif + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::settextantialias() + Returns the antialias property associated with the wand. +*/ +PHP_METHOD(ImagickDraw, setTextAntialias) +{ + php_imagickdraw_object *internd; + zend_bool antialias; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &antialias) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + + DrawSetTextAntialias(internd->drawing_wand, antialias); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::setTextEncoding(string encoding) + Specifies 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. +*/ +PHP_METHOD(ImagickDraw, setTextEncoding) +{ + php_imagickdraw_object *internd; + char *encoding; + IM_LEN_TYPE encoding_len; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &encoding, &encoding_len) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + + DrawSetTextEncoding(internd->drawing_wand, encoding); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::setStrokeAlpha(float opacity) + Specifies the opacity of stroked object outlines. +*/ +PHP_METHOD(ImagickDraw, setStrokeAlpha) +{ + php_imagickdraw_object *internd; + double opacity; + + IMAGICK_METHOD_DEPRECATED("ImagickDraw", "setStrokeAlpha"); + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &opacity) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + +#if MagickLibVersion >= 0x635 + DrawSetStrokeOpacity(internd->drawing_wand, opacity); +#else + DrawSetStrokeAlpha(internd->drawing_wand, opacity); +#endif + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::setStrokeWidth(float stroke_width) + Sets the width of the stroke used to draw object outlines. +*/ +PHP_METHOD(ImagickDraw, setStrokeWidth) +{ + php_imagickdraw_object *internd; + double width; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &width) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + + DrawSetStrokeWidth(internd->drawing_wand, width); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::setFont(string font_name) + Sets the fully-sepecified font to use when annotating with text. +*/ +PHP_METHOD(ImagickDraw, setFont) +{ + php_imagickdraw_object *internd; + char *font, *absolute; + IM_LEN_TYPE font_len; + MagickBooleanType status; + php_imagick_rw_result_t rc; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &font, &font_len) == FAILURE) { + RETURN_THROWS(); + } + + /* Check that no empty string is passed */ + if (font_len == 0) { + php_imagick_throw_exception (IMAGICKDRAW_CLASS, "Can not set empty font" TSRMLS_CC); + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + + /* And if it wasn't */ + if (!php_imagick_check_font(font, font_len TSRMLS_CC)) { + + if ((absolute = expand_filepath(font, NULL TSRMLS_CC)) == NULL) { + php_imagick_throw_exception (IMAGICKDRAW_CLASS, "Unable to set font, file path expansion failed" TSRMLS_CC); + RETURN_THROWS(); + } + + /* Do an access check for the font */ + if ((rc = php_imagick_file_access_check (absolute TSRMLS_CC)) != IMAGICK_RW_OK) { + // Failed + php_imagick_imagickdraw_rw_fail_to_exception (internd->drawing_wand, rc, absolute TSRMLS_CC); + efree(absolute); + RETURN_THROWS(); + } + status = DrawSetFont(internd->drawing_wand, absolute); + efree(absolute); + + } else { + status = DrawSetFont(internd->drawing_wand, font); + } + + if (status == MagickFalse) { + php_imagick_convert_imagickdraw_exception (internd->drawing_wand, "Unable to set font" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::setFontFamily(string font_family) + Sets the font family to use when annotating with text. +*/ +PHP_METHOD(ImagickDraw, setFontFamily) +{ + php_imagickdraw_object *internd; + char *font_family; + IM_LEN_TYPE font_family_len; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &font_family, &font_family_len) == FAILURE) { + RETURN_THROWS(); + } + + /* Check that no empty string is passed */ + if (font_family_len == 0) { + php_imagick_throw_exception(IMAGICKDRAW_CLASS, "Can not set empty font family" TSRMLS_CC); + RETURN_THROWS(); + } + + if (!php_imagick_check_font(font_family, font_family_len TSRMLS_CC )) { + php_imagick_throw_exception(IMAGICKDRAW_CLASS, "Unable to set font family; parameter not found in the list of configured fonts" TSRMLS_CC); + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + status = DrawSetFontFamily(internd->drawing_wand, font_family); + + if (status == MagickFalse) { + php_imagick_convert_imagickdraw_exception (internd->drawing_wand, "Unable to set font family" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::setFontSize(float pointsize) + Sets the font pointsize to use when annotating with text. +*/ +PHP_METHOD(ImagickDraw, setFontSize) +{ + php_imagickdraw_object *internd; + double font_size; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &font_size) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + + DrawSetFontSize(internd->drawing_wand, font_size); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::setFontStyle(int style) + Sets the font style to use when annotating with text. The AnyStyle enumeration acts as a wild-card "don't care" option. +*/ +PHP_METHOD(ImagickDraw, setFontStyle) +{ + php_imagickdraw_object *internd; + im_long style_id = AnyStyle; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &style_id) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + + DrawSetFontStyle(internd->drawing_wand, style_id); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::setFontWeight(int font_weight) + Sets the font weight to use when annotating with text. +*/ +PHP_METHOD(ImagickDraw, setFontWeight) +{ + php_imagickdraw_object *internd; + im_long weight; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &weight) == FAILURE) { + RETURN_THROWS(); + } + + if (weight >= 100 && weight <= 900) { + internd = Z_IMAGICKDRAW_P(getThis());; + DrawSetFontWeight(internd->drawing_wand, weight); + RETURN_TRUE; + } + php_imagick_throw_exception(IMAGICKDRAW_CLASS, "Font weight valid range is 100-900" TSRMLS_CC); +} +/* }}} */ + +/* {{{ proto int ImagickDraw::getFontStretch(int fontStretch) + Gets the font stretch to use when annotating with text +*/ +PHP_METHOD(ImagickDraw, getFontStretch) +{ + php_imagickdraw_object *internd; + + internd = Z_IMAGICKDRAW_P(getThis());; + RETVAL_LONG(DrawGetFontStretch(internd->drawing_wand)); +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::setFontStretch(int fontStretch) + Sets the font stretch to use when annotating with text. The AnyStretch enumeration acts as a wild-card "don't care" option. +*/ +PHP_METHOD(ImagickDraw, setFontStretch) +{ + php_imagickdraw_object *internd; + im_long stretch; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &stretch) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + + DrawSetFontStretch(internd->drawing_wand, stretch); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::setStrokeAntialias(bool stroke_antialias) + Controls whether stroked outlines are antialiased. Stroked outlines are antialiased by default. When antialiasing is disabled stroked pixels are thresholded to determine if the stroke color or underlying canvas color should be used. +*/ +PHP_METHOD(ImagickDraw, setStrokeAntialias) +{ + php_imagickdraw_object *internd; + zend_bool antialias; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &antialias) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + + DrawSetStrokeAntialias(internd->drawing_wand, antialias); + RETURN_TRUE; + +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::setTextAlignment(int alignment) + Specifies a text alignment to be applied when annotating with text. +*/ +PHP_METHOD(ImagickDraw, setTextAlignment) +{ + php_imagickdraw_object *internd; + im_long align; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &align) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + + DrawSetTextAlignment(internd->drawing_wand, align); + RETURN_TRUE; + +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::setTextDecoration(int decoration) + Specifies a decoration to be applied when annotating with text. +*/ +PHP_METHOD(ImagickDraw, setTextDecoration) +{ + php_imagickdraw_object *internd; + im_long decoration; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &decoration) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + + DrawSetTextDecoration(internd->drawing_wand, decoration); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::setTextUnderColor(PixelWand under_wand) + Specifies the color of a background rectangle to place under text annotations. +*/ +PHP_METHOD(ImagickDraw, setTextUnderColor) +{ + zval *param; + php_imagickdraw_object *internd; + PixelWand *color_wand; + zend_bool allocated; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", ¶m) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + + color_wand = php_imagick_zval_to_pixelwand (param, IMAGICKDRAW_CLASS, &allocated TSRMLS_CC); + if (!color_wand) + RETURN_FALSE; + + DrawSetTextUnderColor(internd->drawing_wand, color_wand); + if (allocated) + color_wand = DestroyPixelWand (color_wand); + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::setViewbox(float x1, float y1, float x2, float y2 ) + Sets the overall canvas size to be recorded with the drawing vector data. Usually this will be specified using the same size as the canvas image. When the vector data is saved to SVG or MVG formats, the viewbox is use to specify the size of the canvas image that a viewer will render the vector data on. +*/ +PHP_METHOD(ImagickDraw, setViewbox) +{ + php_imagickdraw_object *internd; + im_long x1, y1, x2, y2; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llll", &x1, &y1, &x2, &y2) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + + DrawSetViewbox(internd->drawing_wand, x1, y1, x2, y2); + RETURN_TRUE; +} + +/* {{{ proto string ImagickDraw::getFont() + Returns a string specifying the font used when annotating with text +*/ +PHP_METHOD(ImagickDraw, getFont) +{ + php_imagickdraw_object *internd; + char *font; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + + font = DrawGetFont(internd->drawing_wand); + + if (!font) { + RETURN_FALSE; + } else { + IM_ZVAL_STRING(return_value, font); + IMAGICK_FREE_MAGICK_MEMORY(font); + } +} +/* }}} */ + +/* {{{ proto string ImagickDraw::getFontFamily() + Returns the font family to use when annotating with text. The value returned must be freed by the user when it is no longer needed. +*/ +PHP_METHOD(ImagickDraw, getFontFamily) +{ + php_imagickdraw_object *internd; + char *font_family; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + + font_family = DrawGetFontFamily(internd->drawing_wand); + if (!font_family) { + RETURN_FALSE; + } else { + IM_ZVAL_STRING(return_value, font_family); + IMAGICK_FREE_MAGICK_MEMORY(font_family); + } +} +/* }}} */ + +/* {{{ proto float ImagickDraw::getFontSize() + Returns the font pointsize used when annotating with text. +*/ +PHP_METHOD(ImagickDraw, getFontSize) +{ + php_imagickdraw_object *internd; + double font_size; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + + font_size = DrawGetFontSize(internd->drawing_wand); + ZVAL_DOUBLE(return_value, font_size); +} +/* }}} */ + +/* {{{ proto int ImagickDraw::getFontStyle() + Returns the font style used when annotating with text. +*/ +PHP_METHOD(ImagickDraw, getFontStyle) +{ + php_imagickdraw_object *internd; + long font_style; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + + font_style = DrawGetFontStyle(internd->drawing_wand); + ZVAL_LONG(return_value, font_style); +} +/* }}} */ + +/* {{{ proto int ImagickDraw::getFontWeight() + Returns the font weight used when annotating with text. +*/ +PHP_METHOD(ImagickDraw, getFontWeight) +{ + php_imagickdraw_object *internd; + long weight; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + + weight = DrawGetFontWeight(internd->drawing_wand); + ZVAL_LONG(return_value, weight); +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::clear() + Clears a DrawingWand resource of any accumulated commands, and resets the settings it contains to their defaults. +*/ +PHP_METHOD(ImagickDraw, clear) +{ + php_imagickdraw_object *internd; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + ClearDrawingWand(internd->drawing_wand); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto int ImagickDraw::getTextDecoration() + Returns the decoration applied when annotating with text. +*/ +PHP_METHOD(ImagickDraw, getTextDecoration) +{ + php_imagickdraw_object *internd; + long decoration; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + + decoration = DrawGetTextDecoration(internd->drawing_wand); + ZVAL_LONG(return_value, decoration); +} +/* }}} */ + +/* {{{ proto string ImagickDraw::getTextEncoding() + Returns a null-terminated string which specifies the code set used for text annotations. The string must be freed by the user once it is no longer required. +*/ +PHP_METHOD(ImagickDraw, getTextEncoding) +{ + php_imagickdraw_object *internd; + char *encoding; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + encoding = DrawGetTextEncoding(internd->drawing_wand); + + if (!encoding) { + RETURN_FALSE; + } else { + IM_ZVAL_STRING(return_value, encoding); + IMAGICK_FREE_MAGICK_MEMORY(encoding); + } +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::annotation(float x, float y, string *text) + Draws text on the image. +*/ +PHP_METHOD(ImagickDraw, annotation) +{ + php_imagickdraw_object *internd; + double x, y; + unsigned char *text; + IM_LEN_TYPE text_len; +#if MagickLibVersion < 0x632 + char *font; +#endif + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dds", &x, &y, &text, &text_len) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; +#if MagickLibVersion < 0x632 + font = DrawGetFont(internd->drawing_wand); + + /* Fixes PECL Bug #11328 */ + if (!font) { + php_imagick_throw_exception(IMAGICKDRAW_CLASS, "Font needs to be set before annotating an image" TSRMLS_CC); + RETURN_THROWS(); + } +#endif + + DrawAnnotation(internd->drawing_wand, x, y, text); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::arc(float sx, float sy, float ex, float ey, float sd, float ed) + Draws an arc falling within a specified bounding rectangle on the image. +*/ +PHP_METHOD(ImagickDraw, arc) +{ + double sx, sy, ex, ey, sd, ed; + php_imagickdraw_object *internd; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddddd", &sx, &sy, &ex, &ey, &sd, &ed) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + + DrawArc(internd->drawing_wand, sx, sy, ex, ey, sd, ed); + RETURN_TRUE; +} +/* }}} */ + + +#if MagickLibVersion < 0x700 +/* {{{ proto bool ImagickDraw::matte(float x, float y, int paintMethod) + Paints on the image's opacity channel in order to set effected pixels to transparent. to influence the opacity of pixels. The available paint methods are: +*/ +PHP_METHOD(ImagickDraw, matte) +{ + double x, y; + php_imagickdraw_object *internd; + im_long paint_method; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddl", &x, &y, &paint_method) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + + DrawMatte(internd->drawing_wand, x, y, paint_method); + RETURN_TRUE; +} +/* }}} */ + +#else + +/* {{{ proto bool ImagickDraw::alpha(float x, float y, int paintMethod) + Paints on the image's alpha channel in order to set effected pixels to transparent. to influence the alpha of pixels. The available paint methods are: + PointMethod: Select the target pixel + ReplaceMethod: Select any pixel that matches the target pixel. + FloodfillMethod: Select the target pixel and matching neighbors. + FillToBorderMethod: Select the target pixel and neighbors not matching +border color. + ResetMethod: Select all pixels. +*/ +PHP_METHOD(ImagickDraw, alpha) +{ + double x, y; + php_imagickdraw_object *internd; + im_long paint_method; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddl", &x, &y, &paint_method) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + + DrawAlpha(internd->drawing_wand, x, y, paint_method); + RETURN_TRUE; +} +/* }}} */ + +#endif + + +/* {{{ proto bool ImagickDraw::polygon(array coordinates) + Draws a polygon using the current stroke, stroke width, and fill color or texture, using the specified array of coordinates. +*/ +PHP_METHOD(ImagickDraw, polygon) +{ + zval *coordinate_array; + php_imagickdraw_object *internd; + PointInfo *coordinates; + int num_elements = 0; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &coordinate_array) == FAILURE) { + RETURN_THROWS(); + } + + coordinates = php_imagick_zval_to_pointinfo_array(coordinate_array, &num_elements TSRMLS_CC); + + if (!coordinates) { + php_imagick_throw_exception(IMAGICKDRAW_CLASS, "Unable to read coordinate array" TSRMLS_CC); + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + DrawPolygon(internd->drawing_wand, num_elements, coordinates); + + efree(coordinates); + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::bezier(array coordinates) + Draws a bezier curve through a set of points on the image. +*/ +PHP_METHOD(ImagickDraw, bezier) +{ + zval *coordinate_array; + php_imagickdraw_object *internd; + PointInfo *coordinates; + int num_elements = 0; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &coordinate_array) == FAILURE) { + RETURN_THROWS(); + } + + coordinates = php_imagick_zval_to_pointinfo_array(coordinate_array, &num_elements TSRMLS_CC); + + if (!coordinates) { + php_imagick_throw_exception(IMAGICKDRAW_CLASS, "Unable to read coordinate array" TSRMLS_CC); + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + DrawBezier(internd->drawing_wand, num_elements, coordinates); + + efree(coordinates); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::point(float x, float y) + Draws a point using the current stroke color and stroke thickness at the specified coordinates. +*/ +PHP_METHOD(ImagickDraw, point) +{ + php_imagickdraw_object *internd; + double x, y; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &x, &y) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + DrawPoint(internd->drawing_wand, x, y); + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::line(float sx, float sy, float ex, float ey) + Draws a line on the image using the current stroke color, stroke opacity, and stroke width. +*/ +PHP_METHOD(ImagickDraw, line) +{ + php_imagickdraw_object *internd; + double sx, sy, ex, ey; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddd", &sx, &sy, &ex, &ey) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + + DrawLine(internd->drawing_wand, sx, sy, ex, ey); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto ImagickDraw ImagickDraw::clone() + Makes an exact copy of the specified wand. +*/ +PHP_METHOD(ImagickDraw, clone) +{ + php_imagickdraw_object *internd, *intern_return; + DrawingWand *tmp_wand; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + IMAGICK_METHOD_DEPRECATED("ImagickDraw", "clone"); + + internd = Z_IMAGICKDRAW_P(getThis());; + tmp_wand = CloneDrawingWand(internd->drawing_wand); + + if (!tmp_wand) { + php_imagick_throw_exception (IMAGICK_CLASS, "Failed to allocate DrawingWand structure" TSRMLS_CC); + RETURN_THROWS(); + } + + object_init_ex(return_value, php_imagickdraw_sc_entry); + intern_return = Z_IMAGICKDRAW_P(return_value); + php_imagick_replace_drawingwand(intern_return, tmp_wand); +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::affine(array affine) + Adjusts the current affine transformation matrix with the specified affine transformation matrix. Note that the current affine transform is adjusted rather than replaced. +*/ +PHP_METHOD(ImagickDraw, affine) +{ + php_imagickdraw_object *internd; + zval *affine_matrix; + +#if PHP_VERSION_ID >= 70000 + zval *pzval; +#else + HashTable *affine; + zval **ppzval; +#endif + char *matrix_elements = { "sx", "rx", "ry", + "sy", "tx", "ty" }; + int i; + double value; + AffineMatrix matrix; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &affine_matrix) == FAILURE) { + RETURN_THROWS(); + } + +#if PHP_VERSION_ID < 70000 + affine = Z_ARRVAL_P(affine_matrix); + zend_hash_internal_pointer_reset_ex(affine, (HashPosition *) 0); +#endif + + + for (i = 0; i < 6 ; i++) { +#if PHP_VERSION_ID >= 70000 + pzval = zend_hash_str_find(HASH_OF(affine_matrix), matrix_elementsi, 2); + ZVAL_DEREF(pzval); + if (pzval == NULL) { + php_imagick_throw_exception(IMAGICKDRAW_CLASS, "AffineMatrix must contain keys: sx, rx, ry, sy, tx and ty" TSRMLS_CC); + RETURN_THROWS(); +#else + if (zend_hash_find(affine, matrix_elementsi, 3, (void**)&ppzval) == FAILURE) { + php_imagick_throw_exception(IMAGICKDRAW_CLASS, "AffineMatrix must contain keys: sx, rx, ry, sy, tx and ty" TSRMLS_CC); + RETURN_THROWS(); +#endif + } else { + +#if PHP_VERSION_ID >= 70000 + value = zval_get_double(pzval); +#else + zval tmp_zval, *tmp_pzval; + + tmp_zval = **ppzval; + zval_copy_ctor(&tmp_zval); + tmp_pzval = &tmp_zval; + convert_to_double(tmp_pzval); + value = Z_DVAL(tmp_zval); +#endif + if (strcmp(matrix_elementsi, "sx") == 0) { + matrix.sx = value; + } else if (strcmp(matrix_elementsi, "rx") == 0) { + matrix.rx = value; + } else if (strcmp(matrix_elementsi, "ry") == 0) { + matrix.ry = value; + } else if (strcmp(matrix_elementsi, "sy") == 0) { + matrix.sy = value; + } else if (strcmp(matrix_elementsi, "tx") == 0) { + matrix.tx = value; + } else if (strcmp(matrix_elementsi, "ty") == 0) { + matrix.ty = value; + } + } + } + + internd = Z_IMAGICKDRAW_P(getThis()); + + DrawAffine(internd->drawing_wand, &matrix); + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::composite(int compose, float x, float y, float width, float height, MagickWand magick_wand) + Composites an image onto the current image, using the specified composition operator, specified position, and at the specified size. +*/ +PHP_METHOD(ImagickDraw, composite) +{ + php_imagickdraw_object *internd; + php_imagick_object *intern; + zval *magick_obj; + im_long compose; + double x, y, width, height; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lddddO", &compose, &x, &y, &width, &height, &magick_obj, php_imagick_sc_entry) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(magick_obj); + + IMAGICK_NOT_EMPTY(intern); + + internd = Z_IMAGICKDRAW_P(getThis()); + status = DrawComposite(internd->drawing_wand, compose, x, y, width, height, intern->magick_wand); + + if (status == MagickFalse) { + php_imagick_convert_imagickdraw_exception (internd->drawing_wand, "Compositing image failed" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::color(float x, float y, int paintMethod) + Draws color on image using the current fill color, starting at specified position, and using specified paint method. The available paint methods are: +*/ +PHP_METHOD(ImagickDraw, color) +{ + php_imagickdraw_object *internd; + double x, y; + im_long paint_method; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddl", &x, &y, &paint_method) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + + DrawColor(internd->drawing_wand, x, y, paint_method); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::comment(string comment) + Adds a comment to a vector output stream. +*/ +PHP_METHOD(ImagickDraw, comment) +{ + php_imagickdraw_object *internd; + char *comment; + IM_LEN_TYPE comment_len; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &comment, &comment_len) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + + DrawComment(internd->drawing_wand, comment); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto string ImagickDraw::getClipPath() + Obtains the current clipping path ID. The value returned must be deallocated by the user when it is no longer needed. +*/ +PHP_METHOD(ImagickDraw, getClipPath) +{ + php_imagickdraw_object *internd; + char *clip_path; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + clip_path = DrawGetClipPath(internd->drawing_wand); + + if (!clip_path) { + RETURN_FALSE; + } else { + IM_ZVAL_STRING(return_value, clip_path); + IMAGICK_FREE_MAGICK_MEMORY(clip_path); + } +} +/* }}} */ + +/* {{{ proto int ImagickDraw::getClipRule() + Returns the current polygon fill rule to be used by the clipping path. +*/ +PHP_METHOD(ImagickDraw, getClipRule) +{ + php_imagickdraw_object *internd; + long clip_rule; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + clip_rule = DrawGetClipRule(internd->drawing_wand); + + RETVAL_LONG(clip_rule); +} +/* }}} */ + +/* {{{ proto int ImagickDraw::getClipUnits() + Returns the interpretation of clip path units. +*/ +PHP_METHOD(ImagickDraw, getClipUnits) +{ + php_imagickdraw_object *internd; + long units; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + units = DrawGetClipUnits(internd->drawing_wand); + + RETVAL_LONG(units); +} +/* }}} */ + +/* {{{ proto ImagickPixel ImagickDraw::getFillColor() + Returns the fill color used for drawing filled objects. +*/ +PHP_METHOD(ImagickDraw, getFillColor) +{ + php_imagickpixel_object *internp; + php_imagickdraw_object *internd; + PixelWand *tmp_wand; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + + tmp_wand = NewPixelWand(); + DrawGetFillColor(internd->drawing_wand, tmp_wand); + + object_init_ex(return_value, php_imagickpixel_sc_entry); + internp = Z_IMAGICKPIXEL_P(return_value); + php_imagick_replace_pixelwand(internp, tmp_wand); +} +/* }}} */ + +/* {{{ proto float ImagickDraw::getFillOpacity() + Returns the opacity used when drawing using the fill color or fill texture. Fully opaque is 1.0. +*/ +PHP_METHOD(ImagickDraw, getFillOpacity) +{ + php_imagickdraw_object *internd; + double opacity; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + opacity = DrawGetFillOpacity(internd->drawing_wand); + + RETVAL_DOUBLE(opacity); +} +/* }}} */ + +/* {{{ proto int ImagickDraw::getFillRule(const DrawingWand *wand) + Returns the fill rule used while drawing polygons. +*/ +PHP_METHOD(ImagickDraw, getFillRule) +{ + php_imagickdraw_object *internd; + long fill_rule; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + fill_rule = DrawGetFillRule(internd->drawing_wand); + + RETVAL_LONG(fill_rule); +} +/* }}} */ + +/* {{{ proto int ImagickDraw::getGravity() + Returns the text placement gravity used when annotating with text. +*/ +PHP_METHOD(ImagickDraw, getGravity) +{ + php_imagickdraw_object *internd; + long gravity; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + gravity = DrawGetGravity(internd->drawing_wand); + + RETVAL_LONG(gravity); +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::getStrokeAntialias() + Returns the current stroke antialias setting. Stroked outlines are antialiased by default. When antialiasing is disabled stroked pixels are thresholded to determine if the stroke color or underlying canvas color should be used. +*/ +PHP_METHOD(ImagickDraw, getStrokeAntialias) +{ + php_imagickdraw_object *internd; + MagickBooleanType status; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + status = DrawGetStrokeAntialias(internd->drawing_wand); + + if (status == MagickFalse) { + RETURN_FALSE; + } else { + RETURN_TRUE; + } +} +/* }}} */ + +/* {{{ proto ImagickPixel ImagickDraw::getStrokeColor(PixelWand stroke_color) + Returns the color used for stroking object outlines. +*/ +PHP_METHOD(ImagickDraw, getStrokeColor) +{ + php_imagickpixel_object *internp; + php_imagickdraw_object *internd; + PixelWand *tmp_wand; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + + tmp_wand = NewPixelWand(); + DrawGetStrokeColor(internd->drawing_wand, tmp_wand); + + object_init_ex(return_value, php_imagickpixel_sc_entry); + internp = Z_IMAGICKPIXEL_P(return_value); + php_imagick_replace_pixelwand(internp, tmp_wand); +} +/* }}} */ + +/* {{{ proto array ImagickDraw::getStrokeDashArray() + Returns an array representing the pattern of dashes and gaps used to stroke paths (see DrawSetStrokeDashArray). The array must be freed once it is no longer required by the user. +*/ +PHP_METHOD(ImagickDraw, getStrokeDashArray) +{ + php_imagickdraw_object *internd; + double *stroke_array; + unsigned long i; + size_t num_elements; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + + stroke_array = DrawGetStrokeDashArray(internd->drawing_wand, &num_elements); + array_init(return_value); + + for (i = 0; i < num_elements ; i++) { + add_next_index_double(return_value, stroke_arrayi); + } + + IMAGICK_FREE_MAGICK_MEMORY(stroke_array); +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::setStrokeDashArray(array dashArray) + Specifies the pattern of dashes and gaps used to stroke paths. The strokeDashArray represents an array of numbers that specify the lengths of alternating dashes and gaps in pixels. If an odd number of values is provided, then the list of values is repeated to yield an even number of values. To remove an existing dash array, pass a zero number_elements argument and null dash_array. A typical strokeDashArray_ array might contain the members 5 3 2. +*/ +PHP_METHOD(ImagickDraw, setStrokeDashArray) +{ + zval *param_array; + double *double_array; + im_long elements; + php_imagickdraw_object *internd; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a!", ¶m_array) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + + if (param_array == NULL) { + DrawSetStrokeDashArray(internd->drawing_wand, 0, NULL); + RETURN_TRUE; + } + + double_array = php_imagick_zval_to_double_array(param_array, &elements TSRMLS_CC); + + if (!double_array) { + php_imagick_throw_exception(IMAGICKDRAW_CLASS, "Cannot read stroke dash array parameter" TSRMLS_CC); + RETURN_THROWS(); + } + + DrawSetStrokeDashArray(internd->drawing_wand, elements, double_array); + efree(double_array); + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto float ImagickDraw::getStrokeDashOffset() + Returns the offset into the dash pattern to start the dash. +*/ +PHP_METHOD(ImagickDraw, getStrokeDashOffset) +{ + php_imagickdraw_object *internd; + double offset; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + offset = DrawGetStrokeDashOffset(internd->drawing_wand); + + RETVAL_DOUBLE(offset); +} +/* }}} */ + +/* {{{ proto int ImagickDraw::getStrokeLineCap() + Returns the shape to be used at the end of open subpaths when they are stroked. Values of LineCap are UndefinedCap, ButtCap, RoundCap, and SquareCap. +*/ +PHP_METHOD(ImagickDraw, getStrokeLineCap) +{ + php_imagickdraw_object *internd; + long line_cap; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + line_cap = DrawGetStrokeLineCap(internd->drawing_wand); + + RETVAL_LONG(line_cap); +} +/* }}} */ + +/* {{{ proto int ImagickDraw::getStrokeLineJoin() + Returns the shape to be used at the corners of paths (or other vector shapes) when they are stroked. Values of LineJoin are UndefinedJoin, MiterJoin, RoundJoin, and BevelJoin. +*/ +PHP_METHOD(ImagickDraw, getStrokeLineJoin) +{ + php_imagickdraw_object *internd; + long line_join; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + line_join = DrawGetStrokeLineJoin(internd->drawing_wand); + + RETVAL_LONG(line_join); +} +/* }}} */ + +/* {{{ proto int ImagickDraw::getStrokeMiterLimit() + Returns the miter limit. When two line segments meet at a sharp angle and miter joins have been specified for 'lineJoin', it is possible for the miter to extend far beyond the thickness of the line stroking the path. The miterLimit' imposes a limit on the ratio of the miter length to the 'lineWidth'. +*/ +PHP_METHOD(ImagickDraw, getStrokeMiterLimit) +{ + php_imagickdraw_object *internd; + unsigned long miter_limit; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + miter_limit = DrawGetStrokeMiterLimit(internd->drawing_wand); + + RETVAL_LONG(miter_limit); +} +/* }}} */ + +/* {{{ proto float ImagickDraw::getStrokeOpacity() + Returns the opacity of stroked object outlines. +*/ +PHP_METHOD(ImagickDraw, getStrokeOpacity) +{ + php_imagickdraw_object *internd; + double opacity; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + opacity = DrawGetStrokeOpacity(internd->drawing_wand); + + RETVAL_DOUBLE(opacity); +} +/* }}} */ + +/* {{{ proto float ImagickDraw::getStrokeWidth() + Returns the width of the stroke used to draw object outlines. +*/ +PHP_METHOD(ImagickDraw, getStrokeWidth) +{ + php_imagickdraw_object *internd; + double width; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + width = DrawGetStrokeWidth(internd->drawing_wand); + + RETVAL_DOUBLE(width); +} +/* }}} */ + +/* {{{ proto int ImagickDraw::getTextAlignment() + Returns the alignment applied when annotating with text. +*/ +PHP_METHOD(ImagickDraw, getTextAlignment) +{ + php_imagickdraw_object *internd; + long align_type; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + align_type = DrawGetTextAlignment(internd->drawing_wand); + + RETVAL_LONG(align_type); +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::getTextAntialias() + Returns the current text antialias setting, which determines whether text is antialiased. Text is antialiased by default. +*/ +PHP_METHOD(ImagickDraw, getTextAntialias) +{ + php_imagickdraw_object *internd; + MagickBooleanType status; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + status = DrawGetTextAntialias(internd->drawing_wand); + + if (status == MagickFalse) { + RETURN_FALSE; + } else { + RETURN_TRUE; + } +} +/* }}} */ + +/* {{{ proto string ImagickDraw::getVectorGraphics() + Returns a null-terminated string which specifies the vector graphics generated by any graphics calls made since the wand was instantiated. The string must be freed by the user once it is no longer required. +*/ +PHP_METHOD(ImagickDraw, getVectorGraphics) +{ + php_imagickdraw_object *internd; + char *vector; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + vector = DrawGetVectorGraphics(internd->drawing_wand); + + IM_ZVAL_STRING(return_value, vector); + IMAGICK_FREE_MAGICK_MEMORY(vector); +} +/* }}} */ + +/* {{{ proto ImagickPixel ImagickDraw::getTextUnderColor(PixelWand under_color) + Returns the color of a background rectangle to place under text annotations. +*/ +PHP_METHOD(ImagickDraw, getTextUnderColor) +{ + php_imagickpixel_object *internp; + php_imagickdraw_object *internd; + PixelWand *tmp_wand; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + tmp_wand = NewPixelWand(); + + if (!tmp_wand) { + php_imagick_throw_exception(IMAGICKDRAW_CLASS, "Failed to allocate space for new PixelWand" TSRMLS_CC); + RETURN_THROWS(); + } + + DrawGetTextUnderColor(internd->drawing_wand, tmp_wand); + + object_init_ex(return_value, php_imagickpixel_sc_entry); + internp = Z_IMAGICKPIXEL_P(return_value); + php_imagick_replace_pixelwand(internp, tmp_wand); +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::pathClose() + Adds a path element to the current path which closes the current subpath by drawing a straight line from the current point to the current subpath's most recent starting point (usually, the most recent moveto point). +*/ +PHP_METHOD(ImagickDraw, pathClose) +{ + php_imagickdraw_object *internd; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + DrawPathClose(internd->drawing_wand); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::pathCurveToAbsolute(float x1, float y1, float x2, float y2, float x, float y) + Draws a cubic Bezier curve from the current point to (x,y) using (x1,y1) as the control point at the beginning of the curve and (x2,y2) as the control point at the end of the curve using absolute coordinates. At the end of the command, the new current point becomes the final (x,y) coordinate pair used in the polybezier. +*/ +PHP_METHOD(ImagickDraw, pathCurveToAbsolute) +{ + php_imagickdraw_object *internd; + double x1, y1, x2, y2, x, y; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddddd", &x1, &y1, &x2, &y2, &x, &y) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + + DrawPathCurveToAbsolute(internd->drawing_wand, x1, y1, x2, y2, x, y); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::pathCurveToRelative(float x1, float y1, float x2, float y2, float x, float y) + Draws a cubic Bezier curve from the current point to (x,y) using (x1,y1) as the control point at the beginning of the curve and (x2,y2) as the control point at the end of the curve using relative coordinates. At the end of the command, the new current point becomes the final (x,y) coordinate pair used in the polybezier. +*/ +PHP_METHOD(ImagickDraw, pathCurveToRelative) +{ + php_imagickdraw_object *internd; + double x1, y1, x2, y2, x, y; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddddd", &x1, &y1, &x2, &y2, &x, &y) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + + DrawPathCurveToRelative(internd->drawing_wand, x1, y1, x2, y2, x, y); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::pathCurveToQuadraticBezierAbsolute(float x1, float y1, float x, float y) + Draws a quadratic Bezier curve from the current point to (x,y) using (x1,y1) as the control point using absolute coordinates. At the end of the command, the new current point becomes the final (x,y) coordinate pair used in the polybezier. +*/ +PHP_METHOD(ImagickDraw, pathCurveToQuadraticBezierAbsolute) +{ + php_imagickdraw_object *internd; + double x1, y1, x, y; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddd", &x1, &y1, &x, &y) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + + DrawPathCurveToQuadraticBezierAbsolute(internd->drawing_wand, x1, y1, x, y); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::pathCurveToQuadraticBezierRelative(float x1, float y1, float x, float y) + Draws a quadratic Bezier curve from the current point to (x,y) using (x1,y1) as the control point using relative coordinates. At the end of the command, the new current point becomes the final (x,y) coordinate pair used in the polybezier. +*/ +PHP_METHOD(ImagickDraw, pathCurveToQuadraticBezierRelative) +{ + php_imagickdraw_object *internd; + double x1, y1, x, y; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddd", &x1, &y1, &x, &y) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + + DrawPathCurveToQuadraticBezierRelative(internd->drawing_wand, x1, y1, x, y); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::pathCurveToQuadraticBezierSmoothAbsolute(float x, float y) + Draws a quadratic Bezier curve (using relative coordinates) from the current point to (x,y). The control point is assumed to be the reflection of the control point on the previous command relative to the current point. (If there is no previous command or if the previous command was not a DrawPathCurveToQuadraticBezierAbsolute, DrawPathCurveToQuadraticBezierRelative, DrawPathCurveToQuadraticBezierSmoothAbsolut or DrawPathCurveToQuadraticBezierSmoothRelative, assume the control point is coincident with the current point.). At the end of the command, the new current point becomes the final (x,y) coordinate pair used in the polybezier. +*/ +PHP_METHOD(ImagickDraw, pathCurveToQuadraticBezierSmoothAbsolute) +{ + php_imagickdraw_object *internd; + double x, y; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &x, &y) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + + DrawPathCurveToQuadraticBezierSmoothAbsolute(internd->drawing_wand, x, y); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::pathCurveToQuadraticBezierSmoothRelative(float x, float y) + Draws a quadratic Bezier curve (using relative coordinates) from the current point to (x, y). The control point is assumed to be the reflection of the control point on the previous command relative to the current point. (If there is no previous command or if the previous command was not a DrawPathCurveToQuadraticBezierAbsolute, DrawPathCurveToQuadraticBezierRelative, DrawPathCurveToQuadraticBezierSmoothAbsolut or DrawPathCurveToQuadraticBezierSmoothRelative, assume the control point is coincident with the current point). At the end of the command, the new current point becomes the final (x, y) coordinate pair used in the polybezier. +*/ +PHP_METHOD(ImagickDraw, pathCurveToQuadraticBezierSmoothRelative) +{ + php_imagickdraw_object *internd; + double x, y; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &x, &y) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + + DrawPathCurveToQuadraticBezierSmoothRelative(internd->drawing_wand, x, y); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::pathCurveToSmoothAbsolute(float x2, float y2, float x, float y) + Draws a cubic Bezier curve from the current point to (x,y) using absolute coordinates. The first control point is assumed to be the reflection of the second control point on the previous command relative to the current point. (If there is no previous command or if the previous command was not an DrawPathCurveToAbsolute, DrawPathCurveToRelative, DrawPathCurveToSmoothAbsolute or DrawPathCurveToSmoothRelative, assume the first control point is coincident with the current point.) (x2,y2) is the second control point (i.e., the control point at the end of the curve). At the end of the command, the new current point becomes the final (x,y) coordinate pair used in the polybezier. +*/ +PHP_METHOD(ImagickDraw, pathCurveToSmoothAbsolute) +{ + php_imagickdraw_object *internd; + double x1, y1, x, y; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddd", &x1, &y1, &x, &y) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + + DrawPathCurveToSmoothAbsolute(internd->drawing_wand, x1, y1, x, y); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::pathCurveToSmoothRelative(float x2, float y2, float x, float y) + Draws a cubic Bezier curve from the current point to (x,y) using relative coordinates. The first control point is assumed to be the reflection of the second control point on the previous command relative to the current point. (If there is no previous command or if the previous command was not an DrawPathCurveToAbsolute, DrawPathCurveToRelative, DrawPathCurveToSmoothAbsolute or DrawPathCurveToSmoothRelative, assume the first control point is coincident with the current point.) (x2,y2) is the second control point (i.e., the control point at the end of the curve). At the end of the command, the new current point becomes the final (x,y) coordinate pair used in the polybezier. +*/ +PHP_METHOD(ImagickDraw, pathCurveToSmoothRelative) +{ + php_imagickdraw_object *internd; + double x1, y1, x, y; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddd", &x1, &y1, &x, &y) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + + DrawPathCurveToSmoothRelative(internd->drawing_wand, x1, y1, x, y); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::pathEllipticArcAbsolute(float rx, float ry, float x_axis_rotation, bool large_arc_flag, bool sweep_flag, float x, float y) + Draws an elliptical arc from the current point to (x, y) using absolute coordinates. The size and orientation of the ellipse are defined by two radii (rx, ry) and an xAxisRotation, which indicates how the ellipse as a whole is rotated relative to the current coordinate system. The center (cx, cy) of the ellipse is calculated automatically to satisfy the constraints imposed by the other parameters. largeArcFlag and sweepFlag contribute to the automatic calculations and help determine how the arc is drawn. If largeArcFlag is true then draw the larger of the available arcs. If sweepFlag is true, then draw the arc matching a clock-wise rotation. +*/ +PHP_METHOD(ImagickDraw, pathEllipticArcAbsolute) +{ + php_imagickdraw_object *internd; + double rx, ry, x_axis_rotation, x, y; + zend_bool large_arc, sweep; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddbbdd", &rx, &ry, &x_axis_rotation, &large_arc, &sweep, &x, &y) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + DrawPathEllipticArcAbsolute(internd->drawing_wand, rx, ry, x_axis_rotation, large_arc, sweep, x, y); + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::pathEllipticArcRelative(float rx, float ry, float x_axis_rotation, bool large_arc_flag, bool sweep_flag, float x, float y) + Draws an elliptical arc from the current point to (x, y) using relative coordinates. The size and orientation of the ellipse are defined by two radii (rx, ry) and an xAxisRotation, which indicates how the ellipse as a whole is rotated relative to the current coordinate system. The center (cx, cy) of the ellipse is calculated automatically to satisfy the constraints imposed by the other parameters. largeArcFlag and sweepFlag contribute to the automatic calculations and help determine how the arc is drawn. If largeArcFlag is true then draw the larger of the available arcs. If sweepFlag is true, then draw the arc matching a clock-wise rotation. +*/ +PHP_METHOD(ImagickDraw, pathEllipticArcRelative) +{ + php_imagickdraw_object *internd; + double rx, ry, x_axis_rotation, x, y; + zend_bool large_arc, sweep; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddbbdd", &rx, &ry, &x_axis_rotation, &large_arc, &sweep, &x, &y) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + DrawPathEllipticArcRelative(internd->drawing_wand, rx, ry, x_axis_rotation, large_arc, sweep, x, y); + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::pathFinish() + Terminates the current path. +*/ +PHP_METHOD(ImagickDraw, pathFinish) +{ + php_imagickdraw_object *internd; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + DrawPathFinish(internd->drawing_wand); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::pathLineToAbsolute(float x, float y) + Draws a line path from the current point to the given coordinate using absolute coordinates. The coordinate then becomes the new current point. +*/ +PHP_METHOD(ImagickDraw, pathLineToAbsolute) +{ + php_imagickdraw_object *internd; + double x, y; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &x, &y) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + + DrawPathLineToAbsolute(internd->drawing_wand, x, y); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::pathLineToRelative(float x, float y) + Draws a line path from the current point to the given coordinate using relative coordinates. The coordinate then becomes the new current point. +*/ +PHP_METHOD(ImagickDraw, pathLineToRelative) +{ + php_imagickdraw_object *internd; + double x, y; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &x, &y) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + + DrawPathLineToRelative(internd->drawing_wand, x, y); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::pathLineToHorizontalAbsolute(float x) + Draws a horizontal line path from the current point to the target point using absolute coordinates. The target point then becomes the new current point. +*/ +PHP_METHOD(ImagickDraw, pathLineToHorizontalAbsolute) +{ + php_imagickdraw_object *internd; + double y; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &y) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + + DrawPathLineToHorizontalAbsolute(internd->drawing_wand, y); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::pathLineToHorizontalRelative(float x) + Draws a horizontal line path from the current point to the target point using relative coordinates. The target point then becomes the new current point. +*/ +PHP_METHOD(ImagickDraw, pathLineToHorizontalRelative) +{ + php_imagickdraw_object *internd; + double x; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &x) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + + DrawPathLineToHorizontalRelative(internd->drawing_wand, x); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::pathLineToVerticalAbsolute(float y) + Draws a vertical line path from the current point to the target point using absolute coordinates. The target point then becomes the new current point. +*/ +PHP_METHOD(ImagickDraw, pathLineToVerticalAbsolute) +{ + php_imagickdraw_object *internd; + double y; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &y) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + + DrawPathLineToVerticalAbsolute(internd->drawing_wand, y); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::pathLineToVerticalRelative(float y) + Draws a vertical line path from the current point to the target point using relative coordinates. The target point then becomes the new current point. +*/ +PHP_METHOD(ImagickDraw, pathLineToVerticalRelative) +{ + php_imagickdraw_object *internd; + double y; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &y) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + + DrawPathLineToVerticalRelative(internd->drawing_wand, y); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::pathMoveToAbsolute(float x, float y) + Starts a new sub-path at the given coordinate using absolute coordinates. The current point then becomes the specified coordinate. +*/ +PHP_METHOD(ImagickDraw, pathMoveToAbsolute) +{ + php_imagickdraw_object *internd; + double x, y; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &x, &y) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + + DrawPathMoveToAbsolute(internd->drawing_wand, x, y); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::pathMoveToRelative(float x, float y) + Starts a new sub-path at the given coordinate using relative coordinates. The current point then becomes the specified coordinate. +*/ +PHP_METHOD(ImagickDraw, pathMoveToRelative) +{ + php_imagickdraw_object *internd; + double x, y; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &x, &y) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + + DrawPathMoveToRelative(internd->drawing_wand, x, y); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::pathStart() + Declares the start of a path drawing list which is terminated by a matching DrawPathFinish() command. All other DrawPath commands must be enclosed between a and a DrawPathFinish() command. This is because path drawing commands are subordinate commands and they do not function by themselves. +*/ +PHP_METHOD(ImagickDraw, pathStart) +{ + php_imagickdraw_object *internd; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + DrawPathStart(internd->drawing_wand); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::polyline(array coordinates) + Draws a polyline using the current stroke, stroke width, and fill color or texture, using the specified array of coordinates. +*/ +PHP_METHOD(ImagickDraw, polyline) +{ + zval *coordinate_array; + php_imagickdraw_object *internd; + PointInfo *coordinates; + int num_elements = 0; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &coordinate_array) == FAILURE) { + RETURN_THROWS(); + } + + coordinates = php_imagick_zval_to_pointinfo_array(coordinate_array, &num_elements TSRMLS_CC); + + if (!coordinates) { + php_imagick_throw_exception(IMAGICKDRAW_CLASS, "Unable to read coordinate array" TSRMLS_CC); + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + DrawPolyline(internd->drawing_wand, num_elements, coordinates); + + efree(coordinates); + RETURN_TRUE; + +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::popClipPath() + Terminates a clip path definition. +*/ +PHP_METHOD(ImagickDraw, popClipPath) +{ + php_imagickdraw_object *internd; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + DrawPopClipPath(internd->drawing_wand); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::popDefs() + Terminates a definition list +*/ +PHP_METHOD(ImagickDraw, popDefs) +{ + php_imagickdraw_object *internd; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + DrawPopDefs(internd->drawing_wand); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::popPattern() + Terminates a pattern definition. +*/ +PHP_METHOD(ImagickDraw, popPattern) +{ + php_imagickdraw_object *internd; + MagickBooleanType status; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + internd = Z_IMAGICKDRAW_P(getThis());; + status = DrawPopPattern(internd->drawing_wand); + + if (status == MagickFalse) { + php_imagick_convert_imagickdraw_exception (internd->drawing_wand, "Unable to terminate the pattern definition" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::pushClipPath(string clip_mask_id) + Starts a clip path definition which is comprized of any number of drawing commands and terminated by a DrawPopClipPath() command. +*/ +PHP_METHOD(ImagickDraw, pushClipPath) +{ + php_imagickdraw_object *internd; + char *clip_mask; + IM_LEN_TYPE clip_mask_len; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &clip_mask, &clip_mask_len) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + + DrawPushClipPath(internd->drawing_wand, clip_mask); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::pushDefs() + Indicates that commands up to a terminating DrawPopDefs() command create named elements (e.g. clip-paths, textures, etc.) which may safely be processed earlier for the sake of efficiency. +*/ +PHP_METHOD(ImagickDraw, pushDefs) +{ + php_imagickdraw_object *internd; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + DrawPushDefs(internd->drawing_wand); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::pushPattern(string pattern_id, float x, float y, float width, float height) + Indicates that subsequent commands up to a DrawPopPattern() command comprise the definition of a named pattern. The pattern space is assigned top left corner coordinates, a width and height, and becomes its own drawing space. Anything which can be drawn may be used in a pattern definition. Named patterns may be used as stroke or brush definitions. +*/ +PHP_METHOD(ImagickDraw, pushPattern) +{ + php_imagickdraw_object *internd; + char *pattern_id; + IM_LEN_TYPE pattern_id_len; + double x, y, width, height; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sdddd", &pattern_id, &pattern_id_len, &x, &y, &width, &height) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + + DrawPushPattern(internd->drawing_wand, pattern_id, x, y, width, height); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::render() + Renders all preceding drawing commands. +*/ +PHP_METHOD(ImagickDraw, render) +{ + php_imagickdraw_object *internd; + MagickBooleanType status; + char *old_locale; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + + old_locale = php_imagick_set_locale (TSRMLS_C); + + status = DrawRender(internd->drawing_wand); + + php_imagick_restore_locale (old_locale); + + if (old_locale) + efree (old_locale); + + if (status == MagickFalse) { + php_imagick_convert_imagickdraw_exception (internd->drawing_wand, "Unable to render the drawing commands" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::rotate(float degrees) + Applies the specified rotation to the current coordinate space. +*/ +PHP_METHOD(ImagickDraw, rotate) +{ + php_imagickdraw_object *internd; + double degrees; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", °rees) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + + DrawRotate(internd->drawing_wand, degrees); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::scale(float x, float y) + Adjusts the scaling factor to apply in the horizontal and vertical directions to the current coordinate space. +*/ +PHP_METHOD(ImagickDraw, scale) +{ + php_imagickdraw_object *internd; + double x, y; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &x, &y) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + + DrawScale(internd->drawing_wand, x, y); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::setClipPath(string clip_mask) + Associates a named clipping path with the image. Only the areas drawn on by the clipping path will be modified as long as it remains in effect. +*/ +PHP_METHOD(ImagickDraw, setClipPath) +{ + php_imagickdraw_object *internd; + char *clip_mask; + IM_LEN_TYPE clip_mask_len; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &clip_mask, &clip_mask_len) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + status = DrawSetClipPath(internd->drawing_wand, clip_mask); + + if (status == MagickFalse) { + php_imagick_convert_imagickdraw_exception (internd->drawing_wand, "Unable to set clipping path" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::setClipRule(int fill_rule) + Set the polygon fill rule to be used by the clipping path. +*/ +PHP_METHOD(ImagickDraw, setClipRule) +{ + php_imagickdraw_object *internd; + im_long fill_rule; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &fill_rule) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + + DrawSetClipRule(internd->drawing_wand, fill_rule); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::setClipUnits(int clip_units) + Sets the interpretation of clip path units. +*/ +PHP_METHOD(ImagickDraw, setClipUnits) +{ + php_imagickdraw_object *internd; + im_long units; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &units) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + + DrawSetClipUnits(internd->drawing_wand, units); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::setFillOpacity(float fillOpacity) + Sets the opacity to use when drawing using the fill color or fill texture. Fully opaque is 1.0. +*/ +PHP_METHOD(ImagickDraw, setFillOpacity) +{ + php_imagickdraw_object *internd; + double fillOpacity; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &fillOpacity) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + + DrawSetFillOpacity(internd->drawing_wand, fillOpacity); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::setFillPatternUrl(string fill_url) + Sets the URL to use as a fill pattern for filling objects. Only local URLs ("#identifier") are supported at this time. + These local URLs are normally created by defining a named fill pattern with DrawPushPattern/DrawPopPattern. +*/ +PHP_METHOD(ImagickDraw, setFillPatternUrl) +{ + php_imagickdraw_object *internd; + char *url; + IM_LEN_TYPE url_len; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &url, &url_len) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + status = DrawSetFillPatternURL(internd->drawing_wand, url); + + if (status == MagickFalse) { + php_imagick_convert_imagickdraw_exception (internd->drawing_wand, "Unable to set fill pattern URL" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::setFillRule(int fill_rule) + Sets the fill rule to use while drawing polygons. +*/ +PHP_METHOD(ImagickDraw, setFillRule) +{ + php_imagickdraw_object *internd; + im_long fill_rule; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &fill_rule) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + + DrawSetFillRule(internd->drawing_wand, fill_rule); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::setGravity(int gravity) + Sets the text placement gravity to use when annotating with text. +*/ +PHP_METHOD(ImagickDraw, setGravity) +{ + php_imagickdraw_object *internd; + im_long gravity; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &gravity) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + + DrawSetGravity(internd->drawing_wand, gravity); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::setStrokePatternUrl(string stroke_url) + Sets the pattern used for stroking object outlines. +*/ +PHP_METHOD(ImagickDraw, setStrokePatternUrl) +{ + php_imagickdraw_object *internd; + char *url; + IM_LEN_TYPE url_len; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &url, &url_len) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + status = DrawSetStrokePatternURL(internd->drawing_wand, url); + + if (status == MagickFalse) { + php_imagick_convert_imagickdraw_exception (internd->drawing_wand, "Unable to set stroke pattern URL" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::setStrokeDashOffset(float dash_offset) + Specifies the offset into the dash pattern to start the dash. +*/ +PHP_METHOD(ImagickDraw, setStrokeDashOffset) +{ + php_imagickdraw_object *internd; + double offset; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &offset) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + + DrawSetStrokeDashOffset(internd->drawing_wand, offset); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::setStrokeLineCap(int linecap) + Specifies the shape to be used at the end of open subpaths when they are stroked. Values of LineCap are UndefinedCap, ButtCap, RoundCap, and SquareCap. +*/ +PHP_METHOD(ImagickDraw, setStrokeLineCap) +{ + php_imagickdraw_object *internd; + im_long line_cap; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &line_cap) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + + DrawSetStrokeLineCap(internd->drawing_wand, line_cap); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::setStrokeLineJoin(int linejoin) + Specifies the shape to be used at the corners of paths (or other vector shapes) when they are stroked. Values of LineJoin are UndefinedJoin, MiterJoin, RoundJoin, and BevelJoin. +*/ +PHP_METHOD(ImagickDraw, setStrokeLineJoin) +{ + php_imagickdraw_object *internd; + im_long line_join; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &line_join) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + + DrawSetStrokeLineJoin(internd->drawing_wand, line_join); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::setStrokeMiterLimit(int miterlimit) + Specifies the miter limit. When two line segments meet at a sharp angle and miter joins have been specified for 'lineJoin', it is possible for the miter to extend far beyond the thickness of the line stroking the path. The miterLimit' imposes a limit on the ratio of the miter length to the 'lineWidth'. +*/ +PHP_METHOD(ImagickDraw, setStrokeMiterLimit) +{ + php_imagickdraw_object *internd; + im_long miter_limit; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &miter_limit) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + + DrawSetStrokeMiterLimit(internd->drawing_wand, miter_limit); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::setStrokeOpacity(float stroke_opacity) + Specifies the opacity of stroked object outlines. +*/ +PHP_METHOD(ImagickDraw, setStrokeOpacity) +{ + php_imagickdraw_object *internd; + double opacity; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &opacity) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + + DrawSetStrokeOpacity(internd->drawing_wand, opacity); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::setVectorGraphics(string xml) + Sets the vector graphics associated with the specified wand. Use this method with DrawGetVectorGraphics() as a method to persist the vector graphics state. +*/ +PHP_METHOD(ImagickDraw, setVectorGraphics) +{ + php_imagickdraw_object *internd; + char *vector; + IM_LEN_TYPE vector_len; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &vector, &vector_len) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + status = DrawSetVectorGraphics(internd->drawing_wand, vector); + + if (status == MagickFalse) { + php_imagick_convert_imagickdraw_exception (internd->drawing_wand, "Unable to set the vector graphics" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::pop() + Destroys the current DrawingWand in the stack, and returns to the previously pushed DrawingWand. Multiple DrawingWands may exist. It is an error to attempt to pop more DrawingWands than have been pushed, and it is proper form to pop all DrawingWands which have been pushed. +*/ +PHP_METHOD(ImagickDraw, pop) +{ + php_imagickdraw_object *internd; + MagickBooleanType status; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + status = PopDrawingWand(internd->drawing_wand); + + if (status == MagickFalse) { + php_imagick_convert_imagickdraw_exception (internd->drawing_wand, "Unable to pop the current ImagickDraw object" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::push() + Clones the current DrawingWand to create a new DrawingWand, which is then added to the DrawingWand stack. The original drawing DrawingWand(s) may be returned to by invoking PopDrawingWand(). The DrawingWands are stored on a DrawingWand stack. For every Pop there must have already been an equivalent Push. +*/ +PHP_METHOD(ImagickDraw, push) +{ + php_imagickdraw_object *internd; + MagickBooleanType status; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + status = PushDrawingWand(internd->drawing_wand); + + if (status == MagickFalse) { + php_imagick_convert_imagickdraw_exception (internd->drawing_wand, "Unable to push the current ImagickDraw object" TSRMLS_CC); + RETURN_THROWS(); + } + RETURN_TRUE; +} +/* }}} */ + +#if MagickLibVersion >= 0x693 +/* {{{ proto float ImagickDraw::getOpacity() + Returns the opacity used when drawing with the fill or stroke color or texture. Fully opaque is 1.0. +*/ +PHP_METHOD(ImagickDraw, getOpacity) +{ + php_imagickdraw_object *internd; + double opacity; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + opacity = DrawGetOpacity(internd->drawing_wand); + + RETURN_DOUBLE(opacity); +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::setOpacity(float opacity) + Sets the opacity to use when drawing using the fill or stroke color or texture. Fully opaque is 1.0. +*/ +PHP_METHOD(ImagickDraw, setOpacity) +{ + php_imagickdraw_object *internd; + double opacity; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &opacity) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + DrawSetOpacity(internd->drawing_wand, opacity); + + RETURN_TRUE; +} +/* }}} */ +#endif //#if MagickLibVersion >= 0x693 + +#if MagickLibVersion >= 0x675 +/* {{{ proto array ImagickDraw::getFontResolution() + Gets the image X and Y resolution. +*/ +PHP_METHOD(ImagickDraw, getFontResolution) +{ + php_imagickdraw_object *internd; + double x, y; + MagickBooleanType status; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + status = DrawGetFontResolution(internd->drawing_wand, &x, &y); + + if (status == MagickFalse) { + php_imagick_convert_imagickdraw_exception (internd->drawing_wand, "Unable to push the current ImagickDraw object" TSRMLS_CC); + RETURN_THROWS(); + } + + array_init(return_value); + add_assoc_double(return_value, "x", x); + add_assoc_double(return_value, "y", y); +} +/* }}} */ +#endif //#if MagickLibVersion >= 0x675 + + +#if MagickLibVersion >= 0x675 +/* {{{ proto bool ImagickDraw::setFontResolution(float x, float y) + Sets the image font resolution. +*/ +PHP_METHOD(ImagickDraw, setFontResolution) +{ + php_imagickdraw_object *internd; + double x, y; + + MagickBooleanType status; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &x, &y) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + status = DrawSetFontResolution(internd->drawing_wand, x, y); + if (status == MagickFalse) { + php_imagick_convert_imagickdraw_exception (internd->drawing_wand, "Unable to push the current ImagickDraw object" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ +#endif //#if MagickLibVersion >= 0x675 + + +#if MagickLibVersion >= 0x675 +/* {{{ proto ImagickPixel ImagickDraw::getBorderColor() + Returns the border color used for drawing bordered objects. +*/ +PHP_METHOD(ImagickDraw, getBorderColor) +{ + php_imagickpixel_object *internp; + php_imagickdraw_object *internd; + PixelWand *tmp_wand; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + + tmp_wand = NewPixelWand(); + DrawGetBorderColor(internd->drawing_wand, tmp_wand); + + object_init_ex(return_value, php_imagickpixel_sc_entry); + internp = Z_IMAGICKPIXEL_P(return_value); + php_imagick_replace_pixelwand(internp, tmp_wand); +} +/* }}} */ +#endif //#if MagickLibVersion >= 0x675 + + + +#if MagickLibVersion >= 0x675 +/* {{{ proto bool ImagickDraw::setBorderColor(ImagickPixel color) + Sets the border color to be used for drawing bordered objects. +*/ +PHP_METHOD(ImagickDraw, setBorderColor) +{ + zval *param; + php_imagickdraw_object *internd; + PixelWand *color_wand; + zend_bool allocated; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", ¶m) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + + color_wand = php_imagick_zval_to_pixelwand(param, IMAGICKDRAW_CLASS, &allocated TSRMLS_CC); + if (!color_wand) + RETURN_FALSE; + + DrawSetBorderColor(internd->drawing_wand, color_wand); + if (allocated) + color_wand = DestroyPixelWand (color_wand); + + RETURN_TRUE; +} +/* }}} */ +#endif //#if MagickLibVersion >= 0x675 + +#if MagickLibVersion >= 0x692 +/* {{{ proto integer ImagickDraw::getTextDirection() + Returns the direction that will be used when annotating with text. +*/ +PHP_METHOD(ImagickDraw, getTextDirection) +{ + php_imagickdraw_object *internd; + im_long direction; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + direction = DrawGetTextDirection(internd->drawing_wand); + + RETURN_LONG(direction); +} + +/* }}} */ + + +/* {{{ proto bool ImagickDraw::setTextDirection(int direction) + Sets the font style to use when annotating with text. The AnyStyle enumeration acts as a wild-card "don't care" option. +*/ +PHP_METHOD(ImagickDraw, setTextDirection) +{ + php_imagickdraw_object *internd; + im_long direction; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &direction) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + + DrawSetTextDirection(internd->drawing_wand, direction); + RETURN_TRUE; +} +/* }}} */ +#endif //#if MagickLibVersion >= 0x692 + +#if MagickLibVersion >= 0x692 +/* {{{ proto bool ImagickDraw::setDensity(string density_string) + Sets the vertical and horizontal resolution. +*/ +PHP_METHOD(ImagickDraw, setDensity) +{ + php_imagickdraw_object *internd; + char *density; + IM_LEN_TYPE density_len; + MagickBooleanType status; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &density, &density_len) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + status = DrawSetDensity(internd->drawing_wand, density); + + if (status == MagickFalse) { + php_imagick_convert_imagickdraw_exception (internd->drawing_wand, "Unable to setdensity for ImagickDraw object" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + + +/* {{{ proto string|null ImagickDraw::getDensity() + Obtains the vertical and horizontal resolution. +*/ +PHP_METHOD(ImagickDraw, getDensity) +{ + php_imagickdraw_object *internd; + char *density; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + density = DrawGetDensity(internd->drawing_wand); + + if (density == NULL) { + RETURN_NULL(); + } + else { + IM_RETURN_STRING(density); + } +} +/* }}} */ +#endif// #if MagickLibVersion >= 0x692 + + +/* END OF DRAWINGWAND METHODS */
View file
imagick-3.8.0.tgz/imagick-3.8.0/imagickkernel_class.c
Added
@@ -0,0 +1,856 @@ +/* + +----------------------------------------------------------------------+ + | PHP Version 5 / Imagick | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Dan Ackroyd <danack@php.net> | + +----------------------------------------------------------------------+ +*/ + +#include "php_imagick.h" +#include "php_imagick_defs.h" +#include "php_imagick_macros.h" +#include "php_imagick_helpers.h" + +#ifdef IMAGICK_WITH_KERNEL + +#if MagickLibVersion < 0x691 +// These function defines are required currently as the functions are +// currently not available in the public ImageMagick header files +// This is being fixed for the next version of ImageMagick. +Image + *MorphologyApply(const Image *,const ChannelType,const MorphologyMethod, + const ssize_t,const KernelInfo *,const CompositeOperator,const double, + ExceptionInfo *); + +void + ScaleKernelInfo(KernelInfo *,const double,const GeometryFlags), + UnityAddKernelInfo(KernelInfo *,const double), + ZeroKernelNans(KernelInfo *); +#endif + + +static void php_imagickkernelvalues_to_zval(zval *zv, KernelInfo *kernel_info) { + int count; + double value; + unsigned int x, y; +#if PHP_VERSION_ID >= 70000 + zval row; +#else + zval *row; +#endif + + zval *p_row; + + count = 0; + + for (y=0; y<kernel_info->height ; y++) { +#if PHP_VERSION_ID >= 70000 + p_row = &row; +#else + MAKE_STD_ZVAL(row); + p_row = row; +#endif + + array_init(p_row); + for (x=0; x<kernel_info->width ; x++) { + value = kernel_info->valuescount; + count++; + + //nan is not equal to itself + if (value != value) { + //this will be broken by some compilers - need to investigate more... + add_next_index_bool(p_row, 0); + } + else { + add_next_index_double(p_row, value); + } + } + + add_next_index_zval(zv, p_row); + } +} + + +#if PHP_VERSION_ID >= 80000 +HashTable* php_imagickkernel_get_debug_info(zend_object *obj, int *is_temp TSRMLS_DC) /* {{{ */ +#else +HashTable* php_imagickkernel_get_debug_info(zval *obj, int *is_temp TSRMLS_DC) /* {{{ */ +#endif +{ + php_imagickkernel_object *internp; + HashTable *debug_info; + KernelInfo *kernel_info; +#if PHP_VERSION_ID >= 70000 + zval matrix; +#else + zval *matrix; +#endif + + *is_temp = 1; //var_dump will destroy the hashtable + +#if PHP_VERSION_ID >= 80000 + internp = php_imagickkernel_fetch_object(obj); +#else + internp = Z_IMAGICKKERNEL_P(obj); +#endif + kernel_info = internp->kernel_info; + + ALLOC_HASHTABLE(debug_info); + ZEND_INIT_SYMTABLE_EX(debug_info, 1, 0); + + while (kernel_info != NULL) { +#if PHP_VERSION_ID >= 70000 + array_init(&matrix); + php_imagickkernelvalues_to_zval(&matrix, kernel_info); + zend_hash_next_index_insert(debug_info, &matrix); +#else + MAKE_STD_ZVAL(matrix); + array_init(matrix); + php_imagickkernelvalues_to_zval(matrix, kernel_info); + zend_hash_next_index_insert(debug_info, &matrix, sizeof(zval *), NULL); +#endif + kernel_info = kernel_info->next; + } + + return debug_info; +} + + +static void im_CalcKernelMetaData(KernelInfo *kernel) { + size_t i; + + kernel->minimum = kernel->maximum = 0.0; + kernel->negative_range = kernel->positive_range = 0.0; + + for (i=0; i < (kernel->width*kernel->height); i++) { + if (fabs(kernel->valuesi) < MagickEpsilon) { + kernel->valuesi = 0.0; + } + if (kernel->valuesi < 0) { + kernel->negative_range += kernel->valuesi; + } + else { + kernel->positive_range += kernel->valuesi; + } + if (kernel->valuesi < kernel->minimum) { + kernel->minimum = kernel->valuesi; + } + + if (kernel->valuesi > kernel->maximum) { + kernel->maximum = kernel->valuesi; + } + } +} + + +#if MagickLibVersion > 0x661 +static KernelInfo *imagick_createKernel(KernelValueType *values, size_t width, size_t height, size_t origin_x, size_t origin_y) +{ + KernelInfo *kernel_info; + +#if MagickLibVersion >= 0x700 + unsigned int i; + ExceptionInfo *_exception_info = (ExceptionInfo *) NULL; + //TODO - inspect exception info + kernel_info=AcquireKernelInfo(NULL, _exception_info); +#else + kernel_info=AcquireKernelInfo(NULL); +#endif + if (kernel_info == (KernelInfo *) NULL) { + return NULL; + } + + kernel_info->width = width; + kernel_info->height = height; + + kernel_info->x = origin_x; + kernel_info->y = origin_y; + + //Need to free old values? + if (kernel_info->values != NULL) { + RelinquishAlignedMemory(kernel_info->values); + } + +#if MagickLibVersion >= 0x700 + kernel_info->values = (MagickRealType *)AcquireAlignedMemory(width*height, sizeof(MagickRealType)); + + for (i=0; i<width*height;i++) { + kernel_info->valuesi = (MagickRealType)valuesi; + } + // The values are not going to be used so free them + RelinquishAlignedMemory(values); + +#else + // For IM 6, the values get used + kernel_info->values = values; +#endif + + im_CalcKernelMetaData(kernel_info); + + return kernel_info; +} +#endif + +static void createKernelZval(zval *pzval, KernelInfo *kernel_info TSRMLS_DC) { + php_imagickkernel_object *intern_return; + + object_init_ex(pzval, php_imagickkernel_sc_entry); + intern_return = Z_IMAGICKKERNEL_P(pzval); + intern_return->kernel_info = kernel_info; +} + + +/* {{{ proto ImagickKernel ImagickKernel::__construct() + The ImagickKernel constructor +*/ +PHP_METHOD(ImagickKernel, __construct) +{ + // This suppresses an 'unused parameter' warning. + (void)return_value; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + // this method is private. +} +/* }}} */ + +#define MATRIX_ERROR_EMPTY "Cannot create kernel, matrix is empty." +#define MATRIX_ERROR_UNEVEN "Values must be matrix, with the same number of columns in each row." +#define MATRIX_ERROR_BAD_VALUE "Only numbers or false are valid values in a kernel matrix." +#define MATRIX_ORIGIN_REQUIRED "For kernels with even numbered rows or columns, the origin position must be specified." + +/* {{{ proto ImagickKernel ImagickKernel::fromMatrix(array matrix, array origin) + Create a kernel from an 2d matrix of values. Each value should either be a float + (if the element should be used) or 'false' if the element should be skipped. For + matrixes that are odd sizes in both dimensions the the origin pixel will default + to the centre of the kernel. For all other kernel sizes the origin pixel must be specified. +*/ +#if PHP_VERSION_ID >= 70000 +PHP_METHOD(ImagickKernel, fromMatrix) +{ + zval *kernel_array; + zval *origin_array; + HashTable *inner_array; + KernelInfo *kernel_info; + unsigned long num_rows, num_columns = 0; + unsigned int previous_num_columns = (unsigned int)-1; + unsigned int row, column; + + zval *pzval_outer; + zval *pzval_inner; + + int count = 0; + size_t origin_x, origin_y; + zval *tmp; + + KernelValueType *values = NULL; + double notanumber = sqrt((double)-1.0); /* Special Value : Not A Number */ + + count = 0; + row = 0; + origin_array = NULL; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|a!", &kernel_array, &origin_array) == FAILURE) { + RETURN_THROWS(); + } + + num_rows = zend_hash_num_elements(Z_ARRVAL_P(kernel_array)); + + if (num_rows == 0) { + //error - array has zero elements. + php_imagick_throw_exception(IMAGICKKERNEL_CLASS, MATRIX_ERROR_EMPTY TSRMLS_CC); + RETURN_THROWS(); + } + + + for (row=0 ; row<num_rows ; row++) { + pzval_outer = zend_hash_index_find(Z_ARRVAL_P(kernel_array), row); + if (pzval_outer == NULL) { + php_imagick_throw_exception(IMAGICKKERNEL_CLASS, MATRIX_ERROR_UNEVEN TSRMLS_CC); + goto cleanup; + } + ZVAL_DEREF(pzval_outer); + + column = 0; + + if (Z_TYPE_P(pzval_outer) == IS_ARRAY ) { + inner_array = Z_ARRVAL_P(pzval_outer); + num_columns = zend_hash_num_elements(inner_array); + + if (num_columns == 0) { + php_imagick_throw_exception(IMAGICKKERNEL_CLASS, MATRIX_ERROR_EMPTY TSRMLS_CC); + goto cleanup; + } + + if (values == NULL) { + values = (KernelValueType *)AcquireAlignedMemory(num_columns, num_rows*sizeof(KernelValueType)); + } + + if (previous_num_columns != ((unsigned int)-1)) { + if (previous_num_columns != num_columns) { + php_imagick_throw_exception(IMAGICKKERNEL_CLASS, MATRIX_ERROR_UNEVEN TSRMLS_CC); + goto cleanup; + } + } + + previous_num_columns = num_columns; + + for (column=0; column<num_columns ; column++) { + pzval_inner = zend_hash_index_find(inner_array, column); + if (pzval_inner == NULL) { + php_imagick_throw_exception(IMAGICKKERNEL_CLASS, MATRIX_ERROR_UNEVEN TSRMLS_CC); + goto cleanup; + } + + ZVAL_DEREF(pzval_inner); + if (Z_TYPE_P(pzval_inner) == IS_DOUBLE) { + //It's a float lets use it. + valuescount = Z_DVAL_P(pzval_inner); + } + else if (Z_TYPE_P(pzval_inner) == IS_LONG) { + //It's a long lets use it. + valuescount = (float)Z_LVAL_P(pzval_inner); + } + else if (Z_TYPE_P(pzval_inner) == IS_FALSE) { + //It's false, use nan + valuescount = notanumber; + } + else { + php_imagick_throw_exception(IMAGICKKERNEL_CLASS, MATRIX_ERROR_BAD_VALUE TSRMLS_CC); + goto cleanup; + } + count++; + } + } + else { + php_imagick_throw_exception(IMAGICKKERNEL_CLASS, MATRIX_ERROR_UNEVEN TSRMLS_CC); + goto cleanup; + } + } + + if (origin_array == NULL) { + if (((num_columns%2) == 0) || ((num_rows%2) == 0)) { + php_imagick_throw_exception(IMAGICKKERNEL_CLASS, MATRIX_ORIGIN_REQUIRED TSRMLS_CC); + goto cleanup; + } + origin_x = (num_columns - 1) >> 1; + origin_y = (num_rows - 1) >> 1; + } + else { + HashTable *origin_array_ht; + origin_array_ht = Z_ARRVAL_P(origin_array); + + // parse the origin_x + tmp = zend_hash_index_find(origin_array_ht, 0); + if (tmp != NULL) { + ZVAL_DEREF(tmp); + origin_x = Z_LVAL_P(tmp); + } + else { + php_imagick_throw_exception(IMAGICKKERNEL_CLASS, MATRIX_ORIGIN_REQUIRED TSRMLS_CC); + goto cleanup; + } + // origin_x is unsigned, so checking for > num_columns, also + // checks for < 0 + if (origin_x>=num_columns) { + zend_throw_exception_ex( + php_imagickkernel_exception_class_entry, + 5 TSRMLS_CC, + "origin_x for matrix is outside bounds of columns: %zu", + origin_x + ); + goto cleanup; + } + + // parse the origin_y + tmp = zend_hash_index_find(origin_array_ht, 1); + if (tmp != NULL) { + ZVAL_DEREF(tmp); + origin_y = Z_LVAL_P(tmp); + } + else { + php_imagick_throw_exception(IMAGICKKERNEL_CLASS, MATRIX_ORIGIN_REQUIRED TSRMLS_CC); + goto cleanup; + } + // origin_y is unsigned, so checking for > num_rows, also + // checks for < 0 + if (origin_y>=num_rows) { + zend_throw_exception_ex( + php_imagickkernel_exception_class_entry, + 5 TSRMLS_CC, + "origin_y for matrix is outside bounds of rows: %zu", + origin_x + ); + goto cleanup; + } + } + + kernel_info = imagick_createKernel(values, num_columns, num_rows, origin_x, origin_y); + createKernelZval(return_value, kernel_info TSRMLS_CC); + + // values are freed / used by imagick_createKernel so do not try to free them + return; + +cleanup: + if (values != NULL) { + RelinquishAlignedMemory(values); + } +} + +#else // PHP 5 + + +PHP_METHOD(ImagickKernel, fromMatrix) +{ + zval *kernel_array; + zval *origin_array; + HashTable *inner_array; + KernelInfo *kernel_info; + unsigned long num_rows, num_columns = 0; + unsigned int previous_num_columns = (unsigned int)-1; + unsigned int row, column; + + HashTable *origin_array_ht; + zval **ppzval_outer; + zval **ppzval_inner; + + int count = 0; + size_t origin_x, origin_y; + zval **tmp; + + KernelValueType *values = NULL; + double notanumber = sqrt((double)-1.0); /* Special Value : Not A Number */ + + previous_num_columns = -1; + count = 0; + row = 0; + origin_array = NULL; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|a!", &kernel_array, &origin_array) == FAILURE) { + RETURN_THROWS(); + } + + num_rows = zend_hash_num_elements(Z_ARRVAL_P(kernel_array)); + + if (num_rows == 0) { + //error - array has zero elements. + php_imagick_throw_exception(IMAGICKKERNEL_CLASS, MATRIX_ERROR_EMPTY TSRMLS_CC); + RETURN_THROWS(); + } + + for (row=0 ; row<num_rows ; row++) { + if (zend_hash_index_find(Z_ARRVAL_P(kernel_array), row, (void **) &ppzval_outer) != SUCCESS) { + php_imagick_throw_exception(IMAGICKKERNEL_CLASS, MATRIX_ERROR_UNEVEN TSRMLS_CC); + goto cleanup; + } + + column = 0; + + if (Z_TYPE_PP(ppzval_outer) == IS_ARRAY ) { + //parse this row + inner_array = Z_ARRVAL_PP(ppzval_outer); + num_columns = zend_hash_num_elements(inner_array); + + if (num_columns == 0) { + php_imagick_throw_exception(IMAGICKKERNEL_CLASS, MATRIX_ERROR_EMPTY TSRMLS_CC); + goto cleanup; + } + + if (values == NULL) { + values = (KernelValueType *)AcquireAlignedMemory(num_columns, num_rows*sizeof(KernelValueType)); + } + + if (previous_num_columns != ((unsigned int)-1)) { + if (previous_num_columns != num_columns) { + php_imagick_throw_exception(IMAGICKKERNEL_CLASS, MATRIX_ERROR_UNEVEN TSRMLS_CC); + goto cleanup; + } + } + + previous_num_columns = num_columns; + + for (column=0; column<num_columns ; column++) { + if (zend_hash_index_find(inner_array, column, (void **) &ppzval_inner) != SUCCESS) { + php_imagick_throw_exception(IMAGICKKERNEL_CLASS, MATRIX_ERROR_UNEVEN TSRMLS_CC); + goto cleanup; + } + + if (Z_TYPE_PP(ppzval_inner) == IS_DOUBLE) { + //It's a float lets use it. + valuescount = Z_DVAL_PP(ppzval_inner); + } + else if (Z_TYPE_PP(ppzval_inner) == IS_LONG) { + //It's a long lets use it. + valuescount = (float)Z_LVAL_PP(ppzval_inner); + } + else if (Z_TYPE_PP(ppzval_inner) == IS_BOOL && Z_BVAL_PP(ppzval_inner) == 0) { + //It's false, use nan + valuescount = notanumber; + } + else { + php_imagick_throw_exception(IMAGICKKERNEL_CLASS, MATRIX_ERROR_BAD_VALUE TSRMLS_CC); + goto cleanup; + } + count++; + } + } + else { + php_imagick_throw_exception(IMAGICKKERNEL_CLASS, MATRIX_ERROR_UNEVEN TSRMLS_CC); + goto cleanup; + } + } + + if (origin_array == NULL) { + if (((num_columns%2) == 0) || ((num_rows%2) == 0)) { + php_imagick_throw_exception(IMAGICKKERNEL_CLASS, MATRIX_ORIGIN_REQUIRED TSRMLS_CC); + goto cleanup; + } + origin_x = (num_columns - 1) >> 1; + origin_y = (num_rows - 1) >> 1; + } + else { + origin_array_ht = Z_ARRVAL_P(origin_array); + + // parse and check the origin_x + if (zend_hash_index_find(origin_array_ht, 0, (void**)&tmp) == SUCCESS) { + origin_x = Z_LVAL_PP(tmp); + } + else { + php_imagick_throw_exception(IMAGICKKERNEL_CLASS, MATRIX_ORIGIN_REQUIRED TSRMLS_CC); + goto cleanup; + } + + // origin_x is unsigned, so checking for > num_columns, also + // checks for < 0 + if (origin_x>=num_columns) { + zend_throw_exception_ex( + php_imagickkernel_exception_class_entry, + 5 TSRMLS_CC, + "origin_x for matrix is outside bounds of columns: %d", + origin_x + ); + goto cleanup; + } + + // parse and check the origin_y + if (zend_hash_index_find(origin_array_ht, 1, (void**)&tmp) == SUCCESS) { + origin_y = Z_LVAL_PP(tmp); + } + else { + php_imagick_throw_exception(IMAGICKKERNEL_CLASS, MATRIX_ORIGIN_REQUIRED TSRMLS_CC); + goto cleanup; + } + + // origin_y is unsigned, so checking for > num_rows, also + // checks for < 0 + if (origin_y>=num_rows) { + zend_throw_exception_ex( + php_imagickkernel_exception_class_entry, + 5 TSRMLS_CC, + "origin_y for matrix is outside bounds of rows: %d", + origin_y + ); + goto cleanup; + } + } + + kernel_info = imagick_createKernel(values, num_columns, num_rows, origin_x, origin_y); + createKernelZval(return_value, kernel_info TSRMLS_CC); + + return; + +cleanup: + if (values != NULL) { + RelinquishAlignedMemory(values); + } +} +#endif //end of zend_engine_3 +/* }}} */ + +static void imagick_fiddle_with_geometry_info(ssize_t type, GeometryFlags flags, GeometryInfo *geometry_info) { + + /* special handling of missing values in input string */ + switch( type ) { + /* Shape Kernel Defaults */ + case UnityKernel: { + if ((flags & WidthValue) == 0) + geometry_info->rho = 1.0; /* Default scale = 1.0, zero is valid */ + break; + } + case SquareKernel: + case DiamondKernel: + case OctagonKernel: + case DiskKernel: + case PlusKernel: + case CrossKernel: { + if ( (flags & HeightValue) == 0 ) { + geometry_info->sigma = 1.0; /* Default scale = 1.0, zero is valid */ + } + break; + } + case RingKernel: { + if ((flags & XValue) == 0) { + geometry_info->xi = 1.0; /* Default scale = 1.0, zero is valid */ + } + break; + } + case RectangleKernel: { /* Rectangle - set size defaults */ + if ((flags & WidthValue) == 0) { /* if no width then */ + geometry_info->rho = geometry_info->sigma; /* then width = height */ + } + if (geometry_info->rho < 1.0) { /* if width too small */ + geometry_info->rho = 3; /* then width = 3 */ + } + if (geometry_info->sigma < 1.0) { /* if height too small */ + geometry_info->sigma = geometry_info->rho; /* then height = width */ + } + if ((flags & XValue) == 0) { /* center offset if not defined */ + geometry_info->xi = (double)(((ssize_t)geometry_info->rho-1)/2); + } + if ((flags & YValue) == 0) { + geometry_info->psi = (double)(((ssize_t)geometry_info->sigma-1)/2); + } + break; + } + /* Distance Kernel Defaults */ + case ChebyshevKernel: + case ManhattanKernel: + case OctagonalKernel: + case EuclideanKernel: { + if ((flags & HeightValue) == 0) { /* no distance scale */ + geometry_info->sigma = 100.0; /* default distance scaling */ + } + else if ((flags & AspectValue ) != 0) { /* '!' flag */ + geometry_info->sigma = QuantumRange/(geometry_info->sigma+1); /* maximum pixel distance */ + } + else if ((flags & PercentValue ) != 0) { /* '%' flag */ + geometry_info->sigma *= QuantumRange/100.0; /* percentage of color range */ + } + break; + } + default: { + break; + } + } +} + +/* {{{ proto ImagickKernel ImagickKernel::fromBuiltin(type, string) + Create a kernel from a builtin in kernel. See http://www.imagemagick.org/Usage/morphology/#kernel for examples. Currently the 'rotation' symbols are not supported. Example: + $diamondKernel = ImagickKernel::fromBuiltIn(\Imagick::KERNEL_DIAMOND, "2"); +*/ +PHP_METHOD(ImagickKernel, fromBuiltin) +{ + im_long kernel_type; + GeometryInfo geometry_info = { + 0, //rho, + 0, //sigma, + 0, //xi, + 0, //psi, + 0, //chi; + }; + KernelInfo *kernel_info; + char *string; + IM_LEN_TYPE string_len; + GeometryFlags flags; +#if MagickLibVersion >= 0x700 + ExceptionInfo *_exception_info = NULL; +#endif + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &kernel_type, &string, &string_len) == FAILURE) { + RETURN_THROWS(); + } + + flags = ParseGeometry(string, &geometry_info); + imagick_fiddle_with_geometry_info(kernel_type, flags, &geometry_info); + +#if MagickLibVersion >= 0x700 + //TODO - inspect exception info + kernel_info = AcquireKernelBuiltIn(kernel_type, &geometry_info, _exception_info); +#else + kernel_info = AcquireKernelBuiltIn(kernel_type, &geometry_info); +#endif + createKernelZval(return_value, kernel_info TSRMLS_CC); +} + +/* }}} */ + + +/* {{{ proto void ImagickKernel::addKernel(ImagickKernel kernel) + Attach another kernel to this kernel to allow them to both be applied in a single morphology or filter function. Returns the new combined kernel. +*/ +PHP_METHOD(ImagickKernel, addKernel) +{ + zval *objvar; + KernelInfo *kernel_info_add_clone; + + KernelInfo *kernel_info; + KernelInfo *kernel_info_target; + + php_imagickkernel_object *kernel; + php_imagickkernel_object *internp; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &objvar, php_imagickkernel_sc_entry) == FAILURE) { + RETURN_THROWS(); + } + + kernel = Z_IMAGICKKERNEL_P(objvar); + internp = Z_IMAGICKKERNEL_P(getThis()); + + if (kernel->kernel_info == NULL) { + zend_throw_exception(php_imagickkernel_exception_class_entry, "ImagickKernel is empty, cannot be used", (long)0 TSRMLS_CC); + RETURN_NULL(); + } + + kernel_info = internp->kernel_info; + do { + kernel_info_target = kernel_info; + kernel_info = kernel_info->next; + } while (kernel_info != NULL); + + kernel_info_add_clone = CloneKernelInfo(kernel->kernel_info); + kernel_info_target->next = kernel_info_add_clone; +} +/* }}} */ + + +/* {{{ proto ImagickKernel ImagickKernel::separate(void) + Separates a linked set of kernels and returns an array of ImagickKernels. +*/ +PHP_METHOD(ImagickKernel, separate) +{ + php_imagickkernel_object *internp; + KernelInfo *kernel_info; + KernelInfo *kernel_info_copy; + int number_values; + KernelValueType * values_copy; + +#if PHP_VERSION_ID >= 70000 + zval separate_object; +#else + zval *separate_object; +#endif + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internp = Z_IMAGICKKERNEL_P(getThis()); + IMAGICK_KERNEL_NOT_NULL_EMPTY(internp); + kernel_info = internp->kernel_info; + + array_init(return_value); + + while (kernel_info != NULL) { + number_values = kernel_info->width * kernel_info->height; + // The values are created because they can by used by imagick_createKernel which takes their ownership + values_copy = (KernelValueType *)AcquireAlignedMemory(kernel_info->width, kernel_info->height*sizeof(KernelValueType)); + memcpy(values_copy, kernel_info->values, number_values * sizeof(KernelValueType)); + + kernel_info_copy = imagick_createKernel( + values_copy, + kernel_info->width, + kernel_info->height, + kernel_info->x, + kernel_info->y + ); + +#if PHP_VERSION_ID >= 70000 + createKernelZval(&separate_object, kernel_info_copy TSRMLS_CC); + add_next_index_zval(return_value, &separate_object); +#else + MAKE_STD_ZVAL(separate_object); + createKernelZval(separate_object, kernel_info_copy TSRMLS_CC); + add_next_index_zval(return_value, separate_object); +#endif + kernel_info = kernel_info->next; + } +} +/* }}} */ + + +/* {{{ proto ImagickKernel::getMatrix(void) + Get the 2d matrix of values used in this kernel. The elements are either + float for elements that are used or 'false' if the element should be skipped. +*/ +PHP_METHOD(ImagickKernel, getMatrix) +{ + php_imagickkernel_object *internp; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internp = Z_IMAGICKKERNEL_P(getThis()); + IMAGICK_KERNEL_NOT_NULL_EMPTY(internp); + + array_init(return_value); + php_imagickkernelvalues_to_zval(return_value, internp->kernel_info); +} +/* }}} */ + + + + + +/* {{{ proto ImagickKernel::scale(float scaling_factor, int NORMALIZE_KERNEL_FLAG) + ScaleKernelInfo() scales the given kernel list by the given amount, with or without + normalization of the sum of the kernel values (as per given flags). + + The exact behaviour of this function depends on the normalization type being used + please see http://www.imagemagick.org/api/morphology.php#ScaleKernelInfo for details. + + Flag should be one of NORMALIZE_KERNEL_VALUE, NORMALIZE_KERNEL_CORRELATE, + NORMALIZE_KERNEL_PERCENT or not set. +*/ +PHP_METHOD(ImagickKernel, scale) +{ + php_imagickkernel_object *internp; + double scale; + im_long normalize_flag = 0; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d|l", &scale, &normalize_flag) == FAILURE) { + RETURN_THROWS(); + } + (void)return_value; + + internp = Z_IMAGICKKERNEL_P(getThis()); + IMAGICK_KERNEL_NOT_NULL_EMPTY(internp); + ScaleKernelInfo(internp->kernel_info, scale, normalize_flag); +} +/* }}} */ + + + + +/* {{{ proto ImagickKernel::addUnityKernel(float scale) + Adds a given amount of the 'Unity' Convolution Kernel to the given pre-scaled + and normalized Kernel. This in effect adds that amount of the original image + into the resulting convolution kernel. The resulting effect is to convert the + defined kernels into blended soft-blurs, unsharp kernels or into sharpening kernels. +*/ +PHP_METHOD(ImagickKernel, addUnityKernel) +{ + php_imagickkernel_object *internp; + double scale; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &scale) == FAILURE) { + RETURN_THROWS(); + } + (void)return_value; + + internp = Z_IMAGICKKERNEL_P(getThis()); + IMAGICK_KERNEL_NOT_NULL_EMPTY(internp); + UnityAddKernelInfo(internp->kernel_info, scale); +} +/* }}} */ + +#endif
View file
imagick-3.8.0.tgz/imagick-3.8.0/imagickpixel_class.c
Added
@@ -0,0 +1,798 @@ +/* + +----------------------------------------------------------------------+ + | PHP Version 5 / Imagick | + +----------------------------------------------------------------------+ + | Copyright (c) 2006-2013 Mikko Koppanen, Scott MacVicar | + | ImageMagick (c) ImageMagick Studio LLC | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Mikko Kopppanen <mkoppanen@php.net> | + | Scott MacVicar <scottmac@php.net> | + +----------------------------------------------------------------------+ +*/ + +#include "php_imagick.h" +#include "php_imagick_defs.h" +#include "php_imagick_macros.h" +#include "php_imagick_helpers.h" + +#if MagickLibVersion > 0x628 +/* {{{ proto array ImagickPixel::getHSL() + Returns the normalized HSL color of the pixel wand in an array with the keys "hue", "saturation", and "luminosity". +*/ +PHP_METHOD(ImagickPixel, getHSL) +{ + php_imagickpixel_object *internp; + double hue, saturation, luminosity; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internp = Z_IMAGICKPIXEL_P(getThis()); + IMAGICK_PIXEL_NOT_EMPTY(internp); + + PixelGetHSL(internp->pixel_wand, &hue, &saturation, &luminosity); + + array_init(return_value); + add_assoc_double(return_value, "hue", hue); + add_assoc_double(return_value, "saturation", saturation); + add_assoc_double(return_value, "luminosity", luminosity); +} +/* }}} */ + +/* {{{ proto bool ImagickPixel::setHSL(float hue, float saturation, float luminosity) + Sets the normalized HSL color of the pixel wand. +*/ +PHP_METHOD(ImagickPixel, setHSL) +{ + php_imagickpixel_object *internp; + double hue, saturation, luminosity; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddd", &hue, &saturation, &luminosity) == FAILURE) { + RETURN_THROWS(); + } + + internp = Z_IMAGICKPIXEL_P(getThis()); + IMAGICK_PIXEL_NOT_EMPTY(internp); + + PixelSetHSL(internp->pixel_wand, hue, saturation, luminosity); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto Quantum ImagickPixel::getColorValueQuantum(int color) + Gets the quantum value of a color in the ImagickPixel. Quantum is a float if ImageMagick was compiled with HDRI + otherwise an integer. +*/ +PHP_METHOD(ImagickPixel, getColorValueQuantum) +{ + php_imagickpixel_object *internp; + im_long color; + Quantum color_value; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &color) == FAILURE) { + RETURN_THROWS(); + } + + internp = Z_IMAGICKPIXEL_P(getThis()); + IMAGICK_PIXEL_NOT_EMPTY(internp); + + switch (color) { + + case PHP_IMAGICK_COLOR_BLACK: + color_value = PixelGetBlackQuantum(internp->pixel_wand); + break; + + case PHP_IMAGICK_COLOR_BLUE: + color_value = PixelGetBlueQuantum(internp->pixel_wand); + break; + + case PHP_IMAGICK_COLOR_CYAN: + color_value = PixelGetCyanQuantum(internp->pixel_wand); + break; + + case PHP_IMAGICK_COLOR_GREEN: + color_value = PixelGetGreenQuantum(internp->pixel_wand); + break; + + case PHP_IMAGICK_COLOR_RED: + color_value = PixelGetRedQuantum(internp->pixel_wand); + break; + + case PHP_IMAGICK_COLOR_YELLOW: + color_value = PixelGetYellowQuantum(internp->pixel_wand); + break; + + case PHP_IMAGICK_COLOR_MAGENTA: + color_value = PixelGetMagentaQuantum(internp->pixel_wand); + break; + +#if MagickLibVersion < 0x700 + case PHP_IMAGICK_COLOR_OPACITY: + color_value = PixelGetOpacityQuantum(internp->pixel_wand); + break; +#endif + + case PHP_IMAGICK_COLOR_ALPHA: + color_value = PixelGetAlphaQuantum(internp->pixel_wand); + break; + + default: + php_imagick_throw_exception (IMAGICKPIXEL_CLASS, "Unknown color type" TSRMLS_CC); + RETURN_THROWS(); + break; + } + +#if MAGICKCORE_HDRI_ENABLE + RETVAL_DOUBLE(color_value); +#else + RETVAL_LONG(color_value); +#endif +} +/* }}} */ + +/* {{{ proto bool ImagickPixel::setColorValueQuantum(int color, float value) + Sets the quantum color of the ImagickPixel. +*/ +PHP_METHOD(ImagickPixel, setColorValueQuantum) +{ + php_imagickpixel_object *internp; + im_long color; + +#if MAGICKCORE_HDRI_ENABLE + double color_value; + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ld", &color, &color_value) == FAILURE) { + RETURN_THROWS(); + } +#else + im_long color_value; + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &color, &color_value) == FAILURE) { + RETURN_THROWS(); + } +#endif + + internp = Z_IMAGICKPIXEL_P(getThis()); + IMAGICK_PIXEL_NOT_EMPTY(internp); + + switch (color) { + + case PHP_IMAGICK_COLOR_BLACK: + PixelSetBlackQuantum(internp->pixel_wand, color_value); + break; + + case PHP_IMAGICK_COLOR_BLUE: + PixelSetBlueQuantum(internp->pixel_wand, color_value); + break; + + case PHP_IMAGICK_COLOR_CYAN: + PixelSetCyanQuantum(internp->pixel_wand, color_value); + break; + + case PHP_IMAGICK_COLOR_GREEN: + PixelSetGreenQuantum(internp->pixel_wand, color_value); + break; + + case PHP_IMAGICK_COLOR_RED: + PixelSetRedQuantum(internp->pixel_wand, color_value); + break; + + case PHP_IMAGICK_COLOR_YELLOW: + PixelSetYellowQuantum(internp->pixel_wand, color_value); + break; + + case PHP_IMAGICK_COLOR_MAGENTA: + PixelSetMagentaQuantum(internp->pixel_wand, color_value); + break; + +#if MagickLibVersion < 0x700 + case PHP_IMAGICK_COLOR_OPACITY: + PixelSetOpacityQuantum(internp->pixel_wand, color_value); + break; +#endif + + case PHP_IMAGICK_COLOR_ALPHA: + PixelSetAlphaQuantum(internp->pixel_wand, color_value); + break; + + default: + php_imagick_throw_exception (IMAGICKPIXEL_CLASS, "Unknown color type" TSRMLS_CC); + RETURN_THROWS(); + break; + } + RETVAL_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickPixel::getIndex() + Gets the colormap index of the pixel wand +*/ +PHP_METHOD(ImagickPixel, getIndex) +{ + php_imagickpixel_object *internp; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internp = Z_IMAGICKPIXEL_P(getThis()); + IMAGICK_PIXEL_NOT_EMPTY(internp); + + RETVAL_LONG(PixelGetIndex(internp->pixel_wand)); +} +/* }}} */ + +/* {{{ proto bool ImagickPixel::setIndex(int pixel_packet) + Sets the colormap index of the pixel wand +*/ +PHP_METHOD(ImagickPixel, setIndex) +{ + php_imagickpixel_object *internp; +#if MAGICKCORE_HDRI_ENABLE + double index; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &index) == FAILURE) { +#else + im_long index; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &index) == FAILURE) { +#endif + RETURN_THROWS(); + } + + internp = Z_IMAGICKPIXEL_P(getThis()); + IMAGICK_PIXEL_NOT_EMPTY(internp); + + PixelSetIndex(internp->pixel_wand, index); + RETURN_TRUE; +} +/* }}} */ +#endif + +/* {{{ proto ImagickPixel ImagickPixel::__construct(string color ) + The ImagickPixel constructor +*/ +PHP_METHOD(ImagickPixel, __construct) +{ + php_imagickpixel_object *internp; + char *color_name = NULL; + IM_LEN_TYPE color_name_len = 0; + + // This suppresses an 'unused parameter' warning. + (void)return_value; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &color_name, &color_name_len) == FAILURE) { + RETURN_THROWS(); + } + + internp = Z_IMAGICKPIXEL_P(getThis()); + + if (internp->pixel_wand != NULL) { + DestroyPixelWand(internp->pixel_wand); + } + + internp->pixel_wand = NewPixelWand(); + + if (!internp->pixel_wand) { + php_imagick_throw_exception (IMAGICKPIXEL_CLASS, "Failed to allocate PixelWand structure" TSRMLS_CC); + RETURN_THROWS(); + } + + /* If color was given as parameter, set it here.*/ + if (color_name && color_name_len) { + if (PixelSetColor(internp->pixel_wand, color_name) == MagickFalse) { + php_imagick_throw_exception (IMAGICKPIXEL_CLASS, "Unable to construct ImagickPixel" TSRMLS_CC); + RETURN_THROWS(); + } + } +} +/* }}} */ + +/* {{{ proto bool ImagickPixel::setColor(string color) + Sets the color of the pixel wand with a string (e.g. "blue", "#0000ff", "rgb(0,0,255)", "cmyk(100,100,100,10)", etc.). +*/ +PHP_METHOD(ImagickPixel, setColor) +{ + char *color_name; + IM_LEN_TYPE color_name_len; + + php_imagickpixel_object *internp; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &color_name, &color_name_len) == FAILURE) { + RETURN_THROWS(); + } + + internp = Z_IMAGICKPIXEL_P(getThis()); + IMAGICK_PIXEL_NOT_EMPTY(internp); + + status = PixelSetColor(internp->pixel_wand, color_name); + + if (status == MagickFalse) { + php_imagick_convert_imagickpixel_exception (internp->pixel_wand, "Unable to set ImagickPixel color" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickPixel::clear() + Clears resources associated with the wand. +*/ +PHP_METHOD(ImagickPixel, clear) +{ + php_imagickpixel_object *internp; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internp = Z_IMAGICKPIXEL_P(getThis()); + IMAGICK_PIXEL_NOT_EMPTY(internp); + + ClearPixelWand(internp->pixel_wand); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickPixel::isSimilar(float fuzz) + Returns true if the distance between two colors is less than the specified distance. +*/ +static +void s_is_pixelwand_similar(INTERNAL_FUNCTION_PARAMETERS, zend_bool use_quantum) +{ + zval *param; + double fuzz; + php_imagickpixel_object *internp; + MagickBooleanType status; + PixelWand *color_wand; + zend_bool allocated; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zd", ¶m, &fuzz) == FAILURE) { + RETURN_THROWS(); + } + + internp = Z_IMAGICKPIXEL_P(getThis()); + IMAGICK_PIXEL_NOT_EMPTY(internp); + + color_wand = php_imagick_zval_to_pixelwand (param, IMAGICKPIXEL_CLASS, &allocated TSRMLS_CC); + if (!color_wand) + return; + + status = IsPixelWandSimilar(internp->pixel_wand, color_wand, (use_quantum ? (QuantumRange * fuzz) : fuzz)); + if (allocated) + color_wand = DestroyPixelWand (color_wand); + + if (status == MagickFalse) { + RETURN_FALSE; + } + + RETURN_TRUE; +} + + +/* {{{ proto bool ImagickPixel::isPixelSimilarQuantum(ImagickPixel pixel, float fuzz) + Returns true if the distance between two colors is less than the specified distance. + The fuzz value should be in the range 0-QuantumRange. + The maximum value represents the longest possible distance in the colorspace. + e.g. from RGB(0, 0, 0) to RGB(255, 255, 255) for the RGB colorspace +*/ +PHP_METHOD(ImagickPixel, isPixelSimilarQuantum) +{ + s_is_pixelwand_similar (INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); +} +/* }}} */ + +/* {{{ proto bool ImagickPixel::isPixelSimilar(ImagickPixel pixel, float fuzz) + Returns true if the distance between two colors is less than the specified distance. + The fuzz value should be in the range 0-1. + The maximum value represents the longest possible distance in the colorspace. + e.g. from RGB(0, 0, 0) to RGB(255, 255, 255) for the RGB colorspace +*/ +PHP_METHOD(ImagickPixel, isPixelSimilar) +{ + s_is_pixelwand_similar (INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); +} +/* }}} */ + +/* {{{ proto float ImagickPixel::getColorValue(int color) + Gets the normalized value of a color in the ImagickPixel. +*/ +PHP_METHOD(ImagickPixel, getColorValue) +{ + php_imagick_color_t color_enum; + php_imagickpixel_object *internp; + im_long color; + double color_value = 0; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &color) == FAILURE) { + RETURN_THROWS(); + } + + internp = Z_IMAGICKPIXEL_P(getThis()); + IMAGICK_PIXEL_NOT_EMPTY(internp); + + if (color <= PHP_IMAGICK_COLOR_MIN || color >= PHP_IMAGICK_COLOR_MAX) { + php_imagick_throw_exception (IMAGICKPIXEL_CLASS, "Unknown color type" TSRMLS_CC); + RETURN_THROWS(); + } + + color_enum = color; + + switch (color_enum) { + + case PHP_IMAGICK_COLOR_BLACK: + color_value = PixelGetBlack(internp->pixel_wand); + break; + + case PHP_IMAGICK_COLOR_BLUE: + color_value = PixelGetBlue(internp->pixel_wand); + break; + + case PHP_IMAGICK_COLOR_CYAN: + color_value = PixelGetCyan(internp->pixel_wand); + break; + + case PHP_IMAGICK_COLOR_GREEN: + color_value = PixelGetGreen(internp->pixel_wand); + break; + + case PHP_IMAGICK_COLOR_RED: + color_value = PixelGetRed(internp->pixel_wand); + break; + + case PHP_IMAGICK_COLOR_YELLOW: + color_value = PixelGetYellow(internp->pixel_wand); + break; + + case PHP_IMAGICK_COLOR_MAGENTA: + color_value = PixelGetMagenta(internp->pixel_wand); + break; + +#if MagickLibVersion < 0x700 + case PHP_IMAGICK_COLOR_OPACITY: + color_value = PixelGetOpacity(internp->pixel_wand); + break; +#endif + + case PHP_IMAGICK_COLOR_ALPHA: + color_value = PixelGetAlpha(internp->pixel_wand); + break; + +#if MagickLibVersion > 0x628 + case PHP_IMAGICK_COLOR_FUZZ: + color_value = PixelGetFuzz(internp->pixel_wand); + break; +#endif + + default: + php_imagick_throw_exception (IMAGICKPIXEL_CLASS, "Unknown color type" TSRMLS_CC); + RETURN_THROWS(); + break; + } + RETVAL_DOUBLE(color_value); +} +/* }}} */ + +/* {{{ proto float ImagickPixel::setColorValue(int color, float value ) + Sets the normalized color of the ImagickPixel. +*/ +PHP_METHOD(ImagickPixel, setColorValue) +{ + php_imagick_color_t color_enum; + php_imagickpixel_object *internp; + im_long color; + double color_value; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ld", &color, &color_value) == FAILURE) { + RETURN_THROWS(); + } + + internp = Z_IMAGICKPIXEL_P(getThis()); + IMAGICK_PIXEL_NOT_EMPTY(internp); + + if (color <= PHP_IMAGICK_COLOR_MIN || color >= PHP_IMAGICK_COLOR_MAX) { + php_imagick_throw_exception (IMAGICKPIXEL_CLASS, "Unknown color type" TSRMLS_CC); + RETURN_THROWS(); + } + + color_enum = color; + + switch (color_enum) { + + case PHP_IMAGICK_COLOR_BLACK: + PixelSetBlack(internp->pixel_wand, color_value); + break; + + case PHP_IMAGICK_COLOR_BLUE: + PixelSetBlue(internp->pixel_wand, color_value); + break; + + case PHP_IMAGICK_COLOR_CYAN: + PixelSetCyan(internp->pixel_wand, color_value); + break; + + case PHP_IMAGICK_COLOR_GREEN: + PixelSetGreen(internp->pixel_wand, color_value); + break; + + case PHP_IMAGICK_COLOR_RED: + PixelSetRed(internp->pixel_wand, color_value); + break; + + case PHP_IMAGICK_COLOR_YELLOW: + PixelSetYellow(internp->pixel_wand, color_value); + break; + + case PHP_IMAGICK_COLOR_MAGENTA: + PixelSetMagenta(internp->pixel_wand, color_value); + break; + +#if MagickLibVersion < 0x700 + case PHP_IMAGICK_COLOR_OPACITY: + PixelSetOpacity(internp->pixel_wand, color_value); + break; +#endif + + case PHP_IMAGICK_COLOR_ALPHA: + PixelSetAlpha(internp->pixel_wand, color_value); + break; + +#if MagickLibVersion > 0x628 + case PHP_IMAGICK_COLOR_FUZZ: + PixelSetFuzz(internp->pixel_wand, color_value); + break; +#endif + + default: + php_imagick_throw_exception (IMAGICKPIXEL_CLASS, "Unknown color type" TSRMLS_CC); + RETURN_THROWS(); + break; + } + RETVAL_TRUE; +} +/* }}} */ + +/* {{{ proto array ImagickPixel::getColor(int normalization) + Returns the color of the pixel in an array + normalization - 0 - values returned in the range 0,255 and will be ints, except + for legacy reasons alpha which is 0-1 + normalization - 1 - values returned in the range 0,1 and will be floats + normalization - 2 - values returned in the range 0,255 and will be ints including alpha + values i.e. float if ImageMagick was compiled with HDRI, or integers normally. +*/ +PHP_METHOD(ImagickPixel, getColor) +{ + php_imagickpixel_object *internp; + im_long normalization = 0; + double red, green, blue, alpha; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &normalization) == FAILURE) { + RETURN_THROWS(); + } + + internp = Z_IMAGICKPIXEL_P(getThis()); + IMAGICK_PIXEL_NOT_EMPTY(internp); + array_init(return_value); + + red = PixelGetRed(internp->pixel_wand); + green = PixelGetGreen(internp->pixel_wand); + blue = PixelGetBlue(internp->pixel_wand); + alpha = PixelGetAlpha(internp->pixel_wand); + + switch (normalization){ + //values returned in the range 0,255 and will be ints + case(0): { + //Leave like this for legacy code + //TODO fix the alpha not being normalised at next major/minor verysion + red *= 255; + green *= 255; + blue *= 255; + + //values are always >=0, so the rounding below may not be necessary + add_assoc_long(return_value, "r", (long) (red > 0.0 ? red + 0.5 : red - 0.5)); + add_assoc_long(return_value, "g", (long) (green > 0.0 ? green + 0.5 : green - 0.5)); + add_assoc_long(return_value, "b", (long) (blue > 0.0 ? blue + 0.5 : blue - 0.5)); + add_assoc_long(return_value, "a", alpha); + break; + } + + //values returned in the range 0,1 and will be floats + case(1): { + add_assoc_double(return_value, "r", red); + add_assoc_double(return_value, "g", green); + add_assoc_double(return_value, "b", blue); + add_assoc_double(return_value, "a", alpha); + break; + } + + case(2): { + red *= 255; + green *= 255; + blue *= 255; + alpha *= 255; + + //values are always >=0, so the rounding below may not be necessary + add_assoc_long(return_value, "r", (long) (red > 0.0 ? red + 0.5 : red - 0.5)); + add_assoc_long(return_value, "g", (long) (green > 0.0 ? green + 0.5 : green - 0.5)); + add_assoc_long(return_value, "b", (long) (blue > 0.0 ? blue + 0.5 : blue - 0.5)); + add_assoc_long(return_value, "a", (long) (alpha > 0.0 ? alpha + 0.5 : alpha - 0.5)); + break; + } + } +} +/* }}} */ + + +/* {{{ proto array ImagickPixel::getColorQuantum() + Returns the color of the pixel in an array as Quantum values. If ImageMagick was compiled + as HDRI these will be floats, otherwise they will be integers +*/ +PHP_METHOD(ImagickPixel, getColorQuantum) +{ + php_imagickpixel_object *internp; + Quantum red, green, blue, alpha; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internp = Z_IMAGICKPIXEL_P(getThis()); + IMAGICK_PIXEL_NOT_EMPTY(internp); + array_init(return_value); + + red = PixelGetRedQuantum(internp->pixel_wand); + green = PixelGetGreenQuantum(internp->pixel_wand); + blue = PixelGetBlueQuantum(internp->pixel_wand) ; + alpha = PixelGetAlphaQuantum(internp->pixel_wand); + + +#if MAGICKCORE_HDRI_ENABLE + add_assoc_double(return_value, "r", red); + add_assoc_double(return_value, "g", green); + add_assoc_double(return_value, "b", blue); + add_assoc_double(return_value, "a", alpha); +#else + add_assoc_long(return_value, "r", (long)red); + add_assoc_long(return_value, "g", (long)green); + add_assoc_long(return_value, "b", (long)blue); + add_assoc_long(return_value, "a", (long)alpha); +#endif +} +/* }}} */ + +/* {{{ proto array ImagickPixel::getColorAsString(void ) + Returns the color as a string +*/ +PHP_METHOD(ImagickPixel, getColorAsString) +{ + php_imagickpixel_object *internp; + char *color_string; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internp = Z_IMAGICKPIXEL_P(getThis()); + IMAGICK_PIXEL_NOT_EMPTY(internp); + + color_string = PixelGetColorAsString(internp->pixel_wand); + IM_ZVAL_STRING(return_value, color_string); + + IMAGICK_FREE_MAGICK_MEMORY(color_string); +} +/* }}} */ + +/* {{{ proto ImagickPixel ImagickPixel::clone(void) + Clones the ImagickPixel +*/ +PHP_METHOD(ImagickPixel, clone) +{ + php_imagickpixel_object *internp; + php_imagickpixel_object *intern_return; + PixelWand *pixel_wand; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + IMAGICK_METHOD_DEPRECATED("ImagickPixel", "clone"); + + internp = Z_IMAGICKPIXEL_P(getThis()); + + pixel_wand = php_imagick_clone_pixelwand (internp->pixel_wand); + if (!pixel_wand) { + php_imagick_throw_exception (IMAGICKPIXEL_CLASS, "Failed to allocate" TSRMLS_CC); + RETURN_THROWS(); + } + + object_init_ex(return_value, php_imagickpixel_sc_entry); + intern_return = Z_IMAGICKPIXEL_P(return_value); + + php_imagick_replace_pixelwand(intern_return, pixel_wand); +} +/* }}} */ + +/* {{{ proto int ImagickPixel::getColorCount() + Returns the color count associated with this color. +*/ +PHP_METHOD(ImagickPixel, getColorCount) +{ + php_imagickpixel_object *internp; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internp = Z_IMAGICKPIXEL_P(getThis()); + IMAGICK_PIXEL_NOT_EMPTY(internp); + + RETVAL_LONG(PixelGetColorCount(internp->pixel_wand)); +} +/* }}} */ + +/* {{{ proto int ImagickPixel::setColorCount(int colorCount) + Sets the color count associated with this color. +*/ +PHP_METHOD(ImagickPixel, setColorCount) +{ + php_imagickpixel_object *internp; + im_long color_count; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &color_count) == FAILURE) { + RETURN_THROWS(); + } + + internp = Z_IMAGICKPIXEL_P(getThis()); + IMAGICK_PIXEL_NOT_EMPTY(internp); + + PixelSetColorCount(internp->pixel_wand, color_count); + RETVAL_TRUE; +} +/* }}} */ + +#if MagickLibVersion >= 0x693 +/* {{{ proto bool ImagickPixel::setColorFromPixel(ImagickPixel $srcPixel) + Sets the color count associated with this color from another ImagickPixel object. +*/ +PHP_METHOD(ImagickPixel, setColorFromPixel) +{ + php_imagickpixel_object *internp, *src_pixel; + zval *objvar; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &objvar, php_imagickpixel_sc_entry) == FAILURE) { + RETURN_THROWS(); + } + + internp = Z_IMAGICKPIXEL_P(getThis()); + IMAGICK_PIXEL_NOT_EMPTY(internp); + src_pixel = Z_IMAGICKPIXEL_P(objvar); + IMAGICK_PIXEL_NOT_EMPTY(src_pixel); + + PixelSetColorFromWand(internp->pixel_wand, src_pixel->pixel_wand); + + RETVAL_TRUE; +} +/* }}} */ + +#endif //#if MagickLibVersion >= 0x693
View file
imagick-3.8.0.tgz/imagick-3.8.0/imagickpixeliterator_class.c
Added
@@ -0,0 +1,679 @@ +/* + +----------------------------------------------------------------------+ + | PHP Version 5 / Imagick | + +----------------------------------------------------------------------+ + | Copyright (c) 2006-2013 Mikko Koppanen, Scott MacVicar | + | ImageMagick (c) ImageMagick Studio LLC | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Mikko Kopppanen <mkoppanen@php.net> | + | Scott MacVicar <scottmac@php.net> | + +----------------------------------------------------------------------+ +*/ + +#include "php_imagick.h" +#include "php_imagick_defs.h" +#include "php_imagick_macros.h" +#include "php_imagick_helpers.h" + +#if MagickLibVersion <= 0x628 +static +long s_count_pixeliterator_rows(php_imagickpixeliterator_object *internpix) +{ + long rows = 0, tmp; + PixelWand **row; + PixelResetIterator(internpix->pixel_iterator); + + while ((row = PixelGetNextIteratorRow(internpix->pixel_iterator, &tmp)) != NULL) + rows++; + + return rows; +} +#endif + +void php_imagick_pixel_iterator_new (PixelIterator *pixel_it, zval *return_value TSRMLS_DC) +{ + php_imagickpixeliterator_object *internpix; + + object_init_ex(return_value, php_imagickpixeliterator_sc_entry); + internpix = Z_IMAGICKPIXELITERATOR_P(return_value); + + internpix->pixel_iterator = pixel_it; + internpix->initialized = 1; + +#if MagickLibVersion <= 0x628 + internpix->rows = s_count_pixeliterator_rows (internpix); +#endif +} + +/* {{{ proto ImagickPixelIterator ImagickPixelIterator::__construct(Imagick source) + The ImagickPixelIterator constructor +*/ +PHP_METHOD(ImagickPixelIterator, __construct) +{ + zval *magick_object; + php_imagickpixeliterator_object *internpix; + php_imagick_object *intern; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|llll", &magick_object, php_imagick_sc_entry) == FAILURE) { + RETURN_THROWS(); + } + + internpix = Z_IMAGICKPIXELITERATOR_P(getThis()); + intern = Z_IMAGICK_P(magick_object); + + if (!intern->magick_wand) { + php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "Invalid Imagick object passed" TSRMLS_CC); + RETURN_THROWS(); + } + + IMAGICK_NOT_EMPTY(intern); + + internpix->pixel_iterator = NewPixelIterator(intern->magick_wand); + + if (!internpix->pixel_iterator) { + php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "Can not allocate ImagickPixelIterator" TSRMLS_CC); + RETURN_THROWS(); + } + +#if MagickLibVersion <= 0x628 + internpix->rows = s_count_pixeliterator_rows (internpix); +#endif + + internpix->initialized = 1; + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto void ImagickPixelIterator::rewind() + Resets the pixel iterator. Use it in conjunction with PixelGetNextIteratorRow() to iterate over all the pixels in a pixel container. +*/ +PHP_METHOD(ImagickPixelIterator, rewind) +{ + php_imagickpixeliterator_object *internpix; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + (void)return_value; // fix -Werror=unused-parameter + + internpix = Z_IMAGICKPIXELITERATOR_P(getThis()); + + if (!internpix->initialized) { + php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "ImagickPixelIterator is not initialized correctly" TSRMLS_CC); + RETURN_THROWS(); + } + + PixelResetIterator(internpix->pixel_iterator); +#if MagickLibVersion <= 0x628 + internpix->iterator_position = 0; +#endif +} +/* }}} */ + +/* {{{ proto bool ImagickPixelIterator::resetIterator() + Resets the pixel iterator. Use it in conjunction with PixelGetNextIteratorRow() to iterate over all the pixels in a pixel container. +*/ +PHP_METHOD(ImagickPixelIterator, resetIterator) +{ + php_imagickpixeliterator_object *internpix; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internpix = Z_IMAGICKPIXELITERATOR_P(getThis()); + + if (!internpix->initialized) { + php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "ImagickPixelIterator is not initialized correctly" TSRMLS_CC); + RETURN_THROWS(); + } + + PixelResetIterator(internpix->pixel_iterator); +#if MagickLibVersion <= 0x628 + internpix->iterator_position = 0; +#endif + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickPixelIterator::syncIterator() + Syncs the pixel iterator. +*/ +PHP_METHOD(ImagickPixelIterator, syncIterator) +{ + php_imagickpixeliterator_object *internpix; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internpix = Z_IMAGICKPIXELITERATOR_P(getThis()); + + if (!internpix->initialized) { + php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "ImagickPixelIterator is not initialized correctly" TSRMLS_CC); + RETURN_THROWS(); + } + + PixelSyncIterator(internpix->pixel_iterator); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickPixelIterator::setIteratorFirstRow() + Sets the pixel iterator to the first pixel row. +*/ +PHP_METHOD(ImagickPixelIterator, setIteratorFirstRow) +{ + php_imagickpixeliterator_object *internpix; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internpix = Z_IMAGICKPIXELITERATOR_P(getThis()); + + if (!internpix->initialized) { + php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "ImagickPixelIterator is not initialized correctly" TSRMLS_CC); + RETURN_THROWS(); + } + + PixelSetFirstIteratorRow(internpix->pixel_iterator); +#if MagickLibVersion <= 0x628 + internpix->iterator_position = 0; +#endif + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickPixelIterator::setIteratorLastRow() + Sets the pixel iterator to the last pixel row. +*/ +PHP_METHOD(ImagickPixelIterator, setIteratorLastRow) +{ + php_imagickpixeliterator_object *internpix; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internpix = Z_IMAGICKPIXELITERATOR_P(getThis()); + + if (!internpix->initialized) { + php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "ImagickPixelIterator is not initialized correctly" TSRMLS_CC); + RETURN_THROWS(); + } + + PixelSetLastIteratorRow(internpix->pixel_iterator); +#if MagickLibVersion <= 0x628 + internpix->iterator_position = (internpix->rows - 1); +#endif + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto ImagickPixelIterator ImagickPixelIterator::getPixelIterator(Imagick source) + Returns a new pixel iterator, static method. This is equivalent to Imagick::getPixelIterator + which probably ought to be used in preference to this method. +*/ +PHP_METHOD(ImagickPixelIterator, getPixelIterator) +{ + PixelIterator *pixel_it; + zval *magick_object; + php_imagick_object *intern; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &magick_object, php_imagick_sc_entry) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(magick_object); + + if (!intern->magick_wand) { + php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "Invalid Imagick object passed" TSRMLS_CC); + RETURN_THROWS(); + } + + IMAGICK_NOT_EMPTY(intern); + + pixel_it = NewPixelIterator (intern->magick_wand); + if (!pixel_it) { + php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "Can not allocate ImagickPixelIterator" TSRMLS_CC); + RETURN_THROWS(); + } + + php_imagick_pixel_iterator_new (pixel_it, return_value TSRMLS_CC); +} +/* }}} */ + +/* {{{ proto ImagickPixelIterator ImagickPixelIterator::newPixelIterator(Imagick source) + Returns a new pixel iterator. +*/ +PHP_METHOD(ImagickPixelIterator, newPixelIterator) +{ + PixelIterator *pixel_it; + zval *magick_object; + php_imagickpixeliterator_object *internpix; + php_imagick_object *intern; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &magick_object, php_imagick_sc_entry) == FAILURE) { + RETURN_THROWS(); + } + + IMAGICK_METHOD_DEPRECATED_USE_INSTEAD("ImagickPixelIterator", "newPixelIterator", "ImagickPixelIterator", "getPixelIterator"); + + internpix = Z_IMAGICKPIXELITERATOR_P(getThis() ); + intern = Z_IMAGICK_P(magick_object); + + if (!intern->magick_wand) { + php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "Invalid Imagick object passed" TSRMLS_CC); + RETURN_THROWS(); + } + + IMAGICK_NOT_EMPTY(intern); + + pixel_it = NewPixelIterator(intern->magick_wand); + + if (!pixel_it) { + php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "Can not allocate ImagickPixelIterator" TSRMLS_CC); + RETURN_THROWS(); + } + + if (internpix->initialized && internpix->pixel_iterator) + DestroyPixelIterator (internpix->pixel_iterator); + + internpix->pixel_iterator = pixel_it; +#if MagickLibVersion <= 0x628 + internpix->rows = s_count_pixeliterator_rows (internpix); +#endif + + internpix->initialized = 1; + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto ImagickPixelIterator ImagickPixelIterator::getPixelRegionIterator(Imagick source, int x, int y, int columns, int rows) + Returns a new pixel region iterator, static method. This is equivalent to the non-static + Imagick::getPixelRegionIterator which ought to be used in preference to this method. +*/ +PHP_METHOD(ImagickPixelIterator, getPixelRegionIterator) +{ + PixelIterator *pixel_it; + zval *magick_object; + php_imagick_object *intern; + long x, y, columns, rows; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ollll", &magick_object, php_imagick_sc_entry, &x, &y, &columns, &rows) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(magick_object); + + if (!intern->magick_wand) { + php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "Invalid Imagick object passed" TSRMLS_CC); + RETURN_THROWS(); + } + + IMAGICK_NOT_EMPTY(intern); + + pixel_it = NewPixelRegionIterator(intern->magick_wand, x, y, columns, rows); + if (!pixel_it) { + php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "Can not allocate ImagickPixelIterator" TSRMLS_CC); + RETURN_THROWS(); + } + + php_imagick_pixel_iterator_new (pixel_it, return_value TSRMLS_CC); +} +/* }}} */ + +/* {{{ proto bool ImagickPixelIterator::newPixelRegionIterator(Imagick source, int x, int y, int columns, int rows) + Returns a new pixel iterator. +*/ +PHP_METHOD(ImagickPixelIterator, newPixelRegionIterator) +{ + PixelIterator *pixel_it; + zval *magick_object; + php_imagickpixeliterator_object *internpix; + php_imagick_object *intern; + long x, y, columns, rows; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ollll", &magick_object, php_imagick_sc_entry, &x, &y, &columns, &rows) == FAILURE) { + RETURN_THROWS(); + } + + IMAGICK_METHOD_DEPRECATED_USE_INSTEAD("ImagickPixelIterator", "newPixelRegionIterator", "ImagickPixelIterator", "getPixelRegionIterator"); + + internpix = Z_IMAGICKPIXELITERATOR_P(getThis()); + intern = Z_IMAGICK_P(magick_object); + + if (!intern->magick_wand) { + php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "Invalid Imagick object passed" TSRMLS_CC); + RETURN_THROWS(); + } + + IMAGICK_NOT_EMPTY(intern); + + pixel_it = NewPixelRegionIterator(intern->magick_wand, x, y, columns, rows); + + if (!pixel_it) { + php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "Can not allocate ImagickPixelIterator" TSRMLS_CC); + RETURN_THROWS(); + } + + if (internpix->initialized && internpix->pixel_iterator) + DestroyPixelIterator (internpix->pixel_iterator); + + internpix->pixel_iterator = pixel_it; + +#if MagickLibVersion <= 0x628 + internpix->rows = s_count_pixeliterator_rows (internpix); +#endif + internpix->initialized = 1; + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto int ImagickPixelIterator::getIteratorRow() + Returns the crurent pixel iterator row. +*/ +PHP_METHOD(ImagickPixelIterator, getIteratorRow) +{ + php_imagickpixeliterator_object *internpix; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + internpix = Z_IMAGICKPIXELITERATOR_P(getThis()); + + if (!internpix->initialized) { + php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "ImagickPixelIterator is not initialized correctly" TSRMLS_CC); + RETURN_THROWS(); + } + +#if MagickLibVersion <= 0x628 + ZVAL_LONG(return_value, internpix->iterator_position); +#else + ZVAL_LONG(return_value, (long) PixelGetIteratorRow(internpix->pixel_iterator)); +#endif +} +/* }}} */ + +/* {{{ proto bool ImagickPixelIterator::setIteratorRow(int row) + Set the pixel iterator row. +*/ +PHP_METHOD(ImagickPixelIterator, setIteratorRow) +{ + php_imagickpixeliterator_object *internpix; + MagickBooleanType status; + im_long row; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &row) == FAILURE) { + RETURN_THROWS(); + } + + internpix = Z_IMAGICKPIXELITERATOR_P(getThis()); + + if (!internpix->initialized) { + php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "ImagickPixelIterator is not initialized correctly" TSRMLS_CC); + RETURN_THROWS(); + } + + status = PixelSetIteratorRow(internpix->pixel_iterator, row); + + if (status == MagickFalse) { + php_imagick_convert_imagickpixeliterator_exception(internpix->pixel_iterator, "Unable to set iterator row" TSRMLS_CC); + RETURN_THROWS(); + } +#if MagickLibVersion <= 0x628 + internpix->iterator_position = row; +#endif + RETURN_TRUE; +} +/* }}} */ + +static +void s_pixelwands_to_zval (PixelWand **wand_array, unsigned long num_wands, zval *return_value TSRMLS_DC) +{ + php_imagickpixel_object *internp; +#if PHP_VERSION_ID >= 70000 + zval obj; +#else + zval *obj; +#endif + + unsigned long i; + + array_init(return_value); + + for (i = 0; i < num_wands; i++) { +#if PHP_VERSION_ID >= 70000 + object_init_ex(&obj, php_imagickpixel_sc_entry); + internp = Z_IMAGICKPIXEL_P(&obj); +#else + MAKE_STD_ZVAL(obj); + object_init_ex(obj, php_imagickpixel_sc_entry); + internp = Z_IMAGICKPIXEL_P(obj); +#endif + + internp->initialized_via_iterator = 1; + + php_imagick_replace_pixelwand(internp, wand_arrayi); +#if PHP_VERSION_ID >= 70000 + add_next_index_zval(return_value, &obj); +#else + add_next_index_zval(return_value, obj); +#endif + } + +} + +/* {{{ proto array ImagickPixelIterator::getPreviousIteratorRow() + Returns the previous row as an array of pixel wands from the pixel iterator. +*/ +PHP_METHOD(ImagickPixelIterator, getPreviousIteratorRow) +{ + php_imagickpixeliterator_object *internpix; + PixelWand **wand_array; + size_t num_wands; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internpix = Z_IMAGICKPIXELITERATOR_P(getThis()); + + if (!internpix->initialized) { + php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "ImagickPixelIterator is not initialized correctly" TSRMLS_CC); + RETURN_THROWS(); + } + + wand_array = PixelGetPreviousIteratorRow(internpix->pixel_iterator, &num_wands); + +#if MagickLibVersion <= 0x628 + if (internpix->iterator_position > 0) { + internpix->iterator_position--; + } +#endif + + if (!wand_array) { + RETURN_NULL(); + } + + s_pixelwands_to_zval (wand_array, num_wands, return_value TSRMLS_CC); +} +/* }}} */ + + +/* {{{ proto array ImagickPixelIterator::getCurrentIteratorRow() + Returns the current row as an array of pixel wands from the pixel iterator. +*/ +PHP_METHOD(ImagickPixelIterator, getCurrentIteratorRow) +{ + php_imagickpixeliterator_object *internpix; + PixelWand **wand_array; + size_t num_wands; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internpix = Z_IMAGICKPIXELITERATOR_P(getThis()); + + if (!internpix->initialized) { + php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "ImagickPixelIterator is not initialized correctly" TSRMLS_CC); + RETURN_THROWS(); + } + +#if MagickLibVersion <= 0x628 + if (internpix->iterator_position >= internpix->rows) { + RETURN_NULL(); + } else if (internpix->iterator_position != 0) { + long tmp; + (void)PixelGetPreviousIteratorRow(internpix->pixel_iterator, &tmp); + } + wand_array = PixelGetNextIteratorRow(internpix->pixel_iterator, &num_wands); +#else + wand_array = PixelGetCurrentIteratorRow(internpix->pixel_iterator, &num_wands); +#endif + + if (!wand_array) { + RETURN_NULL(); + } + + s_pixelwands_to_zval (wand_array, num_wands, return_value TSRMLS_CC); +} +/* }}} */ + +/* {{{ proto void ImagickPixelIterator::next() + Returns the next row as an array of pixel wands from the pixel iterator. +*/ +PHP_METHOD(ImagickPixelIterator, next) +{ + php_imagickpixeliterator_object *internpix; + size_t num_wands; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + (void)return_value; // fix -Werror=unused-parameter + + internpix = Z_IMAGICKPIXELITERATOR_P(getThis()); + + if (!internpix->initialized) { + php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "ImagickPixelIterator is not initialized correctly" TSRMLS_CC); + RETURN_THROWS(); + } + + PixelGetNextIteratorRow(internpix->pixel_iterator, &num_wands); + +#if MagickLibVersion <= 0x628 + internpix->iterator_position++; +#endif +} +/* }}} */ + +/* {{{ proto array ImagickPixelIterator::getNextIteratorRow() + Returns the next row as an array of pixel wands from the pixel iterator. +*/ +PHP_METHOD(ImagickPixelIterator, getNextIteratorRow) +{ + php_imagickpixeliterator_object *internpix; + PixelWand **wand_array; + size_t num_wands; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internpix = Z_IMAGICKPIXELITERATOR_P(getThis()); + + if (!internpix->initialized) { + php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "ImagickPixelIterator is not initialized correctly" TSRMLS_CC); + RETURN_THROWS(); + } + + wand_array = PixelGetNextIteratorRow(internpix->pixel_iterator, &num_wands); + +#if MagickLibVersion <= 0x628 + internpix->iterator_position++; +#endif + + if (!wand_array) { + RETURN_NULL(); + } + + s_pixelwands_to_zval (wand_array, num_wands, return_value TSRMLS_CC); +} +/* }}} */ + +/* {{{ proto bool ImagickPixelIterator::clear() + Clear resources associated with a PixelIterator. +*/ +PHP_METHOD(ImagickPixelIterator, clear) +{ + php_imagickpixeliterator_object *internpix; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + internpix = Z_IMAGICKPIXELITERATOR_P(getThis()); + + if (!internpix->initialized) { + php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "ImagickPixelIterator is not initialized correctly" TSRMLS_CC); + RETURN_THROWS(); + } +/* Assertion failure with earlier versions */ +#if MagickLibVersion <= 0x628 + RETURN_TRUE; +#else + ClearPixelIterator(internpix->pixel_iterator); + RETURN_TRUE; +#endif +} +/* }}} */ + +/* {{{ proto bool ImagickPixelIterator::valid() + The if the current iterator row is valid +*/ +PHP_METHOD(ImagickPixelIterator, valid) +{ + php_imagickpixeliterator_object *internpix; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internpix = Z_IMAGICKPIXELITERATOR_P(getThis()); + + if (!internpix->initialized) { + php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "ImagickPixelIterator is not initialized correctly" TSRMLS_CC); + RETURN_THROWS(); + } +#if MagickLibVersion <= 0x628 + if (internpix->iterator_position < internpix->rows) { + RETURN_TRUE; + } +#else + /* Test if the current row is valid */ + if (PixelSetIteratorRow(internpix->pixel_iterator, PixelGetIteratorRow(internpix->pixel_iterator))) { + RETURN_TRUE; + } +#endif + RETURN_FALSE; +} +/* }}} */ + +/* END OF PIXELITERATOR */
View file
imagick-3.8.0.tgz/imagick-3.8.0/php_imagemagick_version_defs.h
Added
@@ -0,0 +1,232 @@ + +#ifndef PHP_IMAGEMAGICK_VERSION_DEFS_H +# define PHP_IMAGEMAGICK_VERSION_DEFS_H + +// Q) Why are the defines done in this file? +// +// A) Checking whether an ImageMagick function is available _and_ usable is +// annoyingly difficult. It's pretty common for new functions to be introduced +// in patch releases, (e.g. 6.5.4-8) rather than in minor releases (6.5.5-0). +// +// Additionally, the api for new functions often changes quite rapidly in the +// first few versions it is available in, which means we can't just check for +// the presence of the symbol +// +// Because of those two things, the sanest thing to do is to support features +// based on the minimum minor version from which they are continually +// available and stable. +// +// Any mistake in which version is required for a feature can be fixed in a +// single place, rather than having to have duplicated info elsewhere. + + +#if MagickLibVersion >= 0x700 + #if MagickLibVersion >= 0x702 + #define IM_HAVE_IMAGICK_SETIMAGEINTERPOLATEMETHOD 1 + #endif +#elif MagickLibVersion >= 0x631 + #define IM_HAVE_IMAGICK_SETIMAGEINTERPOLATEMETHOD 1 +#endif + + +#if MagickLibVersion >= 0x709 + #define IM_HAVE_IMAGICK_SETIMAGEPIXELCOLOR 1 +#endif + + +// Although there is some 'cannyEdgeImage' code in ImageMagick 6, +// there is no 'MagickCannyEdgeImage' exported function in the API. +#if MagickLibVersion >= 0x709 + #define IM_HAVE_IMAGICK_CANNYEDGEIMAGE 1 +#endif + + +#if MagickLibVersion >= 0x709 + #define IM_HAVE_IMAGICK_SETSEED 1 +#endif + +#if MagickLibVersion >= 0x709 + #define IM_HAVE_IMAGICK_WAVELETDENOISEIMAGE 1 +#endif + +#if MagickLibVersion >= 0x709 + #define IM_HAVE_IMAGICK_MEANSHIFTIMAGE 1 +#endif + +#if MagickLibVersion >= 0x710 + #define IM_HAVE_IMAGICK_KMEANSIMAGE 1 +#endif + +#if MagickLibVersion >= 0x709 + #define IM_HAVE_IMAGICK_RANGETHRESHOLDIMAGE 1 +#endif + +#if MagickLibVersion >= 0x709 + #define IM_HAVE_IMAGICK_AUTOTHRESHOLDIMAGE 1 +#endif + +#if MagickLibVersion >= 0x710 + #define IM_HAVE_IMAGICK_BILATERALBLURIMAGE 1 +#endif + +#if MagickLibVersion >= 0x709 + #define IM_HAVE_IMAGICK_CLAHEIMAGE 1 +#endif + +#if MagickLibVersion >= 0x702 + #define IM_HAVE_IMAGICK_CHANNELFXIMAGE 1 +#endif + +#if MagickLibVersion >= 0x710 + #define IM_HAVE_IMAGICK_COLORTHRESHOLDIMAGE 1 +#endif + +#if MagickLibVersion >= 0x709 + #define IM_HAVE_IMAGICK_COMPLEXIMAGES 1 +#endif + +#if MagickLibVersion >= 0x702 + #define IM_HAVE_IMAGICK_INTERPOLATIVERESIZEIMAGE 1 +#endif + +#if MagickLibVersion >= 0x709 + #define IM_HAVE_IMAGICK_LEVELIMAGECOLORS 1 +#endif + +#if MagickLibVersion >= 0x709 + #define IM_HAVE_IMAGICK_LEVELIZEIMAGE 1 +#endif + +#if MagickLibVersion >= 0x702 + #define IM_HAVE_IMAGICK_ORDEREDDITHERIMAGE 1 +#endif + +#if MagickLibVersion >= 0x70B + #define IM_HAVE_IMAGICK_WHITEBALANCEIMAGE 1 +#endif + +#if MagickLibVersion >= 0x702 + #define IM_HAVE_IMAGICK_ADD_NOISE_WITH_ATTENUATE 1 +#endif + +#if MagickLibVersion >= 0x701 + #define IM_HAVE_IMAGICK_DELETE_OPTION 1 +#endif + +#if MagickLibVersion >= 0x701 + #define IM_HAVE_IMAGICK_GET_BACKGROUND_COLOR 1 +#endif + +#if MagickLibVersion >= 0x701 + #define IM_HAVE_IMAGICK_GET_IMAGE_ARTIFACTS 1 +#endif + +#if MagickLibVersion >= 0x701 + #define IM_HAVE_IMAGICK_GET_IMAGE_DISTORTIONS 1 +#endif + +#if MagickLibVersion >= 0x701 + #define IM_HAVE_IMAGICK_GET_IMAGE_KURTOSIS 1 +#endif + +#if MagickLibVersion >= 0x701 + #define IM_HAVE_IMAGICK_GET_IMAGE_MEAN 1 +#endif + +#if MagickLibVersion >= 0x701 + #define IM_HAVE_IMAGICK_GET_IMAGE_RANGE 1 +#endif + +#if MagickLibVersion >= 0x701 + #define IM_HAVE_IMAGICK_GET_INTERPOLATE_METHOD 1 +#endif + +#if MagickLibVersion >= 0x701 + #define IM_HAVE_IMAGICK_GET_OPTIONS 1 +#endif + +#if MagickLibVersion >= 0x701 + #define IM_HAVE_IMAGICK_GET_ORIENTATION 1 +#endif + +#if MagickLibVersion >= 0x701 + #define IM_HAVE_IMAGICK_GET_RESOLUTION 1 +#endif + +#if MagickLibVersion >= 0x701 + #define IM_HAVE_IMAGICK_GET_TYPE 1 +#endif + +#if MagickLibVersion >= 0x709 + #define IM_HAVE_IMAGICK_POLYNOMIAL_IMAGE 1 +#endif + +#if MagickLibVersion >= 0x701 + #define IM_HAVE_IMAGICK_SET_DEPTH 1 +#endif + +#if MagickLibVersion >= 0x701 + #define IM_HAVE_IMAGICK_SET_EXTRACT 1 +#endif + +#if MagickLibVersion >= 0x701 + #define IM_HAVE_IMAGICK_SET_INTERPOLATE_METHOD 1 +#endif + +#if MagickLibVersion >= 0x701 + #define IM_HAVE_IMAGICK_SET_ORIENTATION 1 +#endif + +#if MagickLibVersion >= 0x70A + // Technically, this may be available earlier, but the behaviour around + // default mask changed. + #define IM_HAVE_IMAGICK_GETSETIMAGEMASK 1 + +// ImageMagick forget to export the header until about 7.0.11-14... +WandExport MagickBooleanType MagickSetImageMask( + MagickWand *wand, const PixelMask type, const MagickWand *clip_mask +); + +#endif + +// The above is sub-optimal as it's hard to read. It'd be better to do +// something like the below: + +//#define MAGICK_LIB_RANGE(NAME, IM6_VERSION, IM7_VERSION) slash +//#if MagickLibVersion >= 0x700 slash +// #if MagickLibVersion >= IM7_VERSION slash +// #define IM_HAVE_##NAME 1 slash +// #endif slash +//#elif MagickLibVersion >= 0x600 slash +// #if MagickLibVersion >= IM6_VERSION slash +// #define IM_HAVE_##NAME 1 slash +// #endif slash +//#endif + +// MAGICK_LIB_RANGE(IMAGICK_SETIMAGEINTERPOLATEMETHOD, 0x631, 0x702) + +// But this type of macro expansion is not possible. +// +// https://stackoverflow.com/questions/48431325/is-it-possible-to-define-macro-inside-macro +// "The resulting completely macro-replaced preprocessing token sequence is not +// processed as a preprocessing directive even if it resembles one,..." +// +// An alternative would be to use code generation to build the define file as +// part of the build process. However that would involve looking at m4 config files. + + +#if MagickLibVersion >= 0x700 +// declare symbols only defined in C source and not in header +WandExport MagickBooleanType MagickSetImageMask( + MagickWand *wand, const PixelMask type, const MagickWand *clip_mask +); +#endif + +#if MagickLibVersion >= 0x710 +// declare symbols only defined in C source and not in header +WandExport MagickBooleanType MagickBilateralBlurImage(MagickWand *wand, + const double radius,const double sigma,const double intensity_sigma, + const double spatial_sigma); +#endif + +#endif /* PHP_IMAGEMAGICK_VERSION_DEFS_H */ \ No newline at end of file
View file
imagick-3.8.0.tgz/imagick-3.8.0/php_imagick.h
Added
@@ -0,0 +1,51 @@ +/* + +----------------------------------------------------------------------+ + | PHP Version 5 / Imagick | + +----------------------------------------------------------------------+ + | Copyright (c) 2006-2013 Mikko Koppanen, Scott MacVicar | + | ImageMagick (c) ImageMagick Studio LLC | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Mikko Kopppanen <mkoppanen@php.net> | + | Scott MacVicar <scottmac@php.net> | + +----------------------------------------------------------------------+ +*/ +#ifndef PHP_IMAGICK_H +/* Prevent double inclusion */ +#define PHP_IMAGICK_H + +/* Define Extension Properties */ +#define PHP_IMAGICK_EXTNAME "imagick" +// The version is deliberately left as 'PACKAGE_VERSION' in source code. +// It is only replaced with the actual version number that packaged through pecl.php.net +#define PHP_IMAGICK_VERSION "3.8.0" +#define PHP_IMAGICK_EXTNUM 30800 + +/* Import configure options when building + outside of the PHP source tree */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#ifdef ZTS +# include "TSRM.h" +#endif + +/* Include PHP Standard Headers */ +#include "php.h" + +/* Define the entry point symbol + * ZE will use when loading this module + */ +extern zend_module_entry imagick_module_entry; +#define phpext_imagick_ptr &imagick_module_entry + +#endif /* PHP_IMAGICK_H */ +
View file
imagick-3.8.0.tgz/imagick-3.8.0/php_imagick_defs.h
Added
@@ -0,0 +1,1258 @@ +/* + +----------------------------------------------------------------------+ + | PHP Version 5 / Imagick | + +----------------------------------------------------------------------+ + | Copyright (c) 2006-2013 Mikko Koppanen, Scott MacVicar | + | ImageMagick (c) ImageMagick Studio LLC | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Mikko Kopppanen <mkoppanen@php.net> | + | Scott MacVicar <scottmac@php.net> | + +----------------------------------------------------------------------+ +*/ +#ifndef PHP_IMAGICK_DEFS_H /* PHP_IMAGICK_DEFS_H */ +# define PHP_IMAGICK_DEFS_H + +/* Include magic wand header */ +#if defined (IM_MAGICKWAND_HEADER_STYLE_SEVEN) +# include <MagickWand/MagickWand.h> +#elif defined (IM_MAGICKWAND_HEADER_STYLE_OLD) +# include <wand/magick-wand.h> +#else +# include <wand/MagickWand.h> +#endif + +#include "php_imagemagick_version_defs.h" + +#if MagickLibVersion >= 0x700 +#include "shim_im6_to_im7.h" +#endif + +/* Some extra headers */ +#include "Zend/zend_exceptions.h" +#include "Zend/zend_interfaces.h" +#include "ext/standard/php_string.h" +#include "ext/standard/info.h" +#include "ext/standard/php_filestat.h" +#include "php_ini.h" +#include "Zend/zend.h" + +#if PHP_VERSION_ID >= 80000 + #define HAVE_LOCALE_H + #define TSRMLS_C + #define TSRMLS_CC + #define TSRMLS_D + #define TSRMLS_DC + #define TSRMLS_FETCH() + #define TSRMLS_SET_CTX(ctx) +#endif + +/* Include locale header */ +#ifdef HAVE_LOCALE_H +# include <locale.h> +#endif + +#if MagickLibVersion >= 0x680 + #define IMAGICK_WITH_KERNEL +#endif + + + +#if MagickLibVersion >= 0x700 +#if !defined(MaxTextExtent) +# define MaxTextExtent 4096 /* always >= 4096 */ +#endif + +#endif + + +#if PHP_VERSION_ID >= 70000 + #define im_long zend_long +#else + #define im_long long +#endif + +#if PHP_VERSION_ID >= 70200 + #define im_ce_countable zend_ce_countable +#else + #define im_ce_countable spl_ce_Countable +#endif + +typedef struct _php_imagick_callback { + void ***thread_ctx; +#if PHP_VERSION_ID >= 70000 + zval user_callback; +#else + zval *user_callback; +#endif + struct _php_imagick_callback *previous_callback; +} php_imagick_callback; + +/* Globals, needed for the ini settings */ +ZEND_BEGIN_MODULE_GLOBALS(imagick) + zend_bool locale_fix; + zend_bool progress_monitor; + zend_bool skip_version_check; + + zend_bool set_single_thread; + zend_bool allow_zero_dimension_images; + im_long shutdown_sleep_count; + + php_imagick_callback *progress_callback; +#ifdef PHP_IMAGICK_ZEND_MM + MagickWand *keep_alive; +#endif +ZEND_END_MODULE_GLOBALS(imagick) + +#ifdef ZTS +# define IMAGICK_G(v) TSRMG(imagick_globals_id, zend_imagick_globals *, v) +#else +# define IMAGICK_G(v) (imagick_globals.v) +#endif + +ZEND_EXTERN_MODULE_GLOBALS(imagick) + +#ifdef HAVE_LOCALE_H +# if defined(PHP_WIN32) +# define IMAGICK_LC_NUMERIC_LOCALE "English" +# else +# define IMAGICK_LC_NUMERIC_LOCALE "C" +# endif +#endif + +#if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 3 +#define zend_parse_parameters_none() zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") +#endif + + +/* Class names */ +#define PHP_IMAGICK_SC_NAME "Imagick" +#define PHP_IMAGICK_EXCEPTION_SC_NAME "ImagickException" + +#define PHP_IMAGICKDRAW_SC_NAME "ImagickDraw" +#define PHP_IMAGICKDRAW_EXCEPTION_SC_NAME "ImagickDrawException" + +#define PHP_IMAGICKPIXEL_SC_NAME "ImagickPixel" +#define PHP_IMAGICKPIXEL_EXCEPTION_SC_NAME "ImagickPixelException" + +#define PHP_IMAGICKPIXELITERATOR_SC_NAME "ImagickPixelIterator" +#define PHP_IMAGICKPIXELITERATOR_EXCEPTION_SC_NAME "ImagickPixelIteratorException" + +#ifdef IMAGICK_WITH_KERNEL +#define PHP_IMAGICKKERNEL_SC_NAME "ImagickKernel" +#define PHP_IMAGICKKERNEL_EXCEPTION_SC_NAME "ImagickKernelException" +#endif + + +#if PHP_VERSION_ID >= 70000 + +/* Structure for Imagick object. */ +typedef struct _php_imagick_object { + MagickWand *magick_wand; + char *progress_monitor_name; + zend_bool next_out_of_bound; + zend_object zo; +} php_imagick_object; + +#else + +/* Structure for Imagick object. */ +typedef struct _php_imagick_object { + zend_object zo; + MagickWand *magick_wand; + char *progress_monitor_name; + zend_bool next_out_of_bound; +} php_imagick_object; + +#endif + + +#if PHP_VERSION_ID >= 70000 + +/* Structure for ImagickDraw object. */ +typedef struct _php_imagickdraw_object { + DrawingWand *drawing_wand; + zend_object zo; +} php_imagickdraw_object; + + +#else + + +/* Structure for ImagickDraw object. */ +typedef struct _php_imagickdraw_object { + zend_object zo; + DrawingWand *drawing_wand; +} php_imagickdraw_object; + + +#endif + +#if PHP_VERSION_ID >= 70000 + +/* Structure for ImagickPixelIterator object. */ +typedef struct _php_imagickpixeliterator_object { + + PixelIterator *pixel_iterator; + zend_bool initialized; + +#if MagickLibVersion <= 0x628 + long rows; + long iterator_position; +#endif + + zend_object zo; +} php_imagickpixeliterator_object; + +#else + +/* Structure for ImagickPixelIterator object. */ +typedef struct _php_imagickpixeliterator_object { + zend_object zo; + PixelIterator *pixel_iterator; + zend_bool initialized; + +#if MagickLibVersion <= 0x628 + long rows; + long iterator_position; +#endif + +} php_imagickpixeliterator_object; + +#endif + + +#if PHP_VERSION_ID >= 70000 + +/* Structure for ImagickPixel object. */ +typedef struct _php_imagickpixel_object { + PixelWand *pixel_wand; + zend_bool initialized_via_iterator; + zend_object zo; +} php_imagickpixel_object; + + +#else + + +/* Structure for ImagickPixel object. */ +typedef struct _php_imagickpixel_object { + zend_object zo; + PixelWand *pixel_wand; + zend_bool initialized_via_iterator; +} php_imagickpixel_object; + +#endif + + +#ifdef IMAGICK_WITH_KERNEL +#if PHP_VERSION_ID >= 70000 +/* Structure for ImagickKernel object. */ +typedef struct _php_imagickkernel_object { + KernelInfo *kernel_info; + zend_object zo; +} php_imagickkernel_object; +#else + +/* Structure for ImagickKernel object. */ +typedef struct _php_imagickkernel_object { + zend_object zo; + KernelInfo *kernel_info; +} php_imagickkernel_object; +#endif +#endif + +//Object fetching. +#if PHP_VERSION_ID >= 70000 + +static inline php_imagick_object *php_imagick_fetch_object(zend_object *obj) { + return (php_imagick_object *)((char*)(obj) - XtOffsetOf(php_imagick_object, zo)); +} + +static inline php_imagickdraw_object *php_imagickdraw_fetch_object(zend_object *obj) { + return (php_imagickdraw_object *)((char*)(obj) - XtOffsetOf(php_imagickdraw_object, zo)); +} + +static inline php_imagickpixel_object *php_imagickpixel_fetch_object(zend_object *obj) { + return (php_imagickpixel_object *)((char*)(obj) - XtOffsetOf(php_imagickpixel_object, zo)); +} + +static inline php_imagickpixeliterator_object *php_imagickpixeliterator_fetch_object(zend_object *obj) { + return (php_imagickpixeliterator_object *)((char*)(obj) - XtOffsetOf(php_imagickpixeliterator_object, zo)); +} + +#ifdef IMAGICK_WITH_KERNEL +static inline php_imagickkernel_object *php_imagickkernel_fetch_object(zend_object *obj) { + return (php_imagickkernel_object *)((char*)(obj) - XtOffsetOf(php_imagickkernel_object, zo)); +} +#endif + +#else + #define php_imagick_fetch_object(object) ((php_imagick_object *)object) + #define php_imagickdraw_fetch_object(object) ((php_imagickdraw_object *)object) + #define php_imagickpixel_fetch_object(object) ((php_imagickpixel_object *)object) + #define php_imagickpixeliterator_fetch_object(object) ((php_imagickpixeliterator_object *)object) + #define php_imagickkernel_fetch_object(object) ((php_imagickkernel_object *)object) +#endif + +// Object access +#if PHP_VERSION_ID >= 70000 + #define Z_IMAGICK_P(zv) php_imagick_fetch_object(Z_OBJ_P((zv))) + #define Z_IMAGICKDRAW_P(zv) php_imagickdraw_fetch_object(Z_OBJ_P((zv))) + #define Z_IMAGICKPIXEL_P(zv) php_imagickpixel_fetch_object(Z_OBJ_P((zv))) + #define Z_IMAGICKPIXELITERATOR_P(zv) php_imagickpixeliterator_fetch_object(Z_OBJ_P((zv))) +#ifdef IMAGICK_WITH_KERNEL + #define Z_IMAGICKKERNEL_P(zv) php_imagickkernel_fetch_object(Z_OBJ_P((zv))) +#endif +#else + #define Z_IMAGICK_P(zv) (php_imagick_object *)zend_object_store_get_object(zv TSRMLS_CC) + #define Z_IMAGICKDRAW_P(zv) (php_imagickdraw_object *)zend_object_store_get_object(zv TSRMLS_CC) + #define Z_IMAGICKPIXEL_P(zv) (php_imagickpixel_object *) zend_object_store_get_object(zv TSRMLS_CC) + #define Z_IMAGICKPIXELITERATOR_P(zv) (php_imagickpixeliterator_object *)zend_object_store_get_object(zv TSRMLS_CC) + #define Z_IMAGICKKERNEL_P(zv) (php_imagickkernel_object *)zend_object_store_get_object(zv TSRMLS_CC) +#endif + +// String access +#if PHP_VERSION_ID >= 70000 + #define IM_ZVAL_STRING(zv, charstar) ZVAL_STRING(zv, charstar); + #define IM_RETURN_STRING(s) RETURN_STRING(s) +#else + #define IM_ZVAL_STRING(zv, charstar) ZVAL_STRING(zv, charstar, 1); + //RETURN_STRING(s, duplicate) + #define IM_RETURN_STRING(s) RETURN_STRING(s, 0) +#endif + +#if PHP_VERSION_ID >= 70000 + #define IM_add_assoc_string(zv, key, charstr) add_assoc_string(zv, key, charstr) + #define IM_ZVAL_STRINGL(zv, charstr, length) ZVAL_STRINGL(zv, charstr, length) + #define IM_add_next_index_string(zv, charstr) add_next_index_string(zv, charstr) + #define IM_LEN_TYPE size_t +#else + #define IM_add_assoc_string(zv, key, charstr) add_assoc_string(zv, key, charstr, 1) + #define IM_add_assoc_string(zv, key, charstr) add_assoc_string(zv, key, charstr, 1) + #define IM_ZVAL_STRINGL(zv, charstr, length) ZVAL_STRINGL(zv, charstr, length, 1) + #define IM_add_next_index_string(zv, charstr) add_next_index_string(zv, charstr, 1) + #define IM_add_next_index_zval(zv1, zv2) + #define IM_LEN_TYPE int +#endif + +#if PHP_VERSION_ID >= 70000 + #define IM_ZEND_OBJECT zend_object +#else + #define IM_ZEND_OBJECT void +#endif + + +/* RETURN_THROWS() isn't defined in PHP 5.6 through 7.4 + */ +#if !defined(RETURN_THROWS) +#define RETURN_THROWS() return +#endif + + +/* Define some color constants */ +typedef enum _php_imagick_color_t { + PHP_IMAGICK_COLOR_MIN = 10, + PHP_IMAGICK_COLOR_BLACK, + PHP_IMAGICK_COLOR_BLUE, + PHP_IMAGICK_COLOR_CYAN, + PHP_IMAGICK_COLOR_GREEN, + PHP_IMAGICK_COLOR_RED, + PHP_IMAGICK_COLOR_YELLOW, + PHP_IMAGICK_COLOR_MAGENTA, +#if MagickLibVersion < 0x700 + PHP_IMAGICK_COLOR_OPACITY, +#endif + PHP_IMAGICK_COLOR_ALPHA, + PHP_IMAGICK_COLOR_FUZZ, + PHP_IMAGICK_COLOR_MAX, +} php_imagick_color_t; + +/* Class enum */ +typedef enum _php_imagick_class_type_t { + IMAGICK_CLASS, + IMAGICKDRAW_CLASS, + IMAGICKPIXELITERATOR_CLASS, + IMAGICKPIXEL_CLASS, +#ifdef IMAGICK_WITH_KERNEL + IMAGICKKERNEL_CLASS +#endif +} php_imagick_class_type_t; + +/* Read / write constants */ +typedef enum _php_imagick_rw_result_t { + IMAGICK_RW_OK, + IMAGICK_RW_SAFE_MODE_ERROR, + IMAGICK_RW_OPEN_BASEDIR_ERROR, + IMAGICK_RW_UNDERLYING_LIBRARY, + IMAGICK_RW_PERMISSION_DENIED, + IMAGICK_RW_FILENAME_TOO_LONG, + IMAGICK_RW_PATH_DOES_NOT_EXIST, + IMAGICK_RW_PATH_IS_DIR, +} php_imagick_rw_result_t; + +/* Class entries */ +extern zend_class_entry *php_imagick_sc_entry; +extern zend_class_entry *php_imagick_exception_class_entry; +extern zend_class_entry *php_imagickdraw_sc_entry; +extern zend_class_entry *php_imagickdraw_exception_class_entry; +extern zend_class_entry *php_imagickpixel_sc_entry; +extern zend_class_entry *php_imagickpixel_exception_class_entry; +extern zend_class_entry *php_imagickpixeliterator_sc_entry; +extern zend_class_entry *php_imagickpixeliterator_exception_class_entry; +#ifdef IMAGICK_WITH_KERNEL +extern zend_class_entry *php_imagickkernel_sc_entry; +extern zend_class_entry *php_imagickkernel_exception_class_entry; +#endif + +/* Forward declarations (Imagick) */ + +#if (MagickLibVersion >= 0x700 && MagickLibVersion >= 0x709) + #define PHP_IMAGICK_HAVE_HOUGHLINE 1 +#else + #define PHP_IMAGICK_HAVE_HOUGHLINE 0 +#endif + +/* The conditional methods */ +#if MagickLibVersion > 0x628 +PHP_METHOD(imagick, pingimageblob); +PHP_METHOD(imagick, pingimagefile); +PHP_METHOD(imagick, transposeimage); +PHP_METHOD(imagick, transverseimage); +PHP_METHOD(imagick, trimimage); +PHP_METHOD(imagick, waveimage); +PHP_METHOD(imagick, vignetteimage); +PHP_METHOD(imagick, compareimagelayers); +PHP_METHOD(imagick, optimizeimagelayers); +PHP_METHOD(imagick, uniqueimagecolors); +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 +PHP_METHOD(imagick, getimagematte); +#endif //#if MagickLibVersion < 0x700 +#endif +PHP_METHOD(imagick, setimagematte); +PHP_METHOD(imagick, adaptiveresizeimage); +PHP_METHOD(imagick, sketchimage); +PHP_METHOD(imagick, shadeimage); +PHP_METHOD(imagick, getsizeoffset); +PHP_METHOD(imagick, setsizeoffset); +PHP_METHOD(imagick, adaptiveblurimage); +PHP_METHOD(imagick, contraststretchimage); +PHP_METHOD(imagick, adaptivesharpenimage); +PHP_METHOD(imagick, randomthresholdimage); +PHP_METHOD(imagick, roundcornersimage); +PHP_METHOD(imagick, setiteratorindex); +PHP_METHOD(imagick, getiteratorindex); +#if MagickLibVersion < 0x700 +PHP_METHOD(imagick, transformimage); +#endif // #if MagickLibVersion < 0x700 +#endif +#if MagickLibVersion > 0x630 +#if MagickLibVersion < 0x700 +PHP_METHOD(imagick, setimageopacity); +#endif +#if MagickLibVersion >= 0x700 +PHP_METHOD(imagick, setimagealpha); +#endif +#if MagickLibVersion < 0x700 +PHP_METHOD(imagick, orderedposterizeimage); +#endif //#if MagickLibVersion < 0x700 +#endif +#if MagickLibVersion > 0x631 +PHP_METHOD(imagick, polaroidimage); +PHP_METHOD(imagick, getimageproperty); +PHP_METHOD(imagick, setimageproperty); +PHP_METHOD(imagick, deleteimageproperty); +PHP_METHOD(imagick, identifyformat); +#if IM_HAVE_IMAGICK_SETIMAGEINTERPOLATEMETHOD +PHP_METHOD(imagick, setimageinterpolatemethod); +#endif +PHP_METHOD(imagick, getimageinterpolatemethod); +PHP_METHOD(imagick, linearstretchimage); +PHP_METHOD(imagick, getimagelength); +PHP_METHOD(imagick, extentimage); +#endif +#if MagickLibVersion > 0x633 +PHP_METHOD(imagick, getimageorientation); +PHP_METHOD(imagick, setimageorientation); +#endif +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion > 0x634 +PHP_METHOD(imagick, paintfloodfillimage); +#endif +#endif +#if MagickLibVersion > 0x635 +PHP_METHOD(imagick, clutimage); +PHP_METHOD(imagick, getimageproperties); +PHP_METHOD(imagick, getimageprofiles); +PHP_METHOD(imagick, distortimage); +PHP_METHOD(imagick, writeimagefile); +PHP_METHOD(imagick, writeimagesfile); +PHP_METHOD(imagick, resetimagepage); + +#if MagickLibVersion < 0x700 +PHP_METHOD(imagick, setimageclipmask); +PHP_METHOD(imagick, getimageclipmask); +#endif +PHP_METHOD(imagick, animateimages); +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 +PHP_METHOD(imagick, recolorimage); +#endif +#endif +#endif +#if MagickLibVersion > 0x636 +PHP_METHOD(imagick, setfont); +PHP_METHOD(imagick, getfont); +PHP_METHOD(imagick, setpointsize); +PHP_METHOD(imagick, getpointsize); +PHP_METHOD(imagick, mergeimagelayers); +#endif +#if MagickLibVersion > 0x637 +PHP_METHOD(imagick, floodfillpaintimage); +PHP_METHOD(imagick, opaquepaintimage); +PHP_METHOD(imagick, transparentpaintimage); +PHP_METHOD(imagick, setimagealphachannel); +#endif +#if MagickLibVersion > 0x638 +PHP_METHOD(imagick, liquidrescaleimage); +PHP_METHOD(imagick, decipherimage); +PHP_METHOD(imagick, encipherimage); +#endif +#if MagickLibVersion > 0x639 +PHP_METHOD(imagick, setgravity); +PHP_METHOD(imagick, getgravity); +PHP_METHOD(imagick, getimagechannelrange); +PHP_METHOD(imagick, getimagealphachannel); +#endif +#if MagickLibVersion > 0x642 +PHP_METHOD(imagick, getimagechanneldistortions); +#endif +#if MagickLibVersion > 0x643 +PHP_METHOD(imagick, getimagegravity); +PHP_METHOD(imagick, setimagegravity); +#endif +#if MagickLibVersion > 0x645 +PHP_METHOD(imagick, importimagepixels); +PHP_METHOD(imagick, deskewimage); + + +#if PHP_IMAGICK_HAVE_HOUGHLINE +PHP_METHOD(imagick, houghlineimage); +#endif +PHP_METHOD(imagick, segmentimage); +PHP_METHOD(imagick, sparsecolorimage); +PHP_METHOD(imagick, remapimage); +#endif +#if MagickLibVersion > 0x646 +PHP_METHOD(imagick, exportimagepixels); +#endif +#if MagickLibVersion > 0x648 +PHP_METHOD(imagick, getimagechannelkurtosis); +PHP_METHOD(imagick, functionimage); +#endif +#if MagickLibVersion > 0x651 +PHP_METHOD(imagick, transformimagecolorspace); +#endif +#if MagickLibVersion > 0x652 +PHP_METHOD(imagick, haldclutimage); +#endif +#if MagickLibVersion > 0x655 +PHP_METHOD(imagick, autolevelimage); +PHP_METHOD(imagick, blueshiftimage); +#endif +#if MagickLibVersion > 0x656 +PHP_METHOD(imagick, setimageartifact); +PHP_METHOD(imagick, getimageartifact); +PHP_METHOD(imagick, deleteimageartifact); +PHP_METHOD(imagick, setcolorspace); +PHP_METHOD(imagick, getcolorspace); +PHP_METHOD(imagick, clampimage); +#endif +#if MagickLibVersion > 0x667 +PHP_METHOD(imagick, smushimages); +#endif + +PHP_METHOD(imagick, __construct); +PHP_METHOD(imagick, __tostring); +PHP_METHOD(imagick, count); +PHP_METHOD(imagick, getpixeliterator); +PHP_METHOD(imagick, getpixelregioniterator); +PHP_METHOD(imagick, readimage); +PHP_METHOD(imagick, readimages); +PHP_METHOD(imagick, pingimage); +PHP_METHOD(imagick, readimageblob); +PHP_METHOD(imagick, readimagefile); +PHP_METHOD(imagick, displayimage); +PHP_METHOD(imagick, displayimages); +PHP_METHOD(imagick, destroy); +PHP_METHOD(imagick, clear); +PHP_METHOD(imagick, clone); +PHP_METHOD(imagick, removeimage); +PHP_METHOD(imagick, writeimage); +PHP_METHOD(imagick, writeimages); +PHP_METHOD(imagick, resetiterator); +PHP_METHOD(imagick, setfirstiterator); +PHP_METHOD(imagick, setlastiterator); +PHP_METHOD(imagick, previousimage); +PHP_METHOD(imagick, nextimage); +PHP_METHOD(imagick, haspreviousimage); +PHP_METHOD(imagick, hasnextimage); +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 +PHP_METHOD(imagick, setimageindex); +PHP_METHOD(imagick, getimageindex); +#endif // #if MagickLibVersion < 0x700 +#endif +PHP_METHOD(imagick, setimageformat); +PHP_METHOD(imagick, setimagefilename); +PHP_METHOD(imagick, getimagefilename); +PHP_METHOD(imagick, getimageformat); +PHP_METHOD(imagick, getimagemimetype); +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 +PHP_METHOD(imagick, getimagesize); +#endif +#endif +PHP_METHOD(imagick, getimagegeometry); +PHP_METHOD(imagick, getimagecolors); +PHP_METHOD(imagick, scaleimage); +PHP_METHOD(imagick, blurimage); +PHP_METHOD(imagick, thumbnailimage); +PHP_METHOD(imagick, cropthumbnailimage); +PHP_METHOD(imagick, commentimage); +PHP_METHOD(imagick, cropimage); +PHP_METHOD(imagick, labelimage); +PHP_METHOD(imagick, valid); +PHP_METHOD(imagick, current); +PHP_METHOD(imagick, drawimage); +PHP_METHOD(imagick, getimageblob); +PHP_METHOD(imagick, getimagesblob); +PHP_METHOD(imagick, setimagecompressionquality); +PHP_METHOD(imagick, getimagecompressionquality); +PHP_METHOD(imagick, setimagecompression); +PHP_METHOD(imagick, getimagecompression); +PHP_METHOD(imagick, annotateimage); +PHP_METHOD(imagick, compositeimage); +PHP_METHOD(imagick, modulateimage); +PHP_METHOD(imagick, montageimage); +PHP_METHOD(imagick, morphology); +PHP_METHOD(imagick, identifyimage); +PHP_METHOD(imagick, thresholdimage); +PHP_METHOD(imagick, adaptivethresholdimage); +PHP_METHOD(imagick, blackthresholdimage); +PHP_METHOD(imagick, whitethresholdimage); +PHP_METHOD(imagick, appendimages); +PHP_METHOD(imagick, charcoalimage); +PHP_METHOD(imagick, normalizeimage); +PHP_METHOD(imagick, oilpaintimage); +PHP_METHOD(imagick, posterizeimage); +#if MagickLibVersion < 0x700 +PHP_METHOD(imagick, radialblurimage); +#endif +PHP_METHOD(imagick, raiseimage); +PHP_METHOD(imagick, resampleimage); +PHP_METHOD(imagick, resizeimage); +PHP_METHOD(imagick, rollimage); +PHP_METHOD(imagick, rotateimage); +PHP_METHOD(imagick, sampleimage); +PHP_METHOD(imagick, solarizeimage); +PHP_METHOD(imagick, shadowimage); +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 +PHP_METHOD(imagick, setimageattribute); +#endif // #if MagickLibVersion < 0x700 +#endif +PHP_METHOD(imagick, setimagebackgroundcolor); +#if MagickLibVersion >= 0x700 +PHP_METHOD(imagick, setimagechannelmask); +#endif +PHP_METHOD(imagick, setimagecompose); +PHP_METHOD(imagick, setimagecompression); +PHP_METHOD(imagick, setimagedelay); +PHP_METHOD(imagick, setimagedepth); +PHP_METHOD(imagick, setimagegamma); +PHP_METHOD(imagick, setimageiterations); +#if MagickLibVersion < 0x700 +PHP_METHOD(imagick, setimagemattecolor); +#endif // #if MagickLibVersion < 0x700 +PHP_METHOD(imagick, setimagepage); +PHP_METHOD(imagick, setimageprogressmonitor); +#if MagickLibVersion > 0x653 +PHP_METHOD(imagick, setprogressmonitor); +#endif +PHP_METHOD(imagick, setimageresolution); +PHP_METHOD(imagick, setimagescene); +PHP_METHOD(imagick, setimagetickspersecond); +PHP_METHOD(imagick, setimagetype); +PHP_METHOD(imagick, setimageunits); +PHP_METHOD(imagick, sharpenimage); +PHP_METHOD(imagick, shaveimage); +PHP_METHOD(imagick, shearimage); +PHP_METHOD(imagick, spliceimage); +PHP_METHOD(imagick, spreadimage); +PHP_METHOD(imagick, swirlimage); +PHP_METHOD(imagick, stripimage); +PHP_METHOD(imagick, queryformats); +PHP_METHOD(imagick, queryfonts); +PHP_METHOD(imagick, queryfontmetrics); +PHP_METHOD(imagick, steganoimage); +PHP_METHOD(imagick, motionblurimage); +#if MagickLibVersion < 0x700 +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +PHP_METHOD(imagick, mosaicimages); +#endif +#endif +PHP_METHOD(imagick, morphimages); +PHP_METHOD(imagick, minifyimage); +PHP_METHOD(imagick, addnoiseimage); +PHP_METHOD(imagick, affinetransformimage); +#if MagickLibVersion < 0x700 +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +PHP_METHOD(imagick, averageimages); +#endif +#endif +PHP_METHOD(imagick, borderimage); +PHP_METHOD(imagick, calculatecrop); +PHP_METHOD(imagick, chopimage); +PHP_METHOD(imagick, clipimage); +PHP_METHOD(imagick, clippathimage); +PHP_METHOD(imagick, coalesceimages); +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 +PHP_METHOD(imagick, colorfloodfillimage); +#endif //#if MagickLibVersion < 0x700 +#endif +PHP_METHOD(imagick, colorizeimage); +PHP_METHOD(imagick, compareimagechannels); +PHP_METHOD(imagick, compareimages); +PHP_METHOD(imagick, contrastimage); +PHP_METHOD(imagick, combineimages); +PHP_METHOD(imagick, convolveimage); +PHP_METHOD(imagick, cyclecolormapimage); +PHP_METHOD(imagick, deconstructimages); +PHP_METHOD(imagick, despeckleimage); +PHP_METHOD(imagick, edgeimage); +PHP_METHOD(imagick, embossimage); +PHP_METHOD(imagick, enhanceimage); +PHP_METHOD(imagick, equalizeimage); +PHP_METHOD(imagick, evaluateimage); +#if MagickLibVersion >= 0x687 +PHP_METHOD(imagick, evaluateimages); +#endif +#if MagickLibVersion < 0x700 +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +PHP_METHOD(imagick, flattenimages); +#endif +#endif +PHP_METHOD(imagick, flipimage); +PHP_METHOD(imagick, flopimage); +#if MagickLibVersion >= 0x655 +PHP_METHOD(imagick, forwardfouriertransformimage); +#endif +PHP_METHOD(imagick, frameimage); +PHP_METHOD(imagick, fximage); +PHP_METHOD(imagick, gammaimage); +PHP_METHOD(imagick, gaussianblurimage); +#if MagickLibVersion < 0x700 +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +PHP_METHOD(imagick, getimageattribute); +#endif +#endif +PHP_METHOD(imagick, getimagebackgroundcolor); +PHP_METHOD(imagick, getimageblueprimary); +PHP_METHOD(imagick, getimagebordercolor); +PHP_METHOD(imagick, getimagechanneldepth); +PHP_METHOD(imagick, getimagechanneldistortion); +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 +PHP_METHOD(imagick, getimagechannelextrema); +#endif // #if MagickLibVersion < 0x700 +#endif +PHP_METHOD(imagick, getimagechannelmean); +PHP_METHOD(imagick, getimagechannelstatistics); +PHP_METHOD(imagick, getimagecolormapcolor); +PHP_METHOD(imagick, getimagecolorspace); +PHP_METHOD(imagick, getimagecompose); +PHP_METHOD(imagick, getimagedelay); +PHP_METHOD(imagick, getimagedepth); +PHP_METHOD(imagick, getimagedistortion); +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 +PHP_METHOD(imagick, getimageextrema); +#endif // #if MagickLibVersion < 0x700 +#endif +PHP_METHOD(imagick, getimagedispose); +PHP_METHOD(imagick, getimagegamma); +PHP_METHOD(imagick, getimagegreenprimary); +PHP_METHOD(imagick, getimageheight); +PHP_METHOD(imagick, getimagehistogram); +PHP_METHOD(imagick, getimageinterlacescheme); +PHP_METHOD(imagick, getimageiterations); +#if MagickLibVersion < 0x700 +PHP_METHOD(imagick, getimagemattecolor); +#endif //#if MagickLibVersion < 0x700 +PHP_METHOD(imagick, getimagepage); +PHP_METHOD(imagick, getimagepixelcolor); +PHP_METHOD(imagick, setImagePixelColor); +PHP_METHOD(imagick, getimageprofile); +PHP_METHOD(imagick, getimageredprimary); +PHP_METHOD(imagick, getimagerenderingintent); +PHP_METHOD(imagick, getimageresolution); +PHP_METHOD(imagick, getimagescene); +PHP_METHOD(imagick, getimagesignature); +PHP_METHOD(imagick, getimagetickspersecond); +PHP_METHOD(imagick, getimagetype); +PHP_METHOD(imagick, getimageunits); +PHP_METHOD(imagick, getimagevirtualpixelmethod); +PHP_METHOD(imagick, getimagewhitepoint); +PHP_METHOD(imagick, getimagewidth); +PHP_METHOD(imagick, getnumberimages); +PHP_METHOD(imagick, getimagetotalinkdensity); +PHP_METHOD(imagick, getimageregion); +PHP_METHOD(imagick, implodeimage); +#if MagickLibVersion >= 0x658 +PHP_METHOD(imagick, inversefouriertransformimage); +#endif +PHP_METHOD(imagick, levelimage); +PHP_METHOD(imagick, magnifyimage); +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 +PHP_METHOD(imagick, mapimage); +PHP_METHOD(imagick, mattefloodfillimage); +#endif // #if MagickLibVersion < 0x700 +#endif +#if MagickLibVersion < 0x700 +PHP_METHOD(imagick, medianfilterimage); +#endif +PHP_METHOD(imagick, negateimage); +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 +PHP_METHOD(imagick, paintopaqueimage); +PHP_METHOD(imagick, painttransparentimage); +#endif //#if MagickLibVersion < 0x700 +#endif +PHP_METHOD(imagick, previewimages); +PHP_METHOD(imagick, profileimage); +PHP_METHOD(imagick, quantizeimage); +PHP_METHOD(imagick, quantizeimages); +#if MagickLibVersion < 0x700 +PHP_METHOD(imagick, reducenoiseimage); +#endif +PHP_METHOD(imagick, removeimageprofile); +PHP_METHOD(imagick, separateimagechannel); +PHP_METHOD(imagick, sepiatoneimage); + +#if MagickLibVersion < 0x700 +PHP_METHOD(imagick, setimagebias); +PHP_METHOD(imagick, setimagebiasquantum); +#endif + +PHP_METHOD(imagick, setimageblueprimary); +PHP_METHOD(imagick, setimagebordercolor); +PHP_METHOD(imagick, setimagechanneldepth); +PHP_METHOD(imagick, setimagecolormapcolor); +PHP_METHOD(imagick, setimagecolorspace); +PHP_METHOD(imagick, setimagedispose); +PHP_METHOD(imagick, setimageextent); +PHP_METHOD(imagick, setimagegreenprimary); +PHP_METHOD(imagick, setimageinterlacescheme); +PHP_METHOD(imagick, setimageprofile); +PHP_METHOD(imagick, setimageredprimary); +PHP_METHOD(imagick, setimagerenderingintent); +PHP_METHOD(imagick, setimagevirtualpixelmethod); +PHP_METHOD(imagick, setimagewhitepoint); +PHP_METHOD(imagick, sigmoidalcontrastimage); +PHP_METHOD(imagick, stereoimage); +PHP_METHOD(imagick, textureimage); +PHP_METHOD(imagick, tintimage); +PHP_METHOD(imagick, unsharpmaskimage); +PHP_METHOD(imagick, getimage); +PHP_METHOD(imagick, setimage); +PHP_METHOD(imagick, addimage); +PHP_METHOD(imagick, newimage); +PHP_METHOD(imagick, newpseudoimage); +PHP_METHOD(imagick, getcompression); +PHP_METHOD(imagick, getcompressionquality); +PHP_METHOD(imagick, getcopyright); +PHP_METHOD(imagick, getconfigureoptions); +#if MagickLibVersion > 0x660 +PHP_METHOD(imagick, getfeatures); +#endif +PHP_METHOD(imagick, getfilename); +PHP_METHOD(imagick, getformat); +PHP_METHOD(imagick, gethomeurl); +PHP_METHOD(imagick, getinterlacescheme); +PHP_METHOD(imagick, getoption); +PHP_METHOD(imagick, getpackagename); +PHP_METHOD(imagick, getpage); +PHP_METHOD(imagick, gethdrienabled); +PHP_METHOD(imagick, getquantum); +PHP_METHOD(imagick, getquantumdepth); +PHP_METHOD(imagick, getquantumrange); +PHP_METHOD(imagick, getreleasedate); +PHP_METHOD(imagick, getresource); +PHP_METHOD(imagick, getresourcelimit); +PHP_METHOD(imagick, getsamplingfactors); +PHP_METHOD(imagick, getsize); +PHP_METHOD(imagick, getversion); +PHP_METHOD(imagick, setbackgroundcolor); +PHP_METHOD(imagick, setcompression); +PHP_METHOD(imagick, setcompressionquality); +PHP_METHOD(imagick, setfilename); +PHP_METHOD(imagick, setformat); +PHP_METHOD(imagick, setinterlacescheme); +PHP_METHOD(imagick, setoption); +PHP_METHOD(imagick, setpage); +PHP_METHOD(imagick, setresourcelimit); +PHP_METHOD(imagick, setresolution); +PHP_METHOD(imagick, setsamplingfactors); +PHP_METHOD(imagick, setsize); +PHP_METHOD(imagick, settype); +PHP_METHOD(imagick, brightnesscontrastimage); +#if MagickLibVersion > 0x661 +PHP_METHOD(imagick, colormatriximage); +#endif +PHP_METHOD(imagick, selectiveblurimage); +#if MagickLibVersion >= 0x689 +PHP_METHOD(imagick, rotationalblurimage); +#endif +#if MagickLibVersion >= 0x687 +PHP_METHOD(imagick, optimizeimagetransparency); +#endif +#if MagickLibVersion >= 0x683 +PHP_METHOD(imagick, statisticimage); +#endif +#if MagickLibVersion >= 0x652 +PHP_METHOD(imagick, subimagematch); +#endif + +PHP_METHOD(imagick, setregistry); +PHP_METHOD(imagick, getregistry); +PHP_METHOD(imagick, listregistry); +PHP_METHOD(imagick, morphology); +#if MagickLibVersion < 0x700 +PHP_METHOD(imagick, filter); +#endif // #if MagickLibVersion < 0x700 +PHP_METHOD(imagick, setantialias); +PHP_METHOD(imagick, getantialias); +#if MagickLibVersion > 0x676 +PHP_METHOD(imagick, colordecisionlistimage); +#endif + +#if MagickLibVersion >= 0x660 +PHP_METHOD(imagick, autogammaimage); +#endif //#if MagickLibVersion >= 0x660 +#if MagickLibVersion >= 0x692 +PHP_METHOD(imagick, autoorient); +PHP_METHOD(imagick, compositeimagegravity); +#endif // #if MagickLibVersion >= 0x692 +#if MagickLibVersion >= 0x692 +PHP_METHOD(imagick, localcontrastimage); +#endif // #if MagickLibVersion >= 0x692 +#if MagickLibVersion >= 0x700 +PHP_METHOD(imagick, identifyimagetype); +#endif // #if MagickLibVersion >= 0x700 + +#if IM_HAVE_IMAGICK_SETSEED +PHP_METHOD(imagick, setSeed); +#endif +#if IM_HAVE_IMAGICK_WAVELETDENOISEIMAGE +PHP_METHOD(imagick, waveletDenoiseImage); +#endif +#if IM_HAVE_IMAGICK_MEANSHIFTIMAGE +PHP_METHOD(imagick, meanShiftImage); +#endif +#if IM_HAVE_IMAGICK_KMEANSIMAGE +PHP_METHOD(imagick, kmeansImage); +#endif +#if IM_HAVE_IMAGICK_RANGETHRESHOLDIMAGE +PHP_METHOD(imagick, rangeThresholdImage); +#endif +#if IM_HAVE_IMAGICK_AUTOTHRESHOLDIMAGE +PHP_METHOD(imagick, autoThresholdImage); +#endif +#if IM_HAVE_IMAGICK_BILATERALBLURIMAGE +PHP_METHOD(imagick, bilateralBlurImage); +#endif +#if IM_HAVE_IMAGICK_CLAHEIMAGE +PHP_METHOD(imagick, claheImage); +#endif + +#if IM_HAVE_IMAGICK_CHANNELFXIMAGE +PHP_METHOD(imagick, channelFxImage); +#endif + +#if IM_HAVE_IMAGICK_COLORTHRESHOLDIMAGE +PHP_METHOD(imagick, colorThresholdImage); +#endif +#if IM_HAVE_IMAGICK_COMPLEXIMAGES +PHP_METHOD(imagick, complexImages); +#endif +#if IM_HAVE_IMAGICK_INTERPOLATIVERESIZEIMAGE +PHP_METHOD(imagick, interpolativeResizeImage); +#endif +#if IM_HAVE_IMAGICK_LEVELIMAGECOLORS +PHP_METHOD(imagick, levelImageColors); +#endif +#if IM_HAVE_IMAGICK_LEVELIZEIMAGE +PHP_METHOD(imagick, levelizeImage); +#endif +#if IM_HAVE_IMAGICK_ORDEREDDITHERIMAGE +PHP_METHOD(imagick, orderedDitherImage); +#endif +#if IM_HAVE_IMAGICK_WHITEBALANCEIMAGE +PHP_METHOD(imagick, whiteBalanceImage); +#endif + + + + + + + + + + + + +/* Forward declarations (ImagickDraw) */ +#if MagickLibVersion > 0x628 +PHP_METHOD(imagickdraw, resetvectorgraphics); +#endif +#if MagickLibVersion > 0x649 +PHP_METHOD(imagickdraw, gettextkerning); +PHP_METHOD(imagickdraw, settextkerning); +PHP_METHOD(imagickdraw, gettextinterwordspacing); +PHP_METHOD(imagickdraw, settextinterwordspacing); +#endif +#if MagickLibVersion > 0x655 +PHP_METHOD(imagickdraw, gettextinterlinespacing); +PHP_METHOD(imagickdraw, settextinterlinespacing); +#endif +PHP_METHOD(imagickdraw, __construct); +PHP_METHOD(imagickdraw, setfillcolor); +PHP_METHOD(imagickdraw, setfillalpha); +PHP_METHOD(imagickdraw, setresolution); +PHP_METHOD(imagickdraw, setstrokecolor); +PHP_METHOD(imagickdraw, setstrokealpha); +PHP_METHOD(imagickdraw, setstrokewidth); +PHP_METHOD(imagickdraw, setfont); +PHP_METHOD(imagickdraw, setfontfamily); +PHP_METHOD(imagickdraw, setfontsize); +PHP_METHOD(imagickdraw, setfontstyle); +PHP_METHOD(imagickdraw, setfontweight); +PHP_METHOD(imagickdraw, getfont); +PHP_METHOD(imagickdraw, getfontfamily); +PHP_METHOD(imagickdraw, getfontsize); +PHP_METHOD(imagickdraw, getfontstyle); +PHP_METHOD(imagickdraw, getfontweight); +PHP_METHOD(imagickdraw, clear); +PHP_METHOD(imagickdraw, destroy); +PHP_METHOD(imagickdraw, annotation); +PHP_METHOD(imagickdraw, settextantialias); +PHP_METHOD(imagickdraw, settextencoding); +PHP_METHOD(imagickdraw, rectangle); +PHP_METHOD(imagickdraw, roundrectangle); +PHP_METHOD(imagickdraw, ellipse); +PHP_METHOD(imagickdraw, circle); +PHP_METHOD(imagickdraw, skewx); +PHP_METHOD(imagickdraw, skewy); +PHP_METHOD(imagickdraw, translate); +PHP_METHOD(imagickdraw, line); +PHP_METHOD(imagickdraw, polygon); +PHP_METHOD(imagickdraw, arc); + +#if MagickLibVersion >= 0x700 +PHP_METHOD(imagickdraw, alpha); +#else +PHP_METHOD(imagickdraw, matte); +#endif + +PHP_METHOD(imagickdraw, point); +PHP_METHOD(imagickdraw, getfontstretch); +PHP_METHOD(imagickdraw, setfontstretch); +PHP_METHOD(imagickdraw, settextalignment); +PHP_METHOD(imagickdraw, settextdecoration); +PHP_METHOD(imagickdraw, settextundercolor); +PHP_METHOD(imagickdraw, setviewbox); +PHP_METHOD(imagickdraw, gettextdecoration); +PHP_METHOD(imagickdraw, gettextencoding); +PHP_METHOD(imagickdraw, clone); +PHP_METHOD(imagickdraw, affine); +PHP_METHOD(imagickdraw, bezier); +PHP_METHOD(imagickdraw, composite); +PHP_METHOD(imagickdraw, color); +PHP_METHOD(imagickdraw, comment); +PHP_METHOD(imagickdraw, getclippath); +PHP_METHOD(imagickdraw, getcliprule); +PHP_METHOD(imagickdraw, getclipunits); +PHP_METHOD(imagickdraw, getfillcolor); +PHP_METHOD(imagickdraw, getfillopacity); +PHP_METHOD(imagickdraw, getfillrule); +PHP_METHOD(imagickdraw, getgravity); +PHP_METHOD(imagickdraw, getstrokeantialias); +PHP_METHOD(imagickdraw, getstrokecolor); +PHP_METHOD(imagickdraw, getstrokedasharray); +PHP_METHOD(imagickdraw, getstrokedashoffset); +PHP_METHOD(imagickdraw, getstrokelinecap); +PHP_METHOD(imagickdraw, getstrokelinejoin); +PHP_METHOD(imagickdraw, getstrokemiterlimit); +PHP_METHOD(imagickdraw, getstrokeopacity); +PHP_METHOD(imagickdraw, getstrokewidth); +PHP_METHOD(imagickdraw, gettextalignment); +PHP_METHOD(imagickdraw, gettextantialias); +PHP_METHOD(imagickdraw, getvectorgraphics); +PHP_METHOD(imagickdraw, gettextundercolor); +PHP_METHOD(imagickdraw, pathclose); +PHP_METHOD(imagickdraw, pathcurvetoabsolute); +PHP_METHOD(imagickdraw, pathcurvetorelative); +PHP_METHOD(imagickdraw, pathcurvetoquadraticbezierabsolute); +PHP_METHOD(imagickdraw, pathcurvetoquadraticbezierrelative); +PHP_METHOD(imagickdraw, pathcurvetoquadraticbeziersmoothabsolute); +PHP_METHOD(imagickdraw, pathcurvetoquadraticbeziersmoothrelative); +PHP_METHOD(imagickdraw, pathcurvetosmoothabsolute); +PHP_METHOD(imagickdraw, pathcurvetosmoothrelative); +PHP_METHOD(imagickdraw, pathellipticarcabsolute); +PHP_METHOD(imagickdraw, pathellipticarcrelative); +PHP_METHOD(imagickdraw, pathfinish); +PHP_METHOD(imagickdraw, pathlinetoabsolute); +PHP_METHOD(imagickdraw, pathlinetorelative); +PHP_METHOD(imagickdraw, pathlinetohorizontalabsolute); +PHP_METHOD(imagickdraw, pathlinetohorizontalrelative); +PHP_METHOD(imagickdraw, pathlinetoverticalabsolute); +PHP_METHOD(imagickdraw, pathlinetoverticalrelative); +PHP_METHOD(imagickdraw, pathmovetoabsolute); +PHP_METHOD(imagickdraw, pathmovetorelative); +PHP_METHOD(imagickdraw, pathstart); +PHP_METHOD(imagickdraw, polyline); +PHP_METHOD(imagickdraw, popclippath); +PHP_METHOD(imagickdraw, popdefs); +PHP_METHOD(imagickdraw, poppattern); +PHP_METHOD(imagickdraw, pushclippath); +PHP_METHOD(imagickdraw, pushdefs); +PHP_METHOD(imagickdraw, pushpattern); +PHP_METHOD(imagickdraw, render); +PHP_METHOD(imagickdraw, rotate); +PHP_METHOD(imagickdraw, scale); +PHP_METHOD(imagickdraw, setclippath); +PHP_METHOD(imagickdraw, setcliprule); +PHP_METHOD(imagickdraw, setclipunits); +PHP_METHOD(imagickdraw, setfillopacity); +PHP_METHOD(imagickdraw, setfillpatternurl); +PHP_METHOD(imagickdraw, setfillrule); +PHP_METHOD(imagickdraw, setgravity); +PHP_METHOD(imagickdraw, setstrokepatternurl); +PHP_METHOD(imagickdraw, setstrokeantialias); +PHP_METHOD(imagickdraw, setstrokedasharray); +PHP_METHOD(imagickdraw, setstrokedashoffset); +PHP_METHOD(imagickdraw, setstrokelinecap); +PHP_METHOD(imagickdraw, setstrokelinejoin); +PHP_METHOD(imagickdraw, setstrokemiterlimit); +PHP_METHOD(imagickdraw, setstrokeopacity); +PHP_METHOD(imagickdraw, setvectorgraphics); +PHP_METHOD(imagickdraw, pop); +PHP_METHOD(imagickdraw, push); +#if MagickLibVersion >= 0x693 +PHP_METHOD(imagickdraw, getopacity); +PHP_METHOD(imagickdraw, setopacity); +#endif //MagickLibVersion >= 0x693 + +#if MagickLibVersion >= 0x675 +PHP_METHOD(imagickdraw, getfontresolution); +PHP_METHOD(imagickdraw, setfontresolution); +PHP_METHOD(imagickdraw, getbordercolor); +PHP_METHOD(imagickdraw, setbordercolor); +#endif //#if MagickLibVersion >= 0x675 + +#if MagickLibVersion >= 0x693 +PHP_METHOD(imagickdraw, setdensity); +PHP_METHOD(imagickdraw, getdensity); +#endif// #if MagickLibVersion >= 0x693 + +#if MagickLibVersion >= 0x692 +PHP_METHOD(imagickdraw, gettextdirection); +PHP_METHOD(imagickdraw, settextdirection); +#endif //#if MagickLibVersion >= 0x692 + +/* Imagick Pixel iterator */ +PHP_METHOD(imagickpixeliterator, __construct); +PHP_METHOD(imagickpixeliterator, newpixeliterator); +PHP_METHOD(imagickpixeliterator, newpixelregioniterator); +PHP_METHOD(imagickpixeliterator, getpixeliterator); +PHP_METHOD(imagickpixeliterator, getpixelregioniterator); +PHP_METHOD(imagickpixeliterator, getiteratorrow); +PHP_METHOD(imagickpixeliterator, setiteratorrow); +PHP_METHOD(imagickpixeliterator, getpreviousiteratorrow); +PHP_METHOD(imagickpixeliterator, getcurrentiteratorrow); +PHP_METHOD(imagickpixeliterator, getnextiteratorrow); +PHP_METHOD(imagickpixeliterator, setiteratorfirstrow); +PHP_METHOD(imagickpixeliterator, setiteratorlastrow); +PHP_METHOD(imagickpixeliterator, resetiterator); +PHP_METHOD(imagickpixeliterator, synciterator); +PHP_METHOD(imagickpixeliterator, destroy); +PHP_METHOD(imagickpixeliterator, clear); +PHP_METHOD(imagickpixeliterator, valid); + +/* ImagickPixel */ +#if MagickLibVersion > 0x628 +PHP_METHOD(imagickpixel, gethsl); +PHP_METHOD(imagickpixel, sethsl); +PHP_METHOD(imagickpixel, getcolorvaluequantum); +PHP_METHOD(imagickpixel, setcolorvaluequantum); +PHP_METHOD(imagickpixel, getindex); +PHP_METHOD(imagickpixel, setindex); +#endif +PHP_METHOD(imagickpixel, __construct); +PHP_METHOD(imagickpixel, setcolor); +PHP_METHOD(imagickpixel, clear); +PHP_METHOD(imagickpixel, destroy); +PHP_METHOD(imagickpixel, ispixelsimilarquantum); +PHP_METHOD(imagickpixel, ispixelsimilar); +PHP_METHOD(imagickpixel, getcolorvalue); +PHP_METHOD(imagickpixel, setcolorvalue); +PHP_METHOD(imagickpixel, getcolor); +PHP_METHOD(imagickpixel, getcolorquantum); +PHP_METHOD(imagickpixel, getcolorasstring); +PHP_METHOD(imagickpixel, getcolorcount); +PHP_METHOD(imagickpixel, setcolorcount); +PHP_METHOD(imagickpixel, clone); +#if MagickLibVersion >= 0x693 +PHP_METHOD(imagickpixel, setcolorfrompixel); +#endif //#if MagickLibVersion >= 0x693 + +#ifdef IMAGICK_WITH_KERNEL +PHP_METHOD(imagickkernel, __construct); +PHP_METHOD(imagickkernel, frommatrix); +PHP_METHOD(imagickkernel, frombuiltin); +PHP_METHOD(imagickkernel, addkernel); +PHP_METHOD(imagickkernel, getmatrix); +PHP_METHOD(imagickkernel, separate); +PHP_METHOD(imagickkernel, scale); +PHP_METHOD(imagickkernel, addunitykernel); +#endif + +#if MagickLibVersion < 0x700 +#define KernelValueType double +#else +#define KernelValueType MagickRealType +#endif + + +// This is defined as 'UndefinedChannel' so that when the functions go through +// the shim functions in shim_im6_to_im7.c I can check for whether the user actually +// set the channel or not. +#if MagickLibVersion >= 0x700 +#define IM_DEFAULT_CHANNEL UndefinedChannel +#else +#define IM_DEFAULT_CHANNEL DefaultChannels +#endif + +#endif /* PHP_IMAGICK_DEFS_H */
View file
imagick-3.8.0.tgz/imagick-3.8.0/php_imagick_file.h
Changed
(renamed from imagick-3.7.0/php_imagick_file.h)
View file
imagick-3.8.0.tgz/imagick-3.8.0/php_imagick_helpers.h
Changed
(renamed from imagick-3.7.0/php_imagick_helpers.h)
View file
imagick-3.8.0.tgz/imagick-3.8.0/php_imagick_macros.h
Added
@@ -0,0 +1,79 @@ +/* + +----------------------------------------------------------------------+ + | PHP Version 5 / Imagick | + +----------------------------------------------------------------------+ + | Copyright (c) 2006-2013 Mikko Koppanen, Scott MacVicar | + | ImageMagick (c) ImageMagick Studio LLC | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Mikko Kopppanen <mkoppanen@php.net> | + | Scott MacVicar <scottmac@php.net> | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_IMAGICK_MACROS_H +# define PHP_IMAGICK_MACROS_H + +#define EXTRACT_BUILD_NUMBER(str) ({ \ + int build = 0; \ + const char *s = str; \ + while (*s && !isdigit(*s)) s++; \ + if (*s) build = atoi(s); \ + build; \ +}) + +#define MAGICK_LIB_VERSION_MAJOR ((MagickLibVersion >> 8) & 0xFF) +#define MAGICK_LIB_VERSION_MINOR ((MagickLibVersion >> 4) & 0xF) +#define MAGICK_LIB_VERSION_PATCH (MagickLibVersion & 0xF) +#define MAGICK_LIB_VERSION_BUILD EXTRACT_BUILD_NUMBER(MagickLibAddendum) + +#define MAGICK_LIB_VERSION_GTE(major, minor, patch, build) \ + ((VERSION_MAJOR > (major)) || \ + (VERSION_MAJOR == (major) && VERSION_MINOR > (minor)) || \ + (VERSION_MAJOR == (major) && VERSION_MINOR == (minor) && VERSION_PATCH > (patch)) || \ + (VERSION_MAJOR == (major) && VERSION_MINOR == (minor) && VERSION_PATCH == (patch) && VERSION_BUILD >= (build))) + +#define IMAGICK_FREE_MAGICK_MEMORY(value) \ + do { \ + if (value) { \ + MagickRelinquishMemory(value); \ + value = NULL; \ + } \ + } while (0) + +#if !defined(E_DEPRECATED) +# define E_DEPRECATED E_STRICT +#endif + +#define IMAGICK_METHOD_DEPRECATED(class_name, method_name) \ + php_error(E_DEPRECATED, "%s::%s method is deprecated and it's use should be avoided", class_name, method_name); + +#define IMAGICK_METHOD_DEPRECATED_USE_INSTEAD(class_name, method_name, new_class, new_method) \ + php_error(E_DEPRECATED, "%s::%s is deprecated. %s::%s should be used instead", class_name, method_name, new_class, new_method); + + +#define IMAGICK_KERNEL_NOT_NULL_EMPTY(kernel) \ + if (kernel->kernel_info == NULL) { \ + zend_throw_exception(php_imagickkernel_exception_class_entry, "ImagickKernel is empty, cannot be used", (long)0 TSRMLS_CC); \ + RETURN_THROWS(); \ + } + +#define IMAGICK_NOT_EMPTY(wand) \ + if (php_imagick_ensure_not_empty(wand->magick_wand) == 0) { \ + RETURN_THROWS(); \ + } + +#define IMAGICK_PIXEL_NOT_EMPTY(pixel) \ + if (php_imagickpixel_ensure_not_null(pixel->pixel_wand) == 0) { \ + RETURN_THROWS(); \ + } + + +#endif /* PHP_IMAGICK_MACROS_H */
View file
imagick-3.8.0.tgz/imagick-3.8.0/php_imagick_shared.h
Changed
(renamed from imagick-3.7.0/php_imagick_shared.h)
View file
imagick-3.8.0.tgz/imagick-3.8.0/regen_arginfo.sh
Changed
(renamed from imagick-3.7.0/regen_arginfo.sh)
View file
imagick-3.8.0.tgz/imagick-3.8.0/shim_im6_to_im7.c
Added
@@ -0,0 +1,895 @@ + +/* + +----------------------------------------------------------------------+ + | Imagick | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ +*/ + +#include "php_imagick.h" +#include "php_imagick_defs.h" +#include "php_imagick_macros.h" +#include "php_imagick_helpers.h" +#include "php_imagick_file.h" + + +#if MagickLibVersion >= 0x700 + + +// Functions that have been replaced by channel aware versions +MagickBooleanType MagickAdaptiveBlurImageChannel(MagickWand *wand,const ChannelType channel,const double radius, const double sigma) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickAdaptiveBlurImage(wand, radius, sigma); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + +MagickBooleanType MagickAdaptiveSharpenImageChannel(MagickWand *wand, const ChannelType channel, const double radius, const double sigma) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickAdaptiveSharpenImage(wand, radius, sigma); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + +MagickBooleanType MagickAddNoiseImageChannel(MagickWand *wand,const ChannelType channel,const NoiseType noise_type) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + //TODO - what is the value meant to be? + status = MagickAddNoiseImage(wand, noise_type, 1.0); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + +// This is not actually an ImageMagick function, but the name is likely to +// avoid any symbol clash for the foreseeable. +MagickBooleanType MagickAddNoiseImageChannelWithAttenuate(MagickWand *wand,const ChannelType channel,const NoiseType noise_type, double attenuate) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickAddNoiseImage(wand, noise_type, attenuate); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + + +MagickBooleanType MagickAutoGammaImageChannel(MagickWand *wand, const ChannelType channel) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickAutoGammaImage(wand); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + +MagickBooleanType MagickAutoLevelImageChannel(MagickWand *wand, + const ChannelType channel) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickAutoLevelImage(wand); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + +MagickBooleanType MagickBlurImageChannel(MagickWand *wand, + const ChannelType channel,const double radius,const double sigma) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickBlurImage(wand, radius,sigma); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + +MagickBooleanType MagickBrightnessContrastImageChannel(MagickWand *wand,const ChannelType channel,const double brightness, const double contrast) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickBrightnessContrastImage(wand, brightness, contrast); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + +MagickBooleanType MagickClampImageChannel(MagickWand *wand, const ChannelType channel) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickClampImage(wand); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + +MagickBooleanType MagickClutImageChannel( + MagickWand *wand, + const ChannelType channel, + const MagickWand *clut_wand +) { + MagickBooleanType status; + ChannelType previous_channel_mask; + PixelInterpolateMethod pixelInterpolateMethod; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + pixelInterpolateMethod = MagickGetInterpolateMethod(wand); + status = MagickClutImage(wand, clut_wand, pixelInterpolateMethod); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + +MagickBooleanType MagickCompositeImageChannel(MagickWand *wand, + const ChannelType channel,const MagickWand *source_wand, + const CompositeOperator compose,const ssize_t x,const ssize_t y) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + long clip_to_self = 1; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickCompositeImage(wand, source_wand, compose, clip_to_self, x,y); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + + +MagickWand *MagickCompareImageChannels(MagickWand *wand, const MagickWand *reference, const ChannelType channel, const MetricType metric, double *distortion) { + + MagickWand *tmp_wand; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + tmp_wand = MagickCompareImages(wand, reference, metric, distortion); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + return tmp_wand; +} + + +MagickBooleanType MagickContrastStretchImageChannel(MagickWand *wand, + const ChannelType channel,const double black_point, + const double white_point) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickContrastStretchImage(wand, black_point, white_point); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + +MagickBooleanType MagickConvolveImageChannel(MagickWand *wand, + const ChannelType channel, const KernelInfo *kernel){ + + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickConvolveImage(wand, kernel); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + + +MagickBooleanType MagickEqualizeImageChannel(MagickWand *wand, + const ChannelType channel) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickEqualizeImage(wand); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + + +MagickBooleanType MagickEvaluateImageChannel(MagickWand *wand, + const ChannelType channel,const MagickEvaluateOperator op,const double value) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickEvaluateImage(wand,op,value); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + +//MagickBooleanType MagickFilterImageChannel(MagickWand *wand, +// const ChannelType channel,const KernelInfo *kernel) { +// MagickBooleanType status; +// ChannelType previous_channel_mask; +// +// if (channel != UndefinedChannel) { +// previous_channel_mask = MagickSetImageChannelMask(wand, channel); +// } +// +// status = MagickFilterImage(wand, kernel); +// +// if (channel != UndefinedChannel) { +// (void) MagickSetImageChannelMask(wand, previous_channel_mask); +// } +// +// return status; +//} + +MagickBooleanType MagickFloodfillPaintImageChannel(MagickWand *wand, + const ChannelType channel,const PixelWand *fill,const double fuzz, + const PixelWand *bordercolor,const ssize_t x,const ssize_t y, + const MagickBooleanType invert) { + + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickFloodfillPaintImage(wand, fill, fuzz, bordercolor, x, y, invert); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + +MagickBooleanType MagickFunctionImageChannel(MagickWand *wand, + const ChannelType channel,const MagickFunction function, + const size_t number_arguments,const double *arguments) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickFunctionImage(wand,function,number_arguments,arguments); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + + +MagickWand *MagickFxImageChannel(MagickWand *wand, const ChannelType channel,const char *expression) { + + MagickWand *result_wand; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + result_wand = MagickFxImage(wand, expression); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return result_wand; +} + + +MagickBooleanType MagickGammaImageChannel(MagickWand *wand, + const ChannelType channel,const double gamma) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickGammaImage(wand,gamma); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + +MagickBooleanType MagickGaussianBlurImageChannel(MagickWand *wand, + const ChannelType channel,const double radius,const double sigma) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickGaussianBlurImage(wand,radius,sigma); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + +size_t MagickGetImageChannelDepth(MagickWand *wand, const ChannelType channel) { + size_t depth; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + depth = MagickGetImageDepth(wand); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return depth; +} + +MagickBooleanType MagickGetImageChannelMean(MagickWand *wand, const ChannelType channel,double *mean, + double *standard_deviation) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickGetImageMean(wand, mean, standard_deviation); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + + +MagickBooleanType MagickSetImageChannelDepth(MagickWand *wand, const ChannelType channel, + const size_t depth) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickSetImageDepth(wand, depth); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + +MagickBooleanType MagickGetImageChannelDistortion(MagickWand *wand, + const MagickWand *reference,const ChannelType channel,const MetricType metric, + double *distortion) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickGetImageDistortion(wand, reference, metric, distortion); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + +MagickBooleanType MagickGetImageChannelKurtosis(MagickWand *wand,const ChannelType channel, + double *kurtosis,double *skewness) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickGetImageKurtosis(wand,kurtosis,skewness); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + +MagickBooleanType MagickGetImageChannelRange(MagickWand *wand,const ChannelType channel,double *minima, + double *maxima) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickGetImageRange(wand, minima, maxima); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + +MagickBooleanType MagickOrderedPosterizeImageChannel(MagickWand *wand,const ChannelType channel, + const char *threshold_map) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickOrderedDitherImage(wand, threshold_map); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + +ChannelStatistics *MagickGetImageChannelStatistics(MagickWand *wand) { + return MagickGetImageStatistics(wand); +} + +MagickBooleanType MagickHaldClutImageChannel(MagickWand *wand, const ChannelType channel,const MagickWand *hald_wand) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickHaldClutImage(wand, hald_wand); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + +MagickBooleanType MagickLevelImageChannel(MagickWand *wand, + const ChannelType channel,const double black_point,const double gamma, + const double white_point) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickLevelImage(wand,black_point,gamma, white_point); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + +MagickBooleanType MagickMorphologyImageChannel(MagickWand *wand, + ChannelType channel,MorphologyMethod method,const ssize_t iterations, + KernelInfo *kernel) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickMorphologyImage(wand, method, iterations, kernel); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + +MagickBooleanType MagickMotionBlurImageChannel(MagickWand *wand, + const ChannelType channel,const double radius,const double sigma, + const double angle) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickMotionBlurImage(wand, radius, sigma,angle); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + + +MagickBooleanType MagickNegateImageChannel(MagickWand *wand,const ChannelType channel,const MagickBooleanType gray) { + + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickNegateImage(wand, gray); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + +MagickBooleanType MagickNormalizeImageChannel(MagickWand *wand, + const ChannelType channel) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickNormalizeImage(wand); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + +MagickBooleanType MagickOpaquePaintImageChannel(MagickWand *wand, + const ChannelType channel,const PixelWand *target, + const PixelWand *fill,const double fuzz,const MagickBooleanType invert) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickOpaquePaintImage(wand, target, fill, fuzz, invert); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + + +MagickBooleanType MagickRandomThresholdImageChannel(MagickWand *wand, + const ChannelType channel,const double low,const double high) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickRandomThresholdImage(wand, low, high); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + +MagickBooleanType MagickRotationalBlurImageChannel(MagickWand *wand, + const ChannelType channel,const double angle) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickRotationalBlurImage(wand, angle); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + +MagickBooleanType MagickSelectiveBlurImageChannel(MagickWand *wand, + const ChannelType channel,const double radius,const double sigma, + const double threshold) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickSelectiveBlurImage(wand, radius, sigma, threshold); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + +MagickBooleanType MagickSeparateImageChannel(MagickWand *wand,const ChannelType channel) { + return MagickSeparateImage(wand, channel); +} + +MagickBooleanType MagickSharpenImageChannel(MagickWand *wand, + const ChannelType channel,const double radius,const double sigma) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickSharpenImage(wand, radius, sigma); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + +MagickBooleanType MagickSigmoidalContrastImageChannel( + MagickWand *wand,const ChannelType channel,const MagickBooleanType sharpen, + const double alpha,const double beta) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickSigmoidalContrastImage(wand, sharpen, alpha, beta); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + +MagickBooleanType MagickSolarizeImageChannel(MagickWand *wand, const ChannelType channel,const double threshold) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickSolarizeImage(wand, threshold); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + + + +MagickBooleanType MagickSparseColorImageChannel(MagickWand *wand, const ChannelType channel,const SparseColorMethod method, const size_t number_arguments,const double *arguments) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickSparseColorImage(wand, method, number_arguments, arguments); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + + + +MagickBooleanType MagickStatisticImageChannel(MagickWand *wand, + const ChannelType channel,const StatisticType type,const size_t width, + const size_t height) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickStatisticImage(wand, type, width, height); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + +//MagickBooleanType MagickThresholdImageChannel(MagickWand *wand, +// const ChannelType channel,const double threshold) { +// MagickBooleanType status; +// ChannelType previous_channel_mask; +// +// if (channel != UndefinedChannel) { +// previous_channel_mask = MagickSetImageChannelMask(wand, channel); +// } +// +// status = MagickThresholdImage(wand, threshold); +// +// if (channel != UndefinedChannel) { +// (void) MagickSetImageChannelMask(wand, previous_channel_mask); +// } +// +// return status; +//} + + +MagickBooleanType MagickUnsharpMaskImageChannel(MagickWand *wand, + const ChannelType channel,const double radius,const double sigma, + const double amount,const double threshold) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickUnsharpMaskImage(wand, radius, sigma, amount, threshold); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + + + + +#endif \ No newline at end of file
View file
imagick-3.8.0.tgz/imagick-3.8.0/shim_im6_to_im7.h
Changed
(renamed from imagick-3.7.0/shim_im6_to_im7.h)
View file
imagick-3.8.0.tgz/imagick-3.8.0/shim_php7_to_php8.h
Changed
(renamed from imagick-3.7.0/shim_php7_to_php8.h)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/001_imagick_readimage.phpt
Changed
(renamed from imagick-3.7.0/tests/001_imagick_readimage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/002_thumbnail.phpt
Changed
(renamed from imagick-3.7.0/tests/002_thumbnail.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/003_cast_color_opacity.phpt
Changed
(renamed from imagick-3.7.0/tests/003_cast_color_opacity.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/004_clone.phpt
Changed
(renamed from imagick-3.7.0/tests/004_clone.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/005_bestfit.phpt
Changed
(renamed from imagick-3.7.0/tests/005_bestfit.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/006_cropthumbnail.phpt
Changed
(renamed from imagick-3.7.0/tests/006_cropthumbnail.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/007_thumbnail_fill.phpt
Changed
(renamed from imagick-3.7.0/tests/007_thumbnail_fill.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/008_newpseudoimage.phpt
Changed
(renamed from imagick-3.7.0/tests/008_newpseudoimage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/009_properties.phpt
Changed
(renamed from imagick-3.7.0/tests/009_properties.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/010_importimagepixels.phpt
Changed
(renamed from imagick-3.7.0/tests/010_importimagepixels.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/011_polygon.phpt
Changed
(renamed from imagick-3.7.0/tests/011_polygon.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/012-clone-separation.phpt
Changed
(renamed from imagick-3.7.0/tests/012-clone-separation.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/013-read-filehandle-file-stream.phpt
Added
@@ -0,0 +1,39 @@ +--TEST-- +Imagick::readImageFile, file stream test +--SKIPIF-- +<?php + require_once(dirname(__FILE__) . '/skipif.inc'); + checkFormatPresent('jpg'); +?> +--FILE-- +<?php + +$file = dirname(__FILE__) . '/__tmp_rose.jpg'; +$handle = fopen($file, 'w+'); + +$imagick = new Imagick('magick:rose'); +$imagick->setImageFormat('jpg'); +$imagick->writeImageFile($handle); + +$imagick->clear(); + +rewind($handle); + +$imagick->readImageFile($handle); + +echo "Width: " . $imagick->getImageWidth() . "\n"; +echo "Height: " . $imagick->getImageHeight() . "\n"; + +@unlink($file); + +echo 'success'; + +?> +--CLEAN-- +<?php +@unlink(dirname(__FILE__) . '/__tmp_rose.jpg'); +?> +--EXPECT-- +Width: 70 +Height: 46 +success
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/013-read-filehandle-memory-stream.phpt
Added
@@ -0,0 +1,35 @@ +--TEST-- +Imagick::readImageFile, in-memory stream test +--SKIPIF-- +<?php + require_once(dirname(__FILE__) . '/skipif.inc'); + checkFormatPresent('jpg'); +?> +--XFAIL-- +This test was recently added (July 2024), and appears to be failing on multiple +versions of PHP. It should be fixed, but doesn't need to hold up a release. +--FILE-- +<?php + +$handle = fopen('php://memory', 'w+'); + +$imagick = new Imagick('magick:rose'); +$imagick->setImageFormat('jpg'); +$imagick->writeImageFile($handle); + +$imagick->clear(); + +rewind($handle); + +$imagick->readImageFile($handle); + +echo "Width: " . $imagick->getImageWidth() . "\n"; +echo "Height: " . $imagick->getImageHeight() . "\n"; + +echo 'success'; + +?> +--EXPECT-- +Width: 70 +Height: 46 +success
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/013-read-filehandle.phpt
Added
@@ -0,0 +1,32 @@ +--TEST-- +Imagick::readImageFile test +--SKIPIF-- +<?php + require_once(dirname(__FILE__) . '/skipif.inc'); + checkFormatPresent('jpg'); +?> +--FILE-- +<?php + +$file = dirname(__FILE__) . '/__tmp_rose.jpg'; + +$imagick = new Imagick('magick:rose'); +$imagick->setImageFormat('jpg'); +$imagick->writeImage($file); + +$imagick->clear(); + +$handle = fopen($file, 'rb'); +$imagick->readImageFile($handle); + +@unlink($file); + +echo 'success'; + +?> +--CLEAN-- +<?php +@unlink(dirname(__FILE__) . '/__tmp_rose.jpg'); +?> +--EXPECT-- +success \ No newline at end of file
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/014-setresourcelimit.phpt
Added
@@ -0,0 +1,78 @@ +--TEST-- +Imagick::setResourceLimit test +--SKIPIF-- +<?php +$imageMagickRequiredVersion=0x692; +require_once(dirname(__FILE__) . '/skipif.inc'); +?> +--FILE-- +<?php + + +$k = 1024; +$m = $k * $k; + +// These tests are flaky as the values ImageMagick will accept +// are limited by the policy.xml of the system. +// Also, it appears that some versions of ImageMagick will +// reject overly large values. e.g. setting RESOURCETYPE_WIDTH +// to a billion fails. Which is not totally unreasonable. + +$tests = array( + Imagick::RESOURCETYPE_AREA => 100000000, + + // Set maximum amount of disk space in bytes permitted for use by the pixel cache. When this limit is exceeded, the pixel cache is not be created and an error message is returned. + Imagick::RESOURCETYPE_DISK => 100, + + //Set maximum number of open pixel cache files. When this limit is exceeded, any subsequent pixels cached to disk are closed and reopened on demand. This behavior permits a large number of images to be accessed simultaneously on disk, but with a speed penalty due to repeated open/close calls. + Imagick::RESOURCETYPE_FILE => 100, + + // Set maximum amount of memory map in bytes to allocate for the pixel cache. When this limit is exceeded, the image pixels are cached to disk + Imagick::RESOURCETYPE_MAP => 123 * $m, + + // Set maximum amount of memory in bytes to allocate for the pixel cache from the heap. When this limit is exceeded, the image pixels are cached to memory-mapped disk + Imagick::RESOURCETYPE_MEMORY => 234 * $m, +); + +if (defined('Imagick::RESOURCETYPE_TIME')) { + $testsImagick::RESOURCETYPE_TIME = 30; +} + +if (defined('Imagick::RESOURCETYPE_THROTTLE')) { + $testsImagick::RESOURCETYPE_THROTTLE = 1; +} +if (defined('Imagick::RESOURCETYPE_THREAD')) { + $testsImagick::RESOURCETYPE_THREAD = 1; +} +if (defined('Imagick::RESOURCETYPE_WIDTH')) { + $testsImagick::RESOURCETYPE_WIDTH = 15 * $k; +} +if (defined('Imagick::RESOURCETYPE_HEIGHT')) { + $testsImagick::RESOURCETYPE_HEIGHT = 15 * $k; +} + +$reflection_class = new ReflectionClass(Imagick::class); +$constants = $reflection_class->getConstants(); +$resource_constants = ; +foreach ($constants as $name => $value) { + if (strpos($name, "RESOURCETYPE") === 0) { + $resource_constants$value = $name; + } +} + + +foreach ($tests as $resourceType => $value) { + Imagick::setResourceLimit($resourceType, $value); + $actualValue = Imagick::getResourceLimit($resourceType); + + if ($actualValue != $value) { + $resourceTypeString = $resource_constants$resourceType; + echo "Error testing $resourceTypeString, value returned $actualValue is not $value \n"; + } +} + +echo 'success'; + +?> +--EXPECTF-- +success \ No newline at end of file
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/015-imagickdrawsetresolution.phpt
Changed
(renamed from imagick-3.7.0/tests/015-imagickdrawsetresolution.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/016-static-methods.phpt
Changed
(renamed from imagick-3.7.0/tests/016-static-methods.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/017-clear-destroy.phpt
Changed
(renamed from imagick-3.7.0/tests/017-clear-destroy.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/018-clone-length.phpt
Changed
(renamed from imagick-3.7.0/tests/018-clone-length.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/019-readimages.phpt
Changed
(renamed from imagick-3.7.0/tests/019-readimages.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/020-pixeliterator.phpt
Changed
(renamed from imagick-3.7.0/tests/020-pixeliterator.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/021-countable.phpt
Changed
(renamed from imagick-3.7.0/tests/021-countable.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/022-writeimagefileformat.phpt
Changed
(renamed from imagick-3.7.0/tests/022-writeimagefileformat.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/024-ispixelsimilar.phpt
Changed
(renamed from imagick-3.7.0/tests/024-ispixelsimilar.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/025-function-image.phpt
Changed
(renamed from imagick-3.7.0/tests/025-function-image.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/025-get-color.phpt
Changed
(renamed from imagick-3.7.0/tests/025-get-color.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/026_phpinfo.phpt
Changed
(renamed from imagick-3.7.0/tests/026_phpinfo.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/027_Imagick_adaptiveResizeImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/027_Imagick_adaptiveResizeImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/028_Imagick_adaptiveSharpenImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/028_Imagick_adaptiveSharpenImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/029_Imagick_adaptiveBlurImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/029_Imagick_adaptiveBlurImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/030_Imagick_adaptiveThresholdImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/030_Imagick_adaptiveThresholdImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/031_Imagick_affineTransformImage_basic.phpt
Added
@@ -0,0 +1,146 @@ +--TEST-- +Test Imagick, affineTransformImage +--SKIPIF-- +<?php +$imageMagickRequiredVersion=0x675; +require_once(dirname(__FILE__) . '/skipif.inc'); +if (PHP_OS_FAMILY == 'Windows') die('skip dither is apparently borken on Windows https://github.com/Imagick/imagick/issues/590'); +?> +--XFAIL-- +I don't understand what values are returned in which elements of getImageChannelStatistics +--FILE-- +<?php + + +function checkAllStatsAreValue($channelStatistics, $value) { + + if ($channelStatisticsImagick::CHANNEL_RED'mean' != $value) { + echo "Channel red is wrong " . $channelStatisticsImagick::CHANNEL_RED'mean' . " vs " . $value. "\n"; + } + if ($channelStatisticsImagick::CHANNEL_GREEN'mean' != $value) { + echo "Channel green is wrong " . $channelStatisticsImagick::CHANNEL_GREEN'mean' . " vs " . $value. "\n"; + } + if ($channelStatisticsImagick::CHANNEL_BLUE'mean' != $value) { + echo "Channel blue is wrong " . $channelStatisticsImagick::CHANNEL_BLUE'mean' . " vs " . $value. "\n"; + } + + echo "Stats checked\n"; +} + +function affineTransformImage() { + $imagick = new \Imagick(); + $imagick->newPseudoImage(640, 640, "xc:black"); + $draw = new \ImagickDraw(); + + $angle = deg2rad(45); + //$angle = deg2rad(3); + + $draw->setFillColor('white'); + $draw->setStrokeColor('white'); + $draw->setStrokeWidth(10.0); + $draw->setStrokeLineCap(Imagick::LINECAP_SQUARE); + $draw->setStrokeLineJoin(Imagick::LINEJOIN_BEVEL); + + $draw->line( + $start_x = -50, + $start_y = -50, + $end_x = 690, + $end_y = 690 + ); + + $imagick->drawImage($draw); + + $draw = new \ImagickDraw(); + + $affineRotate = array( + "sx" => cos($angle), "sy" => cos($angle), + "rx" => sin($angle), "ry" => -sin($angle), + "tx" => 0, "ty" => 0, + ); + + $draw->affine($affineRotate); + + $imagick->setImageVirtualPixelMethod(Imagick::VIRTUALPIXELMETHOD_BLACK); + $imagick->affineTransformImage($draw); + $imagick->setImagePage($imagick->getimageWidth(), $imagick->getimageheight(), 0, 0); + + $imagick->cropImage( + $imagick->getImageWidth() - 40, + $imagick->getImageHeight() - 40, + 20, + 20 + ); + + $imagick->setImageFormat('png'); + $imagick->writeImage(__DIR__ . '/test_031.png'); + + + $lineCheckBlack = clone $imagick; + $blackout = new \ImagickDraw(); + $blackout->setStrokeColor('black'); + $blackout->setFillColor('black'); + $blackout->rectangle( + ($lineCheckBlack->getImageWidth() / 2) - 20, + 0, + ($lineCheckBlack->getImageWidth() / 2) + 20, + $lineCheckBlack->getImageHeight() + ); + + $lineCheckBlack->drawImage($blackout); + // $lineCheckBlack->writeImage(__DIR__ . '/test_031_blank.png'); + + $whiteout = new \ImagickDraw(); + $lineCheckWhite = clone $imagick; + $whiteout->setStrokeColor('white'); + $whiteout->setFillColor('white'); + $whiteout->rectangle( + ($lineCheckBlack->getImageWidth() / 2) - 4, + 0, + 0, + $lineCheckBlack->getImageHeight() + ); + $whiteout->rectangle( + ($lineCheckWhite->getImageWidth() / 2) + 4, + 0, + $lineCheckWhite->getImageWidth(), + $lineCheckWhite->getImageHeight() + ); + + $lineCheckWhite->drawImage($whiteout); + // $lineCheckWhite->writeImage(__DIR__ . '/test_031_white.png'); + + $channelStatistics = $lineCheckWhite->getImageChannelStatistics(); + + echo "Checking white\n"; + checkAllStatsAreValue($channelStatistics, Imagick::getQuantum()); + + + $channelStatistics = $lineCheckBlack->getImageChannelStatistics(); +// var_dump( +// "lineCheckBlack channel stats are:", +// $channelStatistics +// ); + + echo "Checking black\n"; + checkAllStatsAreValue($channelStatistics, 0); + + $bytes = $imagick->getImageBlob(); + if (strlen($bytes) <= 0) { echo "Failed to generate image.";} +} + +affineTransformImage() ; +echo "Ok"; +?> +--CLEAN-- +<?php +$f = __DIR__ . "/test_031.png"; +if (file_exists($f)) { + @unlink($f); +} +?> +--EXPECTF-- +Checking white +Stats checked +Checking black +Stats checked +Ok
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/032_Imagick_addNoiseImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/032_Imagick_addNoiseImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/033_Imagick_autoLevelImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/033_Imagick_autoLevelImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/034_Imagick_annotateImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/034_Imagick_annotateImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/035_Imagick_blackThresholdImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/035_Imagick_blackThresholdImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/036_Imagick_blueShiftImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/036_Imagick_blueShiftImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/037_Imagick_blurImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/037_Imagick_blurImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/038_Imagick_brightnessContrastImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/038_Imagick_brightnessContrastImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/039_Imagick_borderImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/039_Imagick_borderImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/039_Imagick_borderImage_im7.phpt
Changed
(renamed from imagick-3.7.0/tests/039_Imagick_borderImage_im7.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/040_Imagick_charcoalImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/040_Imagick_charcoalImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/041_Imagick_chopImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/041_Imagick_chopImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/042_Imagick_clutImage_basic.phpt
Added
@@ -0,0 +1,60 @@ +--TEST-- +Test Imagick, clutImage +--SKIPIF-- +<?php +$imageMagickRequiredVersion=0x675; +require_once(dirname(__FILE__) . '/skipif.inc'); +?> +--FILE-- +<?php + +$draw = new \ImagickDraw(); +$draw->setStrokeOpacity(0); +$draw->setFillColor('black'); +$points = + 'x' => 40 * 3, 'y' => 10 * 5, + 'x' => 20 * 3, 'y' => 20 * 5, + 'x' => 70 * 3, 'y' => 50 * 5, + 'x' => 80 * 3, 'y' => 15 * 5, +; +$draw->polygon($points); +$imagick = new \Imagick(); + +$imagick->setColorspace(\Imagick::COLORSPACE_GRAY); + +$imagick->newPseudoImage( + 300, 300, + "xc:white" +); + +$imagick->drawImage($draw); +$imagick->blurImage(0, 10); + +$draw = new \ImagickDraw(); +$draw->setStrokeOpacity(1); +$draw->setFillColor('red'); +$draw->point(0, 2); +$draw->setFillColor('yellow'); +$draw->rectangle(0, 0, 1, 1); +$gradient = new Imagick(); +$gradient->newPseudoImage(1, 5, 'xc:black'); +$gradient->drawImage($draw); +$gradient->setImageFormat('png'); + + + +$imagick->setImageFormat('png'); + +// This test is for IM < 7 so setInterpolate not available +// Which probably means the clutImage method isn't usuable... +//$imagick->setInterpolateMethod(Imagick::INTERPOLATE_BILINEAR); +$imagick->clutImage($gradient); + +$bytes = $imagick->getImageBlob(); +if (strlen($bytes) <= 0) { echo "Failed to generate image.";} + + +echo "Ok"; +?> +--EXPECTF-- +Ok \ No newline at end of file
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/042_Imagick_clutImage_im7.phpt
Added
@@ -0,0 +1,59 @@ +--TEST-- +Test Imagick, clutImageWithInterpolate +--SKIPIF-- +<?php + +require_once(dirname(__FILE__) . '/skipif.inc'); + +checkClassMethods('Imagick', array('clutImageWithInterpolate')); + +?> +--FILE-- +<?php + +$draw = new \ImagickDraw(); +$draw->setStrokeOpacity(0); +$draw->setFillColor('black'); +$points = + 'x' => 40 * 3, 'y' => 10 * 5, + 'x' => 20 * 3, 'y' => 20 * 5, + 'x' => 70 * 3, 'y' => 50 * 5, + 'x' => 80 * 3, 'y' => 15 * 5, +; +$draw->polygon($points); +$imagick = new \Imagick(); + +$imagick->setColorspace(\Imagick::COLORSPACE_GRAY); + +$imagick->newPseudoImage( + 300, 300, + "xc:white" +); + + +$imagick->drawImage($draw); +$imagick->blurImage(0, 10); + +$draw = new \ImagickDraw(); +$draw->setStrokeOpacity(1); +$draw->setFillColor('red'); +$draw->point(0, 2); +$draw->setFillColor('yellow'); +$draw->rectangle(0, 0, 1, 1); +$gradient = new Imagick(); +$gradient->newPseudoImage(1, 5, 'xc:black'); +$gradient->drawImage($draw); + + +$imagick->setImageFormat('png'); +$imagick->clutImageWithInterpolate($gradient, Imagick::INTERPOLATE_BILINEAR); + +$bytes = $imagick->getImageBlob(); +if (strlen($bytes) <= 0) { echo "Failed to generate image.";} + +// $imagick->writeImage(__DIR__ . "/feels_bad_man.png"); + +echo "Ok"; +?> +--EXPECTF-- +Ok \ No newline at end of file
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/043_Imagick_colorizeImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/043_Imagick_colorizeImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/044_Imagick_colorMatrixImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/044_Imagick_colorMatrixImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/045_Imagick_compositeImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/045_Imagick_compositeImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/046_Imagick_contrastImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/046_Imagick_contrastImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/047_Imagick_convolveImage_6.phpt
Changed
(renamed from imagick-3.7.0/tests/047_Imagick_convolveImage_6.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/047_Imagick_convolveImage_7.phpt
Changed
(renamed from imagick-3.7.0/tests/047_Imagick_convolveImage_7.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/048_Imagick_cropImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/048_Imagick_cropImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/049_Imagick_deskewImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/049_Imagick_deskewImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/050_Imagick_distortImage_Affine.phpt
Changed
(renamed from imagick-3.7.0/tests/050_Imagick_distortImage_Affine.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/051_Imagick_distortImage_Projection.phpt
Changed
(renamed from imagick-3.7.0/tests/051_Imagick_distortImage_Projection.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/052_Imagick_distortImage_Arc.phpt
Changed
(renamed from imagick-3.7.0/tests/052_Imagick_distortImage_Arc.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/053_Imagick_distortImage_RotatedArc.phpt
Changed
(renamed from imagick-3.7.0/tests/053_Imagick_distortImage_RotatedArc.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/054_Imagick_distortImage_Bilinear.phpt
Changed
(renamed from imagick-3.7.0/tests/054_Imagick_distortImage_Bilinear.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/055_Imagick_distortImage_ScaleRotateTransform.phpt
Changed
(renamed from imagick-3.7.0/tests/055_Imagick_distortImage_ScaleRotateTransform.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/056_Imagick_distortImage_Perspective.phpt
Changed
(renamed from imagick-3.7.0/tests/056_Imagick_distortImage_Perspective.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/057_Imagick_distortImage_PerspectiveProjection.phpt
Changed
(renamed from imagick-3.7.0/tests/057_Imagick_distortImage_PerspectiveProjection.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/058_Imagick_distortImage_Polynomial.phpt
Changed
(renamed from imagick-3.7.0/tests/058_Imagick_distortImage_Polynomial.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/059_Imagick_distortImage_Polar.phpt
Changed
(renamed from imagick-3.7.0/tests/059_Imagick_distortImage_Polar.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/060_Imagick_distortImage_Polar.phpt
Changed
(renamed from imagick-3.7.0/tests/060_Imagick_distortImage_Polar.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/061_Imagick_distortImage_Barrel.phpt
Changed
(renamed from imagick-3.7.0/tests/061_Imagick_distortImage_Barrel.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/062_Imagick_distortImage_BarrelInverse.phpt
Changed
(renamed from imagick-3.7.0/tests/062_Imagick_distortImage_BarrelInverse.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/063_Imagick_distortImage_Shepards.phpt
Changed
(renamed from imagick-3.7.0/tests/063_Imagick_distortImage_Shepards.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/064_cropThumbNailImage.phpt
Changed
(renamed from imagick-3.7.0/tests/064_cropThumbNailImage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/065_Imagick_despeckleImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/065_Imagick_despeckleImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/066_Imagick_embossImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/066_Imagick_embossImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/067_Imagick_edgeImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/067_Imagick_edgeImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/068_Imagick_enhanceImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/068_Imagick_enhanceImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/069_Imagick_equalizeImage_case1.phpt
Changed
(renamed from imagick-3.7.0/tests/069_Imagick_equalizeImage_case1.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/070_Imagick_equalizeImage_case2.phpt
Changed
(renamed from imagick-3.7.0/tests/070_Imagick_equalizeImage_case2.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/071_Imagick_flipImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/071_Imagick_flipImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/072_Imagick_evaluateImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/072_Imagick_evaluateImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/073_Imagick_forwardFourierTransformImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/073_Imagick_forwardFourierTransformImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/074_Imagick_flopImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/074_Imagick_flopImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/075_Imagick_floodFillPaintImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/075_Imagick_floodFillPaintImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/076_Imagick_fxImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/076_Imagick_fxImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/077_Imagick_frameImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/077_Imagick_frameImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/077_Imagick_frameImage_im7.phpt
Changed
(renamed from imagick-3.7.0/tests/077_Imagick_frameImage_im7.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/078_Imagick_gammaImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/078_Imagick_gammaImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/079_Imagick_getImageGeometry_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/079_Imagick_getImageGeometry_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/080_Imagick_gaussianBlurImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/080_Imagick_gaussianBlurImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/081_Imagick_getImageHistogram_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/081_Imagick_getImageHistogram_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/083_Imagick_getPixelIterator_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/083_Imagick_getPixelIterator_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/084_Imagick_getPixelRegionIterator_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/084_Imagick_getPixelRegionIterator_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/085_Imagick_haldClutImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/085_Imagick_haldClutImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/086_Imagick_forwardFourierTransformImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/086_Imagick_forwardFourierTransformImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/087_Imagick_levelImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/087_Imagick_levelImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/088_Imagick_implodeImageWithMethod_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/088_Imagick_implodeImageWithMethod_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/088_Imagick_implodeImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/088_Imagick_implodeImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/089_Imagick_medianFilterImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/089_Imagick_medianFilterImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/090_Imagick_magnifyImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/090_Imagick_magnifyImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/091_Imagick_linearStretchImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/091_Imagick_linearStretchImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/092_Imagick_mergeImageLayers_basic.phpt
Added
@@ -0,0 +1,39 @@ +--TEST-- +Test Imagick, mergeImageLayers +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +$layerMethodType = 13; + +function mergeImageLayers($layerMethodType) { + + $imagick = new \Imagick(); + $nextImage = null; + $imageNames = array( + "magick:NETSCAPE", + "magick:logo", + "magick:GRANITE", + ); + + foreach ($imageNames as $imageName) { + $nextImage = new \Imagick(); + $nextImage->newPseudoImage(640, 480, $imageName); + $imagick->addImage($nextImage); + } + + $imagick->resetIterator(); + + $imagick->setImageFormat('png'); + + $result = $imagick->mergeImageLayers($layerMethodType); + $bytes = $result->getImageBlob(); + if (strlen($bytes) <= 0) { echo "Failed to generate image.";} +} + +mergeImageLayers($layerMethodType); +echo "Ok"; +?> +--EXPECTF-- +Ok
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/093_Imagick_modulateImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/093_Imagick_modulateImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/094_Imagick_motionBlurImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/094_Imagick_motionBlurImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/095_Imagick_normalizeImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/095_Imagick_normalizeImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/096_Imagick_negateImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/096_Imagick_negateImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/097_Imagick_newPseudoImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/097_Imagick_newPseudoImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/098_Imagick_orderedPosterizeImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/098_Imagick_orderedPosterizeImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/099_Imagick_oilPaintImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/099_Imagick_oilPaintImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/099_Imagick_oilPaintImage_sigma.phpt
Changed
(renamed from imagick-3.7.0/tests/099_Imagick_oilPaintImage_sigma.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/100_Imagick_posterizeImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/100_Imagick_posterizeImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/101_Imagick_quantizeImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/101_Imagick_quantizeImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/102_Imagick_radialBlurImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/102_Imagick_radialBlurImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/103_Imagick_readImageBlob_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/103_Imagick_readImageBlob_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/104_Imagick_randomThresholdImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/104_Imagick_randomThresholdImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/105_Imagick_raiseImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/105_Imagick_raiseImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/106_Imagick_reduceNoiseImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/106_Imagick_reduceNoiseImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/107_Imagick_recolorImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/107_Imagick_recolorImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/108_Imagick_resampleImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/108_Imagick_resampleImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/109_Imagick_rollImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/109_Imagick_rollImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/110_Imagick_resizeImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/110_Imagick_resizeImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/111_Imagick_rotateImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/111_Imagick_rotateImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/112_Imagick_roundCorners_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/112_Imagick_roundCorners_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/113_Imagick_rotationalBlurImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/113_Imagick_rotationalBlurImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/114_Imagick_scaleImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/114_Imagick_scaleImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/115_Imagick_selectiveBlurImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/115_Imagick_selectiveBlurImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/116_Imagick_separateImageChannel_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/116_Imagick_separateImageChannel_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/117_Imagick_segmentImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/117_Imagick_segmentImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/118_Imagick_setImageArtifact_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/118_Imagick_setImageArtifact_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/119_Imagick_sepiaToneImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/119_Imagick_sepiaToneImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/120_Imagick_setCompressionQuality_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/120_Imagick_setCompressionQuality_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/121_Imagick_setImageBias_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/121_Imagick_setImageBias_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/122_Imagick_setImageCompressionQuality_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/122_Imagick_setImageCompressionQuality_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/123_Imagick_setImageClipMask_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/123_Imagick_setImageClipMask_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/125_Imagick_setImageOrientation_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/125_Imagick_setImageOrientation_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/126_Imagick_getImageChannelStats_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/126_Imagick_getImageChannelStats_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/127_Imagick_progressMonitor_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/127_Imagick_progressMonitor_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/130_Imagick_setOption_case1.phpt
Changed
(renamed from imagick-3.7.0/tests/130_Imagick_setOption_case1.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/131_Imagick_setOption_case2.phpt
Changed
(renamed from imagick-3.7.0/tests/131_Imagick_setOption_case2.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/132_Imagick_setOption_case3.phpt
Changed
(renamed from imagick-3.7.0/tests/132_Imagick_setOption_case3.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/133_Imagick_setSamplingFactors_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/133_Imagick_setSamplingFactors_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/134_Imagick_shadowImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/134_Imagick_shadowImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/135_Imagick_sharpenImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/135_Imagick_sharpenImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/136_Imagick_shadeImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/136_Imagick_shadeImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/137_Imagick_shearImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/137_Imagick_shearImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/138_Imagick_shaveImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/138_Imagick_shaveImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/139_Imagick_sigmoidalContrastImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/139_Imagick_sigmoidalContrastImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/141_Imagick_sketchImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/141_Imagick_sketchImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/142_Imagick_solarizeImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/142_Imagick_solarizeImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/143_Imagick_spreadImageWithMethod_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/143_Imagick_spreadImageWithMethod_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/143_Imagick_spreadImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/143_Imagick_spreadImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/144_Imagick_spliceImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/144_Imagick_spliceImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/145_imagickkernel_coverage.phpt
Added
@@ -0,0 +1,229 @@ +--TEST-- +ImagickKernel::fromMatrix test +--SKIPIF-- +<?php + +$imageMagickRequiredVersion = 0x680; +require_once(dirname(__FILE__) . '/skipif.inc'); + +?> +--FILE-- +<?php + + +$kernel = array( + array(1, 0, -1), + array(1, 0, -1), + array(1, 0, -1), +); + +$kernel = ImagickKernel::fromMatrix($kernel); +$kernel->scale(1, \Imagick::NORMALIZE_KERNEL_VALUE); +$kernel->addUnityKernel(0.50); +$imagick = new \Imagick(); +$imagick->newPseudoImage(640, 480, "magick:logo"); +$imagick->morphology( + \Imagick::MORPHOLOGY_CONVOLVE, + 1, + $kernel +); + + +$tests = array(); + +$tests = array( + "Cannot create kernel, matrix is empty.", + array() +); + +$tests = array( + "Values must be matrix, with the same number of columns in each row.", + array(0, 1, 1) +); + +//Should fail, matrix needs to have same number columns in each row +$tests = array( + "Values must be matrix, with the same number of columns in each row.", + array( + array(1, 0, 1), + array(1, 0, 1), + array(1, 0), + ) +); + +//Should fail, value instead of second row +$tests = array( + "Values must be matrix, with the same number of columns in each row.", + array( + array(0, 1), + 1 + ) +); + +//Should fail, value instead of second row +$tests = array( + "Only numbers or false are valid values in a kernel matrix.", + array( + array(0, 1), + array(0, new StdClass), + ) +); + +$tests = array( + "For kernels with even numbered rows or columns, the origin position must be specified.", + array( + array(1, 0), + ), +); + + +foreach ($tests as $test) { + + list($expectedMessage, $testValue) = $test; + + try { + $kernel = ImagickKernel::fromMatrix($testValue); + echo "Failed to throw exception".PHP_EOL; + } + catch(ImagickKernelException $e) { + if ($e->getMessage() != $expectedMessage) { + echo "Unexpected message ".$e->getMessage()." for test:".PHP_EOL; + var_dump($test); + } + } +} + + +try { + $kernel = ImagickKernel::fromBuiltin(\Imagick::KERNEL_DIAMOND, "CestNestPasUneKernel"); + //echo "builtIn OK".PHP_EOL; +} +catch(Exception $e) { + echo "Unexpected exception: ".$e->getMessage().PHP_EOL; +} + + +//Test adding unity kernel works. +$matrix1 = array( + array(1, 1, 1), + array(0, 0, 0), + array(-1, -1, -1), +); +$kernel = ImagickKernel::fromMatrix($matrix1); +$kernel->addUnityKernel(0.5); +$matrix = $kernel->getMatrix(); + +if ($matrix11 != 0.5) { + echo "center point should be 0.5 but is actually ".$matrix11.PHP_EOL; + var_dump($matrix); +} +//echo "Adding unity kernel ok".PHP_EOL; + +// Test adding kernel works and you can get the values back +$matrix1 = array( + array(1, 1), + array(0, 0), +); +$matrix2 = array( + array(0, 0), + array(1, 1), +); +$kernel1 = ImagickKernel::fromMatrix($matrix1, array(0, 0)); +$kernel2 = ImagickKernel::fromMatrix($matrix2, array(0, 0)); +$kernel1->addKernel($kernel2); + +$kernelList = $kernel1->separate(); +if (count($kernelList) != 2) { + echo "Incorrect number of matrixes returned."; +} +else { + if ($kernelList0->getMatrix() != $matrix1) { + echo "Matrix 1 does not match".PHP_EOL; + var_dump($kernelList0); + } + if ($kernelList1->getMatrix() != $matrix2) { + echo "Matrix 2 does not match".PHP_EOL; + var_dump($kernelList1); + } +} + +//Test Scaling +$matrixIn = array( + array(-1, 0, -1), + array( 0, 8, 0), + array(-1, 0, -1), +); +$kernel = ImagickKernel::fromMatrix($matrixIn); +$kernel->scale(1, \Imagick::NORMALIZE_KERNEL_VALUE); +$matrixOut = $kernel->getMatrix(); + +if ($matrixOut11 != 2) { + echo "Matrix was not normalised correctly."; + var_dump($matrixOut); +} + + + +//Test single line kernel works +$matrixIn = array( + array(1, 0), +); +$kernel = ImagickKernel::fromMatrix($matrixIn, array(1, 0)); +if ($kernel->getMatrix() != $matrixIn) { + echo "Values do not match for 'Test single line kernel works'".PHP_EOL; +} + +//Test even sized kernel works +$matrixIn = array( + array(-1, 0), + array( 0, 1) +); +$kernel = ImagickKernel::fromMatrix($matrixIn, array(0, 1)); +if ($kernel->getMatrix() != $matrixIn) { + echo "Values do not match for 'Test even sized kernel works'".PHP_EOL; +} + +//Test 'wrong' order matrix is converted correctly. +$matrix = array( + array(0.0, 1.0), + array(0.5, false) +); + +$outOfOrderMatrix = array(); +$outOfOrderMatrix11 = $matrix11; +$outOfOrderMatrix10 = $matrix10; +$outOfOrderMatrix01 = $matrix01; +$outOfOrderMatrix00 = $matrix00; + +$kernel = ImagickKernel::fromMatrix($outOfOrderMatrix, array(0, 0)); +$kernelMatrix = $kernel->getMatrix(); +if ($kernelMatrix !== $matrix) { + echo "Kernel generated from 'out of order' matrix is incorrect.".PHP_EOL; + var_dump($matrix); + echo "vs".PHP_EOL; + var_dump($kernelMatrix); +} + + + + +//Test Scaling, and with null origin +$matrixIn = array( + array(-1, 0, -1), + array( 0, 8, 0), + array(-1, 0, -1), +); +$kernel = ImagickKernel::fromMatrix($matrixIn, null); // <-- line under test +$kernel->scale(1, \Imagick::NORMALIZE_KERNEL_VALUE); +$matrixOut = $kernel->getMatrix(); + +if ($matrixOut11 != 2) { + echo "Matrix was not normalised correctly."; + var_dump($matrixOut); +} + + +echo "Complete".PHP_EOL; +?> +--EXPECTF-- +Complete
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/149_Imagick_sparseColorImage.phpt
Changed
(renamed from imagick-3.7.0/tests/149_Imagick_sparseColorImage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/150_Imagick_setregistry.phpt
Changed
(renamed from imagick-3.7.0/tests/150_Imagick_setregistry.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/151_Imagick_subImageMatch_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/151_Imagick_subImageMatch_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/152_Imagick_swirlImageWithMethod_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/152_Imagick_swirlImageWithMethod_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/152_Imagick_swirlImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/152_Imagick_swirlImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/153_Imagick_statisticImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/153_Imagick_statisticImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/154_Imagick_textureImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/154_Imagick_textureImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/155_Imagick_thresholdImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/155_Imagick_thresholdImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/156_Imagick_tintImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/156_Imagick_tintImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/157_Imagick_thumbnailImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/157_Imagick_thumbnailImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/158_Imagick_transposeImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/158_Imagick_transposeImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/159_Imagick_transformImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/159_Imagick_transformImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/160_Imagick_transparentPaintImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/160_Imagick_transparentPaintImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/161_Imagick_transformImageColorspace_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/161_Imagick_transformImageColorspace_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/162_Imagick_transverseImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/162_Imagick_transverseImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/163_Imagick_uniqueImageColors_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/163_Imagick_uniqueImageColors_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/164_Imagick_trimImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/164_Imagick_trimImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/165_Imagick_unsharpMaskImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/165_Imagick_unsharpMaskImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/166_Imagick_waveImageWithMethod_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/166_Imagick_waveImageWithMethod_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/166_Imagick_waveImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/166_Imagick_waveImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/167_Imagick_vignetteImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/167_Imagick_vignetteImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/168_Imagick_whiteThresholdImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/168_Imagick_whiteThresholdImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/169_ImagickPixel_construct_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/169_ImagickPixel_construct_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/170_ImagickPixel_setColor_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/170_ImagickPixel_setColor_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/171_ImagickPixel_setColorValue_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/171_ImagickPixel_setColorValue_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/172_ImagickPixel_setColorValueQuantum_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/172_ImagickPixel_setColorValueQuantum_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/173_ImagickDraw_bezier_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/173_ImagickDraw_bezier_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/174_ImagickDraw_affine_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/174_ImagickDraw_affine_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/175_ImagickDraw_arc_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/175_ImagickDraw_arc_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/176_ImagickDraw_ellipse_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/176_ImagickDraw_ellipse_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/177_ImagickDraw_composite_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/177_ImagickDraw_composite_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/178_ImagickDraw_circle_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/178_ImagickDraw_circle_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/179_ImagickDraw_line_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/179_ImagickDraw_line_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/180_ImagickDraw_matte_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/180_ImagickDraw_matte_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/181_ImagickDraw_pathStart_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/181_ImagickDraw_pathStart_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/182_ImagickDraw_pathCurveToQuadraticBezierAbsolute_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/183_ImagickDraw_pathCurveToQuadraticBezierAbsolute_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/183_ImagickDraw_pathCurveToQuadraticBezierAbsolute_basic.phpt
Added
@@ -0,0 +1,64 @@ +--TEST-- +Test ImagickDraw, pathCurveToQuadraticBezierAbsolute +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +$backgroundColor = 'rgb(225, 225, 225)'; +$strokeColor = 'rgb(0, 0, 0)'; +$fillColor = 'DodgerBlue2'; + +function pathCurveToQuadraticBezierAbsolute($strokeColor, $fillColor, $backgroundColor) { + + $draw = new \ImagickDraw(); + + $draw->setStrokeOpacity(1); + $draw->setStrokeColor($strokeColor); + $draw->setFillColor($fillColor); + + $draw->setStrokeWidth(2); + $draw->setFontSize(72); + + $draw->pathStart(); + $draw->pathMoveToAbsolute(50,250); + + // This specifies a quadratic bezier curve with the current position as the start + // point, the control point is the first two params, and the end point is the last two params. + $draw->pathCurveToQuadraticBezierAbsolute( + 150,50, + 250,250 + ); + + // This specifies a quadratic bezier curve with the current position as the start + // point, the control point is mirrored from the previous curves control point + // and the end point is defined by the x, y values. + $draw->pathCurveToQuadraticBezierSmoothAbsolute( + 450,250 + ); + + // This specifies a quadratic bezier curve with the current position as the start + // point, the control point is mirrored from the previous curves control point + // and the end point is defined relative from the current position by the x, y values. + $draw->pathCurveToQuadraticBezierSmoothRelative( + 200,-100 + ); + + $draw->pathFinish(); + + $imagick = new \Imagick(); + $imagick->newImage(700, 500, $backgroundColor); + $imagick->setImageFormat("png"); + + $imagick->drawImage($draw); + + $bytes = $imagick->getImageBlob(); + if (strlen($bytes) <= 0) { echo "Failed to generate image.";} + +} + +pathCurveToQuadraticBezierAbsolute($strokeColor, $fillColor, $backgroundColor) ; +echo "Ok"; +?> +--EXPECTF-- +Ok \ No newline at end of file
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/184_ImagickDraw_polyline_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/184_ImagickDraw_polyline_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/185_ImagickDraw_point_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/185_ImagickDraw_point_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/186_ImagickDraw_polygon_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/186_ImagickDraw_polygon_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/187_ImagickDraw_push_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/191_ImagickDraw_push_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/188_ImagickDraw_pushPattern_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/193_ImagickDraw_pushPattern_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/189_ImagickDraw_setClipPath_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/189_ImagickDraw_setClipPath_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/190_ImagickDraw_popDefs_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/190_ImagickDraw_popDefs_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/191_ImagickDraw_push_basic.phpt
Added
@@ -0,0 +1,41 @@ +--TEST-- +Test ImagickDraw, push +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +$backgroundColor = 'rgb(225, 225, 225)'; +$strokeColor = 'rgb(0, 0, 0)'; +$fillColor = 'DodgerBlue2'; +$fillModifiedColor = 'LightCoral'; + +function push($strokeColor, $fillColor, $backgroundColor, $fillModifiedColor) { + + $draw = new \ImagickDraw(); + $draw->setStrokeColor($strokeColor); + $draw->setFillColor($fillModifiedColor); + $draw->setStrokeWidth(2); + $draw->setFontSize(72); + $draw->push(); + $draw->translate(50, 50); + $draw->rectangle(200, 200, 300, 300); + $draw->pop(); + $draw->setFillColor($fillColor); + $draw->rectangle(200, 200, 300, 300); + + $imagick = new \Imagick(); + $imagick->newImage(500, 500, $backgroundColor); + $imagick->setImageFormat("png"); + + $imagick->drawImage($draw); + + $bytes = $imagick->getImageBlob(); + if (strlen($bytes) <= 0) { echo "Failed to generate image.";} +} + +push($strokeColor, $fillColor, $backgroundColor, $fillModifiedColor) ; +echo "Ok"; +?> +--EXPECTF-- +Ok \ No newline at end of file
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/192_ImagickDraw_setClipPath_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/198_ImagickDraw_setClipPath_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/193_ImagickDraw_pushPattern_basic.phpt
Added
@@ -0,0 +1,59 @@ +--TEST-- +Test ImagickDraw, pushPattern +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +$backgroundColor = 'rgb(225, 225, 225)'; +$strokeColor = 'rgb(0, 0, 0)'; +$fillColor = 'DodgerBlue2'; + +function pushPattern($strokeColor, $fillColor, $backgroundColor) { + $draw = new \ImagickDraw(); + + $draw->setStrokeColor($strokeColor); + $draw->setFillColor($fillColor); + $draw->setStrokeWidth(1); + $draw->setStrokeOpacity(1); + $draw->setStrokeColor($strokeColor); + $draw->setFillColor($fillColor); + + $draw->setStrokeWidth(1); + + $draw->pushPattern("MyFirstPattern", 0, 0, 50, 50); + for ($x = 0; $x < 50; $x += 10) { + for ($y = 0; $y < 50; $y += 5) { + $positionX = $x + (($y / 5) % 5); + $draw->rectangle($positionX, $y, $positionX + 5, $y + 5); + } + } + $draw->popPattern(); + + $draw->setFillOpacity(0); + $draw->rectangle(100, 100, 400, 400); + $draw->setFillOpacity(1); + + $draw->setFillOpacity(1); + + $draw->push(); + $draw->setFillPatternURL('#MyFirstPattern'); + $draw->setFillColor('yellow'); + $draw->rectangle(100, 100, 400, 400); + $draw->pop(); + + $imagick = new \Imagick(); + $imagick->newImage(500, 500, $backgroundColor); + $imagick->setImageFormat("png"); + + $imagick->drawImage($draw); + + $bytes = $imagick->getImageBlob(); + if (strlen($bytes) <= 0) { echo "Failed to generate image.";} +} + +pushPattern($strokeColor, $fillColor, $backgroundColor) ; +echo "Ok"; +?> +--EXPECTF-- +Ok \ No newline at end of file
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/194_ImagickDraw_rectangle_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/194_ImagickDraw_rectangle_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/195_ImagickDraw_rotate_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/195_ImagickDraw_rotate_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/196_ImagickDraw_scale_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/196_ImagickDraw_scale_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/197_ImagickDraw_roundRectangle_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/197_ImagickDraw_roundRectangle_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/198_ImagickDraw_setClipPath_basic.phpt
Added
@@ -0,0 +1,42 @@ +--TEST-- +Test ImagickDraw, setClipPath +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +$backgroundColor = 'rgb(225, 225, 225)'; +$strokeColor = 'rgb(0, 0, 0)'; +$fillColor = 'DodgerBlue2'; + +function setClipPath($strokeColor, $fillColor, $backgroundColor) { + + $draw = new \ImagickDraw(); + $draw->setStrokeColor($strokeColor); + $draw->setFillColor($fillColor); + $draw->setStrokeOpacity(1); + $draw->setStrokeWidth(2); + + $clipPathName = 'testClipPath'; + + $draw->pushClipPath($clipPathName); + $draw->rectangle(0, 0, 250, 250); + $draw->popClipPath(); + $draw->setClipPath($clipPathName); + $draw->rectangle(100, 100, 400, 400); + + $imagick = new \Imagick(); + $imagick->newImage(500, 500, $backgroundColor); + $imagick->setImageFormat("png"); + + $imagick->drawImage($draw); + + $bytes = $imagick->getImageBlob(); + if (strlen($bytes) <= 0) { echo "Failed to generate image.";} +} + +setClipPath($strokeColor, $fillColor, $backgroundColor) ; +echo "Ok"; +?> +--EXPECTF-- +Ok \ No newline at end of file
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/199_ImagickDraw_setClipRule_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/199_ImagickDraw_setClipRule_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/200_ImagickDraw_setClipUnits_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/200_ImagickDraw_setClipUnits_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/201_ImagickDraw_setFillAlpha_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/201_ImagickDraw_setFillAlpha_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/202_ImagickDraw_setFillColor_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/202_ImagickDraw_setFillColor_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/203_ImagickDraw_setFillRule_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/203_ImagickDraw_setFillRule_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/204_ImagickDraw_setFillOpacity_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/204_ImagickDraw_setFillOpacity_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/206_ImagickDraw_setFontSize_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/206_ImagickDraw_setFontSize_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/207_ImagickDraw_setFontFamily_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/207_ImagickDraw_setFontFamily_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/208_ImagickDraw_setFontStretch_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/208_ImagickDraw_setFontStretch_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/209_ImagickDraw_setFontWeight_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/209_ImagickDraw_setFontWeight_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/210_ImagickDraw_setFontStyle_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/210_ImagickDraw_setFontStyle_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/211_ImagickDraw_setStrokeAntialias_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/211_ImagickDraw_setStrokeAntialias_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/212_ImagickDraw_setGravity_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/212_ImagickDraw_setGravity_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/213_ImagickDraw_setStrokeAlpha_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/213_ImagickDraw_setStrokeAlpha_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/214_ImagickDraw_setStrokeDashOffset_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/214_ImagickDraw_setStrokeDashOffset_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/215_ImagickDraw_setStrokeColor_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/215_ImagickDraw_setStrokeColor_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/216_ImagickDraw_setStrokeDashArray_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/216_ImagickDraw_setStrokeDashArray_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/217_ImagickDraw_setStrokeMiterLimit_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/217_ImagickDraw_setStrokeMiterLimit_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/218_ImagickDraw_setStrokeLineCap_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/218_ImagickDraw_setStrokeLineCap_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/219_ImagickDraw_setStrokeLineJoin_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/219_ImagickDraw_setStrokeLineJoin_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/220_ImagickDraw_setStrokeOpacity_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/220_ImagickDraw_setStrokeOpacity_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/221_ImagickDraw_setStrokeWidth_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/221_ImagickDraw_setStrokeWidth_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/222_ImagickDraw_setTextAlignment_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/222_ImagickDraw_setTextAlignment_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/223_ImagickDraw_setTextAntialias_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/223_ImagickDraw_setTextAntialias_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/224_ImagickDraw_setTextUnderColor_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/224_ImagickDraw_setTextUnderColor_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/225_ImagickDraw_setTextDecoration_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/225_ImagickDraw_setTextDecoration_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/226_ImagickDraw_setViewBox_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/226_ImagickDraw_setViewBox_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/227_ImagickDraw_skewY_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/227_ImagickDraw_skewY_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/228_ImagickDraw_skewX_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/228_ImagickDraw_skewX_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/229_Tutorial_fxAnalyzeImage_case1.phpt
Changed
(renamed from imagick-3.7.0/tests/229_Tutorial_fxAnalyzeImage_case1.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/234_Tutorial_edgeExtend_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/234_Tutorial_edgeExtend_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/235_ImagickDraw_translate_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/235_ImagickDraw_translate_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/236_Imagick_identify_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/236_Imagick_identify_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/237_Tutorial_deconstructGif_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/237_Tutorial_deconstructGif_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/239_Tutorial_gradientReflection_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/239_Tutorial_gradientReflection_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/240_Tutorial_imagickCompositeGen_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/240_Tutorial_imagickCompositeGen_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/241_Tutorial_psychedelicFont_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/241_Tutorial_psychedelicFont_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/242_Tutorial_levelizeImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/242_Tutorial_levelizeImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/243_Tutorial_svgExample_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/243_Tutorial_svgExample_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/244_Tutorial_psychedelicFontGif_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/244_Tutorial_psychedelicFontGif_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/245_Tutorial_screenEmbed_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/245_Tutorial_screenEmbed_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/246_antialias_image.phpt
Added
@@ -0,0 +1,28 @@ +--TEST-- +Test pseudo formats +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +$im = new Imagick(); +$im->newPseudoImage(10, 10, "magick:logo"); +//On by default +var_export($im->getAntiAlias()); +echo PHP_EOL; + +//Turn off +$im->setAntiAlias(false); +var_export($im->getAntiAlias()); +echo PHP_EOL; + +//Turn back on +$im->setAntiAlias(true); +var_export($im->getAntiAlias()); +echo PHP_EOL; + +?> +--EXPECTF-- +true +false +true
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/247_ImagickPixelIterator_construct_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/252_ImagickPixelIterator_construct_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/248_ImagickPixelIterator_clear_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/248_ImagickPixelIterator_clear_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/249_ImagickPixelIterator_getNextIteratorRow_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/249_ImagickPixelIterator_getNextIteratorRow_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/250_ImagickPixelIterator_resetIterator_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/250_ImagickPixelIterator_resetIterator_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/251_ImagickPixelIterator_setIteratorRow_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/251_ImagickPixelIterator_setIteratorRow_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/252_ImagickPixelIterator_construct_basic.phpt
Added
@@ -0,0 +1,39 @@ +--TEST-- +Test ImagickPixelIterator, construct +--SKIPIF-- +<?php +$imageMagickRequiredVersion=0x675; +require_once(dirname(__FILE__) . '/skipif.inc'); +?> +--FILE-- +<?php + + +function construct() { + $imagick = new \Imagick(); + $imagick->newPseudoImage(640, 480, "magick:logo"); + $imageIterator = new \ImagickPixelIterator($imagick); + + /* Loop through pixel rows */ + foreach ($imageIterator as $pixels) { + /* Loop through the pixels in the row (columns) */ + foreach ($pixels as $column => $pixel) { + /** @var $pixel \ImagickPixel */ + if ($column % 2) { + /* Paint every second pixel black*/ + $pixel->setColor("rgba(0, 0, 0, 0)"); + } + } + /* Sync the iterator, this is important to do on each iteration */ + $imageIterator->syncIterator(); + } + + $bytes = $imagick; + if (strlen($bytes) <= 0) { echo "Failed to generate image.";} +} + +construct() ; +echo "Ok"; +?> +--EXPECTF-- +Ok
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/253_getHdri.phpt
Changed
(renamed from imagick-3.7.0/tests/253_getHdri.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/254_getConfigureOptions.phpt
Added
@@ -0,0 +1,160 @@ +--TEST-- +Test Imagick::getConfigureOptions +--SKIPIF-- +<?php + +require_once(dirname(__FILE__) . '/skipif.inc'); + +checkClassMethods('Imagick', array('getconfigureoptions')); + + +?> +--FILE-- +<?php + +$allOptions = Imagick::getConfigureOptions(); + +if (!is_array($allOptions)) { + echo "Failed to return array".PHP_EOL; + var_dump($allOptions); +} +else if (count($allOptions) == 0) { + echo "allOptions is empty".PHP_EOL; +} + + +$optionsStartingWithC = Imagick::getConfigureOptions("Q*"); + +if (!is_array($optionsStartingWithC)) { + echo "Failed to return array".PHP_EOL; + var_dump($optionsStartingWithC); +} +else if (count($optionsStartingWithC) == 0) { + echo "optionsStartingWithC is empty".PHP_EOL; + echo "All options are:\n"; + var_dump(Imagick::getConfigureOptions()); +} + +//Example output on Debian +// +//array(38) { +// "CC"=> +// string(3) "gcc" +// "CFLAGS"=> +// string(186) "-I/usr/include/libxml2 -I/usr/include/libpng16 -I/usr/include/freetype2 -fopenmp -Wall -g -O2 -mtune=core2 -fexceptions -pthread -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16" +// "CODER_PATH"=> +// string(56) "/usr/local/lib/ImageMagick-7.0.11/modules-Q16HDRI/coders" +// "CONFIGURE"=> +// string(155) "./configure '--with-quantum-depth=16' '--with-magick-plus-plus=no' '--without-perl' '--disable-static' '--disable-docs' '--with-jpeg=yes' '--with-png=yes'" +// "CONFIGURE_PATH"=> +// string(29) "/usr/local/etc/ImageMagick-7/" +// "COPYRIGHT"=> +// string(46) "Copyright (C) 1999-2021 ImageMagick Studio LLC" +// "CPPFLAGS"=> +// string(34) "-I/usr/local/include/ImageMagick-7" +// "CXX"=> +// string(3) "g++" +// "CXXFLAGS"=> +// string(9) " -pthread" +// "DEFS"=> +// string(15) "-DHAVE_CONFIG_H" +// "DELEGATES"=> +// string(33) "freetype jng jpeg png ps xml zlib" +// "DISTCHECK_CONFIG_FLAGS"=> +// string(217) " --disable-deprecated --with-quantum-depth=16 --with-jemalloc=no --with-umem=no --with-autotrace=no --with-fftw=no --with-gslib=no --with-fontpath= --with-jxl=no --with-rsvg=no --with-wmf=no --with-perl=no " +// "DOCUMENTATION_PATH"=> +// string(34) "/usr/local/share/doc/ImageMagick-7" +// "EXEC-PREFIX"=> +// string(10) "/usr/local" +// "EXECUTABLE_PATH"=> +// string(14) "/usr/local/bin" +// "FEATURES"=> +// string(22) "DPC HDRI Cipher OpenMP" +// "FILTER_PATH"=> +// string(57) "/usr/local/lib/ImageMagick-7.0.11/modules-Q16HDRI/filters" +// "GIT_REVISION"=> +// string(24) "18571:309fcfa1c:20210328" +// "HOST"=> +// string(19) "x86_64-pc-linux-gnu" +// "INCLUDE_PATH"=> +// string(32) "/usr/local/include/ImageMagick-7" +// "LDFLAGS"=> +// string(17) "-L/usr/local/lib " +// "LIB_VERSION"=> +// string(5) "0x70B" +// "LIB_VERSION_NUMBER"=> +// string(8) "7,0,11,6" +// "LIBRARY_PATH"=> +// string(33) "/usr/local/lib/ImageMagick-7.0.11" +// "LIBS"=> +// string(96) " -lfreetype -ljpeg -lpng16 -lxml2 -lz -lm -lpthread -lgomp" +// "MAGICK_TEMPORARY_PATH"=> +// string(4) "/tmp" +// "NAME"=> +// string(11) "ImageMagick" +// "PCFLAGS"=> +// string(65) "-fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16" +// "PREFIX"=> +// string(10) "/usr/local" +// "QuantumDepth"=> +// string(2) "16" +// "RELEASE_DATE"=> +// string(10) "2021-03-28" +// "SHARE_PATH"=> +// string(30) "/usr/local/share/ImageMagick-7" +// "SHAREARCH_PATH"=> +// string(48) "/usr/local/lib/ImageMagick-7.0.11/config-Q16HDRI" +// "TARGET_CPU"=> +// string(6) "x86_64" +// "TARGET_OS"=> +// string(9) "linux-gnu" +// "TARGET_VENDOR"=> +// string(2) "pc" +// "VERSION"=> +// string(6) "7.0.11" +// "WEBSITE"=> +// string(23) "https://imagemagick.org" +//} + + + +// Examples of output on nixos +//array(5) { +// "DELEGATES"=> +// string(102) "bzlib cairo djvu fontconfig freetype heic jng jp2 jpeg lcms lzma openexr png rsvg tiff webp x xml zlib" +// "FEATURES"=> +// string(28) "Cipher DPC HDRI OpenMP(4.5) " +// "MAGICK_TEMPORARY_PATH"=> +// string(4) "/tmp" +// "NAME"=> +// string(11) "ImageMagick" +// "QuantumDepth"=> +// string(3) "Q16" +//} + + + + + + + + +if (!(count($optionsStartingWithC) < count($allOptions))) { + echo ""; + var_dump($optionsStartingWithC); + var_dump($allOptions); +} + +foreach ($optionsStartingWithC as $key => $value) { + $key = strtolower($key); + + if (stripos($key, "q") !== 0) { + echo "key $key does not start with c".PHP_EOL; + } +} + +echo "Ok"; + +?> +--EXPECTF-- +Ok \ No newline at end of file
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/255_getFeatures.phpt
Changed
(renamed from imagick-3.7.0/tests/255_getFeatures.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/256_Imagick_exportImagePixels_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/256_Imagick_exportImagePixels_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/257_Imagick_setImageChannelMask_basic.phpt
Added
@@ -0,0 +1,39 @@ +--TEST-- +Test Imagick, Imagick::exportImagePixels +--SKIPIF-- +<?php +$imageMagickRequiredVersion=0x700; +require_once(dirname(__FILE__) . '/skipif.inc'); +?> +--FILE-- +<?php + +$imagick = new \Imagick(); +$imagick->newPseudoImage(256, 256, "gradient:black-white"); + +$initialMask = $imagick->setImageChannelMask(\Imagick::CHANNEL_RED); +$imagick->brightnessContrastImage(-20, 20); +$imagick->setImageFormat("png"); +$imagick->writeImage(__DIR__ . "/maskTest.png"); + +$redMask = $imagick->setImageChannelMask(\Imagick::CHANNEL_DEFAULT); + +if ($initialMask != \Imagick::CHANNEL_DEFAULT) { + echo "initialMask is not equal to \Imagick::CHANNEL_DEFAULT but instead is $initialMask\n"; +} + +if ($redMask != \Imagick::CHANNEL_RED) { + echo "redMask is not equal to \Imagick::CHANNEL_RED but instead is $redMask\n"; +} + +echo "Ok"; +?> +--CLEAN-- +<?php +$f = __DIR__ . '/maskTest.png'; +if (file_exists($f)) { + unlink($f); +} +?> +--EXPECTF-- +Ok
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/258_Imagick_evaluateImages_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/258_Imagick_evaluateImages_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/259_Imagick_colorPoints_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/259_Imagick_colorPoints_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/260_localContrastImage.phpt
Changed
(renamed from imagick-3.7.0/tests/260_localContrastImage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/261_compositeImageGravity.phpt
Changed
(renamed from imagick-3.7.0/tests/261_compositeImageGravity.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/262_autoOrient.phpt
Changed
(renamed from imagick-3.7.0/tests/262_autoOrient.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/263_autoGammaImage.phpt
Added
@@ -0,0 +1,22 @@ +--TEST-- +Test autoGammaImage +--SKIPIF-- +<?php +require_once(dirname(__FILE__) . '/skipif.inc'); +checkClassMethods('Imagick', array('autoGammaImage')); +?> +--FILE-- +<?php + +$im = new Imagick("magick:logo"); +$im->autoGammaImage(); + + +$im = new Imagick("magick:logo"); +$im->autoGammaImage(\Imagick::CHANNEL_RED); + +echo "Ok"; + +?> +--EXPECT-- +Ok
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/264_ImagickDraw_getTextDirection_basic.phpt
Added
@@ -0,0 +1,73 @@ +--TEST-- +Test ImagickDraw, getTextDirection +--SKIPIF-- +<?php +require_once(dirname(__FILE__) . '/skipif.inc'); +checkClassMethods('ImagickDraw', array('getTextDirection', 'setTextDirection')); +?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/functions.inc'); + +$backgroundColor = 'rgb(225, 225, 225)'; +$strokeColor = 'rgb(0, 0, 0)'; +$fillColor = 'DodgerBlue2'; + + + +$draw = new \ImagickDraw(); +setFontForImagickDraw($draw); + +$draw->setStrokeColor($strokeColor); +$draw->setFillColor($fillColor); + +$draw->setStrokeWidth(2); +$draw->setFontSize(56); + +$directions = array( + \Imagick::DIRECTION_LEFT_TO_RIGHT, + \Imagick::DIRECTION_RIGHT_TO_LEFT, + \Imagick::DIRECTION_LEFT_TO_RIGHT, +); + +$i = 0; +foreach ($directions as $directionToSet) { + $draw->setTextDirection($directionToSet); + $directionReturned = $draw->getTextDirection(); + + if ($directionReturned != $directionToSet) { + echo "Direction error for $i \n"; + } + + $position = 36; + if ($directionToSet == \Imagick::DIRECTION_RIGHT_TO_LEFT) { + $position = 500 - 36; + } + + $draw->annotation($position, (72 * $i) + 64, "Lorem Ipsum!"); + + $i++; +} + +$imagick = new \Imagick(); +$imagick->newImage(500, 500, $backgroundColor); +$imagick->setImageFormat("png"); +$imagick->drawImage($draw); + +$bytes = $imagick->getImageBlob(); +if (strlen($bytes) <= 0) { echo "Failed to generate image.";} + +$imagick->writeImage(__DIR__ . '/directionTest.png'); + +echo "Ok"; +?> +--CLEAN-- +<?php +$f = __DIR__ . '/directionTest.png'; +if (file_exists($f)) { + unlink($f); +} +?> +--EXPECTF-- +Ok
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/265_ImagickDraw_getOpacity_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/265_ImagickDraw_getOpacity_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/266_ImagickDraw_getFontResolution_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/266_ImagickDraw_getFontResolution_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/267_ImagickDraw_getBorderColor_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/267_ImagickDraw_getBorderColor_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/268_ImagickDraw_getDensity_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/268_ImagickDraw_getDensity_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/269_ImagickPixel_setColorFromPixel_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/269_ImagickPixel_setColorFromPixel_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/270_imagick_restoreErrorHandler.phpt
Changed
(renamed from imagick-3.7.0/tests/270_imagick_restoreErrorHandler.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/271_imagick_constants.phpt
Changed
(renamed from imagick-3.7.0/tests/271_imagick_constants.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/272_imagick_identifyimagetype.phpt
Changed
(renamed from imagick-3.7.0/tests/272_imagick_identifyimagetype.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/273_imagick_falsyimage.phpt
Changed
(renamed from imagick-3.7.0/tests/273_imagick_falsyimage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/274_imagick_setImageAlpha.phpt
Added
@@ -0,0 +1,79 @@ +--TEST-- +Imagick::setImageAlpha +--SKIPIF-- +<?php +$imageMagickRequiredVersion=0x700; +require_once(dirname(__FILE__) . '/skipif.inc'); +?> +--FILE-- +<?php + +require_once __DIR__ . "/../util/functions.php"; + +$imagick = new Imagick(); +$imagick->newPseudoImage(256, 256, 'xc:purple'); +$imagick->setImageAlpha(0.5); + +$imagick->setImageFormat('png'); +$imagick->writeImage(__DIR__ . "/setAlphaTest.png"); + +$pixelTypes = array( + Imagick::PIXEL_CHAR => array(128, 0, 128, 128), + Imagick::PIXEL_FLOAT => array(0.50196081399918, 0, 0.50196081399918, 0.5), + Imagick::PIXEL_DOUBLE => array(0.50196078431373, 0, 0.50196078431373, 0.5), + Imagick::PIXEL_SHORT => array(32896, 0, 32896, 32768), +); + +function getColorError($type, $expected, $actual) { + + if ($type == Imagick::PIXEL_CHAR || + $type == Imagick::PIXEL_SHORT) { + $string = "Expected: " . $actual . "\n"; + $string .= "Actual : " . $actual . "\n"; + + return $string; + } + + if ($type == Imagick::PIXEL_FLOAT) { + return float_compare_32($expected, $actual); + } + + if ($type == Imagick::PIXEL_DOUBLE) { + return float_compare($expected, $actual); + } + + echo "Unknown type: $type \n"; + exit(-1); +} + + +foreach ($pixelTypes as $pixelType => $expectedValues) { + $pixels = $imagick->exportImagePixels(0, 0, 1, 1, "RGBA", $pixelType); + $channelNames = 'R', 'G', 'B', 'A'; + + // Loop over the colours + for ($channel = 0; $channel < 4; $channel++) { + $actual = $pixels$channel; + $expected = $expectedValues$channel; + if (abs($actual - $expected) > get_epsilon_for_off_by_half_errors()) { + $channelName = $channelNames$channel; + + echo "Pixel values appear incorrect for pixelType $pixelType channel:$channelName\n"; + echo getColorError($pixelType, $expected, $actual); + break; + } + } +} + +echo "Ok"; + +?> +--CLEAN-- +<?php +$f = __DIR__ . '/setAlphaTest.png'; +if (file_exists($f)) { + @unlink($f); +} +?> +--EXPECTF-- +Ok
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/275_ImagickPixel_unitializedObjects.phpt
Changed
(renamed from imagick-3.7.0/tests/275_ImagickPixel_unitializedObjects.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/276_Imagick_artifacts.phpt
Changed
(renamed from imagick-3.7.0/tests/276_Imagick_artifacts.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/277_Imagick_colorDecisionListImage.phpt
Changed
(renamed from imagick-3.7.0/tests/277_Imagick_colorDecisionListImage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/278_Imagick_optimaze_gif.phpt
Added
@@ -0,0 +1,86 @@ +--TEST-- +Test Imagick::optimizeimagelayers and Imagick::optimizeimagetransparency +--SKIPIF-- +<?php + +$imageMagickRequiredVersion = 0x686; + +require_once(dirname(__FILE__) . '/skipif.inc'); +checkClassMethods('Imagick', array('optimizeimagelayers')); +checkClassMethods('Imagick', array('optimizeimagetransparency')); + +?> +--FILE-- +<?php + +function makeSimpleGif() { + $aniGif = new \Imagick(); + $aniGif->setFormat("gif"); + + $circleRadius = 20; + $imageFrames = 6; + $imageSize = 200; + + $background = new \Imagick(); + $background->newpseudoimage($imageSize, $imageSize, "canvas:gray"); + + $blackWhite = new \Imagick(); + $blackWhite->newpseudoimage($imageSize, $imageSize, "gradient:black-white"); + + $backgroundPalette = clone $background; + $backgroundPalette->quantizeImage(240, \Imagick::COLORSPACE_RGB, 8, false, false); + + $blackWhitePalette = clone $blackWhite; + $blackWhitePalette->quantizeImage(16, \Imagick::COLORSPACE_RGB, 8, false, false); + + $backgroundPalette->addimage($blackWhitePalette); + + for($count=0 ; $count<$imageFrames ; $count++) { + echo "Frame: ".$count."\n"; + $drawing = new \ImagickDraw(); + $drawing->setFillColor('white'); + $drawing->setStrokeColor('rgba(64, 64, 64, 0.8)'); + $strokeWidth = 4; + $drawing->setStrokeWidth($strokeWidth); + + $distanceToMove = $imageSize + (($circleRadius + $strokeWidth) * 2); + $offset = ($distanceToMove * $count / ($imageFrames -1)) - ($circleRadius + $strokeWidth); + $drawing->translate($offset, ($imageSize / 2) + ($imageSize / 3 * cos(20 * $count / $imageFrames))); + $drawing->circle(0, 0, $circleRadius, 0); + + $frame = clone $background; + $frame->drawimage($drawing); + $frame->clutimage($backgroundPalette); + $frame->setImageDelay(10); + $aniGif->addImage($frame); + } + + $aniGif = $aniGif->deconstructImages(); + + $bytes = $aniGif->getImagesBlob(); + if (strlen($bytes) <= 0) { + echo "Failed to generate image."; + } + + return $aniGif; +} + +function optimizeGif($im) { + $im = $im->coalesceImages(); + $im->optimizeImageLayers(); + $im->optimizeimagetransparency(); +} + +$simpleGif = makeSimpleGif(); +optimizeGif($simpleGif); + +echo "Ok" +?> +--EXPECT-- +Frame: 0 +Frame: 1 +Frame: 2 +Frame: 3 +Frame: 4 +Frame: 5 +Ok
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/279_ImagickDraw_setTextInterlineSpacing.phpt
Changed
(renamed from imagick-3.7.0/tests/279_ImagickDraw_setTextInterlineSpacing.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/280_imagickkernel_exception_invalid_origin.phpt
Changed
(renamed from imagick-3.7.0/tests/280_imagickkernel_exception_invalid_origin.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/281_imagick_houghLineImage_basic.phpt
Added
@@ -0,0 +1,38 @@ +--TEST-- +Test Imagick, houghLineImage +--SKIPIF-- +<?php +require_once(dirname(__FILE__) . '/skipif.inc'); +checkClassMethods('Imagick', array('houghLineImage')); +?> +--FILE-- +<?php + + +function houghLineImage() { + $path = realpath(__DIR__ . '/houghline_input_image.png'); + + if ($path === false) { + echo "Image is not readable.\n"; + exit(-1); + } + + $imagick = new \Imagick(); + $imagick->readImage($path); + $imagick->setbackgroundcolor('rgb(64, 64, 64)'); + $imagick->houghLineImage(20,40, 40); + $imagick->writeImage(__DIR__ . '/houghline_output_image.png'); +} + +houghLineImage() ; +echo "Ok"; +?> +--CLEAN-- +<?php +$f = __DIR__ . '/houghline_output_image.png'; +if (file_exists($f)) { + @unlink($f); +} +?> +--EXPECTF-- +Ok
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/281_ini_settings_default.phpt
Changed
(renamed from imagick-3.7.0/tests/281_ini_settings_default.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/282_ini_settings_set_falsy_string.phpt
Changed
(renamed from imagick-3.7.0/tests/282_ini_settings_set_falsy_string.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/283_ini_settings_set_falsy_zero.phpt
Changed
(renamed from imagick-3.7.0/tests/283_ini_settings_set_falsy_zero.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/284_ini_settings_set_truthy_number.phpt
Changed
(renamed from imagick-3.7.0/tests/284_ini_settings_set_truthy_number.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/285_ini_settings_set_truthy_string.phpt
Changed
(renamed from imagick-3.7.0/tests/285_ini_settings_set_truthy_string.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/286_Imagick_setMask_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/286_Imagick_setMask_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/287_Imagick_GetImageChannelRange_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/287_Imagick_GetImageChannelRange_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/288_imagick_prevent_zero_size_images.phpt
Changed
(renamed from imagick-3.7.0/tests/288_imagick_prevent_zero_size_images.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/289_Imagick_setImageMask_basic.phpt
Added
@@ -0,0 +1,69 @@ +--TEST-- +Test Imagick, medianFilterImage +--SKIPIF-- +<?php +require_once(dirname(__FILE__) . '/skipif.inc'); +checkClassMethods('Imagick', array('getImageMask', 'setImageMask')); +?> +--FILE-- +<?php + +$canvas = new Imagick(__DIR__ . '/houghline_input_image.png'); + +$mask = new Imagick(); +$mask->newPseudoImage( + $canvas->getImageWidth(), + $canvas->getImageHeight(), + 'xc:black' +); + +$drawing = new ImagickDraw(); +$drawing->setBorderColor('black'); +$drawing->setFillColor('black'); +$drawing->rectangle(0, 0, $mask->getImageWidth(), $mask->getImageHeight()); + +$drawing->setBorderColor('white'); +$drawing->setFillColor('white'); +$drawing->circle( + $mask->getImageWidth() / 2, + $mask->getImageHeight() / 2, + 2 * $mask->getImageWidth() / 3, + $mask->getImageHeight() / 2 +); + +$mask->drawImage($drawing); +//$mask->writeImage(__DIR__ . "/test_mask.png"); + +// This would probably be more useful for users +// but shows the issue with PIXELMASK_COMPOSITE +// $mask->blurImage(10, 2); + +$mask_types = array( + \Imagick::PIXELMASK_READ => "PIXELMASK_READ", + \Imagick::PIXELMASK_WRITE => "PIXELMASK_WRITE", + \Imagick::PIXELMASK_COMPOSITE => "PIXELMASK_COMPOSITE", +); + +$channel_types = array( + \Imagick::CHANNEL_ALL => "CHANNEL_ALL", + \Imagick::CHANNEL_RED => "CHANNEL_RED", + \Imagick::CHANNEL_ALPHA => "CHANNEL_ALPHA", + \Imagick::CHANNEL_RGBA => "CHANNEL_RGBA", + \Imagick::CHANNEL_BLACK => "CHANNEL_BLACK", + \Imagick::CHANNEL_DEFAULT => "CHANNEL_DEFAULT", +); + +foreach ($channel_types as $channel_type => $channel_name) { + foreach ($mask_types as $type => $type_name) { + $output = clone $canvas; + $output->setImageMask($mask, $type); + + $output->blurImage(15, 4, $channel_type); +// $output->writeImage(__DIR__ . "/test_canvas" . $type_name . "_" . $channel_name . ".png"); + } +} + +echo "Ok"; +?> +--EXPECTF-- +Ok
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/290_imagick_profileimage.phpt
Changed
(renamed from imagick-3.7.0/tests/290_imagick_profileimage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/291_reflection.phpt
Changed
(renamed from imagick-3.7.0/tests/291_reflection.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/292_index_iterator.phpt
Changed
(renamed from imagick-3.7.0/tests/292_index_iterator.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/294_Imagick_cannyEdgeImage.phpt
Changed
(renamed from imagick-3.7.0/tests/294_Imagick_cannyEdgeImage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/295_Imagick_setSeed.phpt
Changed
(renamed from imagick-3.7.0/tests/295_Imagick_setSeed.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/296_Imagick_waveletDenoiseImage.phpt
Changed
(renamed from imagick-3.7.0/tests/296_Imagick_waveletDenoiseImage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/297_Imagick_meanShiftImage.phpt
Changed
(renamed from imagick-3.7.0/tests/297_Imagick_meanShiftImage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/298_Imagick_kmeansImage.phpt
Changed
(renamed from imagick-3.7.0/tests/298_Imagick_kmeansImage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/299_Imagick_rangeThresholdImage.phpt
Changed
(renamed from imagick-3.7.0/tests/299_Imagick_rangeThresholdImage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/300_Imagick_autoThresholdImage.phpt
Changed
(renamed from imagick-3.7.0/tests/300_Imagick_autoThresholdImage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/301_Imagick_bilateralBlurImage.phpt
Changed
(renamed from imagick-3.7.0/tests/301_Imagick_bilateralBlurImage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/302_Imagick_claheImage.phpt
Changed
(renamed from imagick-3.7.0/tests/302_Imagick_claheImage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/303_Imagick_averageImages.phpt
Changed
(renamed from imagick-3.7.0/tests/303_Imagick_averageImages.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/304_Imagick_is_imagemagick_borked.phpt
Changed
(renamed from imagick-3.7.0/tests/304_Imagick_is_imagemagick_borked.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/305_Imagick_complexImages.phpt
Changed
(renamed from imagick-3.7.0/tests/305_Imagick_complexImages.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/306_Imagick_interpolativeResizeImage.phpt
Changed
(renamed from imagick-3.7.0/tests/306_Imagick_interpolativeResizeImage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/307_Imagick_levelImageColors.phpt
Changed
(renamed from imagick-3.7.0/tests/307_Imagick_levelImageColors.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/308_Imagick_levelizeImage.phpt
Changed
(renamed from imagick-3.7.0/tests/308_Imagick_levelizeImage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/309_Imagick_orderedDitherImage.phpt
Changed
(renamed from imagick-3.7.0/tests/309_Imagick_orderedDitherImage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/310_Imagick_whiteBalanceImage.phpt
Changed
(renamed from imagick-3.7.0/tests/310_Imagick_whiteBalanceImage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/311_Imagick_channelFxImage.phpt
Changed
(renamed from imagick-3.7.0/tests/311_Imagick_channelFxImage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/312_Imagick_colorThresholdImage.phpt
Changed
(renamed from imagick-3.7.0/tests/312_Imagick_colorThresholdImage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/314_Imagick_getBackgroundColor.phpt
Changed
(renamed from imagick-3.7.0/tests/314_Imagick_getBackgroundColor.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/315_Imagick_getImageArtifacts.phpt
Changed
(renamed from imagick-3.7.0/tests/315_Imagick_getImageArtifacts.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/316_Imagick_getImageKurtosis.phpt
Added
@@ -0,0 +1,35 @@ +--TEST-- +Test Imagick, getImageKurtosis +--SKIPIF-- +<?php +require_once(dirname(__FILE__) . '/skipif.inc'); +checkClassMethods('Imagick', array('getImageKurtosis')); +?> +--FILE-- +<?php + +require_once(__DIR__ . '/functions.inc'); + +function getImageKurtosis() { + $imagick = new \Imagick(__DIR__ . '/Biter_500.jpg'); + $values = $imagick->getImageKurtosis(); + + check_value_posibilities( + $values, + "kurtosis", + -0.9379261035010518, -0.70925995674921 + ); + check_value_posibilities( + $values, + "skewness", + 0.4562517200972045, 0.56839010636614 + ); +} + +getImageKurtosis() ; +echo "Ok"; +?> +--EXPECTF-- +Value for 'kurtosis' is %f which is close enough to expected %f +Value for 'skewness' is %f which is close enough to expected %f +Ok \ No newline at end of file
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/317_Imagick_getImageMean.phpt
Changed
(renamed from imagick-3.7.0/tests/317_Imagick_getImageMean.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/318_Imagick_getImageRange.phpt
Changed
(renamed from imagick-3.7.0/tests/318_Imagick_getImageRange.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/319_Imagick_getInterpolateMethod.phpt
Changed
(renamed from imagick-3.7.0/tests/319_Imagick_getInterpolateMethod.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/320_Imagick_getOptions.phpt
Changed
(renamed from imagick-3.7.0/tests/320_Imagick_getOptions.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/321_Imagick_getOrientation.phpt
Changed
(renamed from imagick-3.7.0/tests/321_Imagick_getOrientation.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/322_Imagick_getResolution.phpt
Changed
(renamed from imagick-3.7.0/tests/322_Imagick_getResolution.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/323_Imagick_getType.phpt
Changed
(renamed from imagick-3.7.0/tests/323_Imagick_getType.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/324_Imagick_polynomialImage.phpt
Added
@@ -0,0 +1,38 @@ +--TEST-- +Test Imagick, polynomialImage +--SKIPIF-- +<?php +require_once(dirname(__FILE__) . '/skipif.inc'); +checkClassMethods('Imagick', array('polynomialImage')); +?> +--FILE-- +<?php + +function polynomialImage() { + $imagick = new \Imagick(__DIR__ . '/Biter_500.jpg'); + $imagick_gradient = new \Imagick(); + $imagick_gradient->newPseudoImage( + $imagick->getImageWidth(), + $imagick->getImageHeight(), + "gradient:black-white" + ); + + $imagick->addImage($imagick_gradient); + + $terms = 1, 1, 0.1, 0.1; + + // is 2 x (number_terms + 1 (the constant). + $imagick->polynomialImage($terms); + $imagick->writeImage(__DIR__ . '/polynomialImage_output_image.png'); + $imagick->getImageBlob(); +} + +polynomialImage() ; +echo "Ok"; +?> +--CLEAN-- +<?php +@unlink(__DIR__ . '/polynomialImage_output_image.png'); +?> +--EXPECTF-- +Ok
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/325_Imagick_setDepth.phpt
Added
@@ -0,0 +1,30 @@ +--TEST-- +Test Imagick, setDepth +--SKIPIF-- +<?php +require_once(dirname(__FILE__) . '/skipif.inc'); +checkClassMethods('Imagick', array('setDepth')); +?> +--FILE-- +<?php + +function setDepth() { + $imagick = new \Imagick(); + + $imagick->setDepth(16); + $imagick->newPseudoImage(640, 480, "gradient:red-blue"); + + echo "Depth is " .$imagick->getImageDepth() . "\n"; + + // $imagick->getImageBlob(); + // TODO - check that the depth has actually worked? + // this could be done by generating a gradient, and counting the unique + // numbers of colours, or by looking at gradient artifacts. +} + +setDepth() ; +echo "Ok"; +?> +--EXPECTF-- +Depth is 16 +Ok
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/326_Imagick_setExtract.phpt
Changed
(renamed from imagick-3.7.0/tests/326_Imagick_setExtract.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/327_Imagick_polaroidImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/327_Imagick_polaroidImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/328_Imagick_polaroidImageWithTextAndMethod_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/328_Imagick_polaroidImageWithTextAndMethod_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/329_imagick_getImageBlob_empty.phpt
Added
@@ -0,0 +1,23 @@ +--TEST-- +Imagick::getImageBlob behaviour on invalid images +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +// Fails due to image having no format +$imagick = new Imagick(); +try { + $imagick->newPseudoImage(200, 200, "xc:red"); + $result = $imagick->getImageBlob(); + echo "Imagick failed to throw exception" . PHP_EOL; +} catch (ImagickException $e) { + echo "ImagickException: " . $e->getMessage() . PHP_EOL; +} + +echo "Fin.\n"; + +?> +--EXPECTF-- +ImagickException: Failed to get the image contents (empty or invalid image?) +Fin. \ No newline at end of file
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/330_Imagick_newImage.phpt
Added
@@ -0,0 +1,35 @@ +--TEST-- +Test Imagick, newImage +--SKIPIF-- +<?php +require_once(dirname(__FILE__) . '/skipif.inc'); + +?> +--FILE-- +<?php + + +$image = new Imagick(); +$image->newImage(100, 100, new ImagickPixel('red'), 'png'); + +// Image format case changed at some point in IM +echo strtolower($image->getImageFormat()); +echo "\n"; + +$image = new Imagick(); +$image->newImage(100, 100, 'blue', null); + +try { + $image->getImageFormat(); + echo "Failed to throw exception"; +} +catch (ImagickException $ie) { + echo $ie->getMessage() . "\n"; +} + +echo "Ok"; +?> +--EXPECTF-- +png +Image has no format +Ok
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/Biter_500.jpg
Changed
(renamed from imagick-3.7.0/tests/Biter_500.jpg)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/OFL.txt
Changed
(renamed from imagick-3.7.0/tests/OFL.txt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/anonymous_pro_minus.ttf
Changed
(renamed from imagick-3.7.0/tests/anonymous_pro_minus.ttf)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/bug20636.phpt
Changed
(renamed from imagick-3.7.0/tests/bug20636.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/bug21229.phpt
Changed
(renamed from imagick-3.7.0/tests/bug21229.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/bug59378.phpt
Changed
(renamed from imagick-3.7.0/tests/bug59378.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/bug59378_windows.phpt
Changed
(renamed from imagick-3.7.0/tests/bug59378_windows.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/bug64015.phpt
Changed
(renamed from imagick-3.7.0/tests/bug64015.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/bug81235.phpt
Changed
(renamed from imagick-3.7.0/tests/bug81235.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/bug_66098.phpt
Changed
(renamed from imagick-3.7.0/tests/bug_66098.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/bug_71742.phpt
Changed
(renamed from imagick-3.7.0/tests/bug_71742.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/bug_72226.phpt
Changed
(renamed from imagick-3.7.0/tests/bug_72226.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/bug_73840.phpt
Changed
(renamed from imagick-3.7.0/tests/bug_73840.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/functions.inc
Added
@@ -0,0 +1,196 @@ +<?php + +/** + * + * Gets the installed version of ImageMagick and compares the + * appropriate version to the installed version. * + * + * @param $testIm6Version + * @param $im7Version + * @return int + */ +function version_compare_imagemagick($testIm6Version, $im7Version) +{ + $versionInfo = \Imagick::getVersion(); + + if (array_key_exists("versionString", $versionInfo) == false) { + die("skip unable to determine ImageMagick version."); + } + + $versionInstalledStringComplete = $versionInfo"versionString"; + + $firstSpace = strpos($versionInstalledStringComplete, ' '); + if ($firstSpace === false) { + die("Failed to understand version string $versionInstalledStringComplete - finding first space"); + } + + $secondSpace = strpos($versionInstalledStringComplete, ' ', $firstSpace + 1); + if ($secondSpace === false) { + die("Failed to understand version string $versionInstalledStringComplete - finding second space"); + } + + $versionInstalledString = substr($versionInstalledStringComplete, $firstSpace + 1, $secondSpace - $firstSpace - 1); + // echo "versionInstalledString is $versionInstalledString \n"; + + $versionToCompare = $im7Version; + if (substr($versionInstalledString, 0, 1) === '6') { + $versionToCompare = $testIm6Version; + } + + return version_compare($versionInstalledString, $versionToCompare); +} + +/** + * + * Compares the installed version of ImageMagick and returns true if the appropriate + * version is greater + * + * @param $testIm6Version + * @param $im7Version + * @return bool + */ +function isVersionGreaterEqual($testIm6Version, $im7Version) +{ + $versionCompare = version_compare_imagemagick($testIm6Version, $im7Version); + // echo "version compare for $testIm6Version, $im7Version is $versionCompare \n"; + + if ($versionCompare >= 0) { + return true; + } + + return false; +} + +/** + * On some systems, where the standard fonts aren't available, trying + * to draw any text fails as the ImageMagick default font is null. + * + * This function just find a 'sensible' font to use, either from the + * preferred list, or just the first one from queryFonts(). That 'probably' + * is the right thing to do, as it makes the tests more stable. + */ +function findDefaultFont() +{ + $knownFonts = + 'Courier', + 'Helvetica', + 'Times-Roman', + 'Liberation-Mono', + 'Utopia', + ; + + $fontList = \Imagick::queryFonts(); + + foreach ($knownFonts as $knownFont) { + + if (in_array($knownFont, $fontList, true) === true) { + return $knownFont; + } + } + + if (count($fontList) !== 0) { + return $fontList0; + } + + throw new \Exception("No fonts available on system, apparently."); +} + +// Find and set a font for the Imagick object +function setFontForImagick(\Imagick $imagick) +{ + $font = findDefaultFont(); + + $imagick->setFont($font); +} + +// Find and set a font for the ImagickDraw object +function setFontForImagickDraw(\ImagickDraw $imagickDraw) +{ + $font = findDefaultFont(); + + $imagickDraw->setFont($font); +} + +/** + * Checks that a named value exists in an array and it matches + * an expected value. + */ +function check_value(array $values, $name, $expected_value) +{ + if (array_key_exists($name, $values) !== true) { + + $message = "Expected key '$name' not set. Array contains:\n"; + $message .= var_export($values, true); + + throw new \Exception($message); + } + + + $value = $values$name; + + $epsilon = 0.01; + + if (($value < $expected_value - $epsilon) || ($value > $expected_value + $epsilon)) { + $message = "Value for $name doesn't match expected. Expected: $expected_value, actual: $value"; + throw new \Exception($message); + } + + echo "Value for '$name' is $value which is close enough to expected $expected_value\n"; +} + + +/** + * Checks that a named value exists in an array and it matches + * one of a number of expected values. + * This function exists because the expected values for Kurtosis can + * change when the underlying maths changes: https://github.com/ImageMagick/ImageMagick/issues/6924 + */ +function check_value_posibilities(array $values, $name, array $expected_values) +{ + if (array_key_exists($name, $values) !== true) { + + $message = "Expected key '$name' not set. Array contains:\n"; + $message .= var_export($values, true); + + throw new \Exception($message); + } + + + $value = $values$name; + + $epsilon = 0.01; + + foreach ($expected_values as $expected_value) { + if (($value > $expected_value - $epsilon) && ($value < $expected_value + $epsilon)) { + echo "Value for '$name' is $value which is close enough to expected $expected_value\n"; + return; + } + } + + $expected_string = implode(", ", $expected_values); + + $message = "Value for $name doesn't match expected possibilities. Expected one of: $expected_string, actual: $value"; + throw new \Exception($message); +} + + +function check_value_with_epsilon(array $values, $name, $expected_value, $epsilon) +{ + if (array_key_exists($name, $values) !== true) { + + $message = "Expected key '$name' not set. Array contains:\n"; + $message .= var_export($values, true); + + throw new \Exception($message); + } + + + $value = $values$name; + + if (($value < $expected_value - $epsilon) || ($value > $expected_value + $epsilon)) { + $message = "Value for $name doesn't match expected. Expected: $expected_value, actual: $value, epsilon = $epsilon"; + throw new \Exception($message); + } + + echo "Value for '$name' is $value which is close enough to expected $expected_value\n"; +} \ No newline at end of file
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/github_174.phpt
Changed
(renamed from imagick-3.7.0/tests/github_174.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/houghline_input_image.png
Changed
(renamed from imagick-3.7.0/tests/houghline_input_image.png)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/php.gif
Changed
(renamed from imagick-3.7.0/tests/php.gif)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/skipif.inc
Changed
(renamed from imagick-3.7.0/tests/skipif.inc)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/skipprobefourier.inc
Changed
(renamed from imagick-3.7.0/tests/skipprobefourier.inc)
View file
imagick-3.8.0.tgz/imagick-3.8.0/util/Float32Info.php
Changed
(renamed from imagick-3.7.0/util/Float32Info.php)
View file
imagick-3.8.0.tgz/imagick-3.8.0/util/FloatInfo.php
Changed
(renamed from imagick-3.7.0/util/FloatInfo.php)
View file
imagick-3.8.0.tgz/imagick-3.8.0/util/fixup_arginfo.php
Added
@@ -0,0 +1,156 @@ +<?php + +declare(strict_types = 1); + + +if ($argc !== 2) { + fwrite(STDERR, "usage php fixup_arginfo.php \$arginfo_filename\n"); + exit(-1); +} + +$filename = $argv1; + +$fixup_note = "file has been fixedup for different versions"; + +echo "Fixing $filename\n"; + +$input_lines = file($filename); + +foreach ($input_lines as $input_line) { + if (strpos($input_line, $fixup_note) !== false) { + echo "File has already been fixedup.\n"; + exit(0); + } +} + +$output_lines = ; + +$search = ; +$replace = ; + +$search = "#.*Stub hash: (.*) .*/#iu"; +$replace = "* Stub hash: regen with 'sh regen_arginfo.sh' \n* $fixup_note */"; + +$search = "#ZEND_ARG_OBJ_INFO\(0, (\w*), IMAGICK_QUANTUM_TYPE, 0\)#iu"; +$replace = " +#if MAGICKCORE_HDRI_ENABLE + ZEND_ARG_TYPE_INFO(0, $1, IS_DOUBLE, 0) +#else + ZEND_ARG_TYPE_INFO(0, $1, IS_LONG, 0) +#endif +"; + + +// ZEND_ARG_TYPE_INFO(pass_by_ref, name, type_hint, allow_null) +// ZEND_ARG_INFO(pass_by_ref, name) + +$search = "#ZEND_ARG_TYPE_INFO\((\w*), (\w*), (\w*), (\w*)\)#iu"; +$replace = " +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO($1, $2, $3, $4) +#else + ZEND_ARG_INFO($1, $2) +#endif"; + +$search = "#ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX\((\w*), 0, (\w*), IMAGICK_QUANTUM_TYPE, 0\)#iu"; +$replace = " +#if MAGICKCORE_HDRI_ENABLE +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX($1, 0, $2, IS_DOUBLE, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX($1, 0, $2, IS_LONG, 0) +#endif +"; + + +//ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, type, allow_null) +#define ZEND_BEGIN_ARG_INFO_EX(name, _unused, return_reference, required_num_args) +$search = "#ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX\((\w*), (\w*), (\w*), (\w*), (\w*)\)#iu"; +$replace = " +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX($1, $2, $3, $4, $5) +#else +ZEND_BEGIN_ARG_INFO_EX($1, 0, $2, $3) +#endif +"; + +//#define ZEND_ARG_TYPE_MASK(pass_by_ref, name, type_mask, default_value) \ +$search = "#.*ZEND_ARG_TYPE_MASK\((\w|\|*), (\w|\|*), (\w|\|*), (\w\|\"*)\)#iu"; +$replace = " +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_MASK($1, $2, $3, $4) +#else + ZEND_ARG_INFO($1, $2) +#endif +"; + +//ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(name, return_reference, required_num_args, type) +//ZEND_BEGIN_ARG_INFO_EX(name, _unused, return_reference, required_num_args) + +$search = "#.*ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX\((\w|\|*), (\w|\|*), (\w|\|*), (\w|\|*)\)#iu"; +$replace = " +#if PHP_VERSION_ID >= 80000 + ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX($1, $2, $3, $4) +#else + ZEND_BEGIN_ARG_INFO_EX($1, 0, $2, $3) +#endif +"; + +//ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(name, return_reference, required_num_args, class_name, allow_null) +$search = "#ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX\((\w*), (\w*), (\w*), (\w*), (\w*)\)#iu"; +$replace = " +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX($1, $2, $3, $4, $5) +#else +ZEND_BEGIN_ARG_INFO_EX($1, 0, $2, $3) +#endif +"; + +//ZEND_ARG_OBJ_INFO(pass_by_ref, name, classname, allow_null) \ +$search = "#.*ZEND_ARG_OBJ_INFO\((\w*), (\w*), resource, (\w*)\)#iu"; +$replace = " +#if PHP_VERSION_ID >= 80000 +\tZEND_ARG_OBJ_INFO($1, $2, resource, $3) +#else +\tZEND_ARG_INFO($1, $2) +#endif +"; + +// ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, filename, IS_STRING, 1, "null") +$search = "#.*ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE\((\w*), (\w*), (\w*), (\w*), (\w\"*)\)#iu"; +$replace = " +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE($1, $2, $3, $4, $5) +#else + ZEND_ARG_INFO($1, $2) +#endif +"; + +// ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, filename, "null") +$search = "#.*ZEND_ARG_INFO_WITH_DEFAULT_VALUE\((\w*), (\w*), (\w\"*)\)#iu"; +$replace = " +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_INFO_WITH_DEFAULT_VALUE($1, $2, $3) +#else + ZEND_ARG_INFO($1, $2) +#endif +"; + + + +//#if PHP_VERSION_ID >= 80000 +//ZEND_ARG_TYPE_MASK(0, files, MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_NULL, NULL) +//#else +// ZEND_ARG_INFO(0, files) +//#endif + + + +foreach ($input_lines as $input_line) { + $input_line = rtrim($input_line); + $input_line = preg_replace($search, $replace, $input_line); + + $output_lines = $input_line; +} + +file_put_contents($filename, implode("\n", $output_lines)); +echo "File has now been fixedup.\n";
View file
imagick-3.8.0.tgz/imagick-3.8.0/util/functions.php
Changed
(renamed from imagick-3.7.0/util/functions.php)
View file
imagick-3.7.0.tgz/package.xml -> imagick-3.8.0.tgz/package.xml
Changed
@@ -1,21 +1,27 @@ <?xml version="1.0" encoding="UTF-8"?> -<package packagerversion="1.10.12" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd"> +<package packagerversion="1.10.13" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd"> <name>imagick</name> <channel>pecl.php.net</channel> <summary>Provides a wrapper to the ImageMagick library.</summary> <description>Imagick is a native php extension to create and modify images using the ImageMagick API. -This extension requires ImageMagick version 6.5.3-10+ and PHP 5.4.0+.</description> +This extension requires ImageMagick version 6.5.3-10+ and PHP 5.6.0+.</description> <lead> <name>Dan Ackroyd</name> <user>danack</user> <email>danack@php.net</email> <active>yes</active> </lead> - <date>2022-01-11</date> - <time>15:23:47</time> + <lead> + <name>Jakub Zelenka</name> + <user>bukka</user> + <email>bukka@php.net</email> + <active>yes</active> + </lead> + <date>2025-04-10</date> + <time>17:09:23</time> <version> - <release>3.7.0</release> - <api>3.7.0</api> + <release>3.8.0</release> + <api>3.8.0</api> </version> <stability> <release>stable</release> @@ -23,8 +29,8 @@ </stability> <license uri="http://www.php.net/license">PHP License</license> <notes> -- Added: - * Imagick::COMPOSITE_SALIENCY_BLEND +- Fixes: + * Fix signedness formatting mistakes </notes> <contents> <dir name="/"> @@ -44,8 +50,10 @@ <file md5sum="5575a4c8819e6fcd16a5060d6f6d6b88" name="tests/010_importimagepixels.phpt" role="test" /> <file md5sum="f9a2b3ad703b8e7f5fc017d4ac51e444" name="tests/011_polygon.phpt" role="test" /> <file md5sum="058d0a08752790abf5a5050ea0fd0e98" name="tests/012-clone-separation.phpt" role="test" /> - <file md5sum="2ee0ff0876cf5de08eddac649f58ad9a" name="tests/013-read-filehandle.phpt" role="test" /> - <file md5sum="9bfdc24c7d181c70300cbcfb75ba02aa" name="tests/014-setresourcelimit.phpt" role="test" /> + <file md5sum="22b0b4b6a03246ab701b67fab720d116" name="tests/013-read-filehandle.phpt" role="test" /> + <file md5sum="b5ee2b4af4a54ea2253cd9824cd6cdd2" name="tests/013-read-filehandle-memory-stream.phpt" role="test" /> + <file md5sum="c11ebb2408313fbfe58c2ea22554df1d" name="tests/013-read-filehandle-file-stream.phpt" role="test" /> + <file md5sum="276ae595ebc53c5ad8f2962388aba5ba" name="tests/014-setresourcelimit.phpt" role="test" /> <file md5sum="feb911d00b9d2018b43f65d62657016a" name="tests/015-imagickdrawsetresolution.phpt" role="test" /> <file md5sum="2d811a448bdd4e7c7b906db94cc518f8" name="tests/016-static-methods.phpt" role="test" /> <file md5sum="59e0bde93ae3de720dbedc80bd23933a" name="tests/017-clear-destroy.phpt" role="test" /> @@ -62,7 +70,7 @@ <file md5sum="564f3d103027ffba8c3e983252fe502a" name="tests/028_Imagick_adaptiveSharpenImage_basic.phpt" role="test" /> <file md5sum="9ef2c2c0f19e2ecf46a36080a9c2c4ba" name="tests/029_Imagick_adaptiveBlurImage_basic.phpt" role="test" /> <file md5sum="ab362477502d816f271f09598b1c1fe2" name="tests/030_Imagick_adaptiveThresholdImage_basic.phpt" role="test" /> - <file md5sum="130d4ea7fd98f6e7301392b210ed6238" name="tests/031_Imagick_affineTransformImage_basic.phpt" role="test" /> + <file md5sum="b302e3a53a3dbc93d87c14b1b1b3cb66" name="tests/031_Imagick_affineTransformImage_basic.phpt" role="test" /> <file md5sum="e46101e28b5409950873aec6ba7b9a32" name="tests/032_Imagick_addNoiseImage_basic.phpt" role="test" /> <file md5sum="5df1d44e69b54821f87ab1cb9715dce3" name="tests/033_Imagick_autoLevelImage_basic.phpt" role="test" /> <file md5sum="ca40b80eb5e50f9937f927ac05fa110f" name="tests/034_Imagick_annotateImage_basic.phpt" role="test" /> @@ -74,7 +82,8 @@ <file md5sum="5bf72f9179d7b3bb7e976b2ee0e88641" name="tests/039_Imagick_borderImage_im7.phpt" role="test" /> <file md5sum="f7650055fa622ff57517fe26db2e40f3" name="tests/040_Imagick_charcoalImage_basic.phpt" role="test" /> <file md5sum="ab034867bc3ed969c215c359f785dac3" name="tests/041_Imagick_chopImage_basic.phpt" role="test" /> - <file md5sum="6155d928fa62874282bab995cca0e9ad" name="tests/042_Imagick_clutImage_basic.phpt" role="test" /> + <file md5sum="e1f496a53bd6288b8404b8070da3750c" name="tests/042_Imagick_clutImage_basic.phpt" role="test" /> + <file md5sum="ae6e05bf5ab8d57b653947de42a80f30" name="tests/042_Imagick_clutImage_im7.phpt" role="test" /> <file md5sum="bb569e19869bc4027bd6fa203cdf306e" name="tests/043_Imagick_colorizeImage_basic.phpt" role="test" /> <file md5sum="ed91b225c80fcd75ce63055bbe4a616d" name="tests/044_Imagick_colorMatrixImage_basic.phpt" role="test" /> <file md5sum="de86d54e462c61e691d31ef8e08c96ba" name="tests/045_Imagick_compositeImage_basic.phpt" role="test" /> @@ -125,7 +134,7 @@ <file md5sum="6cf73696f373b8b28594efce9550e093" name="tests/089_Imagick_medianFilterImage_basic.phpt" role="test" /> <file md5sum="7357f18a08692acd51b6ff8a5fae93bf" name="tests/090_Imagick_magnifyImage_basic.phpt" role="test" /> <file md5sum="43d2943e63c01d74adad0375fcdb5133" name="tests/091_Imagick_linearStretchImage_basic.phpt" role="test" /> - <file md5sum="5a720f34ee6ec948f796cca08ddfdf42" name="tests/092_Imagick_mergeImageLayers_basic.phpt" role="test" /> + <file md5sum="71a6dfbf58b1e0a97c67c697402ac0aa" name="tests/092_Imagick_mergeImageLayers_basic.phpt" role="test" /> <file md5sum="238b65c0fa2ef8439cd71d458f222943" name="tests/093_Imagick_modulateImage_basic.phpt" role="test" /> <file md5sum="7ae4cbcc2388ac3e4a98ae9a0d97b897" name="tests/094_Imagick_motionBlurImage_basic.phpt" role="test" /> <file md5sum="fd975fcf80f318926f4d519fdb17977d" name="tests/095_Imagick_normalizeImage_basic.phpt" role="test" /> @@ -176,7 +185,7 @@ <file md5sum="4a377c795ae035b9a736241c234b3c31" name="tests/143_Imagick_spreadImage_basic.phpt" role="test" /> <file md5sum="8c873a32d61a2cd2428f13d402daa945" name="tests/143_Imagick_spreadImageWithMethod_basic.phpt" role="test" /> <file md5sum="9263c00097d1dbd8abceb182cc72e92e" name="tests/144_Imagick_spliceImage_basic.phpt" role="test" /> - <file md5sum="b5334176264be1382cc86badff178846" name="tests/145_imagickkernel_coverage.phpt" role="test" /> + <file md5sum="86b9d786d8d097f8f038a38186e51564" name="tests/145_imagickkernel_coverage.phpt" role="test" /> <file md5sum="4f76d53aa43b408be7dcf58e74129d3f" name="tests/149_Imagick_sparseColorImage.phpt" role="test" /> <file md5sum="329b3f90c0a76f3ae71172d83eb9064a" name="tests/150_Imagick_setregistry.phpt" role="test" /> <file md5sum="f4a0d4208e7c5715acdf9c8ca4aaeeb6" name="tests/151_Imagick_subImageMatch_basic.phpt" role="test" /> @@ -270,26 +279,26 @@ <file md5sum="584b77d3e70004610be1fd3697f52654" name="tests/243_Tutorial_svgExample_basic.phpt" role="test" /> <file md5sum="8253d7110ac4ad3c8158516376083628" name="tests/244_Tutorial_psychedelicFontGif_basic.phpt" role="test" /> <file md5sum="8d2952d75ddc1bd7265dd2aa96312acc" name="tests/245_Tutorial_screenEmbed_basic.phpt" role="test" /> - <file md5sum="72e06e279f77daddb30315092ab74289" name="tests/246_antialias_image.phpt" role="test" /> + <file md5sum="734fc305857c03dd56b198c82b3286ae" name="tests/246_antialias_image.phpt" role="test" /> <file md5sum="4e7d524afc4cd2c32406ece1816a1e3a" name="tests/247_ImagickPixelIterator_construct_basic.phpt" role="test" /> <file md5sum="ee3b287a2c34fdb6b2ce41b112b2611d" name="tests/248_ImagickPixelIterator_clear_basic.phpt" role="test" /> <file md5sum="c47640246b86f53e414c3c22748c16cc" name="tests/249_ImagickPixelIterator_getNextIteratorRow_basic.phpt" role="test" /> <file md5sum="610d1633169d9aad141221b376f93d7d" name="tests/250_ImagickPixelIterator_resetIterator_basic.phpt" role="test" /> <file md5sum="b3b6c4982de222a0b683ec46eee74a4a" name="tests/251_ImagickPixelIterator_setIteratorRow_basic.phpt" role="test" /> - <file md5sum="4e7d524afc4cd2c32406ece1816a1e3a" name="tests/252_ImagickPixelIterator_construct_basic.phpt" role="test" /> + <file md5sum="58f969ee4d5879475c211c936577fcfb" name="tests/252_ImagickPixelIterator_construct_basic.phpt" role="test" /> <file md5sum="709ba0815ab47bb2dc967179e2d0de93" name="tests/064_cropThumbNailImage.phpt" role="test" /> <file md5sum="ebea7ebf0f95aaf25fa401644f5829a1" name="tests/253_getHdri.phpt" role="test" /> - <file md5sum="956182e472896cef88789e9decbaf61d" name="tests/254_getConfigureOptions.phpt" role="test" /> + <file md5sum="5a82388e09077e9151c48d683726cb49" name="tests/254_getConfigureOptions.phpt" role="test" /> <file md5sum="95dc4f184d99da28296768261884bac0" name="tests/255_getFeatures.phpt" role="test" /> <file md5sum="fd4fed6a4d80bce72088047f821b2dc7" name="tests/256_Imagick_exportImagePixels_basic.phpt" role="test" /> - <file md5sum="b9c43a5f6ee19f7142f2c481429b07a1" name="tests/257_Imagick_setImageChannelMask_basic.phpt" role="test" /> + <file md5sum="a968eeade13c74c55872edbfc482bc42" name="tests/257_Imagick_setImageChannelMask_basic.phpt" role="test" /> <file md5sum="d1d1bfc0945e2347268f5b4b607c3235" name="tests/258_Imagick_evaluateImages_basic.phpt" role="test" /> <file md5sum="76d35ace1a27c6001d909af15b79ada8" name="tests/259_Imagick_colorPoints_basic.phpt" role="test" /> <file md5sum="9cf922a27cf0aeecab3d0c51388031dc" name="tests/260_localContrastImage.phpt" role="test" /> <file md5sum="dd0c76af37fa3f8d4d422ae25450becc" name="tests/261_compositeImageGravity.phpt" role="test" /> <file md5sum="51a669efe49af023d00e77cb094a6b15" name="tests/262_autoOrient.phpt" role="test" /> - <file md5sum="5080e13a369db4e2042a83827dbcda9d" name="tests/263_autoGammaImage.phpt" role="test" /> - <file md5sum="df636278b41cccfccbdf3dbf5e9426f4" name="tests/264_ImagickDraw_getTextDirection_basic.phpt" role="test" /> + <file md5sum="ee1c0da6a3a96aa3eec923789d01f8ba" name="tests/263_autoGammaImage.phpt" role="test" /> + <file md5sum="3d9fcdd3ff03fcef1c5af679a44f5405" name="tests/264_ImagickDraw_getTextDirection_basic.phpt" role="test" /> <file md5sum="1e61166e6907212a5175b9c647838f1a" name="tests/265_ImagickDraw_getOpacity_basic.phpt" role="test" /> <file md5sum="57d89597b88c88e430364c049b38d718" name="tests/266_ImagickDraw_getFontResolution_basic.phpt" role="test" /> <file md5sum="d1ec44bed69eacde2db52cbf89befc21" name="tests/267_ImagickDraw_getBorderColor_basic.phpt" role="test" /> @@ -299,14 +308,14 @@ <file md5sum="90af42a2b834e318d762b286cfc6ff65" name="tests/271_imagick_constants.phpt" role="test" /> <file md5sum="93d7b4b65df7e0f398f8ffb89c3ded29" name="tests/272_imagick_identifyimagetype.phpt" role="test" /> <file md5sum="5d2e90aac7782db6c543be3e4231dc8b" name="tests/273_imagick_falsyimage.phpt" role="test" /> - <file md5sum="6a7b5e9463e8c786a5dec8482d7efebd" name="tests/274_imagick_setImageAlpha.phpt" role="test" /> + <file md5sum="52b20af8f3fd002bdf017da966fffba5" name="tests/274_imagick_setImageAlpha.phpt" role="test" /> <file md5sum="f5fc0eb6d23f304969c26c9db7ee0014" name="tests/275_ImagickPixel_unitializedObjects.phpt" role="test" /> <file md5sum="9391ee397852444bc877f515c4fc82fa" name="tests/276_Imagick_artifacts.phpt" role="test" /> <file md5sum="ae0ec59997765d5d595ef1420b2786b8" name="tests/277_Imagick_colorDecisionListImage.phpt" role="test" /> - <file md5sum="d4c9b456de56ce6d810c99a28ae2266d" name="tests/278_Imagick_optimaze_gif.phpt" role="test" /> + <file md5sum="b067030838b39c824559f0798cd3def0" name="tests/278_Imagick_optimaze_gif.phpt" role="test" /> <file md5sum="ac97eda781d3df04a02b1ee82d7856d6" name="tests/279_ImagickDraw_setTextInterlineSpacing.phpt" role="test" /> <file md5sum="18cc434cd9dbdc14c36b617365de3e70" name="tests/280_imagickkernel_exception_invalid_origin.phpt" role="test" /> - <file md5sum="916610299aaa04b46d64a23c5db0b8f4" name="tests/281_imagick_houghLineImage_basic.phpt" role="test" /> + <file md5sum="39bd69a5753144f5f555341843117f68" name="tests/281_imagick_houghLineImage_basic.phpt" role="test" /> <file md5sum="a5e414c5a2367791a80a14d0307a7a81" name="tests/281_ini_settings_default.phpt" role="test" /> <file md5sum="7ac90c9793ce913fbeb5dfeea9637c8c" name="tests/282_ini_settings_set_falsy_string.phpt" role="test" /> <file md5sum="685f4dac48116c82d40a0a2fe9b69e44" name="tests/283_ini_settings_set_falsy_zero.phpt" role="test" /> @@ -315,7 +324,7 @@ <file md5sum="70ed9b2e2dc9ded36d61e08e3f1fdca9" name="tests/286_Imagick_setMask_basic.phpt" role="test" /> <file md5sum="fd6bb938349bac41405f545b4efc8e54" name="tests/287_Imagick_GetImageChannelRange_basic.phpt" role="test" /> <file md5sum="fa497613d70bd4af8120781286ce3b98" name="tests/288_imagick_prevent_zero_size_images.phpt" role="test" /> - <file md5sum="966ebdc7725a32671742db2c2a24d828" name="tests/289_Imagick_setImageMask_basic.phpt" role="test" /> + <file md5sum="7cfeb135a9ea25a1387ecd4cfc87a421" name="tests/289_Imagick_setImageMask_basic.phpt" role="test" /> <file md5sum="032fb0d3e18f905f83fd437c561f2d2e" name="tests/290_imagick_profileimage.phpt" role="test" /> <file md5sum="16a0c4b5d0515629eadd173b2073214e" name="tests/291_reflection.phpt" role="test" /> <file md5sum="b7f187644872a160be781648834091a4" name="tests/292_index_iterator.phpt" role="test" /> @@ -340,7 +349,7 @@ <file md5sum="34681d4ffb3d1fa3c9c037dafdec9e12" name="tests/312_Imagick_colorThresholdImage.phpt" role="test" /> <file md5sum="a08bcf706a3ab0b23127bd8c7b0f15be" name="tests/314_Imagick_getBackgroundColor.phpt" role="test" /> <file md5sum="12abf821306dd1584da8de28b046dbb2" name="tests/315_Imagick_getImageArtifacts.phpt" role="test" /> - <file md5sum="7f62b0623c0328b2159849588721cbc8" name="tests/316_Imagick_getImageKurtosis.phpt" role="test" /> + <file md5sum="1cd7ed4bea889b359cecbde3229ee014" name="tests/316_Imagick_getImageKurtosis.phpt" role="test" /> <file md5sum="9dfe1d45cc7659a368b7f53c65ccaf0f" name="tests/317_Imagick_getImageMean.phpt" role="test" /> <file md5sum="58ea6703df1f273e930254440ec10b7c" name="tests/318_Imagick_getImageRange.phpt" role="test" /> <file md5sum="1309063dc6420da68aa246fe6f11af05" name="tests/319_Imagick_getInterpolateMethod.phpt" role="test" /> @@ -348,11 +357,13 @@ <file md5sum="30434386321de90c7ddae519662309ad" name="tests/321_Imagick_getOrientation.phpt" role="test" /> <file md5sum="69e82ca237635877c1d95f02bc3f025c" name="tests/322_Imagick_getResolution.phpt" role="test" /> <file md5sum="9e8b7c236c980c5840b9def9fd912736" name="tests/323_Imagick_getType.phpt" role="test" /> - <file md5sum="a2383b3e9d7df5d85d25a0ccf583db50" name="tests/324_Imagick_polynomialImage.phpt" role="test" /> - <file md5sum="8e12a6ad4de34823058127a9e592a176" name="tests/325_Imagick_setDepth.phpt" role="test" /> + <file md5sum="38c244de709e5a94e9440c05c9af2605" name="tests/324_Imagick_polynomialImage.phpt" role="test" /> + <file md5sum="a40be1f48254f9ea13d326699ae4f5a2" name="tests/325_Imagick_setDepth.phpt" role="test" /> <file md5sum="6aef8ed00d4ebbef680f1bddd8ce05dc" name="tests/326_Imagick_setExtract.phpt" role="test" /> <file md5sum="b08069dd3a7e66b4b81325f0cbfabd0f" name="tests/327_Imagick_polaroidImage_basic.phpt" role="test" /> <file md5sum="6037c71db1fb1b7c050494e4e8b8dbe4" name="tests/328_Imagick_polaroidImageWithTextAndMethod_basic.phpt" role="test" /> + <file md5sum="89e3972a5dbbe89ff58eea1f94b2c5e6" name="tests/329_imagick_getImageBlob_empty.phpt" role="test" /> + <file md5sum="ddcdb3e725a8bf9828500fa9dcc8eb54" name="tests/330_Imagick_newImage.phpt" role="test" /> <file md5sum="7dd644c7b96b6591f83a46bd62fe03c6" name="tests/bug20636.phpt" role="test" /> <file md5sum="44f0d734dab227610bfeae5d0f9266e3" name="tests/bug21229.phpt" role="test" /> <file md5sum="10d5433d2c44583c0775dc56d0e39784" name="tests/bug59378.phpt" role="test" /> @@ -363,7 +374,7 @@ <file md5sum="2b237392d0a7e710082b1ebebb6d6e5f" name="tests/bug_72226.phpt" role="test" /> <file md5sum="5745f92524e319f2983778409d165be8" name="tests/bug_73840.phpt" role="test" /> <file md5sum="f69a3c9a9b358fc92bb6eefccad3722b" name="tests/bug81235.phpt" role="test" /> - <file md5sum="4979d96fd288c5a0daadd16c5500d447" name="tests/functions.inc" role="test" /> + <file md5sum="2f035178707fa1da08e542ce7857db0b" name="tests/functions.inc" role="test" /> <file md5sum="c3b92b06fb138ebed58000ed01f32eef" name="tests/github_174.phpt" role="test" /> <file md5sum="0559726d3af71e62a47417f480a37665" name="tests/houghline_input_image.png" role="test" /> <file md5sum="bc90e473c420305bb99f49acadc72484" name="tests/Biter_500.jpg" role="test" /> @@ -375,51 +386,51 @@ <file md5sum="d323f8286c5045f599098fade7c22f2a" name="util/Float32Info.php" role="test" /> <file md5sum="00df752d5bf8f1f4b79448edb05d9990" name="util/FloatInfo.php" role="test" /> <file md5sum="4f19b77ff6c3c2c31034a0aab1585616" name="util/functions.php" role="test" /> - <file md5sum="df516b68d529c7a3d1bd1292d8b630ba" name="util/fixup_arginfo.php" role="src" /> - <file md5sum="496f815c956afb08245957b3432e7a1c" name="config.m4" role="src" /> + <file md5sum="7acaeeae91ca9be7b5616474e55e4647" name="util/fixup_arginfo.php" role="src" /> + <file md5sum="90b24b5065eb38125eeb884c18eecaae" name="config.m4" role="src" /> <file md5sum="78248656dd502a5f2e379114d7ab69f9" name="imagemagick.m4" role="src" /> <file md5sum="e3f57381df318f416209380691933e9c" name="config.w32" role="src" /> <file md5sum="6077035e65e0b0bbe5a28917282e26b2" name="CREDITS" role="doc" /> - <file md5sum="175640d781b0610d056ce31064301a3e" name="imagick.c" role="src" /> - <file md5sum="989613cd35944ebb597153d145cb287a" name="imagick_class.c" role="src" /> - <file md5sum="41123c3374356bb604aab0980a61224d" name="imagickdraw_class.c" role="src" /> - <file md5sum="678923622f16f5886b1a0219913d480e" name="imagickpixel_class.c" role="src" /> - <file md5sum="da43fceecbfe0355805eb0ad144f6922" name="imagickpixeliterator_class.c" role="src" /> - <file md5sum="1139a8e8095fed6e8ee940addad2d615" name="imagickkernel_class.c" role="src" /> - <file md5sum="9e508919eeee40248e71f5ecc8c362ca" name="imagick_helpers.c" role="src" /> - <file md5sum="3e26d63a209b5348a33be48a491b6584" name="imagick_file.c" role="src" /> - <file md5sum="dbf970757fbfed4367445dec4368553f" name="php_imagick.h" role="src"> + <file md5sum="4f01f1b9a9e87c777a3570fb358c9b76" name="imagick.c" role="src" /> + <file md5sum="9fb1df6874abc8dc98420434521c4372" name="imagick_class.c" role="src" /> + <file md5sum="cf8943614b04a35ea1926600e4db7259" name="imagickdraw_class.c" role="src" /> + <file md5sum="74eb02749ace3413b119276c8c031e83" name="imagickpixel_class.c" role="src" /> + <file md5sum="fe1deed244eec354a5849339eacaa436" name="imagickpixeliterator_class.c" role="src" /> + <file md5sum="6695e6c7a70bcd1c8cb1909fc6d271da" name="imagickkernel_class.c" role="src" /> + <file md5sum="52e2c8b217f3bbcd4d5815f86b548eb2" name="imagick_helpers.c" role="src" /> + <file md5sum="82bf032a928224b955b1556225fd2c99" name="imagick_file.c" role="src" /> + <file md5sum="55614bd87376f43aa3dca938d59a2b2c" name="php_imagick.h" role="src"> <tasks:replace from="@PACKAGE_VERSION@" to="version" type="package-info" /> </file> - <file md5sum="190e7e764adcee73932138c74ae8a004" name="php_imagemagick_version_defs.h" role="src" /> - <file md5sum="6b1ff74629e1d4a0d0ee7a19b84e3eba" name="php_imagick_defs.h" role="src" /> + <file md5sum="a3aabb827cf19ac0acc17d78b0d6d747" name="php_imagemagick_version_defs.h" role="src" /> + <file md5sum="47371eec629b74fb38d417ed9a1e940c" name="php_imagick_defs.h" role="src" /> <file md5sum="9fbf013043be6f71fab9af27022828d4" name="php_imagick_helpers.h" role="src" /> - <file md5sum="53fc8397e1234d2d5c59c1dfc5326585" name="php_imagick_macros.h" role="src" /> + <file md5sum="da06ed1989897056899051e2f2f39d67" name="php_imagick_macros.h" role="src" /> <file md5sum="6bd00e4a01296451379b10f7d76a81a6" name="php_imagick_shared.h" role="src" /> <file md5sum="b771b2f8fa2c34d51827503caf2a4a3a" name="php_imagick_file.h" role="src" /> - <file md5sum="d1915fd770403944df063225073dcceb" name="shim_im6_to_im7.c" role="src" /> + <file md5sum="5dcc679e2f03efecac47c7acd4602ffc" name="shim_im6_to_im7.c" role="src" /> <file md5sum="de4633adf8e1cf4af8fb17a3c67ee064" name="shim_im6_to_im7.h" role="src" /> <file md5sum="9edc8923e14e0df9d730387f86b58e2a" name="shim_php7_to_php8.h" role="src" /> - <file md5sum="753fd5bd36a51314edb7db78c356b80a" name="ImagickPixel_arginfo.h" role="src" /> - <file md5sum="c3edae5f9afeb059a99aa36ed8952eb8" name="Imagick_arginfo.h" role="src" /> - <file md5sum="8d87ef917a6afe590d073d1e8d8c72ac" name="ImagickDraw_arginfo.h" role="src" /> - <file md5sum="92da25606f54c704e73ce79986e62832" name="ImagickKernel_arginfo.h" role="src" /> - <file md5sum="1b5a0599367e12398b3fb18492695722" name="ImagickPixelIterator_arginfo.h" role="src" /> - <file md5sum="95091fc1bcde39436e812626861df4da" name="ImagickPixel.stub.php" role="src" /> - <file md5sum="c2fb6a7536cf6c934cbb3882d8c4abf2" name="Imagick.stub.php" role="src" /> - <file md5sum="de67c832afe3a4a5b308c66f49e5d043" name="ImagickDraw.stub.php" role="src" /> - <file md5sum="eabb1928f78bc72ff62330c745ba4320" name="ImagickKernel.stub.php" role="src" /> - <file md5sum="4f39eafaf97f42a2ed2bbaf5c7eade81" name="ImagickPixelIterator.stub.php" role="src" /> - <file md5sum="190e7e764adcee73932138c74ae8a004" name="php_imagemagick_version_defs.h" role="src" /> + <file md5sum="b8ee611ac8e848d48d12cd677ce53d05" name="ImagickPixel_arginfo.h" role="src" /> + <file md5sum="13d22308da24ef2893e3b33e37be3e76" name="Imagick_arginfo.h" role="src" /> + <file md5sum="b0cdabf4cf6f8a70876d9b0cdcd356a0" name="ImagickDraw_arginfo.h" role="src" /> + <file md5sum="20dec2ce62f484602a2224380bac0123" name="ImagickKernel_arginfo.h" role="src" /> + <file md5sum="5a0335ae46e8d438943fa2e3297c578d" name="ImagickPixelIterator_arginfo.h" role="src" /> + <file md5sum="0086b29c0950b153721226691e519f4d" name="ImagickPixel.stub.php" role="src" /> + <file md5sum="ee12c2e8b2432e13535e871720e1d483" name="Imagick.stub.php" role="src" /> + <file md5sum="a9774eed1e3c35f127079ec55fcf8c89" name="ImagickDraw.stub.php" role="src" /> + <file md5sum="14371d07ec38758501510bff0aa4e0a4" name="ImagickKernel.stub.php" role="src" /> + <file md5sum="fac7db3a865e746ccd15de9e3ac58517" name="ImagickPixelIterator.stub.php" role="src" /> + <file md5sum="a3aabb827cf19ac0acc17d78b0d6d747" name="php_imagemagick_version_defs.h" role="src" /> <file md5sum="a680fef2a389198d6824cf158a0971a9" name="regen_arginfo.sh" role="src" /> - <file md5sum="47eeb35a4f0043c41c2abf4d03a7d0d1" name="ChangeLog" role="doc" /> + <file md5sum="0404d251739b4dc256ad6ac866227a63" name="ChangeLog" role="doc" /> <file md5sum="dd34a70236f008af999de817b93a5e3a" name="LICENSE" role="doc" /> </dir> </contents> <dependencies> <required> <php> - <min>5.4.0</min> + <min>5.6.0</min> </php> <pearinstaller> <min>1.4.0</min>
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.