diff --git a/imagick.c b/imagick.c index ac889118..8c18861d 100644 --- a/imagick.c +++ b/imagick.c @@ -2312,7 +2312,7 @@ const zend_function_entry *php_imagickpixeliterator_class_methods = class_Imagic // { NULL, NULL, NULL, 0, 0 } //}; -#include "ImagickPixel_arginfo.h" +#include "imagickpixel_class_arginfo.h" const zend_function_entry *php_imagickpixel_class_methods = class_ImagickPixel_methods; @@ -2902,7 +2902,7 @@ const zend_function_entry *php_imagick_class_methods = class_Imagick_methods; // { NULL, NULL, NULL, 0, 0 } //}; -#include "ImagickKernel_arginfo.h" +#include "imagickkernel_class_arginfo.h" const zend_function_entry *php_imagickkernel_class_methods = class_ImagickKernel_methods; @@ -3978,7 +3978,9 @@ PHP_MINFO_FUNCTION(imagick) PHP_MSHUTDOWN_FUNCTION(imagick) { +#ifndef HAVE_OMP_PAUSE_RESOURCE_ALL int i; +#endif // This suppresses an 'unused parameter' warning. (void)type; diff --git a/imagickkernel_class.c b/imagickkernel_class.c index 257ec1db..662f2d84 100644 --- a/imagickkernel_class.c +++ b/imagickkernel_class.c @@ -821,7 +821,7 @@ PHP_METHOD(ImagickKernel, scale) { php_imagickkernel_object *internp; double scale; - im_long normalize_flag; + im_long normalize_flag = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d|l", &scale, &normalize_flag) == FAILURE) { return; diff --git a/ImagickKernel.stub.php b/imagickkernel_class.stub.php old mode 100755 new mode 100644 similarity index 87% rename from ImagickKernel.stub.php rename to imagickkernel_class.stub.php index 39924ecf..b6964a2e --- a/ImagickKernel.stub.php +++ b/imagickkernel_class.stub.php @@ -17,7 +17,7 @@ public static function fromMatrix(array $matrix, ?array $origin): ImagickKernel public function getMatrix(): array {} // NORMALIZE_KERNEL_ - public function scale(float $scale, ?int $normalize_kernel): void {} + public function scale(float $scale, ?int $normalize_kernel = 0): void {} public function separate(): array {} } diff --git a/ImagickKernel_arginfo.h b/imagickkernel_class_arginfo.h similarity index 62% rename from ImagickKernel_arginfo.h rename to imagickkernel_class_arginfo.h index aff23cdf..c667e002 100644 --- a/ImagickKernel_arginfo.h +++ b/imagickkernel_class_arginfo.h @@ -1,113 +1,41 @@ /* 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 */ + * Stub hash: 2b1addfe7bec455d316aac0f8a51bac5c4c9c591 */ #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_ARG_TYPE_INFO(0, scale, IS_DOUBLE, 0) 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_ARG_TYPE_INFO(0, kernel, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, shape, IS_STRING, 0) 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_ARG_TYPE_INFO(0, matrix, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, origin, IS_ARRAY, 1) 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, 2, IS_VOID, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickKernel_scale, 0, 0, 2) -#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(0, normalize_kernel, IS_LONG, 1) -#else - ZEND_ARG_INFO(0, normalize_kernel) -#endif +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickKernel_scale, 0, 1, IS_VOID, 0) + ZEND_ARG_TYPE_INFO(0, scale, IS_DOUBLE, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, normalize_kernel, IS_LONG, 1, "0") ZEND_END_ARG_INFO() #endif @@ -162,4 +90,4 @@ static const zend_function_entry class_ImagickKernel_methods[] = { ZEND_ME(ImagickKernel, separate, arginfo_class_ImagickKernel_separate, ZEND_ACC_PUBLIC) #endif ZEND_FE_END -}; \ No newline at end of file +}; diff --git a/ImagickPixel.stub.php b/imagickpixel_class.stub.php old mode 100755 new mode 100644 similarity index 79% rename from ImagickPixel.stub.php rename to imagickpixel_class.stub.php index 0d093a22..ecd2f78a --- a/ImagickPixel.stub.php +++ b/imagickpixel_class.stub.php @@ -2,9 +2,10 @@ /** @generate-function-entries */ + class ImagickPixel { - public function __construct(?string $color) {} + public function __construct(?string $color = null) {} public function clear(): bool {} @@ -20,15 +21,19 @@ public function getColorCount(): int {} public function getColorQuantum(): array {} // COLOR_* - public function getColorValue(int $color): IMAGICK_QUANTUM_TYPE {} + public function getColorValue(int $color): float {} /** * @param int $color // COLOR_* - * @return mixed + * return type: * - Float if IM compiled with HDRI * - int if IM compiled with fixed point math */ - public function getColorValueQuantum(int $color): IMAGICK_QUANTUM_TYPE {} +#if MAGICKCORE_HDRI_ENABLE + public function getColorValueQuantum(int $color): float {} +#else + public function getColorValueQuantum(int $color): int {} +#endif public function getHSL(): array {} @@ -66,13 +71,17 @@ public function setColorValue(int $color, float $value): bool {} * - int if IM compiled with fixed point math * */ - public function setColorValueQuantum(int $color, IMAGICK_QUANTUM_TYPE $value): bool{} +#if MAGICKCORE_HDRI_ENABLE + public function setColorValueQuantum(int $color, float $value): bool{} +#else + public function setColorValueQuantum(int $color, int $value): bool{} +#endif 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 {} + public function setIndex(int $index): bool {} //// Not in docs. #if MagickLibVersion >= 0x693 diff --git a/ImagickPixel_arginfo.h b/imagickpixel_class_arginfo.h similarity index 57% rename from ImagickPixel_arginfo.h rename to imagickpixel_class_arginfo.h index eadcfffd..4712fcf4 100644 --- a/ImagickPixel_arginfo.h +++ b/imagickpixel_class_arginfo.h @@ -1,275 +1,99 @@ /* 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 */ + * Stub hash: e9f76fb33178b8f0738fdeff835472ae37a83431 */ -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel___construct, 0, 0, 1) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, color, IS_STRING, 1) -#else - ZEND_ARG_INFO(0, color) -#endif +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel___construct, 0, 0, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, color, IS_STRING, 1, "null") 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 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, normalized, IS_LONG, 0, "0") 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() +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_getColorValue, 0, 1, IS_DOUBLE, 0) + ZEND_ARG_TYPE_INFO(0, color, IS_LONG, 0) +ZEND_END_ARG_INFO() -#if MAGICKCORE_HDRI_ENABLE - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_getColorValue, 0, 0, IS_DOUBLE, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_getColorValue, 0, 0, 0) -#endif - -#else - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_getColorValue, 0, 0, IS_LONG, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_getColorValue, 0, 0, 0) -#endif - +#if MAGICKCORE_HDRI_ENABLE +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_getColorValueQuantum, 0, 1, IS_DOUBLE, 0) + ZEND_ARG_TYPE_INFO(0, color, IS_LONG, 0) +ZEND_END_ARG_INFO() #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) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_getColorValueQuantum, 0, 1, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, color, IS_LONG, 0) ZEND_END_ARG_INFO() - -#define arginfo_class_ImagickPixel_getColorValueQuantum arginfo_class_ImagickPixel_getColorValue +#endif #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_ARG_TYPE_INFO(0, fuzz, IS_DOUBLE, 0) 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_ARG_TYPE_INFO(0, fuzz_quantum_range_scaled_by_square_root_of_three, IS_DOUBLE, 0) 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_ARG_TYPE_INFO(0, color, IS_STRING, 0) 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_ARG_TYPE_INFO(0, color_count, IS_LONG, 0) 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_ARG_TYPE_INFO(0, color, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, value, IS_DOUBLE, 0) ZEND_END_ARG_INFO() - -#if PHP_VERSION_ID >= 80000 +#if MAGICKCORE_HDRI_ENABLE 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 + ZEND_ARG_TYPE_INFO(0, color, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, value, IS_DOUBLE, 0) +ZEND_END_ARG_INFO() #endif +#if !(MAGICKCORE_HDRI_ENABLE) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_setColorValueQuantum, 0, 2, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, color, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, value, IS_LONG, 0) 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_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_setHSL, 0, 3, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, hue, IS_DOUBLE, 0) + ZEND_ARG_TYPE_INFO(0, saturation, IS_DOUBLE, 0) + ZEND_ARG_TYPE_INFO(0, luminosity, IS_DOUBLE, 0) 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_ARG_TYPE_INFO(0, index, IS_LONG, 0) 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 @@ -282,7 +106,12 @@ ZEND_METHOD(ImagickPixel, getColorAsString); ZEND_METHOD(ImagickPixel, getColorCount); ZEND_METHOD(ImagickPixel, getColorQuantum); ZEND_METHOD(ImagickPixel, getColorValue); +#if MAGICKCORE_HDRI_ENABLE +ZEND_METHOD(ImagickPixel, getColorValueQuantum); +#endif +#if !(MAGICKCORE_HDRI_ENABLE) ZEND_METHOD(ImagickPixel, getColorValueQuantum); +#endif ZEND_METHOD(ImagickPixel, getHSL); ZEND_METHOD(ImagickPixel, getIndex); ZEND_METHOD(ImagickPixel, isPixelSimilar); @@ -290,7 +119,12 @@ ZEND_METHOD(ImagickPixel, isPixelSimilarQuantum); ZEND_METHOD(ImagickPixel, setColor); ZEND_METHOD(ImagickPixel, setColorCount); ZEND_METHOD(ImagickPixel, setColorValue); +#if MAGICKCORE_HDRI_ENABLE +ZEND_METHOD(ImagickPixel, setColorValueQuantum); +#endif +#if !(MAGICKCORE_HDRI_ENABLE) ZEND_METHOD(ImagickPixel, setColorValueQuantum); +#endif ZEND_METHOD(ImagickPixel, setHSL); ZEND_METHOD(ImagickPixel, setIndex); #if MagickLibVersion >= 0x693 @@ -307,7 +141,12 @@ static const zend_function_entry class_ImagickPixel_methods[] = { 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) +#if MAGICKCORE_HDRI_ENABLE + ZEND_ME(ImagickPixel, getColorValueQuantum, arginfo_class_ImagickPixel_getColorValueQuantum, ZEND_ACC_PUBLIC) +#endif +#if !(MAGICKCORE_HDRI_ENABLE) ZEND_ME(ImagickPixel, getColorValueQuantum, arginfo_class_ImagickPixel_getColorValueQuantum, ZEND_ACC_PUBLIC) +#endif 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) @@ -316,11 +155,16 @@ static const zend_function_entry class_ImagickPixel_methods[] = { 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) +#if MAGICKCORE_HDRI_ENABLE ZEND_ME(ImagickPixel, setColorValueQuantum, arginfo_class_ImagickPixel_setColorValueQuantum, ZEND_ACC_PUBLIC) +#endif +#if !(MAGICKCORE_HDRI_ENABLE) + ZEND_ME(ImagickPixel, setColorValueQuantum, arginfo_class_ImagickPixel_setColorValueQuantum, ZEND_ACC_PUBLIC) +#endif 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 +}; diff --git a/package.xml b/package.xml index 6f758c88..c46ca3af 100644 --- a/package.xml +++ b/package.xml @@ -71,8 +71,12 @@ This extension requires ImageMagick version 6.5.3-10+ and PHP 5.4.0+. + + + + @@ -87,11 +91,8 @@ This extension requires ImageMagick version 6.5.3-10+ and PHP 5.4.0+. - - - diff --git a/shim_php7_to_php8.h b/shim_php7_to_php8.h index 5f8d89b4..6f84065c 100644 --- a/shim_php7_to_php8.h +++ b/shim_php7_to_php8.h @@ -1,7 +1,6 @@ - +// Allow the generated stubs to work on previous versions of PHP #if PHP_VERSION_ID < 80000 -// Allow the generated stubs to work on previous versions of PHP #define ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(pass_by_ref, name, type_hint, allow_null, default_value) \ ZEND_ARG_INFO(pass_by_ref, name) @@ -9,6 +8,18 @@ #define ZEND_ARG_OBJ_TYPE_MASK(pass_by_ref, name, class_name, type_mask, default_value) \ ZEND_ARG_INFO(pass_by_ref, name) -#define MAY_BE_STRING "" +#define ZEND_ARG_TYPE_MASK(pass_by_ref, name, type_mask, default_value) \ + ZEND_ARG_INFO(pass_by_ref, name) + +#endif + +#if PHP_VERSION_ID < 70200 +#undef ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX +#define ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, type, allow_null) \ + ZEND_BEGIN_ARG_INFO_EX(name, 0, return_reference, required_num_args) + +#undef ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX +#define ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(name, return_reference, required_num_args, class_name, allow_null) \ + ZEND_BEGIN_ARG_INFO_EX(name, 0, return_reference, required_num_args) -#endif \ No newline at end of file +#endif