From: cristy Date: Mon, 22 Apr 2013 16:01:54 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~3825 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=27affb7894b1d057cd9b8a6744cc93644b3e03e1;p=imagemagick --- diff --git a/MagickCore/enhance.c b/MagickCore/enhance.c index 2dfca2f57..95a64a859 100644 --- a/MagickCore/enhance.c +++ b/MagickCore/enhance.c @@ -2328,7 +2328,7 @@ static inline double LevelPixel(const double black_point, scale=(white_point != black_point) ? 1.0/(white_point-black_point) : 1.0; level_pixel=(double) QuantumRange*pow(scale*((double) pixel- black_point),1.0/gamma); - return((MagickRealType) (IsNaN(level_pixel) ? 0.0 : level_pixel)); + return(IsNaN(level_pixel) != MagickFalse ? 0.0 : level_pixel); } MagickExport MagickBooleanType LevelImage(Image *image,const double black_point, diff --git a/MagickCore/image-private.h b/MagickCore/image-private.h index 6502f6560..4faeb35ff 100644 --- a/MagickCore/image-private.h +++ b/MagickCore/image-private.h @@ -22,6 +22,7 @@ extern "C" { #endif +#define IsNaN(a) ((a) != (a) ? MagickTrue : MagickFalse) #define Magick2PI 6.28318530717958647692528676655900576839433879875020 #define MagickPHI 1.61803398874989484820458683436563811772030917980576 #define MagickPI2 1.57079632679489661923132169163975144209858469968755 diff --git a/MagickCore/morphology-private.h b/MagickCore/morphology-private.h index 048cbabc5..978ac2e75 100644 --- a/MagickCore/morphology-private.h +++ b/MagickCore/morphology-private.h @@ -28,21 +28,6 @@ extern "C" { #include "MagickCore/morphology.h" -/* - The following test is for special floating point numbers of value NaN (not - a number), that may be used within a Kernel Definition. NaN's are defined - as part of the IEEE standard for floating point number representation. - They are used as a Kernel value to mean that this kernel position is not - part of the kernel neighbourhood for convolution or morphology processing, - and thus should be ignored. This allows the use of 'shaped' kernels. - - The special property that two NaN's are never equal, even if they are from - the same variable allow you to test if a value is special NaN value. - - This macro IsNaN() is thus is only true if the value given is NaN. -*/ -#define IsNaN(a) ((a) != (a) ? MagickTrue : MagickFalse) - extern MagickPrivate Image *MorphologyApply(const Image *,const MorphologyMethod,const ssize_t, const KernelInfo *,const CompositeOperator,const double,ExceptionInfo *);