diff --git a/MagickCore/annotate.c b/MagickCore/annotate.c
index 8590c9a..ebfc939 100644
--- a/MagickCore/annotate.c
+++ b/MagickCore/annotate.c
@@ -1393,7 +1393,7 @@
active,
sync;
- MagickRealType
+ double
fill_opacity;
PixelInfo
@@ -1436,7 +1436,7 @@
continue;
}
if (bitmap->bitmap.pixel_mode != ft_pixel_mode_mono)
- fill_opacity=(MagickRealType) (p[n])/(bitmap->bitmap.num_grays-1);
+ fill_opacity=(double) (p[n])/(bitmap->bitmap.num_grays-1);
else
fill_opacity=((p[(x >> 3)+y*bitmap->bitmap.pitch] &
(1 << (~x & 0x07)))) == 0 ? 0.0 : 1.0;
diff --git a/MagickCore/color.c b/MagickCore/color.c
index 4fd5cba..b5d26f8 100644
--- a/MagickCore/color.c
+++ b/MagickCore/color.c
@@ -1027,7 +1027,7 @@
char
text[MaxTextExtent];
- MagickRealType
+ double
color;
color=0.0;
@@ -1332,7 +1332,7 @@
char
component[MaxTextExtent];
- MagickRealType
+ double
color;
color=0.0;
@@ -1425,7 +1425,7 @@
color=(*pixel);
if (color.depth > 8)
{
-#define SVGCompliant(component) ((MagickRealType) \
+#define SVGCompliant(component) ((double) \
ScaleCharToQuantum(ScaleQuantumToChar(ClampToQuantum(component))))
MagickStatusType
@@ -1560,11 +1560,11 @@
MagickExport MagickBooleanType IsEquivalentAlpha(const Image *image,
const PixelInfo *p,const PixelInfo *q)
{
- MagickRealType
+ double
fuzz,
pixel;
- register MagickRealType
+ register double
distance;
if (image->matte == MagickFalse)
@@ -1572,7 +1572,7 @@
if (p->alpha == q->alpha)
return(MagickTrue);
fuzz=MagickMax(image->fuzz,MagickSQ1_2)*MagickMax(image->fuzz,MagickSQ1_2);
- pixel=(MagickRealType) p->alpha-(MagickRealType) q->alpha;
+ pixel=(double) p->alpha-(double) q->alpha;
distance=pixel*pixel;
if (distance > fuzz)
return(MagickFalse);
@@ -2083,10 +2083,10 @@
color_info->path=(char *) "[built-in]";
color_info->name=(char *) p->name;
GetPixelInfo((Image *) NULL,&color_info->color);
- color_info->color.red=(MagickRealType) ScaleCharToQuantum(p->red);
- color_info->color.green=(MagickRealType) ScaleCharToQuantum(p->green);
- color_info->color.blue=(MagickRealType) ScaleCharToQuantum(p->blue);
- color_info->color.alpha=(MagickRealType) (QuantumRange*p->alpha);
+ color_info->color.red=(double) ScaleCharToQuantum(p->red);
+ color_info->color.green=(double) ScaleCharToQuantum(p->green);
+ color_info->color.blue=(double) ScaleCharToQuantum(p->blue);
+ color_info->color.alpha=(double) (QuantumRange*p->alpha);
color_info->compliance=(ComplianceType) p->compliance;
color_info->exempt=MagickTrue;
color_info->signature=MagickSignature;
@@ -2151,7 +2151,7 @@
GeometryInfo
geometry_info;
- MagickRealType
+ double
scale;
MagickStatusType
@@ -2258,14 +2258,14 @@
color->colorspace=sRGBColorspace;
color->matte=MagickFalse;
range=GetQuantumRange(depth);
- color->red=(MagickRealType) ScaleAnyToQuantum(pixel.red,range);
- color->green=(MagickRealType) ScaleAnyToQuantum(pixel.green,range);
- color->blue=(MagickRealType) ScaleAnyToQuantum(pixel.blue,range);
- color->alpha=(MagickRealType) OpaqueAlpha;
+ color->red=(double) ScaleAnyToQuantum(pixel.red,range);
+ color->green=(double) ScaleAnyToQuantum(pixel.green,range);
+ color->blue=(double) ScaleAnyToQuantum(pixel.blue,range);
+ color->alpha=(double) OpaqueAlpha;
if ((n % 3) != 0)
{
color->matte=MagickTrue;
- color->alpha=(MagickRealType) ScaleAnyToQuantum(pixel.alpha,range);
+ color->alpha=(double) ScaleAnyToQuantum(pixel.alpha,range);
}
color->black=0.0;
return(MagickTrue);
@@ -2286,7 +2286,7 @@
if (colorspace[i] == '(')
break;
colorspace[i--]='\0';
- scale=(MagickRealType) ScaleCharToQuantum(1);
+ scale=(double) ScaleCharToQuantum(1);
icc_color=MagickFalse;
if (LocaleCompare(colorspace,"icc-color") == 0)
{
@@ -2299,7 +2299,7 @@
break;
colorspace[j--]='\0';
i+=j+3;
- scale=(MagickRealType) QuantumRange;
+ scale=(double) QuantumRange;
icc_color=MagickTrue;
}
LocaleLower(colorspace);
@@ -2339,27 +2339,27 @@
else
{
if ((flags & PercentValue) != 0)
- scale=(MagickRealType) (QuantumRange/100.0);
+ scale=(double) (QuantumRange/100.0);
if ((flags & RhoValue) != 0)
- color->red=(MagickRealType) ClampToQuantum(scale*geometry_info.rho);
+ color->red=(double) ClampToQuantum(scale*geometry_info.rho);
if ((flags & SigmaValue) != 0)
- color->green=(MagickRealType) ClampToQuantum(scale*
+ color->green=(double) ClampToQuantum(scale*
geometry_info.sigma);
if ((flags & XiValue) != 0)
- color->blue=(MagickRealType) ClampToQuantum(scale*geometry_info.xi);
- color->alpha=(MagickRealType) OpaqueAlpha;
+ color->blue=(double) ClampToQuantum(scale*geometry_info.xi);
+ color->alpha=(double) OpaqueAlpha;
if ((flags & PsiValue) != 0)
{
if (color->colorspace == CMYKColorspace)
- color->black=(MagickRealType) ClampToQuantum(scale*
+ color->black=(double) ClampToQuantum(scale*
geometry_info.psi);
else
if (color->matte != MagickFalse)
- color->alpha=(MagickRealType) ClampToQuantum(QuantumRange*
+ color->alpha=(double) ClampToQuantum(QuantumRange*
geometry_info.psi);
}
if (((flags & ChiValue) != 0) && (color->matte != MagickFalse))
- color->alpha=(MagickRealType) ClampToQuantum(QuantumRange*
+ color->alpha=(double) ClampToQuantum(QuantumRange*
geometry_info.chi);
if (LocaleCompare(colorspace,"gray") == 0)
{
@@ -2367,7 +2367,7 @@
color->green=color->red;
color->blue=color->red;
if (((flags & SigmaValue) != 0) && (color->matte != MagickFalse))
- color->alpha=(MagickRealType) ClampToQuantum(QuantumRange*
+ color->alpha=(double) ClampToQuantum(QuantumRange*
geometry_info.sigma);
}
if ((LocaleCompare(colorspace,"HSB") == 0) ||
@@ -2406,9 +2406,9 @@
360.0)/360.0,geometry_info.sigma,geometry_info.xi,
&pixel.red,&pixel.green,&pixel.blue);
color->colorspace=sRGBColorspace;
- color->red=(MagickRealType) pixel.red;
- color->green=(MagickRealType) pixel.green;
- color->blue=(MagickRealType) pixel.blue;
+ color->red=(double) pixel.red;
+ color->green=(double) pixel.green;
+ color->blue=(double) pixel.blue;
}
}
return(MagickTrue);
@@ -2421,10 +2421,10 @@
return(MagickFalse);
color->colorspace=sRGBColorspace;
color->matte=p->color.alpha != OpaqueAlpha ? MagickTrue : MagickFalse;
- color->red=(MagickRealType) p->color.red;
- color->green=(MagickRealType) p->color.green;
- color->blue=(MagickRealType) p->color.blue;
- color->alpha=(MagickRealType) p->color.alpha;
+ color->red=(double) p->color.red;
+ color->green=(double) p->color.green;
+ color->blue=(double) p->color.blue;
+ color->alpha=(double) p->color.alpha;
color->black=0.0;
return(MagickTrue);
}
@@ -2479,7 +2479,7 @@
PixelInfo
pixel;
- MagickRealType
+ double
opacity;
register const ColorInfo
diff --git a/MagickCore/colorspace-private.h b/MagickCore/colorspace-private.h
index cb2a20a..b042a8e 100644
--- a/MagickCore/colorspace-private.h
+++ b/MagickCore/colorspace-private.h
@@ -29,7 +29,7 @@
static inline void ConvertRGBToCMYK(PixelInfo *pixel)
{
- MagickRealType
+ double
black,
blue,
cyan,
@@ -46,27 +46,27 @@
}
else
{
- red=QuantumRange*DecompandsRGB(QuantumScale*pixel->red);
- green=QuantumRange*DecompandsRGB(QuantumScale*pixel->green);
- blue=QuantumRange*DecompandsRGB(QuantumScale*pixel->blue);
+ red=DecompandsRGB(pixel->red);
+ green=DecompandsRGB(pixel->green);
+ blue=DecompandsRGB(pixel->blue);
}
if ((fabs(red) < MagickEpsilon) && (fabs(green) < MagickEpsilon) &&
(fabs(blue) < MagickEpsilon))
{
- pixel->black=(MagickRealType) QuantumRange;
+ pixel->black=(double) QuantumRange;
return;
}
- cyan=(MagickRealType) (1.0-red);
- magenta=(MagickRealType) (1.0-green);
- yellow=(MagickRealType) (1.0-blue);
+ cyan=(double) (1.0-red);
+ magenta=(double) (1.0-green);
+ yellow=(double) (1.0-blue);
black=cyan;
if (magenta < black)
black=magenta;
if (yellow < black)
black=yellow;
- cyan=(MagickRealType) ((cyan-black)/(1.0-black));
- magenta=(MagickRealType) ((magenta-black)/(1.0-black));
- yellow=(MagickRealType) ((yellow-black)/(1.0-black));
+ cyan=(double) ((cyan-black)/(1.0-black));
+ magenta=(double) ((magenta-black)/(1.0-black));
+ yellow=(double) ((yellow-black)/(1.0-black));
pixel->colorspace=CMYKColorspace;
pixel->red=QuantumRange*cyan;
pixel->green=QuantumRange*magenta;
diff --git a/MagickCore/colorspace.c b/MagickCore/colorspace.c
index 8eaf06f..e6a2506 100644
--- a/MagickCore/colorspace.c
+++ b/MagickCore/colorspace.c
@@ -72,7 +72,7 @@
*/
typedef struct _TransformPacket
{
- MagickRealType
+ double
x,
y,
z;
@@ -268,12 +268,9 @@
magenta,
yellow;
- cyan=QuantumRange*DecompandsRGB(QuantumScale*
- GetPixelCyan(image,q));
- magenta=QuantumRange*DecompandsRGB(QuantumScale*
- GetPixelMagenta(image,q));
- yellow=QuantumRange*DecompandsRGB(QuantumScale*
- GetPixelYellow(image,q));
+ cyan=DecompandsRGB((double) GetPixelCyan(image,q));
+ magenta=DecompandsRGB((double) GetPixelMagenta(image,q));
+ yellow=DecompandsRGB((double) GetPixelYellow(image,q));
SetPixelCyan(image,ClampToQuantum(QuantumRange-cyan),q);
SetPixelMagenta(image,ClampToQuantum(QuantumRange-magenta),q);
SetPixelYellow(image,ClampToQuantum(QuantumRange-yellow),q);
@@ -340,9 +337,9 @@
for (x=0; x < (ssize_t) image->columns; x++)
{
GetPixelInfoPixel(image,q,&pixel);
- pixel.red=QuantumRange*DecompandsRGB(QuantumScale*pixel.red);
- pixel.green=QuantumRange*DecompandsRGB(QuantumScale*pixel.green);
- pixel.blue=QuantumRange*DecompandsRGB(QuantumScale*pixel.blue);
+ pixel.red=DecompandsRGB(pixel.red);
+ pixel.green=DecompandsRGB(pixel.green);
+ pixel.blue=DecompandsRGB(pixel.blue);
ConvertRGBToCMYK(&pixel);
SetPixelInfoPixel(image,&pixel,q);
q+=GetPixelChannels(image);
@@ -404,9 +401,9 @@
green,
red;
- red=QuantumRange*DecompandsRGB(QuantumScale*GetPixelRed(image,q));
- green=QuantumRange*DecompandsRGB(QuantumScale*GetPixelGreen(image,q));
- blue=QuantumRange*DecompandsRGB(QuantumScale*GetPixelBlue(image,q));
+ red=DecompandsRGB((double) GetPixelRed(image,q));
+ green=DecompandsRGB((double) GetPixelGreen(image,q));
+ blue=DecompandsRGB((double) GetPixelBlue(image,q));
gray=0.298839*red+0.586811*green+0.114350*blue;
SetPixelGray(image,ClampToQuantum(gray),q);
q+=GetPixelChannels(image);
@@ -468,9 +465,9 @@
luma,
red;
- red=QuantumRange*DecompandsRGB(QuantumScale*GetPixelRed(image,q));
- green=QuantumRange*DecompandsRGB(QuantumScale*GetPixelGreen(image,q));
- blue=QuantumRange*DecompandsRGB(QuantumScale*GetPixelBlue(image,q));
+ red=DecompandsRGB((double) GetPixelRed(image,q));
+ green=DecompandsRGB((double) GetPixelGreen(image,q));
+ blue=DecompandsRGB((double) GetPixelBlue(image,q));
ConvertRGBToHCL(red,green,blue,&hue,&chroma,&luma);
SetPixelRed(image,ClampToQuantum(QuantumRange*hue),q);
SetPixelGreen(image,ClampToQuantum(QuantumRange*chroma),q);
@@ -533,9 +530,9 @@
red,
saturation;
- red=QuantumRange*DecompandsRGB(QuantumScale*GetPixelRed(image,q));
- green=QuantumRange*DecompandsRGB(QuantumScale*GetPixelGreen(image,q));
- blue=QuantumRange*DecompandsRGB(QuantumScale*GetPixelBlue(image,q));
+ red=DecompandsRGB((double) GetPixelRed(image,q));
+ green=DecompandsRGB((double) GetPixelGreen(image,q));
+ blue=DecompandsRGB((double) GetPixelBlue(image,q));
ConvertRGBToHSB(red,green,blue,&hue,&saturation,&brightness);
SetPixelRed(image,ClampToQuantum(QuantumRange*hue),q);
SetPixelGreen(image,ClampToQuantum(QuantumRange*saturation),q);
@@ -598,9 +595,9 @@
red,
saturation;
- red=QuantumRange*DecompandsRGB(QuantumScale*GetPixelRed(image,q));
- green=QuantumRange*DecompandsRGB(QuantumScale*GetPixelGreen(image,q));
- blue=QuantumRange*DecompandsRGB(QuantumScale*GetPixelBlue(image,q));
+ red=DecompandsRGB((double) GetPixelRed(image,q));
+ green=DecompandsRGB((double) GetPixelGreen(image,q));
+ blue=DecompandsRGB((double) GetPixelBlue(image,q));
ConvertRGBToHSL(red,green,blue,&hue,&saturation,&lightness);
SetPixelRed(image,ClampToQuantum(QuantumRange*hue),q);
SetPixelGreen(image,ClampToQuantum(QuantumRange*saturation),q);
@@ -663,9 +660,9 @@
red,
whiteness;
- red=QuantumRange*DecompandsRGB(QuantumScale*GetPixelRed(image,q));
- green=QuantumRange*DecompandsRGB(QuantumScale*GetPixelGreen(image,q));
- blue=QuantumRange*DecompandsRGB(QuantumScale*GetPixelBlue(image,q));
+ red=DecompandsRGB((double) GetPixelRed(image,q));
+ green=DecompandsRGB((double) GetPixelGreen(image,q));
+ blue=DecompandsRGB((double) GetPixelBlue(image,q));
ConvertRGBToHWB(red,green,blue,&hue,&whiteness,&blackness);
SetPixelRed(image,ClampToQuantum(QuantumRange*hue),q);
SetPixelGreen(image,ClampToQuantum(QuantumRange*whiteness),q);
@@ -731,9 +728,9 @@
Y,
Z;
- red=QuantumRange*DecompandsRGB(QuantumScale*GetPixelRed(image,q));
- green=QuantumRange*DecompandsRGB(QuantumScale*GetPixelGreen(image,q));
- blue=QuantumRange*DecompandsRGB(QuantumScale*GetPixelBlue(image,q));
+ red=DecompandsRGB((double) GetPixelRed(image,q));
+ green=DecompandsRGB((double) GetPixelGreen(image,q));
+ blue=DecompandsRGB((double) GetPixelBlue(image,q));
ConvertRGBToXYZ(red,green,blue,&X,&Y,&Z);
ConvertXYZToLab(X,Y,Z,&L,&a,&b);
SetPixelRed(image,ClampToQuantum(QuantumRange*L),q);
@@ -803,8 +800,8 @@
dynamic_number_threads(image,image->columns,1,1)
#endif
for (i=0; i <= (ssize_t) MaxMap; i++)
- logmap[i]=ScaleMapToQuantum((MagickRealType) (MaxMap*(reference_white+
- log10(black+((MagickRealType) i/MaxMap)*(1.0-black))/((gamma/density)*
+ logmap[i]=ScaleMapToQuantum((double) (MaxMap*(reference_white+
+ log10(black+((double) i/MaxMap)*(1.0-black))/((gamma/density)*
0.002/film_gamma))/1024.0));
image_view=AcquireAuthenticCacheView(image,exception);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
@@ -838,9 +835,9 @@
green,
red;
- red=QuantumRange*DecompandsRGB(QuantumScale*GetPixelRed(image,q));
- green=QuantumRange*DecompandsRGB(QuantumScale*GetPixelGreen(image,q));
- blue=QuantumRange*DecompandsRGB(QuantumScale*GetPixelBlue(image,q));
+ red=DecompandsRGB((double) GetPixelRed(image,q));
+ green=DecompandsRGB((double) GetPixelGreen(image,q));
+ blue=DecompandsRGB((double) GetPixelBlue(image,q));
SetPixelRed(image,logmap[ScaleQuantumToMap(
ClampToQuantum(red))],q);
SetPixelGreen(image,logmap[ScaleQuantumToMap(
@@ -909,9 +906,9 @@
Y,
Z;
- red=QuantumRange*DecompandsRGB(QuantumScale*GetPixelRed(image,q));
- green=QuantumRange*DecompandsRGB(QuantumScale*GetPixelGreen(image,q));
- blue=QuantumRange*DecompandsRGB(QuantumScale*GetPixelBlue(image,q));
+ red=DecompandsRGB((double) GetPixelRed(image,q));
+ green=DecompandsRGB((double) GetPixelGreen(image,q));
+ blue=DecompandsRGB((double) GetPixelBlue(image,q));
ConvertRGBToXYZ(red,green,blue,&X,&Y,&Z);
ConvertXYZToLuv(X,Y,Z,&L,&u,&v);
SetPixelRed(image,ClampToQuantum(QuantumRange*L),q);
@@ -973,9 +970,9 @@
green,
red;
- red=QuantumRange*DecompandsRGB(QuantumScale*GetPixelRed(image,q));
- green=QuantumRange*DecompandsRGB(QuantumScale*GetPixelGreen(image,q));
- blue=QuantumRange*DecompandsRGB(QuantumScale*GetPixelBlue(image,q));
+ red=DecompandsRGB((double) GetPixelRed(image,q));
+ green=DecompandsRGB((double) GetPixelGreen(image,q));
+ blue=DecompandsRGB((double) GetPixelBlue(image,q));
gray=0.212600*red+0.715200*green+0.072200*blue;
SetPixelGray(image,ClampToQuantum(gray),q);
q+=GetPixelChannels(image);
@@ -1034,9 +1031,9 @@
green,
red;
- red=QuantumRange*DecompandsRGB(QuantumScale*GetPixelRed(image,q));
- green=QuantumRange*DecompandsRGB(QuantumScale*GetPixelGreen(image,q));
- blue=QuantumRange*DecompandsRGB(QuantumScale*GetPixelBlue(image,q));
+ red=DecompandsRGB((double) GetPixelRed(image,q));
+ green=DecompandsRGB((double) GetPixelGreen(image,q));
+ blue=DecompandsRGB((double) GetPixelBlue(image,q));
SetPixelRed(image,ClampToQuantum(red),q);
SetPixelGreen(image,ClampToQuantum(green),q);
SetPixelBlue(image,ClampToQuantum(blue),q);
@@ -1098,9 +1095,9 @@
Y,
Z;
- red=QuantumRange*DecompandsRGB(QuantumScale*GetPixelRed(image,q));
- green=QuantumRange*DecompandsRGB(QuantumScale*GetPixelGreen(image,q));
- blue=QuantumRange*DecompandsRGB(QuantumScale*GetPixelBlue(image,q));
+ red=DecompandsRGB((double) GetPixelRed(image,q));
+ green=DecompandsRGB((double) GetPixelGreen(image,q));
+ blue=DecompandsRGB((double) GetPixelBlue(image,q));
ConvertRGBToXYZ(red,green,blue,&X,&Y,&Z);
SetPixelRed(image,ClampToQuantum(QuantumRange*X),q);
SetPixelGreen(image,ClampToQuantum(QuantumRange*Y),q);
@@ -1156,15 +1153,15 @@
#endif
for (i=0; i <= (ssize_t) MaxMap; i++)
{
- x_map[i].x=0.33333*(MagickRealType) i;
- y_map[i].x=0.33334*(MagickRealType) i;
- z_map[i].x=0.33333*(MagickRealType) i;
- x_map[i].y=0.50000*(MagickRealType) i;
- y_map[i].y=0.00000*(MagickRealType) i;
- z_map[i].y=(-0.50000)*(MagickRealType) i;
- x_map[i].z=(-0.25000)*(MagickRealType) i;
- y_map[i].z=0.50000*(MagickRealType) i;
- z_map[i].z=(-0.25000)*(MagickRealType) i;
+ x_map[i].x=0.33333*(double) i;
+ y_map[i].x=0.33334*(double) i;
+ z_map[i].x=0.33333*(double) i;
+ x_map[i].y=0.50000*(double) i;
+ y_map[i].y=0.00000*(double) i;
+ z_map[i].y=(-0.50000)*(double) i;
+ x_map[i].z=(-0.25000)*(double) i;
+ y_map[i].z=0.50000*(double) i;
+ z_map[i].z=(-0.25000)*(double) i;
}
break;
}
@@ -1189,15 +1186,15 @@
#endif
for (i=0; i <= (ssize_t) MaxMap; i++)
{
- x_map[i].x=0.298839*(MagickRealType) i;
- y_map[i].x=0.586811*(MagickRealType) i;
- z_map[i].x=0.114350*(MagickRealType) i;
- x_map[i].y=(-0.168730)*(MagickRealType) i;
- y_map[i].y=(-0.331264)*(MagickRealType) i;
- z_map[i].y=0.500000*(MagickRealType) i;
- x_map[i].z=0.500000*(MagickRealType) i;
- y_map[i].z=(-0.418688)*(MagickRealType) i;
- z_map[i].z=(-0.081312)*(MagickRealType) i;
+ x_map[i].x=0.298839*(double) i;
+ y_map[i].x=0.586811*(double) i;
+ z_map[i].x=0.114350*(double) i;
+ x_map[i].y=(-0.168730)*(double) i;
+ y_map[i].y=(-0.331264)*(double) i;
+ z_map[i].y=0.500000*(double) i;
+ x_map[i].z=0.500000*(double) i;
+ y_map[i].z=(-0.418688)*(double) i;
+ z_map[i].z=(-0.081312)*(double) i;
}
break;
}
@@ -1221,15 +1218,15 @@
#endif
for (i=0; i <= (ssize_t) MaxMap; i++)
{
- x_map[i].x=0.212600*(MagickRealType) i;
- y_map[i].x=0.715200*(MagickRealType) i;
- z_map[i].x=0.072200*(MagickRealType) i;
- x_map[i].y=(-0.114572)*(MagickRealType) i;
- y_map[i].y=(-0.385428)*(MagickRealType) i;
- z_map[i].y=0.500000*(MagickRealType) i;
- x_map[i].z=0.500000*(MagickRealType) i;
- y_map[i].z=(-0.454153)*(MagickRealType) i;
- z_map[i].z=(-0.045847)*(MagickRealType) i;
+ x_map[i].x=0.212600*(double) i;
+ y_map[i].x=0.715200*(double) i;
+ z_map[i].x=0.072200*(double) i;
+ x_map[i].y=(-0.114572)*(double) i;
+ y_map[i].y=(-0.385428)*(double) i;
+ z_map[i].y=0.500000*(double) i;
+ x_map[i].z=0.500000*(double) i;
+ y_map[i].z=(-0.454153)*(double) i;
+ z_map[i].z=(-0.045847)*(double) i;
}
break;
}
@@ -1248,27 +1245,27 @@
primary_info.z=(double) ScaleQuantumToMap(ScaleCharToQuantum(137));
for (i=0; i <= (ssize_t) (0.018*MaxMap); i++)
{
- x_map[i].x=0.003962014134275617*(MagickRealType) i;
- y_map[i].x=0.007778268551236748*(MagickRealType) i;
- z_map[i].x=0.001510600706713781*(MagickRealType) i;
- x_map[i].y=(-0.002426619775463276)*(MagickRealType) i;
- y_map[i].y=(-0.004763965913702149)*(MagickRealType) i;
- z_map[i].y=0.007190585689165425*(MagickRealType) i;
- x_map[i].z=0.006927257754597858*(MagickRealType) i;
- y_map[i].z=(-0.005800713697502058)*(MagickRealType) i;
- z_map[i].z=(-0.0011265440570958)*(MagickRealType) i;
+ x_map[i].x=0.003962014134275617*(double) i;
+ y_map[i].x=0.007778268551236748*(double) i;
+ z_map[i].x=0.001510600706713781*(double) i;
+ x_map[i].y=(-0.002426619775463276)*(double) i;
+ y_map[i].y=(-0.004763965913702149)*(double) i;
+ z_map[i].y=0.007190585689165425*(double) i;
+ x_map[i].z=0.006927257754597858*(double) i;
+ y_map[i].z=(-0.005800713697502058)*(double) i;
+ z_map[i].z=(-0.0011265440570958)*(double) i;
}
for ( ; i <= (ssize_t) MaxMap; i++)
{
- x_map[i].x=0.2201118963486454*(1.099*(MagickRealType) i-0.099);
- y_map[i].x=0.4321260306242638*(1.099*(MagickRealType) i-0.099);
- z_map[i].x=0.08392226148409894*(1.099*(MagickRealType) i-0.099);
- x_map[i].y=(-0.1348122097479598)*(1.099*(MagickRealType) i-0.099);
- y_map[i].y=(-0.2646647729834528)*(1.099*(MagickRealType) i-0.099);
- z_map[i].y=0.3994769827314126*(1.099*(MagickRealType) i-0.099);
- x_map[i].z=0.3848476530332144*(1.099*(MagickRealType) i-0.099);
- y_map[i].z=(-0.3222618720834477)*(1.099*(MagickRealType) i-0.099);
- z_map[i].z=(-0.06258578094976668)*(1.099*(MagickRealType) i-0.099);
+ x_map[i].x=0.2201118963486454*(1.099*(double) i-0.099);
+ y_map[i].x=0.4321260306242638*(1.099*(double) i-0.099);
+ z_map[i].x=0.08392226148409894*(1.099*(double) i-0.099);
+ x_map[i].y=(-0.1348122097479598)*(1.099*(double) i-0.099);
+ y_map[i].y=(-0.2646647729834528)*(1.099*(double) i-0.099);
+ z_map[i].y=0.3994769827314126*(1.099*(double) i-0.099);
+ x_map[i].z=0.3848476530332144*(1.099*(double) i-0.099);
+ y_map[i].z=(-0.3222618720834477)*(1.099*(double) i-0.099);
+ z_map[i].z=(-0.06258578094976668)*(1.099*(double) i-0.099);
}
break;
}
@@ -1292,15 +1289,15 @@
#endif
for (i=0; i <= (ssize_t) MaxMap; i++)
{
- x_map[i].x=0.298839*(MagickRealType) i;
- y_map[i].x=0.586811*(MagickRealType) i;
- z_map[i].x=0.114350*(MagickRealType) i;
- x_map[i].y=0.59600*(MagickRealType) i;
- y_map[i].y=(-0.27400)*(MagickRealType) i;
- z_map[i].y=(-0.32200)*(MagickRealType) i;
- x_map[i].z=0.21100*(MagickRealType) i;
- y_map[i].z=(-0.52300)*(MagickRealType) i;
- z_map[i].z=0.31200*(MagickRealType) i;
+ x_map[i].x=0.298839*(double) i;
+ y_map[i].x=0.586811*(double) i;
+ z_map[i].x=0.114350*(double) i;
+ x_map[i].y=0.59600*(double) i;
+ y_map[i].y=(-0.27400)*(double) i;
+ z_map[i].y=(-0.32200)*(double) i;
+ x_map[i].z=0.21100*(double) i;
+ y_map[i].z=(-0.52300)*(double) i;
+ z_map[i].z=0.31200*(double) i;
}
break;
}
@@ -1324,15 +1321,15 @@
#endif
for (i=0; i <= (ssize_t) MaxMap; i++)
{
- x_map[i].x=0.298839*(MagickRealType) i;
- y_map[i].x=0.586811*(MagickRealType) i;
- z_map[i].x=0.114350*(MagickRealType) i;
- x_map[i].y=(-0.168736)*(MagickRealType) i;
- y_map[i].y=(-0.331264)*(MagickRealType) i;
- z_map[i].y=0.500000*(MagickRealType) i;
- x_map[i].z=0.500000*(MagickRealType) i;
- y_map[i].z=(-0.418688)*(MagickRealType) i;
- z_map[i].z=(-0.081312)*(MagickRealType) i;
+ x_map[i].x=0.298839*(double) i;
+ y_map[i].x=0.586811*(double) i;
+ z_map[i].x=0.114350*(double) i;
+ x_map[i].y=(-0.168736)*(double) i;
+ y_map[i].y=(-0.331264)*(double) i;
+ z_map[i].y=0.500000*(double) i;
+ x_map[i].z=0.500000*(double) i;
+ y_map[i].z=(-0.418688)*(double) i;
+ z_map[i].z=(-0.081312)*(double) i;
}
break;
}
@@ -1356,15 +1353,15 @@
#endif
for (i=0; i <= (ssize_t) MaxMap; i++)
{
- x_map[i].x=0.298839*(MagickRealType) i;
- y_map[i].x=0.586811*(MagickRealType) i;
- z_map[i].x=0.114350*(MagickRealType) i;
- x_map[i].y=(-0.168736)*(MagickRealType) i;
- y_map[i].y=(-0.331264)*(MagickRealType) i;
- z_map[i].y=0.500000*(MagickRealType) i;
- x_map[i].z=0.500000*(MagickRealType) i;
- y_map[i].z=(-0.418688)*(MagickRealType) i;
- z_map[i].z=(-0.081312)*(MagickRealType) i;
+ x_map[i].x=0.298839*(double) i;
+ y_map[i].x=0.586811*(double) i;
+ z_map[i].x=0.114350*(double) i;
+ x_map[i].y=(-0.168736)*(double) i;
+ y_map[i].y=(-0.331264)*(double) i;
+ z_map[i].y=0.500000*(double) i;
+ x_map[i].z=0.500000*(double) i;
+ y_map[i].z=(-0.418688)*(double) i;
+ z_map[i].z=(-0.081312)*(double) i;
}
break;
}
@@ -1379,15 +1376,15 @@
#endif
for (i=0; i <= (ssize_t) MaxMap; i++)
{
- x_map[i].x=(MagickRealType) i;
+ x_map[i].x=(double) i;
y_map[i].x=0.0f;
z_map[i].x=0.0f;
x_map[i].y=0.0f;
- y_map[i].y=(MagickRealType) i;
+ y_map[i].y=(double) i;
z_map[i].y=0.0f;
x_map[i].z=0.0f;
y_map[i].z=0.0f;
- z_map[i].z=(MagickRealType) i;
+ z_map[i].z=(double) i;
}
break;
}
@@ -1438,18 +1435,18 @@
}
for (x=0; x < (ssize_t) image->columns; x++)
{
- red=ScaleQuantumToMap(ClampToQuantum(QuantumRange*DecompandsRGB(
- QuantumScale*GetPixelRed(image,q))));
- green=ScaleQuantumToMap(ClampToQuantum(QuantumRange*DecompandsRGB(
- QuantumScale*GetPixelGreen(image,q))));
- blue=ScaleQuantumToMap(ClampToQuantum(QuantumRange*DecompandsRGB(
- QuantumScale*GetPixelBlue(image,q))));
+ red=ScaleQuantumToMap(ClampToQuantum(DecompandsRGB((double)
+ GetPixelRed(image,q))));
+ green=ScaleQuantumToMap(ClampToQuantum(DecompandsRGB((double)
+ GetPixelGreen(image,q))));
+ blue=ScaleQuantumToMap(ClampToQuantum(DecompandsRGB((double)
+ GetPixelBlue(image,q))));
pixel.red=(x_map[red].x+y_map[green].x+z_map[blue].x)+
- (MagickRealType) primary_info.x;
+ (double) primary_info.x;
pixel.green=(x_map[red].y+y_map[green].y+z_map[blue].y)+
- (MagickRealType) primary_info.y;
+ (double) primary_info.y;
pixel.blue=(x_map[red].z+y_map[green].z+z_map[blue].z)+
- (MagickRealType) primary_info.z;
+ (double) primary_info.z;
SetPixelRed(image,ScaleMapToQuantum(pixel.red),q);
SetPixelGreen(image,ScaleMapToQuantum(pixel.green),q);
SetPixelBlue(image,ScaleMapToQuantum(pixel.blue),q);
@@ -1490,12 +1487,12 @@
PixelInfo
pixel;
- red=ScaleQuantumToMap(ClampToQuantum(QuantumRange*DecompandsRGB(
- QuantumScale*image->colormap[i].red)));
- green=ScaleQuantumToMap(ClampToQuantum(QuantumRange*DecompandsRGB(
- QuantumScale*image->colormap[i].green)));
- blue=ScaleQuantumToMap(ClampToQuantum(QuantumRange*DecompandsRGB(
- QuantumScale*image->colormap[i].blue)));
+ red=ScaleQuantumToMap(ClampToQuantum(DecompandsRGB(
+ image->colormap[i].red)));
+ green=ScaleQuantumToMap(ClampToQuantum(DecompandsRGB(
+ image->colormap[i].green)));
+ blue=ScaleQuantumToMap(ClampToQuantum(DecompandsRGB(
+ image->colormap[i].blue)));
pixel.red=x_map[red].x+y_map[green].x+z_map[blue].x+primary_info.x;
pixel.green=x_map[red].y+y_map[green].y+z_map[blue].y+primary_info.y;
pixel.blue=x_map[red].z+y_map[green].z+z_map[blue].z+primary_info.z;
@@ -1718,7 +1715,7 @@
(D50X+15.0*D50Y+3.0*D50Z))))-1.0)/3.0))-5.0*(*Y);
}
-static inline ssize_t RoundToYCC(const MagickRealType value)
+static inline ssize_t RoundToYCC(const double value)
{
if (value <= 0.0)
return(0);
@@ -2075,12 +2072,9 @@
magenta,
yellow;
- cyan=QuantumRange*CompandsRGB(QuantumScale*(QuantumRange-
- GetPixelCyan(image,q)));
- magenta=QuantumRange*CompandsRGB(QuantumScale*(QuantumRange-
- GetPixelMagenta(image,q)));
- yellow=QuantumRange*CompandsRGB(QuantumScale*(QuantumRange-
- GetPixelYellow(image,q)));
+ cyan=CompandsRGB((double) (QuantumRange-GetPixelCyan(image,q)));
+ magenta=CompandsRGB((double) (QuantumRange-GetPixelMagenta(image,q)));
+ yellow=CompandsRGB((double) (QuantumRange-GetPixelYellow(image,q)));
SetPixelCyan(image,ClampToQuantum(cyan),q);
SetPixelMagenta(image,ClampToQuantum(magenta),q);
SetPixelYellow(image,ClampToQuantum(yellow),q);
@@ -2144,9 +2138,9 @@
{
GetPixelInfoPixel(image,q,&pixel);
ConvertCMYKToRGB(&pixel);
- pixel.red=QuantumRange*CompandsRGB(QuantumScale*pixel.red);
- pixel.green=QuantumRange*CompandsRGB(QuantumScale*pixel.green);
- pixel.blue=QuantumRange*CompandsRGB(QuantumScale*pixel.blue);
+ pixel.red=CompandsRGB(pixel.red);
+ pixel.green=CompandsRGB(pixel.green);
+ pixel.blue=CompandsRGB(pixel.blue);
SetPixelInfoPixel(image,&pixel,q);
q+=GetPixelChannels(image);
}
@@ -2205,7 +2199,7 @@
double
gray;
- gray=QuantumRange*CompandsRGB(QuantumScale*GetPixelGray(image,q));
+ gray=CompandsRGB((double) GetPixelGray(image,q));
SetPixelRed(image,ClampToQuantum(gray),q);
SetPixelGreen(image,ClampToQuantum(gray),q);
SetPixelBlue(image,ClampToQuantum(gray),q);
@@ -2271,12 +2265,9 @@
chroma=(double) (QuantumScale*GetPixelGreen(image,q));
luma=(double) (QuantumScale*GetPixelBlue(image,q));
ConvertHCLToRGB(hue,chroma,luma,&red,&green,&blue);
- red=QuantumRange*CompandsRGB(QuantumScale*red);
- green=QuantumRange*CompandsRGB(QuantumScale*green);
- blue=QuantumRange*CompandsRGB(QuantumScale*blue);
- SetPixelRed(image,ClampToQuantum(red),q);
- SetPixelGreen(image,ClampToQuantum(green),q);
- SetPixelBlue(image,ClampToQuantum(blue),q);
+ SetPixelRed(image,ClampToQuantum(CompandsRGB(red)),q);
+ SetPixelGreen(image,ClampToQuantum(CompandsRGB(green)),q);
+ SetPixelBlue(image,ClampToQuantum(CompandsRGB(blue)),q);
q+=GetPixelChannels(image);
}
sync=SyncCacheViewAuthenticPixels(image_view,exception);
@@ -2339,12 +2330,9 @@
saturation=(double) (QuantumScale*GetPixelGreen(image,q));
brightness=(double) (QuantumScale*GetPixelBlue(image,q));
ConvertHSBToRGB(hue,saturation,brightness,&red,&green,&blue);
- red=QuantumRange*CompandsRGB(QuantumScale*red);
- green=QuantumRange*CompandsRGB(QuantumScale*green);
- blue=QuantumRange*CompandsRGB(QuantumScale*blue);
- SetPixelRed(image,ClampToQuantum(red),q);
- SetPixelGreen(image,ClampToQuantum(green),q);
- SetPixelBlue(image,ClampToQuantum(blue),q);
+ SetPixelRed(image,ClampToQuantum(CompandsRGB(red)),q);
+ SetPixelGreen(image,ClampToQuantum(CompandsRGB(green)),q);
+ SetPixelBlue(image,ClampToQuantum(CompandsRGB(blue)),q);
q+=GetPixelChannels(image);
}
sync=SyncCacheViewAuthenticPixels(image_view,exception);
@@ -2407,12 +2395,9 @@
saturation=(double) (QuantumScale*GetPixelGreen(image,q));
lightness=(double) (QuantumScale*GetPixelBlue(image,q));
ConvertHSLToRGB(hue,saturation,lightness,&red,&green,&blue);
- red=QuantumRange*CompandsRGB(QuantumScale*red);
- green=QuantumRange*CompandsRGB(QuantumScale*green);
- blue=QuantumRange*CompandsRGB(QuantumScale*blue);
- SetPixelRed(image,ClampToQuantum(red),q);
- SetPixelGreen(image,ClampToQuantum(green),q);
- SetPixelBlue(image,ClampToQuantum(blue),q);
+ SetPixelRed(image,ClampToQuantum(CompandsRGB(red)),q);
+ SetPixelGreen(image,ClampToQuantum(CompandsRGB(green)),q);
+ SetPixelBlue(image,ClampToQuantum(CompandsRGB(blue)),q);
q+=GetPixelChannels(image);
}
sync=SyncCacheViewAuthenticPixels(image_view,exception);
@@ -2475,12 +2460,9 @@
whiteness=(double) (QuantumScale*GetPixelGreen(image,q));
blackness=(double) (QuantumScale*GetPixelBlue(image,q));
ConvertHWBToRGB(hue,whiteness,blackness,&red,&green,&blue);
- red=QuantumRange*CompandsRGB(QuantumScale*red);
- green=QuantumRange*CompandsRGB(QuantumScale*green);
- blue=QuantumRange*CompandsRGB(QuantumScale*blue);
- SetPixelRed(image,ClampToQuantum(red),q);
- SetPixelGreen(image,ClampToQuantum(green),q);
- SetPixelBlue(image,ClampToQuantum(blue),q);
+ SetPixelRed(image,ClampToQuantum(CompandsRGB(red)),q);
+ SetPixelGreen(image,ClampToQuantum(CompandsRGB(green)),q);
+ SetPixelBlue(image,ClampToQuantum(CompandsRGB(blue)),q);
q+=GetPixelChannels(image);
}
sync=SyncCacheViewAuthenticPixels(image_view,exception);
@@ -2547,12 +2529,9 @@
b=QuantumScale*GetPixelBlue(image,q);
ConvertLabToXYZ(L,a,b,&X,&Y,&Z);
ConvertXYZToRGB(X,Y,Z,&red,&green,&blue);
- red=QuantumRange*CompandsRGB(QuantumScale*red);
- green=QuantumRange*CompandsRGB(QuantumScale*green);
- blue=QuantumRange*CompandsRGB(QuantumScale*blue);
- SetPixelRed(image,ClampToQuantum(red),q);
- SetPixelGreen(image,ClampToQuantum(green),q);
- SetPixelBlue(image,ClampToQuantum(blue),q);
+ SetPixelRed(image,ClampToQuantum(CompandsRGB(red)),q);
+ SetPixelGreen(image,ClampToQuantum(CompandsRGB(green)),q);
+ SetPixelBlue(image,ClampToQuantum(CompandsRGB(blue)),q);
q+=GetPixelChannels(image);
}
sync=SyncCacheViewAuthenticPixels(image_view,exception);
@@ -2654,11 +2633,11 @@
green,
red;
- red=QuantumRange*CompandsRGB(QuantumScale*logmap[ScaleQuantumToMap(
+ red=CompandsRGB((double) logmap[ScaleQuantumToMap(
GetPixelRed(image,q))]);
- green=QuantumRange*CompandsRGB(QuantumScale*logmap[ScaleQuantumToMap(
+ green=CompandsRGB((double) logmap[ScaleQuantumToMap(
GetPixelGreen(image,q))]);
- blue=QuantumRange*CompandsRGB(QuantumScale*logmap[ScaleQuantumToMap(
+ blue=CompandsRGB((double) logmap[ScaleQuantumToMap(
GetPixelBlue(image,q))]);
SetPixelRed(image,ClampToQuantum(red),q);
SetPixelGreen(image,ClampToQuantum(green),q);
@@ -2730,12 +2709,9 @@
v=QuantumScale*GetPixelBlue(image,q);
ConvertLuvToXYZ(L,u,v,&X,&Y,&Z);
ConvertXYZToRGB(X,Y,Z,&red,&green,&blue);
- red=QuantumRange*CompandsRGB(QuantumScale*red);
- green=QuantumRange*CompandsRGB(QuantumScale*green);
- blue=QuantumRange*CompandsRGB(QuantumScale*blue);
- SetPixelRed(image,ClampToQuantum(red),q);
- SetPixelGreen(image,ClampToQuantum(green),q);
- SetPixelBlue(image,ClampToQuantum(blue),q);
+ SetPixelRed(image,ClampToQuantum(CompandsRGB(red)),q);
+ SetPixelGreen(image,ClampToQuantum(CompandsRGB(green)),q);
+ SetPixelBlue(image,ClampToQuantum(CompandsRGB(blue)),q);
q+=GetPixelChannels(image);
}
sync=SyncCacheViewAuthenticPixels(image_view,exception);
@@ -2791,9 +2767,9 @@
green,
red;
- red=QuantumRange*CompandsRGB(QuantumScale*GetPixelRed(image,q));
- green=QuantumRange*CompandsRGB(QuantumScale*GetPixelGreen(image,q));
- blue=QuantumRange*CompandsRGB(QuantumScale*GetPixelBlue(image,q));
+ red=CompandsRGB((double) GetPixelRed(image,q));
+ green=CompandsRGB((double) GetPixelGreen(image,q));
+ blue=CompandsRGB((double) GetPixelBlue(image,q));
SetPixelRed(image,ClampToQuantum(red),q);
SetPixelGreen(image,ClampToQuantum(green),q);
SetPixelBlue(image,ClampToQuantum(blue),q);
@@ -2859,12 +2835,9 @@
Y=QuantumScale*GetPixelGreen(image,q);
Z=QuantumScale*GetPixelBlue(image,q);
ConvertXYZToRGB(X,Y,Z,&red,&green,&blue);
- red=QuantumRange*CompandsRGB(QuantumScale*red);
- green=QuantumRange*CompandsRGB(QuantumScale*green);
- blue=QuantumRange*CompandsRGB(QuantumScale*blue);
- SetPixelRed(image,ClampToQuantum(red),q);
- SetPixelGreen(image,ClampToQuantum(green),q);
- SetPixelBlue(image,ClampToQuantum(blue),q);
+ SetPixelRed(image,ClampToQuantum(CompandsRGB(red)),q);
+ SetPixelGreen(image,ClampToQuantum(CompandsRGB(green)),q);
+ SetPixelBlue(image,ClampToQuantum(CompandsRGB(blue)),q);
q+=GetPixelChannels(image);
}
sync=SyncCacheViewAuthenticPixels(image_view,exception);
@@ -2921,19 +2894,19 @@
#endif
for (i=0; i <= (ssize_t) MaxMap; i++)
{
- x_map[i].x=(MagickRealType) i;
- y_map[i].x=0.500000*(2.000000*(MagickRealType) i-(MagickRealType)
+ x_map[i].x=(double) i;
+ y_map[i].x=0.500000*(2.000000*(double) i-(double)
MaxMap);
- z_map[i].x=(-0.333340)*(2.000000*(MagickRealType) i-(MagickRealType)
+ z_map[i].x=(-0.333340)*(2.000000*(double) i-(double)
MaxMap);
- x_map[i].y=(MagickRealType) i;
+ x_map[i].y=(double) i;
y_map[i].y=0.000000;
- z_map[i].y=0.666665*(2.000000*(MagickRealType) i-(MagickRealType)
+ z_map[i].y=0.666665*(2.000000*(double) i-(double)
MaxMap);
- x_map[i].z=(MagickRealType) i;
- y_map[i].z=(-0.500000)*(2.000000*(MagickRealType) i-(MagickRealType)
+ x_map[i].z=(double) i;
+ y_map[i].z=(-0.500000)*(2.000000*(double) i-(double)
MaxMap);
- z_map[i].z=(-0.333340)*(2.000000*(MagickRealType) i-(MagickRealType)
+ z_map[i].z=(-0.333340)*(2.000000*(double) i-(double)
MaxMap);
}
break;
@@ -2957,18 +2930,18 @@
#endif
for (i=0; i <= (ssize_t) MaxMap; i++)
{
- x_map[i].x=(MagickRealType) i;
+ x_map[i].x=(double) i;
y_map[i].x=0.000000;
- z_map[i].x=(1.402000*0.500000)*(2.000000*(MagickRealType) i-
- (MagickRealType) MaxMap);
- x_map[i].y=(MagickRealType) i;
- y_map[i].y=(-0.344136*0.500000)*(2.000000*(MagickRealType) i-
- (MagickRealType) MaxMap);
- z_map[i].y=(-0.714136*0.500000)*(2.000000*(MagickRealType) i-
- (MagickRealType) MaxMap);
- x_map[i].z=(MagickRealType) i;
- y_map[i].z=(1.772000*0.500000)*(2.000000*(MagickRealType) i-
- (MagickRealType) MaxMap);
+ z_map[i].x=(1.402000*0.500000)*(2.000000*(double) i-
+ (double) MaxMap);
+ x_map[i].y=(double) i;
+ y_map[i].y=(-0.344136*0.500000)*(2.000000*(double) i-
+ (double) MaxMap);
+ z_map[i].y=(-0.714136*0.500000)*(2.000000*(double) i-
+ (double) MaxMap);
+ x_map[i].z=(double) i;
+ y_map[i].z=(1.772000*0.500000)*(2.000000*(double) i-
+ (double) MaxMap);
z_map[i].z=0.000000;
}
break;
@@ -2991,18 +2964,18 @@
#endif
for (i=0; i <= (ssize_t) MaxMap; i++)
{
- x_map[i].x=(MagickRealType) i;
+ x_map[i].x=(double) i;
y_map[i].x=0.000000;
- z_map[i].x=(1.574800*0.50000)*(2.00000*(MagickRealType) i-
- (MagickRealType) MaxMap);
- x_map[i].y=(MagickRealType) i;
- y_map[i].y=(-0.187324*0.50000)*(2.00000*(MagickRealType) i-
- (MagickRealType) MaxMap);
- z_map[i].y=(-0.468124*0.50000)*(2.00000*(MagickRealType) i-
- (MagickRealType) MaxMap);
- x_map[i].z=(MagickRealType) i;
- y_map[i].z=(1.855600*0.50000)*(2.00000*(MagickRealType) i-
- (MagickRealType) MaxMap);
+ z_map[i].x=(1.574800*0.50000)*(2.00000*(double) i-
+ (double) MaxMap);
+ x_map[i].y=(double) i;
+ y_map[i].y=(-0.187324*0.50000)*(2.00000*(double) i-
+ (double) MaxMap);
+ z_map[i].y=(-0.468124*0.50000)*(2.00000*(double) i-
+ (double) MaxMap);
+ x_map[i].z=(double) i;
+ y_map[i].z=(1.855600*0.50000)*(2.00000*(double) i-
+ (double) MaxMap);
z_map[i].z=0.00000;
}
break;
@@ -3024,17 +2997,17 @@
#endif
for (i=0; i <= (ssize_t) MaxMap; i++)
{
- x_map[i].x=1.3584000*(MagickRealType) i;
+ x_map[i].x=1.3584000*(double) i;
y_map[i].x=0.0000000;
- z_map[i].x=1.8215000*((MagickRealType) i-(MagickRealType)
+ z_map[i].x=1.8215000*((double) i-(double)
ScaleQuantumToMap(ScaleCharToQuantum(137)));
- x_map[i].y=1.3584000*(MagickRealType) i;
- y_map[i].y=(-0.4302726)*((MagickRealType) i-(MagickRealType)
+ x_map[i].y=1.3584000*(double) i;
+ y_map[i].y=(-0.4302726)*((double) i-(double)
ScaleQuantumToMap(ScaleCharToQuantum(156)));
- z_map[i].y=(-0.9271435)*((MagickRealType) i-(MagickRealType)
+ z_map[i].y=(-0.9271435)*((double) i-(double)
ScaleQuantumToMap(ScaleCharToQuantum(137)));
- x_map[i].z=1.3584000*(MagickRealType) i;
- y_map[i].z=2.2179000*((MagickRealType) i-(MagickRealType)
+ x_map[i].z=1.3584000*(double) i;
+ y_map[i].z=2.2179000*((double) i-(double)
ScaleQuantumToMap(ScaleCharToQuantum(156)));
z_map[i].z=0.0000000;
}
@@ -3058,20 +3031,20 @@
#endif
for (i=0; i <= (ssize_t) MaxMap; i++)
{
- x_map[i].x=(MagickRealType) i;
- y_map[i].x=0.47810*(2.00000*(MagickRealType) i-(MagickRealType)
+ x_map[i].x=(double) i;
+ y_map[i].x=0.47810*(2.00000*(double) i-(double)
MaxMap);
- z_map[i].x=0.31070*(2.00000*(MagickRealType) i-(MagickRealType)
+ z_map[i].x=0.31070*(2.00000*(double) i-(double)
MaxMap);
- x_map[i].y=(MagickRealType) i;
- y_map[i].y=(-0.13635)*(2.00000*(MagickRealType) i-(MagickRealType)
+ x_map[i].y=(double) i;
+ y_map[i].y=(-0.13635)*(2.00000*(double) i-(double)
MaxMap);
- z_map[i].y=(-0.32340)*(2.00000*(MagickRealType) i-(MagickRealType)
+ z_map[i].y=(-0.32340)*(2.00000*(double) i-(double)
MaxMap);
- x_map[i].z=(MagickRealType) i;
- y_map[i].z=(-0.55185)*(2.00000*(MagickRealType) i-(MagickRealType)
+ x_map[i].z=(double) i;
+ y_map[i].z=(-0.55185)*(2.00000*(double) i-(double)
MaxMap);
- z_map[i].z=0.85030*(2.00000*(MagickRealType) i-(MagickRealType)
+ z_map[i].z=0.85030*(2.00000*(double) i-(double)
MaxMap);
}
break;
@@ -3094,17 +3067,17 @@
#endif
for (i=0; i <= (ssize_t) MaxMap; i++)
{
- x_map[i].x=(MagickRealType) i;
+ x_map[i].x=(double) i;
y_map[i].x=0.000000;
- z_map[i].x=0.701000*(2.00000*(MagickRealType) i-(MagickRealType)
+ z_map[i].x=0.701000*(2.00000*(double) i-(double)
MaxMap);
- x_map[i].y=(MagickRealType) i;
- y_map[i].y=(-0.172068)*(2.00000*(MagickRealType) i-(MagickRealType)
+ x_map[i].y=(double) i;
+ y_map[i].y=(-0.172068)*(2.00000*(double) i-(double)
MaxMap);
- z_map[i].y=0.357068*(2.00000*(MagickRealType) i-(MagickRealType)
+ z_map[i].y=0.357068*(2.00000*(double) i-(double)
MaxMap);
- x_map[i].z=(MagickRealType) i;
- y_map[i].z=0.88600*(2.00000*(MagickRealType) i-(MagickRealType)
+ x_map[i].z=(double) i;
+ y_map[i].z=0.88600*(2.00000*(double) i-(double)
MaxMap);
z_map[i].z=0.00000;
}
@@ -3128,16 +3101,16 @@
#endif
for (i=0; i <= (ssize_t) MaxMap; i++)
{
- x_map[i].x=(MagickRealType) i;
+ x_map[i].x=(double) i;
y_map[i].x=0.00000;
- z_map[i].x=0.70375*(2.0000*(MagickRealType) i-(MagickRealType) MaxMap);
- x_map[i].y=(MagickRealType) i;
- y_map[i].y=(-0.17275)*(2.00000*(MagickRealType) i-(MagickRealType)
+ z_map[i].x=0.70375*(2.0000*(double) i-(double) MaxMap);
+ x_map[i].y=(double) i;
+ y_map[i].y=(-0.17275)*(2.00000*(double) i-(double)
MaxMap);
- z_map[i].y=(-0.35845)*(2.00000*(MagickRealType) i-(MagickRealType)
+ z_map[i].y=(-0.35845)*(2.00000*(double) i-(double)
MaxMap);
- x_map[i].z=(MagickRealType) i;
- y_map[i].z=0.8895*(2.00000*(MagickRealType) i-(MagickRealType) MaxMap);
+ x_map[i].z=(double) i;
+ y_map[i].z=0.8895*(2.00000*(double) i-(double) MaxMap);
z_map[i].z=0.00000;
}
break;
@@ -3153,15 +3126,15 @@
#endif
for (i=0; i <= (ssize_t) MaxMap; i++)
{
- x_map[i].x=(MagickRealType) i;
+ x_map[i].x=(double) i;
y_map[i].x=0.0;
z_map[i].x=0.0;
x_map[i].y=0.0;
- y_map[i].y=(MagickRealType) i;
+ y_map[i].y=(double) i;
z_map[i].y=0.0;
x_map[i].z=0.0;
y_map[i].z=0.0;
- z_map[i].z=(MagickRealType) i;
+ z_map[i].z=(double) i;
}
break;
}
@@ -3229,12 +3202,12 @@
pixel.blue)];
#endif
}
- SetPixelRed(image,ClampToQuantum(QuantumRange*CompandsRGB(
- QuantumScale*ScaleMapToQuantum(pixel.red))),q);
- SetPixelGreen(image,ClampToQuantum(QuantumRange*CompandsRGB(
- QuantumScale*ScaleMapToQuantum(pixel.green))),q);
- SetPixelBlue(image,ClampToQuantum(QuantumRange*CompandsRGB(
- QuantumScale*ScaleMapToQuantum(pixel.blue))),q);
+ SetPixelRed(image,ClampToQuantum(CompandsRGB((double)
+ ScaleMapToQuantum(pixel.red))),q);
+ SetPixelGreen(image,ClampToQuantum(CompandsRGB((double)
+ ScaleMapToQuantum(pixel.green))),q);
+ SetPixelBlue(image,ClampToQuantum(CompandsRGB((double)
+ ScaleMapToQuantum(pixel.blue))),q);
q+=GetPixelChannels(image);
}
sync=SyncCacheViewAuthenticPixels(image_view,exception);
@@ -3293,12 +3266,12 @@
pixel.blue)];
#endif
}
- image->colormap[i].red=(double) ClampToQuantum(QuantumRange*
- CompandsRGB(QuantumScale*ScaleMapToQuantum(pixel.red)));
- image->colormap[i].green=(double) ClampToQuantum(QuantumRange*
- CompandsRGB(QuantumScale*ScaleMapToQuantum(pixel.green)));
- image->colormap[i].blue=(double) ClampToQuantum(QuantumRange*
- CompandsRGB(QuantumScale*ScaleMapToQuantum(pixel.blue)));
+ image->colormap[i].red=(double) ClampToQuantum(
+ CompandsRGB((double) ScaleMapToQuantum(pixel.red)));
+ image->colormap[i].green=(double) ClampToQuantum(
+ CompandsRGB((double) ScaleMapToQuantum(pixel.green)));
+ image->colormap[i].blue=(double) ClampToQuantum(
+ CompandsRGB((double) ScaleMapToQuantum(pixel.blue)));
}
(void) SyncImage(image,exception);
break;
diff --git a/MagickCore/compare.c b/MagickCore/compare.c
index b2cd11e..ec192d5 100644
--- a/MagickCore/compare.c
+++ b/MagickCore/compare.c
@@ -228,7 +228,7 @@
difference=MagickFalse;
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
- MagickRealType
+ double
distance;
PixelChannel
@@ -245,7 +245,7 @@
(reconstruct_traits == UndefinedPixelTrait) ||
((reconstruct_traits & UpdatePixelTrait) == 0))
continue;
- distance=p[i]-(MagickRealType) GetPixelChannel(reconstruct_image,
+ distance=p[i]-(double) GetPixelChannel(reconstruct_image,
channel,q);
if (fabs((double) distance) >= MagickEpsilon)
difference=MagickTrue;
@@ -492,7 +492,7 @@
}
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
- MagickRealType
+ double
distance;
PixelChannel
@@ -509,7 +509,7 @@
(reconstruct_traits == UndefinedPixelTrait) ||
((reconstruct_traits & UpdatePixelTrait) == 0))
continue;
- distance=QuantumScale*(p[i]-(MagickRealType) GetPixelChannel(
+ distance=QuantumScale*(p[i]-(double) GetPixelChannel(
reconstruct_image,channel,q));
distance*=distance;
channel_distortion[i]+=distance;
@@ -593,7 +593,7 @@
}
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
- MagickRealType
+ double
distance;
PixelChannel
@@ -610,7 +610,7 @@
(reconstruct_traits == UndefinedPixelTrait) ||
((reconstruct_traits & UpdatePixelTrait) == 0))
continue;
- distance=QuantumScale*fabs(p[i]-(MagickRealType) GetPixelChannel(
+ distance=QuantumScale*fabs(p[i]-(double) GetPixelChannel(
reconstruct_image,channel,q));
channel_distortion[i]+=distance;
channel_distortion[CompositePixelChannel]+=distance;
@@ -642,7 +642,7 @@
MagickBooleanType
status;
- MagickRealType
+ double
alpha,
area,
beta,
@@ -690,7 +690,7 @@
}
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
- MagickRealType
+ double
distance;
PixelChannel
@@ -788,7 +788,7 @@
}
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
- MagickRealType
+ double
distance;
PixelChannel
@@ -805,7 +805,7 @@
(reconstruct_traits == UndefinedPixelTrait) ||
((reconstruct_traits & UpdatePixelTrait) == 0))
continue;
- distance=QuantumScale*(p[i]-(MagickRealType) GetPixelChannel(
+ distance=QuantumScale*(p[i]-(double) GetPixelChannel(
reconstruct_image,channel,q));
distance*=distance;
channel_distortion[i]+=distance;
@@ -848,7 +848,7 @@
MagickOffsetType
progress;
- MagickRealType
+ double
area;
register ssize_t
@@ -866,7 +866,7 @@
progress=0;
for (i=0; i <= MaxPixelChannels; i++)
distortion[i]=0.0;
- area=1.0/((MagickRealType) image->columns*image->rows-1);
+ area=1.0/((double) image->columns*image->rows-1);
image_view=AcquireVirtualCacheView(image,exception);
reconstruct_view=AcquireVirtualCacheView(reconstruct_image,exception);
for (y=0; y < (ssize_t) image->rows; y++)
@@ -941,7 +941,7 @@
distortion[CompositePixelChannel]=0.0;
for (i=0; i < MaxPixelChannels; i++)
{
- MagickRealType
+ double
gamma;
PixelChannel
@@ -1023,7 +1023,7 @@
}
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
- MagickRealType
+ double
distance;
PixelChannel
@@ -1040,7 +1040,7 @@
(reconstruct_traits == UndefinedPixelTrait) ||
((reconstruct_traits & UpdatePixelTrait) == 0))
continue;
- distance=QuantumScale*fabs(p[i]-(MagickRealType) GetPixelChannel(
+ distance=QuantumScale*fabs(p[i]-(double) GetPixelChannel(
reconstruct_image,channel,q));
if (distance > channel_distortion[i])
channel_distortion[i]=distance;
@@ -1387,7 +1387,7 @@
MagickBooleanType
status;
- MagickRealType
+ double
area,
maximum_error,
mean_error,
@@ -1436,7 +1436,7 @@
}
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
- MagickRealType
+ double
distance;
PixelChannel
@@ -1453,7 +1453,7 @@
(reconstruct_traits == UndefinedPixelTrait) ||
((reconstruct_traits & UpdatePixelTrait) == 0))
continue;
- distance=fabs(p[i]-(MagickRealType) GetPixelChannel(reconstruct_image,
+ distance=fabs(p[i]-(double) GetPixelChannel(reconstruct_image,
channel,q));
mean_error_per_pixel+=distance;
mean_error+=distance*distance;
diff --git a/MagickCore/composite-private.h b/MagickCore/composite-private.h
index 6204057..0b8e1e1 100644
--- a/MagickCore/composite-private.h
+++ b/MagickCore/composite-private.h
@@ -32,10 +32,10 @@
#include "MagickCore/pixel-accessor.h"
#include "MagickCore/pixel-private.h"
-static inline MagickRealType MagickOver_(const MagickRealType p,
- const MagickRealType alpha,const MagickRealType q,const MagickRealType beta)
+static inline double MagickOver_(const double p,
+ const double alpha,const double q,const double beta)
{
- MagickRealType
+ double
Da,
Sa;
@@ -45,10 +45,10 @@
}
static inline void CompositePixelOver(const Image *image,const PixelInfo *p,
- const MagickRealType alpha,const Quantum *q,const MagickRealType beta,
+ const double alpha,const Quantum *q,const double beta,
Quantum *composite)
{
- MagickRealType
+ double
Da,
gamma,
Sa;
@@ -79,26 +79,26 @@
{
case RedPixelChannel:
{
- composite[i]=ClampToQuantum(gamma*MagickOver_((MagickRealType) p->red,
- alpha,(MagickRealType) q[i],beta));
+ composite[i]=ClampToQuantum(gamma*MagickOver_((double) p->red,
+ alpha,(double) q[i],beta));
break;
}
case GreenPixelChannel:
{
- composite[i]=ClampToQuantum(gamma*MagickOver_((MagickRealType) p->green,
- alpha,(MagickRealType) q[i],beta));
+ composite[i]=ClampToQuantum(gamma*MagickOver_((double) p->green,
+ alpha,(double) q[i],beta));
break;
}
case BluePixelChannel:
{
- composite[i]=ClampToQuantum(gamma*MagickOver_((MagickRealType) p->blue,
- alpha,(MagickRealType) q[i],beta));
+ composite[i]=ClampToQuantum(gamma*MagickOver_((double) p->blue,
+ alpha,(double) q[i],beta));
break;
}
case BlackPixelChannel:
{
- composite[i]=ClampToQuantum(gamma*MagickOver_((MagickRealType) p->black,
- alpha,(MagickRealType) q[i],beta));
+ composite[i]=ClampToQuantum(gamma*MagickOver_((double) p->black,
+ alpha,(double) q[i],beta));
break;
}
case AlphaPixelChannel:
@@ -113,10 +113,10 @@
}
static inline void CompositePixelInfoOver(const PixelInfo *p,
- const MagickRealType alpha,const PixelInfo *q,const MagickRealType beta,
+ const double alpha,const PixelInfo *q,const double beta,
PixelInfo *composite)
{
- MagickRealType
+ double
Da,
gamma,
Sa;
@@ -132,7 +132,7 @@
Sa=QuantumScale*alpha;
Da=QuantumScale*beta,
gamma=Sa*(-Da)+Sa+Da;
- composite->alpha=(MagickRealType) QuantumRange*gamma;
+ composite->alpha=(double) QuantumRange*gamma;
gamma=MagickEpsilonReciprocal(gamma);
composite->red=gamma*MagickOver_(p->red,alpha,q->red,beta);
composite->green=gamma*MagickOver_(p->green,alpha,q->green,beta);
@@ -141,16 +141,16 @@
composite->black=gamma*MagickOver_(p->black,alpha,q->black,beta);
}
-static inline MagickRealType RoundToUnity(const MagickRealType value)
+static inline double RoundToUnity(const double value)
{
return(value < 0.0 ? 0.0 : (value > 1.0) ? 1.0 : value);
}
static inline void CompositePixelInfoPlus(const PixelInfo *p,
- const MagickRealType alpha,const PixelInfo *q,const MagickRealType beta,
+ const double alpha,const PixelInfo *q,const double beta,
PixelInfo *composite)
{
- MagickRealType
+ double
Da,
gamma,
Sa;
@@ -161,7 +161,7 @@
Sa=QuantumScale*alpha;
Da=QuantumScale*beta;
gamma=RoundToUnity(Sa+Da); /* 'Plus' blending -- not 'Over' blending */
- composite->alpha=(MagickRealType) QuantumRange*gamma;
+ composite->alpha=(double) QuantumRange*gamma;
gamma=MagickEpsilonReciprocal(gamma);
composite->red=gamma*(Sa*p->red+Da*q->red);
composite->green=gamma*(Sa*p->green+Da*q->green);
@@ -171,24 +171,24 @@
}
static inline void CompositePixelInfoAreaBlend(const PixelInfo *p,
- const MagickRealType alpha,const PixelInfo *q,const MagickRealType beta,
- const MagickRealType area,PixelInfo *composite)
+ const double alpha,const PixelInfo *q,const double beta,
+ const double area,PixelInfo *composite)
{
/*
Blend pixel colors p and q by the amount given and area.
*/
- CompositePixelInfoPlus(p,(MagickRealType) (1.0-area)*alpha,q,(MagickRealType)
+ CompositePixelInfoPlus(p,(double) (1.0-area)*alpha,q,(double)
(area*beta),composite);
}
static inline void CompositePixelInfoBlend(const PixelInfo *p,
- const MagickRealType alpha,const PixelInfo *q,const MagickRealType beta,
+ const double alpha,const PixelInfo *q,const double beta,
PixelInfo *composite)
{
/*
Blend pixel colors p and q by the amount given.
*/
- CompositePixelInfoPlus(p,(MagickRealType) (alpha*p->alpha),q,(MagickRealType)
+ CompositePixelInfoPlus(p,(double) (alpha*p->alpha),q,(double)
(beta*q->alpha),composite);
}
diff --git a/MagickCore/composite.c b/MagickCore/composite.c
index f0363f5..e65afd8 100644
--- a/MagickCore/composite.c
+++ b/MagickCore/composite.c
@@ -201,7 +201,7 @@
if (fabs((double) max) < MagickEpsilon)
return;
*saturation=(double) (1.0-min/max);
- delta=(MagickRealType) max-min;
+ delta=(double) max-min;
if (fabs(delta) < MagickEpsilon)
return;
if (fabs((double) red-max) < MagickEpsilon)
@@ -389,7 +389,7 @@
}
for (x=0; x < (ssize_t) image->columns; x++)
{
- MagickRealType
+ double
alpha,
Da,
Dc,
@@ -500,8 +500,8 @@
Sc: source color.
Dc: destination color.
*/
- Sc=(MagickRealType) GetPixelChannel(composite_image,channel,p);
- Dc=(MagickRealType) q[i];
+ Sc=(double) GetPixelChannel(composite_image,channel,p);
+ Dc=(double) q[i];
gamma=MagickEpsilonReciprocal(alpha);
q[i]=ClampToQuantum(gamma*(Sa*Sc-Sa*Da*Dc+Da*Dc));
}
@@ -556,7 +556,7 @@
MagickOffsetType
progress;
- MagickRealType
+ double
amount,
destination_dissolve,
midpoint,
@@ -716,7 +716,7 @@
PixelInfo
pixel;
- MagickRealType
+ double
angle_range,
angle_start,
height,
@@ -774,7 +774,7 @@
/* rotate vectors if a rotation angle is given */
if ((flags & XValue) != 0 )
{
- MagickRealType
+ double
angle;
angle=DegreesToRadians(geometry_info.xi);
@@ -840,7 +840,7 @@
}
if (fabs(angle_range) > MagickEpsilon)
{
- MagickRealType
+ double
angle;
angle=angle_start+angle_range*QuantumScale*
@@ -893,7 +893,7 @@
PixelInfo
pixel;
- MagickRealType
+ double
horizontal_scale,
vertical_scale;
@@ -922,14 +922,14 @@
{
if ((flags & AspectValue) == 0)
{
- horizontal_scale=(MagickRealType) (composite_image->columns-1.0)/
+ horizontal_scale=(double) (composite_image->columns-1.0)/
2.0;
- vertical_scale=(MagickRealType) (composite_image->rows-1.0)/2.0;
+ vertical_scale=(double) (composite_image->rows-1.0)/2.0;
}
else
{
- horizontal_scale=(MagickRealType) (image->columns-1.0)/2.0;
- vertical_scale=(MagickRealType) (image->rows-1.0)/2.0;
+ horizontal_scale=(double) (image->columns-1.0)/2.0;
+ vertical_scale=(double) (image->rows-1.0)/2.0;
}
}
else
@@ -960,29 +960,29 @@
default = center of overlay image
arg flag '!' = locations/percentage relative to background image
*/
- center.x=(MagickRealType) x_offset;
- center.y=(MagickRealType) y_offset;
+ center.x=(double) x_offset;
+ center.y=(double) y_offset;
if (compose == DistortCompositeOp)
{
if ((flags & XValue) == 0)
if ((flags & AspectValue) == 0)
- center.x=(MagickRealType) x_offset+(composite_image->columns-1)/
+ center.x=(double) x_offset+(composite_image->columns-1)/
2.0;
else
- center.x=((MagickRealType) image->columns-1)/2.0;
+ center.x=((double) image->columns-1)/2.0;
else
if ((flags & AspectValue) == 0)
- center.x=(MagickRealType) x_offset+geometry_info.xi;
+ center.x=(double) x_offset+geometry_info.xi;
else
center.x=geometry_info.xi;
if ((flags & YValue) == 0)
if ((flags & AspectValue) == 0)
- center.y=(MagickRealType) y_offset+(composite_image->rows-1)/2.0;
+ center.y=(double) y_offset+(composite_image->rows-1)/2.0;
else
- center.y=((MagickRealType) image->rows-1)/2.0;
+ center.y=((double) image->rows-1)/2.0;
else
if ((flags & AspectValue) == 0)
- center.y=(MagickRealType) y_offset+geometry_info.psi;
+ center.y=(double) y_offset+geometry_info.psi;
else
center.y=geometry_info.psi;
}
@@ -1027,11 +1027,11 @@
Displace the offset.
*/
offset.x=(horizontal_scale*(GetPixelRed(composite_image,p)-
- (((MagickRealType) QuantumRange+1.0)/2.0)))/(((MagickRealType)
+ (((double) QuantumRange+1.0)/2.0)))/(((double)
QuantumRange+1.0)/2.0)+center.x+((compose == DisplaceCompositeOp) ?
x : 0);
offset.y=(vertical_scale*(GetPixelGreen(composite_image,p)-
- (((MagickRealType) QuantumRange+1.0)/2.0)))/(((MagickRealType)
+ (((double) QuantumRange+1.0)/2.0)))/(((double)
QuantumRange+1.0)/2.0)+center.y+((compose == DisplaceCompositeOp) ?
y : 0);
(void) InterpolatePixelInfo(image,image_view,
@@ -1040,7 +1040,7 @@
/*
Mask with the 'invalid pixel mask' in alpha channel.
*/
- pixel.alpha=(MagickRealType) QuantumRange*(1.0-(1.0-QuantumScale*
+ pixel.alpha=(double) QuantumRange*(1.0-(1.0-QuantumScale*
pixel.alpha)*(1.0-QuantumScale*GetPixelAlpha(composite_image,p)));
SetPixelInfoPixel(destination_image,&pixel,q);
p+=GetPixelChannels(composite_image);
@@ -1174,7 +1174,7 @@
*/
status=MagickTrue;
progress=0;
- midpoint=((MagickRealType) QuantumRange+1.0)/2;
+ midpoint=((double) QuantumRange+1.0)/2;
composite_view=AcquireVirtualCacheView(composite_image,exception);
image_view=AcquireAuthenticCacheView(image,exception);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
@@ -1247,7 +1247,7 @@
GetPixelInfo(composite_image,&source_pixel);
for (x=0; x < (ssize_t) image->columns; x++)
{
- MagickRealType
+ double
alpha,
Da,
Dc,
@@ -1293,7 +1293,7 @@
}
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
- MagickRealType
+ double
pixel;
PixelChannel
@@ -1322,9 +1322,9 @@
case SrcInCompositeOp:
case SrcOutCompositeOp:
{
- pixel=(MagickRealType) q[i];
+ pixel=(double) q[i];
if (channel == AlphaPixelChannel)
- pixel=(MagickRealType) TransparentAlpha;
+ pixel=(double) TransparentAlpha;
break;
}
case ClearCompositeOp:
@@ -1334,7 +1334,7 @@
{
if (channel == AlphaPixelChannel)
{
- pixel=(MagickRealType) TransparentAlpha;
+ pixel=(double) TransparentAlpha;
break;
}
pixel=0.0;
@@ -1349,12 +1349,12 @@
source);
break;
}
- pixel=(MagickRealType) source[channel];
+ pixel=(double) source[channel];
break;
}
default:
{
- pixel=(MagickRealType) source[channel];
+ pixel=(double) source[channel];
break;
}
}
@@ -1484,7 +1484,7 @@
double
sans;
- MagickRealType
+ double
pixel;
PixelChannel
@@ -1506,8 +1506,8 @@
Sc: source color.
Dc: destination color.
*/
- Sc=(MagickRealType) GetPixelChannel(composite_image,channel,p);
- Dc=(MagickRealType) q[i];
+ Sc=(double) GetPixelChannel(composite_image,channel,p);
+ Dc=(double) q[i];
if ((traits & CopyPixelTrait) != 0)
{
if (channel != AlphaPixelChannel)
@@ -1548,23 +1548,23 @@
MagickBooleanType
equivalent;
- if (Da > ((MagickRealType) QuantumRange/2.0))
+ if (Da > ((double) QuantumRange/2.0))
{
- pixel=(MagickRealType) TransparentAlpha;
+ pixel=(double) TransparentAlpha;
break;
}
equivalent=IsFuzzyEquivalencePixel(composite_image,p,image,q);
if (equivalent != MagickFalse)
{
- pixel=(MagickRealType) TransparentAlpha;
+ pixel=(double) TransparentAlpha;
break;
}
- pixel=(MagickRealType) OpaqueAlpha;
+ pixel=(double) OpaqueAlpha;
break;
}
case ClearCompositeOp:
{
- pixel=(MagickRealType) TransparentAlpha;
+ pixel=(double) TransparentAlpha;
break;
}
case ColorizeCompositeOp:
@@ -1615,7 +1615,7 @@
}
case IntensityCompositeOp:
{
- pixel=(MagickRealType) GetPixelIntensity(composite_image,p);
+ pixel=(double) GetPixelIntensity(composite_image,p);
break;
}
case LightenIntensityCompositeOp:
@@ -1782,28 +1782,28 @@
case CopyBlackCompositeOp:
{
if (channel == BlackPixelChannel)
- pixel=(MagickRealType) GetPixelBlack(composite_image,p);
+ pixel=(double) GetPixelBlack(composite_image,p);
break;
}
case CopyBlueCompositeOp:
case CopyYellowCompositeOp:
{
if (channel == BluePixelChannel)
- pixel=(MagickRealType) GetPixelBlue(composite_image,p);
+ pixel=(double) GetPixelBlue(composite_image,p);
break;
}
case CopyGreenCompositeOp:
case CopyMagentaCompositeOp:
{
if (channel == GreenPixelChannel)
- pixel=(MagickRealType) GetPixelGreen(composite_image,p);
+ pixel=(double) GetPixelGreen(composite_image,p);
break;
}
case CopyRedCompositeOp:
case CopyCyanCompositeOp:
{
if (channel == RedPixelChannel)
- pixel=(MagickRealType) GetPixelRed(composite_image,p);
+ pixel=(double) GetPixelRed(composite_image,p);
break;
}
case DarkenCompositeOp:
@@ -2239,11 +2239,11 @@
}
case ThresholdCompositeOp:
{
- MagickRealType
+ double
delta;
delta=Sc-Dc;
- if ((MagickRealType) fabs((double) (2.0*delta)) < threshold)
+ if ((double) fabs((double) (2.0*delta)) < threshold)
{
pixel=gamma*Dc;
break;
diff --git a/MagickCore/compress.c b/MagickCore/compress.c
index 1319621..5aa87f0 100644
--- a/MagickCore/compress.c
+++ b/MagickCore/compress.c
@@ -806,7 +806,7 @@
for (x=0; x < (ssize_t) huffman_image->columns; x++)
{
*q++=(unsigned char) (GetPixelIntensity(huffman_image,p) >=
- ((MagickRealType) QuantumRange/2.0) ? 0 : 1);
+ ((double) QuantumRange/2.0) ? 0 : 1);
p+=GetPixelChannels(huffman_image);
}
/*
diff --git a/MagickCore/decorate.c b/MagickCore/decorate.c
index 7e1104e..c684424 100644
--- a/MagickCore/decorate.c
+++ b/MagickCore/decorate.c
@@ -248,23 +248,23 @@
interior=image->border_color;
matte=image->matte_color;
accentuate=matte;
- accentuate.red=(MagickRealType) (QuantumScale*((QuantumRange-
+ accentuate.red=(double) (QuantumScale*((QuantumRange-
AccentuateModulate)*matte.red+(QuantumRange*AccentuateModulate)));
- accentuate.green=(MagickRealType) (QuantumScale*((QuantumRange-
+ accentuate.green=(double) (QuantumScale*((QuantumRange-
AccentuateModulate)*matte.green+(QuantumRange*AccentuateModulate)));
- accentuate.blue=(MagickRealType) (QuantumScale*((QuantumRange-
+ accentuate.blue=(double) (QuantumScale*((QuantumRange-
AccentuateModulate)*matte.blue+(QuantumRange*AccentuateModulate)));
- accentuate.black=(MagickRealType) (QuantumScale*((QuantumRange-
+ accentuate.black=(double) (QuantumScale*((QuantumRange-
AccentuateModulate)*matte.black+(QuantumRange*AccentuateModulate)));
accentuate.alpha=matte.alpha;
highlight=matte;
- highlight.red=(MagickRealType) (QuantumScale*((QuantumRange-
+ highlight.red=(double) (QuantumScale*((QuantumRange-
HighlightModulate)*matte.red+(QuantumRange*HighlightModulate)));
- highlight.green=(MagickRealType) (QuantumScale*((QuantumRange-
+ highlight.green=(double) (QuantumScale*((QuantumRange-
HighlightModulate)*matte.green+(QuantumRange*HighlightModulate)));
- highlight.blue=(MagickRealType) (QuantumScale*((QuantumRange-
+ highlight.blue=(double) (QuantumScale*((QuantumRange-
HighlightModulate)*matte.blue+(QuantumRange*HighlightModulate)));
- highlight.black=(MagickRealType) (QuantumScale*((QuantumRange-
+ highlight.black=(double) (QuantumScale*((QuantumRange-
HighlightModulate)*matte.black+(QuantumRange*HighlightModulate)));
highlight.alpha=matte.alpha;
shadow=matte;
@@ -728,8 +728,8 @@
traits=GetPixelChannelMapTraits(image,channel);
if ((traits & UpdatePixelTrait) == 0)
continue;
- q[i]=ClampToQuantum(QuantumScale*((MagickRealType) q[i]*HighlightFactor+
- (MagickRealType) foreground*(QuantumRange-HighlightFactor)));
+ q[i]=ClampToQuantum(QuantumScale*((double) q[i]*HighlightFactor+
+ (double) foreground*(QuantumRange-HighlightFactor)));
}
q+=GetPixelChannels(image);
}
@@ -752,8 +752,8 @@
traits=GetPixelChannelMapTraits(image,channel);
if ((traits & UpdatePixelTrait) == 0)
continue;
- q[i]=ClampToQuantum(QuantumScale*((MagickRealType) q[i]*
- AccentuateFactor+(MagickRealType) foreground*(QuantumRange-
+ q[i]=ClampToQuantum(QuantumScale*((double) q[i]*
+ AccentuateFactor+(double) foreground*(QuantumRange-
AccentuateFactor)));
}
q+=GetPixelChannels(image);
@@ -777,8 +777,8 @@
traits=GetPixelChannelMapTraits(image,channel);
if ((traits & UpdatePixelTrait) == 0)
continue;
- q[i]=ClampToQuantum(QuantumScale*((MagickRealType) q[i]*ShadowFactor+
- (MagickRealType) background*(QuantumRange-ShadowFactor)));
+ q[i]=ClampToQuantum(QuantumScale*((double) q[i]*ShadowFactor+
+ (double) background*(QuantumRange-ShadowFactor)));
}
q+=GetPixelChannels(image);
}
@@ -834,8 +834,8 @@
traits=GetPixelChannelMapTraits(image,channel);
if ((traits & UpdatePixelTrait) == 0)
continue;
- q[i]=ClampToQuantum(QuantumScale*((MagickRealType) q[i]*HighlightFactor+
- (MagickRealType) foreground*(QuantumRange-HighlightFactor)));
+ q[i]=ClampToQuantum(QuantumScale*((double) q[i]*HighlightFactor+
+ (double) foreground*(QuantumRange-HighlightFactor)));
}
q+=GetPixelChannels(image);
}
@@ -860,8 +860,8 @@
traits=GetPixelChannelMapTraits(image,channel);
if ((traits & UpdatePixelTrait) == 0)
continue;
- q[i]=ClampToQuantum(QuantumScale*((MagickRealType) q[i]*ShadowFactor+
- (MagickRealType) background*(QuantumRange-ShadowFactor)));
+ q[i]=ClampToQuantum(QuantumScale*((double) q[i]*ShadowFactor+
+ (double) background*(QuantumRange-ShadowFactor)));
}
q+=GetPixelChannels(image);
}
@@ -917,8 +917,8 @@
traits=GetPixelChannelMapTraits(image,channel);
if ((traits & UpdatePixelTrait) == 0)
continue;
- q[i]=ClampToQuantum(QuantumScale*((MagickRealType) q[i]*HighlightFactor+
- (MagickRealType) foreground*(QuantumRange-HighlightFactor)));
+ q[i]=ClampToQuantum(QuantumScale*((double) q[i]*HighlightFactor+
+ (double) foreground*(QuantumRange-HighlightFactor)));
}
q+=GetPixelChannels(image);
}
@@ -936,8 +936,8 @@
traits=GetPixelChannelMapTraits(image,channel);
if ((traits & UpdatePixelTrait) == 0)
continue;
- q[i]=ClampToQuantum(QuantumScale*((MagickRealType) q[i]*TroughFactor+
- (MagickRealType) background*(QuantumRange-TroughFactor)));
+ q[i]=ClampToQuantum(QuantumScale*((double) q[i]*TroughFactor+
+ (double) background*(QuantumRange-TroughFactor)));
}
q+=GetPixelChannels(image);
}
@@ -960,8 +960,8 @@
traits=GetPixelChannelMapTraits(image,channel);
if ((traits & UpdatePixelTrait) == 0)
continue;
- q[i]=ClampToQuantum(QuantumScale*((MagickRealType) q[i]*ShadowFactor+
- (MagickRealType) background*(QuantumRange-ShadowFactor)));
+ q[i]=ClampToQuantum(QuantumScale*((double) q[i]*ShadowFactor+
+ (double) background*(QuantumRange-ShadowFactor)));
}
q+=GetPixelChannels(image);
}
diff --git a/MagickCore/display.c b/MagickCore/display.c
index 0866bce..38caf63 100644
--- a/MagickCore/display.c
+++ b/MagickCore/display.c
@@ -1856,7 +1856,7 @@
transparent_box = MagickTrue,
transparent_pen = MagickFalse;
- static MagickRealType
+ static double
degrees = 0.0;
static unsigned int
@@ -2907,7 +2907,7 @@
x,
y;
- MagickRealType
+ double
scale_factor;
RectangleInfo
@@ -3232,11 +3232,11 @@
y=0;
if (windows->image.crop_geometry != (char *) NULL)
(void) XParseGeometry(windows->image.crop_geometry,&x,&y,&width,&height);
- scale_factor=(MagickRealType) width/windows->image.ximage->width;
+ scale_factor=(double) width/windows->image.ximage->width;
chop_info.x+=x;
chop_info.x=(ssize_t) (scale_factor*chop_info.x+0.5);
chop_info.width=(unsigned int) (scale_factor*chop_info.width+0.5);
- scale_factor=(MagickRealType) height/windows->image.ximage->height;
+ scale_factor=(double) height/windows->image.ximage->height;
chop_info.y+=y;
chop_info.y=(ssize_t) (scale_factor*chop_info.y+0.5);
chop_info.height=(unsigned int) (scale_factor*chop_info.height+0.5);
@@ -3825,11 +3825,11 @@
y_offset,&target,exception);
if (method == FillToBorderMethod)
{
- target.red=(MagickRealType)
+ target.red=(double)
ScaleShortToQuantum(border_color.red);
- target.green=(MagickRealType)
+ target.green=(double)
ScaleShortToQuantum(border_color.green);
- target.blue=(MagickRealType)
+ target.blue=(double)
ScaleShortToQuantum(border_color.blue);
}
draw_info=CloneDrawInfo(resource_info->image_info,
@@ -3961,7 +3961,7 @@
x,
y;
- MagickRealType
+ double
blend,
scale_factor;
@@ -4280,11 +4280,11 @@
y=0;
if (windows->image.crop_geometry != (char *) NULL)
(void) XParseGeometry(windows->image.crop_geometry,&x,&y,&width,&height);
- scale_factor=(MagickRealType) width/windows->image.ximage->width;
+ scale_factor=(double) width/windows->image.ximage->width;
composite_info.x+=x;
composite_info.x=(ssize_t) (scale_factor*composite_info.x+0.5);
composite_info.width=(unsigned int) (scale_factor*composite_info.width+0.5);
- scale_factor=(MagickRealType) height/windows->image.ximage->height;
+ scale_factor=(double) height/windows->image.ximage->height;
composite_info.y+=y;
composite_info.y=(ssize_t) (scale_factor*composite_info.y+0.5);
composite_info.height=(unsigned int) (scale_factor*composite_info.height+0.5);
@@ -4632,7 +4632,7 @@
Image
*crop_image;
- MagickRealType
+ double
scale_factor;
RectangleInfo
@@ -5331,11 +5331,11 @@
y=0;
if (windows->image.crop_geometry != (char *) NULL)
(void) XParseGeometry(windows->image.crop_geometry,&x,&y,&width,&height);
- scale_factor=(MagickRealType) width/windows->image.ximage->width;
+ scale_factor=(double) width/windows->image.ximage->width;
crop_info.x+=x;
crop_info.x=(ssize_t) (scale_factor*crop_info.x+0.5);
crop_info.width=(unsigned int) (scale_factor*crop_info.width+0.5);
- scale_factor=(MagickRealType) height/windows->image.ximage->height;
+ scale_factor=(double) height/windows->image.ximage->height;
crop_info.y+=y;
crop_info.y=(ssize_t) (scale_factor*crop_info.y+0.5);
crop_info.height=(unsigned int) (scale_factor*crop_info.height+0.5);
@@ -5468,7 +5468,7 @@
x,
y;
- MagickRealType
+ double
degrees;
MagickStatusType
@@ -6371,7 +6371,7 @@
*/
static void XDrawPanRectangle(Display *display,XWindows *windows)
{
- MagickRealType
+ double
scale_factor;
RectangleInfo
@@ -6380,10 +6380,10 @@
/*
Determine dimensions of the panning rectangle.
*/
- scale_factor=(MagickRealType) windows->pan.width/windows->image.ximage->width;
+ scale_factor=(double) windows->pan.width/windows->image.ximage->width;
highlight_info.x=(ssize_t) (scale_factor*windows->image.x+0.5);
highlight_info.width=(unsigned int) (scale_factor*windows->image.width+0.5);
- scale_factor=(MagickRealType)
+ scale_factor=(double)
windows->pan.height/windows->image.ximage->height;
highlight_info.y=(ssize_t) (scale_factor*windows->image.y+0.5);
highlight_info.height=(unsigned int) (scale_factor*windows->image.height+0.5);
@@ -7904,7 +7904,7 @@
black_point*=(double) (*image)->columns*(*image)->rows/100.0;
white_point*=(double) (*image)->columns*(*image)->rows/100.0;
}
- white_point=(MagickRealType) (*image)->columns*(*image)->rows-white_point;
+ white_point=(double) (*image)->columns*(*image)->rows-white_point;
(void) ContrastStretchImage(*image,black_point,white_point,
exception);
XSetCursorState(display,windows,MagickFalse);
@@ -10161,16 +10161,16 @@
y_offset,&target,exception);
if (method == FillToBorderMethod)
{
- target.red=(MagickRealType) ScaleShortToQuantum(
+ target.red=(double) ScaleShortToQuantum(
border_color.red);
- target.green=(MagickRealType) ScaleShortToQuantum(
+ target.green=(double) ScaleShortToQuantum(
border_color.green);
- target.blue=(MagickRealType) ScaleShortToQuantum(
+ target.blue=(double) ScaleShortToQuantum(
border_color.blue);
}
draw_info=CloneDrawInfo(resource_info->image_info,
(DrawInfo *) NULL);
- draw_info->fill.alpha=(MagickRealType) ClampToQuantum(
+ draw_info->fill.alpha=(double) ClampToQuantum(
StringToDouble(matte,(char **) NULL));
channel_mask=SetPixelChannelMask(*image,AlphaChannel);
(void) FloodfillPaintImage(*image,draw_info,&target,(ssize_t)
@@ -10440,7 +10440,7 @@
Cursor
cursor;
- MagickRealType
+ double
x_factor,
y_factor;
@@ -10468,8 +10468,8 @@
/*
Pan image as pointer moves until the mouse button is released.
*/
- x_factor=(MagickRealType) windows->image.ximage->width/windows->pan.width;
- y_factor=(MagickRealType) windows->image.ximage->height/windows->pan.height;
+ x_factor=(double) windows->image.ximage->width/windows->pan.width;
+ y_factor=(double) windows->image.ximage->height/windows->pan.height;
pan_info.width=windows->pan.width*windows->image.width/
windows->image.ximage->width;
pan_info.height=windows->pan.height*windows->image.height/
@@ -10644,7 +10644,7 @@
x,
y;
- MagickRealType
+ double
scale_factor;
RectangleInfo
@@ -10784,9 +10784,9 @@
if (windows->image.crop_geometry != (char *) NULL)
(void) XParseGeometry(windows->image.crop_geometry,&x,&y,
&width,&height);
- scale_factor=(MagickRealType) windows->image.ximage->width/width;
+ scale_factor=(double) windows->image.ximage->width/width;
paste_info.width=(unsigned int) (scale_factor*paste_image->columns+0.5);
- scale_factor=(MagickRealType) windows->image.ximage->height/height;
+ scale_factor=(double) windows->image.ximage->height/height;
paste_info.height=(unsigned int) (scale_factor*paste_image->rows+0.5);
(void) XCheckDefineCursor(display,windows->image.id,cursor);
paste_info.x=(ssize_t) windows->image.x+event.xbutton.x;
@@ -10919,11 +10919,11 @@
y=0;
if (windows->image.crop_geometry != (char *) NULL)
(void) XParseGeometry(windows->image.crop_geometry,&x,&y,&width,&height);
- scale_factor=(MagickRealType) width/windows->image.ximage->width;
+ scale_factor=(double) width/windows->image.ximage->width;
paste_info.x+=x;
paste_info.x=(ssize_t) (scale_factor*paste_info.x+0.5);
paste_info.width=(unsigned int) (scale_factor*paste_info.width+0.5);
- scale_factor=(MagickRealType) height/windows->image.ximage->height;
+ scale_factor=(double) height/windows->image.ximage->height;
paste_info.y+=y;
paste_info.y=(ssize_t) (scale_factor*paste_info.y*scale_factor+0.5);
paste_info.height=(unsigned int) (scale_factor*paste_info.height+0.5);
@@ -11294,7 +11294,7 @@
x,
y;
- MagickRealType
+ double
scale_factor;
MagickProgressMonitor
@@ -11638,11 +11638,11 @@
if (windows->image.crop_geometry != (char *) NULL)
(void) XParseGeometry(windows->image.crop_geometry,&x,&y,
&width,&height);
- scale_factor=(MagickRealType) width/windows->image.ximage->width;
+ scale_factor=(double) width/windows->image.ximage->width;
crop_info.x+=x;
crop_info.x=(ssize_t) (scale_factor*crop_info.x+0.5);
crop_info.width=(unsigned int) (scale_factor*crop_info.width+0.5);
- scale_factor=(MagickRealType)
+ scale_factor=(double)
height/windows->image.ximage->height;
crop_info.y+=y;
crop_info.y=(ssize_t) (scale_factor*crop_info.y+0.5);
@@ -12060,7 +12060,7 @@
x,
y;
- MagickRealType
+ double
normalized_degrees;
register int
@@ -12966,7 +12966,7 @@
x,
y;
- MagickRealType
+ double
scale_factor;
unsigned int
@@ -12997,13 +12997,13 @@
/*
Define the crop geometry string from the cropping rectangle.
*/
- scale_factor=(MagickRealType) width/windows->image.ximage->width;
+ scale_factor=(double) width/windows->image.ximage->width;
if (crop_info->x > 0)
x+=(int) (scale_factor*crop_info->x+0.5);
width=(unsigned int) (scale_factor*crop_info->width+0.5);
if (width == 0)
width=1;
- scale_factor=(MagickRealType) height/windows->image.ximage->height;
+ scale_factor=(double) height/windows->image.ximage->height;
if (crop_info->y > 0)
y+=(int) (scale_factor*crop_info->y+0.5);
height=(unsigned int) (scale_factor*crop_info->height+0.5);
@@ -13090,7 +13090,7 @@
x,
y;
- MagickRealType
+ double
scale_factor;
register char
@@ -13113,10 +13113,10 @@
height=(unsigned int) image->rows;
if (windows->image.crop_geometry != (char *) NULL)
(void) XParseGeometry(windows->image.crop_geometry,&x,&y,&width,&height);
- scale_factor=(MagickRealType) width/windows->image.ximage->width;
+ scale_factor=(double) width/windows->image.ximage->width;
event->xbutton.x+=windows->image.x;
event->xbutton.x=(int) (scale_factor*event->xbutton.x+x+0.5);
- scale_factor=(MagickRealType) height/windows->image.ximage->height;
+ scale_factor=(double) height/windows->image.ximage->height;
event->xbutton.y+=windows->image.y;
event->xbutton.y=(int) (scale_factor*event->xbutton.y+y+0.5);
/*
diff --git a/MagickCore/distort.c b/MagickCore/distort.c
index 190f2c5..fd81081 100644
--- a/MagickCore/distort.c
+++ b/MagickCore/distort.c
@@ -2804,7 +2804,7 @@
*distort_image,
*rotate_image;
- MagickRealType
+ double
angle;
PointInfo
diff --git a/MagickCore/draw.c b/MagickCore/draw.c
index 9aced5b..ab57ff2 100644
--- a/MagickCore/draw.c
+++ b/MagickCore/draw.c
@@ -96,7 +96,7 @@
SegmentInfo
bounds;
- MagickRealType
+ double
scanline;
PointInfo
@@ -117,7 +117,7 @@
typedef struct _ElementInfo
{
- MagickRealType
+ double
cx,
cy,
major,
@@ -168,7 +168,7 @@
static void
TraceArc(PrimitiveInfo *,const PointInfo,const PointInfo,const PointInfo),
TraceArcPath(PrimitiveInfo *,const PointInfo,const PointInfo,const PointInfo,
- const MagickRealType,const MagickBooleanType,const MagickBooleanType),
+ const double,const MagickBooleanType,const MagickBooleanType),
TraceBezier(PrimitiveInfo *,const size_t),
TraceCircle(PrimitiveInfo *,const PointInfo,const PointInfo),
TraceEllipse(PrimitiveInfo *,const PointInfo,const PointInfo,const PointInfo),
@@ -176,7 +176,7 @@
TraceRectangle(PrimitiveInfo *,const PointInfo,const PointInfo),
TraceRoundRectangle(PrimitiveInfo *,const PointInfo,const PointInfo,
PointInfo),
- TraceSquareLinecap(PrimitiveInfo *,const size_t,const MagickRealType);
+ TraceSquareLinecap(PrimitiveInfo *,const size_t,const double);
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -1264,7 +1264,7 @@
DrawInfo
*clone_info;
- MagickRealType
+ double
mid;
PointInfo
@@ -1488,7 +1488,7 @@
DrawInfo
*clone_info;
- MagickRealType
+ double
length,
maximum_length,
offset,
@@ -1504,7 +1504,7 @@
register ssize_t
i;
- register MagickRealType
+ register double
dx,
dy;
@@ -1703,7 +1703,7 @@
proceed,
status;
- MagickRealType
+ double
angle,
factor,
primitive_extent;
@@ -1761,7 +1761,7 @@
primitive=FileToString(draw_info->primitive+1,~0,exception);
if (primitive == (char *) NULL)
return(MagickFalse);
- primitive_extent=(MagickRealType) strlen(primitive);
+ primitive_extent=(double) strlen(primitive);
(void) SetImageArtifact(image,"MVG",primitive);
n=0;
/*
@@ -2017,7 +2017,7 @@
{
GetMagickToken(q,&q,token);
factor=strchr(token,'%') != (char *) NULL ? 0.01 : 1.0;
- graphic_context[n]->fill.alpha=(MagickRealType) QuantumRange*
+ graphic_context[n]->fill.alpha=(double) QuantumRange*
factor*StringToDouble(token,(char **) NULL);
break;
}
@@ -2624,7 +2624,7 @@
{
GetMagickToken(q,&q,token);
factor=strchr(token,'%') != (char *) NULL ? 0.01 : 1.0;
- graphic_context[n]->stroke.alpha=(MagickRealType) QuantumRange*
+ graphic_context[n]->stroke.alpha=(double) QuantumRange*
factor*StringToDouble(token,(char **) NULL);
break;
}
@@ -2871,7 +2871,7 @@
case ArcPrimitive:
case EllipsePrimitive:
{
- MagickRealType
+ double
alpha,
beta,
radius;
@@ -3152,7 +3152,7 @@
%
*/
-static inline MagickRealType GetStopColorOffset(const GradientInfo *gradient,
+static inline double GetStopColorOffset(const GradientInfo *gradient,
const ssize_t x,const ssize_t y)
{
switch (gradient->type)
@@ -3160,7 +3160,7 @@
case UndefinedGradient:
case LinearGradient:
{
- MagickRealType
+ double
gamma,
length,
offset,
@@ -3187,7 +3187,7 @@
}
case RadialGradient:
{
- MagickRealType
+ double
length,
offset;
@@ -3224,7 +3224,7 @@
PixelInfo
zero;
- MagickRealType
+ double
length;
PointInfo
@@ -3269,7 +3269,7 @@
composite,
pixel;
- MagickRealType
+ double
alpha,
offset;
@@ -3369,7 +3369,7 @@
MagickBooleanType
antialias;
- MagickRealType
+ double
repeat;
antialias=MagickFalse;
@@ -3608,12 +3608,12 @@
return(polygon_info);
}
-static MagickRealType GetFillAlpha(PolygonInfo *polygon_info,
- const MagickRealType mid,const MagickBooleanType fill,
+static double GetFillAlpha(PolygonInfo *polygon_info,
+ const double mid,const MagickBooleanType fill,
const FillRule fill_rule,const double x,const double y,
- MagickRealType *stroke_alpha)
+ double *stroke_alpha)
{
- MagickRealType
+ double
alpha,
beta,
distance,
@@ -3790,7 +3790,7 @@
fill,
status;
- MagickRealType
+ double
mid;
PolygonInfo
@@ -3944,7 +3944,7 @@
const int
id = GetOpenMPThreadId();
- MagickRealType
+ double
fill_alpha,
stroke_alpha;
@@ -3987,11 +3987,11 @@
}
(void) GetFillColor(draw_info,x,y,&fill_color,exception);
fill_alpha=fill_alpha*fill_color.alpha;
- CompositePixelOver(image,&fill_color,fill_alpha,q,(MagickRealType)
+ CompositePixelOver(image,&fill_color,fill_alpha,q,(double)
GetPixelAlpha(image,q),q);
(void) GetStrokeColor(draw_info,x,y,&stroke_color,exception);
stroke_alpha=stroke_alpha*stroke_color.alpha;
- CompositePixelOver(image,&stroke_color,stroke_alpha,q,(MagickRealType)
+ CompositePixelOver(image,&stroke_color,stroke_alpha,q,(double)
GetPixelAlpha(image,q),q);
q+=GetPixelChannels(image);
}
@@ -4189,8 +4189,8 @@
if (q == (Quantum *) NULL)
break;
(void) GetFillColor(draw_info,x,y,&fill_color,exception);
- CompositePixelOver(image,&fill_color,(MagickRealType) fill_color.alpha,q,
- (MagickRealType) GetPixelAlpha(image,q),q);
+ CompositePixelOver(image,&fill_color,(double) fill_color.alpha,q,
+ (double) GetPixelAlpha(image,q),q);
(void) SyncCacheViewAuthenticPixels(image_view,exception);
break;
}
@@ -4264,9 +4264,9 @@
&target,exception);
if (primitive_info->method == FillToBorderMethod)
{
- target.red=(MagickRealType) draw_info->border_color.red;
- target.green=(MagickRealType) draw_info->border_color.green;
- target.blue=(MagickRealType) draw_info->border_color.blue;
+ target.red=(double) draw_info->border_color.red;
+ target.green=(double) draw_info->border_color.green;
+ target.blue=(double) draw_info->border_color.blue;
}
(void) FloodfillPaintImage(image,draw_info,&target,x,y,
primitive_info->method == FloodfillMethod ? MagickFalse :
@@ -4386,9 +4386,9 @@
&target,exception);
if (primitive_info->method == FillToBorderMethod)
{
- target.red=(MagickRealType) draw_info->border_color.red;
- target.green=(MagickRealType) draw_info->border_color.green;
- target.blue=(MagickRealType) draw_info->border_color.blue;
+ target.red=(double) draw_info->border_color.red;
+ target.green=(double) draw_info->border_color.green;
+ target.blue=(double) draw_info->border_color.blue;
}
channel_mask=SetPixelChannelMask(image,AlphaChannel);
(void) FloodfillPaintImage(image,draw_info,&target,x,y,
@@ -4533,7 +4533,7 @@
}
default:
{
- MagickRealType
+ double
mid,
scale;
@@ -4878,9 +4878,9 @@
%
%
*/
-static inline MagickRealType Permutate(const ssize_t n,const ssize_t k)
+static inline double Permutate(const ssize_t n,const ssize_t k)
{
- MagickRealType
+ double
r;
register ssize_t
@@ -4925,10 +4925,10 @@
}
static void TraceArcPath(PrimitiveInfo *primitive_info,const PointInfo start,
- const PointInfo end,const PointInfo arc,const MagickRealType angle,
+ const PointInfo end,const PointInfo arc,const double angle,
const MagickBooleanType large_arc,const MagickBooleanType sweep)
{
- MagickRealType
+ double
alpha,
beta,
delta,
@@ -4941,7 +4941,7 @@
points[3],
radii;
- register MagickRealType
+ register double
cosine,
sine;
@@ -5002,10 +5002,10 @@
alpha=atan2(points[0].y-center.y,points[0].x-center.x);
theta=atan2(points[1].y-center.y,points[1].x-center.x)-alpha;
if ((theta < 0.0) && (sweep != MagickFalse))
- theta+=(MagickRealType) (2.0*MagickPI);
+ theta+=(double) (2.0*MagickPI);
else
if ((theta > 0.0) && (sweep == MagickFalse))
- theta-=(MagickRealType) (2.0*MagickPI);
+ theta-=(double) (2.0*MagickPI);
arc_segments=(size_t) ceil(fabs((double) (theta/(0.5*MagickPI+
MagickEpsilon))));
p=primitive_info;
@@ -5059,7 +5059,7 @@
static void TraceBezier(PrimitiveInfo *primitive_info,
const size_t number_coordinates)
{
- MagickRealType
+ double
alpha,
*coefficients,
weight;
@@ -5089,21 +5089,21 @@
for (j=i+1; j < (ssize_t) number_coordinates; j++)
{
alpha=fabs(primitive_info[j].point.x-primitive_info[i].point.x);
- if (alpha > (MagickRealType) quantum)
+ if (alpha > (double) quantum)
quantum=(size_t) alpha;
alpha=fabs(primitive_info[j].point.y-primitive_info[i].point.y);
- if (alpha > (MagickRealType) quantum)
+ if (alpha > (double) quantum)
quantum=(size_t) alpha;
}
}
quantum=(size_t) MagickMin((double) quantum/number_coordinates,
(double) BezierQuantum);
control_points=quantum*number_coordinates;
- coefficients=(MagickRealType *) AcquireQuantumMemory((size_t)
+ coefficients=(double *) AcquireQuantumMemory((size_t)
number_coordinates,sizeof(*coefficients));
points=(PointInfo *) AcquireQuantumMemory((size_t) control_points,
sizeof(*points));
- if ((coefficients == (MagickRealType *) NULL) ||
+ if ((coefficients == (double *) NULL) ||
(points == (PointInfo *) NULL))
ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
/*
@@ -5147,13 +5147,13 @@
p--;
}
points=(PointInfo *) RelinquishMagickMemory(points);
- coefficients=(MagickRealType *) RelinquishMagickMemory(coefficients);
+ coefficients=(double *) RelinquishMagickMemory(coefficients);
}
static void TraceCircle(PrimitiveInfo *primitive_info,const PointInfo start,
const PointInfo end)
{
- MagickRealType
+ double
alpha,
beta,
radius;
@@ -5175,7 +5175,7 @@
static void TraceEllipse(PrimitiveInfo *primitive_info,const PointInfo start,
const PointInfo stop,const PointInfo degrees)
{
- MagickRealType
+ double
delta,
step,
y;
@@ -5199,9 +5199,9 @@
return;
}
delta=2.0/MagickMax(stop.x,stop.y);
- step=(MagickRealType) (MagickPI/8.0);
- if ((delta >= 0.0) && (delta < (MagickRealType) (MagickPI/8.0)))
- step=(MagickRealType) (MagickPI/(4*(MagickPI/delta/2+0.5)));
+ step=(double) (MagickPI/8.0);
+ if ((delta >= 0.0) && (delta < (double) (MagickPI/8.0)))
+ step=(double) (MagickPI/(4*(MagickPI/delta/2+0.5)));
angle.x=DegreesToRadians(degrees.x);
y=degrees.y;
while (y < degrees.x)
@@ -5254,7 +5254,7 @@
attribute,
last_attribute;
- MagickRealType
+ double
x,
y;
@@ -5303,7 +5303,7 @@
large_arc,
sweep;
- MagickRealType
+ double
angle;
PointInfo
@@ -5706,12 +5706,12 @@
}
static void TraceSquareLinecap(PrimitiveInfo *primitive_info,
- const size_t number_vertices,const MagickRealType offset)
+ const size_t number_vertices,const double offset)
{
- MagickRealType
+ double
distance;
- register MagickRealType
+ register double
dx,
dy;
@@ -5753,14 +5753,14 @@
dy*(distance+offset)/distance);
}
-static inline MagickRealType DrawEpsilonReciprocal(const MagickRealType x)
+static inline double DrawEpsilonReciprocal(const double x)
{
-#define DrawEpsilon ((MagickRealType) 1.0e-10)
+#define DrawEpsilon ((double) 1.0e-10)
- MagickRealType sign = x < (MagickRealType) 0.0 ? (MagickRealType) -1.0 :
- (MagickRealType) 1.0;
- return((sign*x) >= DrawEpsilon ? (MagickRealType) 1.0/x : sign*(
- (MagickRealType) 1.0/DrawEpsilon));
+ double sign = x < (double) 0.0 ? (double) -1.0 :
+ (double) 1.0;
+ return((sign*x) >= DrawEpsilon ? (double) 1.0/x : sign*(
+ (double) 1.0/DrawEpsilon));
}
static PrimitiveInfo *TraceStrokePolygon(const DrawInfo *draw_info,
@@ -5783,7 +5783,7 @@
MagickBooleanType
closed_path;
- MagickRealType
+ double
delta_theta,
dot_product,
mid,
@@ -5859,7 +5859,7 @@
slope.p=DrawEpsilonReciprocal(dx.p)*dy.p;
inverse_slope.p=(-1.0*DrawEpsilonReciprocal(slope.p));
mid=ExpandAffine(&draw_info->affine)*draw_info->stroke_width/2.0;
- miterlimit=(MagickRealType) (draw_info->miterlimit*draw_info->miterlimit*
+ miterlimit=(double) (draw_info->miterlimit*draw_info->miterlimit*
mid*mid);
if ((draw_info->linecap == SquareCap) && (closed_path == MagickFalse))
TraceSquareLinecap(polygon_primitive,number_vertices,mid);
@@ -6011,7 +6011,7 @@
theta.p=atan2(box_q[1].y-center.y,box_q[1].x-center.x);
theta.q=atan2(box_q[2].y-center.y,box_q[2].x-center.x);
if (theta.q < theta.p)
- theta.q+=(MagickRealType) (2.0*MagickPI);
+ theta.q+=(double) (2.0*MagickPI);
arc_segments=(size_t) ceil((double) ((theta.q-theta.p)/
(2.0*sqrt((double) (1.0/mid)))));
path_q[q].x=box_q[1].x;
@@ -6019,7 +6019,7 @@
q++;
for (j=1; j < (ssize_t) arc_segments; j++)
{
- delta_theta=(MagickRealType) (j*(theta.q-theta.p)/arc_segments);
+ delta_theta=(double) (j*(theta.q-theta.p)/arc_segments);
path_q[q].x=(double) (center.x+mid*cos(fmod((double)
(theta.p+delta_theta),DegreesToRadians(360.0))));
path_q[q].y=(double) (center.y+mid*sin(fmod((double)
@@ -6083,13 +6083,13 @@
theta.p=atan2(box_p[1].y-center.y,box_p[1].x-center.x);
theta.q=atan2(box_p[2].y-center.y,box_p[2].x-center.x);
if (theta.p < theta.q)
- theta.p+=(MagickRealType) (2.0*MagickPI);
+ theta.p+=(double) (2.0*MagickPI);
arc_segments=(size_t) ceil((double) ((theta.p-theta.q)/
(2.0*sqrt((double) (1.0/mid)))));
path_p[p++]=box_p[1];
for (j=1; j < (ssize_t) arc_segments; j++)
{
- delta_theta=(MagickRealType) (j*(theta.q-theta.p)/arc_segments);
+ delta_theta=(double) (j*(theta.q-theta.p)/arc_segments);
path_p[p].x=(double) (center.x+mid*cos(fmod((double)
(theta.p+delta_theta),DegreesToRadians(360.0))));
path_p[p].y=(double) (center.y+mid*sin(fmod((double)
diff --git a/MagickCore/effect.c b/MagickCore/effect.c
index 9439772..24f64cf 100644
--- a/MagickCore/effect.c
+++ b/MagickCore/effect.c
@@ -354,7 +354,7 @@
}
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
- MagickRealType
+ double
alpha,
gamma,
pixel;
@@ -419,7 +419,7 @@
{
for (u=0; u < (ssize_t) (width-j); u++)
{
- alpha=(MagickRealType) (QuantumScale*GetPixelAlpha(image,pixels));
+ alpha=(double) (QuantumScale*GetPixelAlpha(image,pixels));
pixel+=(*k)*alpha*pixels[i];
gamma+=(*k)*alpha;
k++;
@@ -681,7 +681,7 @@
}
for (i=0; i < (ssize_t) GetPixelChannels(sharp_image); i++)
{
- MagickRealType
+ double
alpha,
gamma,
pixel;
@@ -746,7 +746,7 @@
{
for (u=0; u < (ssize_t) (width-j); u++)
{
- alpha=(MagickRealType) (QuantumScale*GetPixelAlpha(image,pixels));
+ alpha=(double) (QuantumScale*GetPixelAlpha(image,pixels));
pixel+=(*k)*alpha*pixels[i];
gamma+=(*k)*alpha;
k++;
@@ -990,7 +990,7 @@
}
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
- MagickRealType
+ double
alpha,
gamma,
pixel;
@@ -1045,7 +1045,7 @@
gamma=0.0;
for (u=0; u < (ssize_t) width; u++)
{
- alpha=(MagickRealType) (QuantumScale*GetPixelAlpha(image,pixels));
+ alpha=(double) (QuantumScale*GetPixelAlpha(image,pixels));
pixel+=(*k)*alpha*pixels[i];
gamma+=(*k)*alpha;
k++;
@@ -1119,7 +1119,7 @@
}
for (i=0; i < (ssize_t) GetPixelChannels(blur_image); i++)
{
- MagickRealType
+ double
alpha,
gamma,
pixel;
@@ -1174,7 +1174,7 @@
gamma=0.0;
for (u=0; u < (ssize_t) width; u++)
{
- alpha=(MagickRealType) (QuantumScale*GetPixelAlpha(blur_image,
+ alpha=(double) (QuantumScale*GetPixelAlpha(blur_image,
pixels));
pixel+=(*k)*alpha*pixels[i];
gamma+=(*k)*alpha;
@@ -1993,7 +1993,7 @@
}
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
- MagickRealType
+ double
alpha,
gamma,
pixel;
@@ -2055,7 +2055,7 @@
status=MagickFalse;
continue;
}
- alpha=(MagickRealType) (QuantumScale*GetPixelAlpha(image,r));
+ alpha=(double) (QuantumScale*GetPixelAlpha(image,r));
pixel+=(*k)*alpha*r[i];
gamma+=(*k)*alpha;
k++;
@@ -2414,10 +2414,10 @@
preview_image=CloneImage(thumbnail,0,0,MagickTrue,exception);
if (preview_image == (Image *) NULL)
break;
- (void) BilevelImage(thumbnail,(double) (percentage*((MagickRealType)
+ (void) BilevelImage(thumbnail,(double) (percentage*((double)
QuantumRange+1.0))/100.0,exception);
(void) FormatLocaleString(label,MaxTextExtent,"threshold %g",
- (double) (percentage*((MagickRealType) QuantumRange+1.0))/100.0);
+ (double) (percentage*((double) QuantumRange+1.0))/100.0);
break;
}
case EdgeDetectPreview:
@@ -2671,7 +2671,7 @@
MagickOffsetType
progress;
- MagickRealType
+ double
blur_radius,
*cos_theta,
offset,
@@ -2711,18 +2711,18 @@
blur_center.y=(double) image->rows/2.0;
blur_radius=hypot(blur_center.x,blur_center.y);
n=(size_t) fabs(4.0*DegreesToRadians(angle)*sqrt((double) blur_radius)+2UL);
- theta=DegreesToRadians(angle)/(MagickRealType) (n-1);
- cos_theta=(MagickRealType *) AcquireQuantumMemory((size_t) n,
+ theta=DegreesToRadians(angle)/(double) (n-1);
+ cos_theta=(double *) AcquireQuantumMemory((size_t) n,
sizeof(*cos_theta));
- sin_theta=(MagickRealType *) AcquireQuantumMemory((size_t) n,
+ sin_theta=(double *) AcquireQuantumMemory((size_t) n,
sizeof(*sin_theta));
- if ((cos_theta == (MagickRealType *) NULL) ||
- (sin_theta == (MagickRealType *) NULL))
+ if ((cos_theta == (double *) NULL) ||
+ (sin_theta == (double *) NULL))
{
blur_image=DestroyImage(blur_image);
ThrowImageException(ResourceLimitError,"MemoryAllocationFailed");
}
- offset=theta*(MagickRealType) (n-1)/2.0;
+ offset=theta*(double) (n-1)/2.0;
for (i=0; i < (ssize_t) n; i++)
{
cos_theta[i]=cos((double) (theta*i-offset));
@@ -2763,7 +2763,7 @@
}
for (x=0; x < (ssize_t) image->columns; x++)
{
- MagickRealType
+ double
radius;
PointInfo
@@ -2797,7 +2797,7 @@
}
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
- MagickRealType
+ double
gamma,
pixel;
@@ -2885,8 +2885,8 @@
blur_view=DestroyCacheView(blur_view);
radial_view=DestroyCacheView(radial_view);
image_view=DestroyCacheView(image_view);
- cos_theta=(MagickRealType *) RelinquishMagickMemory(cos_theta);
- sin_theta=(MagickRealType *) RelinquishMagickMemory(sin_theta);
+ cos_theta=(double *) RelinquishMagickMemory(cos_theta);
+ sin_theta=(double *) RelinquishMagickMemory(sin_theta);
if (status == MagickFalse)
blur_image=DestroyImage(blur_image);
return(blur_image);
@@ -3076,7 +3076,7 @@
}
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
- MagickRealType
+ double
alpha,
gamma,
intensity,
@@ -3115,7 +3115,7 @@
k=kernel;
pixel=0.0;
pixels=p;
- intensity=(MagickRealType) GetPixelIntensity(image,p+center);
+ intensity=(double) GetPixelIntensity(image,p+center);
gamma=0.0;
if ((blur_traits & BlendPixelTrait) == 0)
{
@@ -3150,7 +3150,7 @@
contrast=GetPixelIntensity(image,pixels)-intensity;
if (fabs(contrast) < threshold)
{
- alpha=(MagickRealType) (QuantumScale*
+ alpha=(double) (QuantumScale*
GetPixelAlpha(image,pixels));
pixel+=(*k)*alpha*pixels[i];
gamma+=(*k)*alpha;
@@ -3291,7 +3291,7 @@
#endif
for (y=0; y < (ssize_t) image->rows; y++)
{
- MagickRealType
+ double
distance,
normal_distance,
shade;
@@ -3731,7 +3731,7 @@
MagickOffsetType
progress;
- MagickRealType
+ double
quantum_threshold;
ssize_t
@@ -3745,7 +3745,7 @@
unsharp_image=BlurImage(image,radius,sigma,exception);
if (unsharp_image == (Image *) NULL)
return((Image *) NULL);
- quantum_threshold=(MagickRealType) QuantumRange*threshold;
+ quantum_threshold=(double) QuantumRange*threshold;
/*
Unsharp-mask image.
*/
@@ -3791,7 +3791,7 @@
}
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
- MagickRealType
+ double
pixel;
PixelChannel
@@ -3812,11 +3812,11 @@
SetPixelChannel(unsharp_image,channel,p[i],q);
continue;
}
- pixel=p[i]-(MagickRealType) GetPixelChannel(unsharp_image,channel,q);
+ pixel=p[i]-(double) GetPixelChannel(unsharp_image,channel,q);
if (fabs(2.0*pixel) < quantum_threshold)
- pixel=(MagickRealType) p[i];
+ pixel=(double) p[i];
else
- pixel=(MagickRealType) p[i]+amount*pixel;
+ pixel=(double) p[i]+amount*pixel;
SetPixelChannel(unsharp_image,channel,ClampToQuantum(pixel),q);
}
p+=GetPixelChannels(image);
diff --git a/MagickCore/enhance.c b/MagickCore/enhance.c
index d59bdd1..f07635c 100644
--- a/MagickCore/enhance.c
+++ b/MagickCore/enhance.c
@@ -711,13 +711,13 @@
#endif
for (i=0; i <= (ssize_t) MaxMap; i++)
{
- cdl_map[i].red=(MagickRealType) ScaleMapToQuantum((MagickRealType)
+ cdl_map[i].red=(double) ScaleMapToQuantum((double)
(MaxMap*(pow(color_correction.red.slope*i/MaxMap+
color_correction.red.offset,color_correction.red.power))));
- cdl_map[i].green=(MagickRealType) ScaleMapToQuantum((MagickRealType)
+ cdl_map[i].green=(double) ScaleMapToQuantum((double)
(MaxMap*(pow(color_correction.green.slope*i/MaxMap+
color_correction.green.offset,color_correction.green.power))));
- cdl_map[i].blue=(MagickRealType) ScaleMapToQuantum((MagickRealType)
+ cdl_map[i].blue=(double) ScaleMapToQuantum((double)
(MaxMap*(pow(color_correction.blue.slope*i/MaxMap+
color_correction.blue.offset,color_correction.blue.power))));
}
@@ -1005,7 +1005,7 @@
MagickExport MagickBooleanType ContrastStretchImage(Image *image,
const double black_point,const double white_point,ExceptionInfo *exception)
{
-#define MaxRange(color) ((MagickRealType) ScaleQuantumToMap((Quantum) (color)))
+#define MaxRange(color) ((double) ScaleQuantumToMap((Quantum) (color)))
#define ContrastStretchImageTag "ContrastStretch/Image"
CacheView
@@ -1126,7 +1126,7 @@
if (intensity > black_point)
break;
}
- black[i]=(MagickRealType) j;
+ black[i]=(double) j;
intensity=0.0;
for (j=(ssize_t) MaxMap; j != 0; j--)
{
@@ -1134,7 +1134,7 @@
if (intensity > ((double) image->columns*image->rows-white_point))
break;
}
- white[i]=(MagickRealType) j;
+ white[i]=(double) j;
}
histogram=(double *) RelinquishMagickMemory(histogram);
/*
@@ -1158,12 +1158,12 @@
stretch_map[GetPixelChannels(image)*j+i]=0.0;
else
if (j > (ssize_t) white[i])
- stretch_map[GetPixelChannels(image)*j+i]=(MagickRealType)
+ stretch_map[GetPixelChannels(image)*j+i]=(double)
QuantumRange;
else
if (black[i] != white[i])
- stretch_map[GetPixelChannels(image)*j+i]=(MagickRealType)
- ScaleMapToQuantum((MagickRealType) (MaxMap*(j-black[i])/
+ stretch_map[GetPixelChannels(image)*j+i]=(double)
+ ScaleMapToQuantum((double) (MaxMap*(j-black[i])/
(white[i]-black[i])));
}
}
@@ -1315,12 +1315,12 @@
MagickExport Image *EnhanceImage(const Image *image,ExceptionInfo *exception)
{
#define EnhancePixel(weight) \
- mean=((MagickRealType) r[i]+GetPixelChannel(enhance_image,channel,q))/2.0; \
- distance=(MagickRealType) r[i]-(MagickRealType) GetPixelChannel( \
+ mean=((double) r[i]+GetPixelChannel(enhance_image,channel,q))/2.0; \
+ distance=(double) r[i]-(double) GetPixelChannel( \
enhance_image,channel,q); \
- distance_squared=QuantumScale*(2.0*((MagickRealType) QuantumRange+1.0)+ \
+ distance_squared=QuantumScale*(2.0*((double) QuantumRange+1.0)+ \
mean)*distance*distance; \
- if (distance_squared < ((MagickRealType) QuantumRange*(MagickRealType) \
+ if (distance_squared < ((double) QuantumRange*(double) \
QuantumRange/25.0f)) \
{ \
aggregate+=(weight)*r[i]; \
@@ -1412,7 +1412,7 @@
}
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
- MagickRealType
+ double
aggregate,
distance,
distance_squared,
@@ -1522,7 +1522,7 @@
MagickOffsetType
progress;
- MagickRealType
+ double
black[CompositePixelChannel],
*equalize_map,
*histogram,
@@ -1545,22 +1545,22 @@
assert(image->signature == MagickSignature);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
- equalize_map=(MagickRealType *) AcquireQuantumMemory(MaxMap+1UL,
+ equalize_map=(double *) AcquireQuantumMemory(MaxMap+1UL,
GetPixelChannels(image)*sizeof(*equalize_map));
- histogram=(MagickRealType *) AcquireQuantumMemory(MaxMap+1UL,
+ histogram=(double *) AcquireQuantumMemory(MaxMap+1UL,
GetPixelChannels(image)*sizeof(*histogram));
- map=(MagickRealType *) AcquireQuantumMemory(MaxMap+1UL,
+ map=(double *) AcquireQuantumMemory(MaxMap+1UL,
GetPixelChannels(image)*sizeof(*map));
- if ((equalize_map == (MagickRealType *) NULL) ||
- (histogram == (MagickRealType *) NULL) ||
- (map == (MagickRealType *) NULL))
+ if ((equalize_map == (double *) NULL) ||
+ (histogram == (double *) NULL) ||
+ (map == (double *) NULL))
{
- if (map != (MagickRealType *) NULL)
- map=(MagickRealType *) RelinquishMagickMemory(map);
- if (histogram != (MagickRealType *) NULL)
- histogram=(MagickRealType *) RelinquishMagickMemory(histogram);
- if (equalize_map != (MagickRealType *) NULL)
- equalize_map=(MagickRealType *) RelinquishMagickMemory(equalize_map);
+ if (map != (double *) NULL)
+ map=(double *) RelinquishMagickMemory(map);
+ if (histogram != (double *) NULL)
+ histogram=(double *) RelinquishMagickMemory(histogram);
+ if (equalize_map != (double *) NULL)
+ equalize_map=(double *) RelinquishMagickMemory(equalize_map);
ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
image->filename);
}
@@ -1608,7 +1608,7 @@
#endif
for (i=0; i < (ssize_t) number_channels; i++)
{
- MagickRealType
+ double
intensity;
register ssize_t
@@ -1637,12 +1637,12 @@
white[i]=map[GetPixelChannels(image)*MaxMap+i];
if (black[i] != white[i])
for (j=0; j <= (ssize_t) MaxMap; j++)
- equalize_map[GetPixelChannels(image)*j+i]=(MagickRealType)
- ScaleMapToQuantum((MagickRealType) ((MaxMap*(map[
+ equalize_map[GetPixelChannels(image)*j+i]=(double)
+ ScaleMapToQuantum((double) ((MaxMap*(map[
GetPixelChannels(image)*j+i]-black[i]))/(white[i]-black[i])));
}
- histogram=(MagickRealType *) RelinquishMagickMemory(histogram);
- map=(MagickRealType *) RelinquishMagickMemory(map);
+ histogram=(double *) RelinquishMagickMemory(histogram);
+ map=(double *) RelinquishMagickMemory(map);
if (image->storage_class == PseudoClass)
{
PixelChannel
@@ -1762,7 +1762,7 @@
}
}
image_view=DestroyCacheView(image_view);
- equalize_map=(MagickRealType *) RelinquishMagickMemory(equalize_map);
+ equalize_map=(double *) RelinquishMagickMemory(equalize_map);
return(status);
}
@@ -1843,7 +1843,7 @@
dynamic_number_threads(image,image->columns,1,1)
#endif
for (i=0; i <= (ssize_t) MaxMap; i++)
- gamma_map[i]=ScaleMapToQuantum((MagickRealType) (MaxMap*pow((double) i/
+ gamma_map[i]=ScaleMapToQuantum((double) (MaxMap*pow((double) i/
MaxMap,1.0/gamma)));
if (image->storage_class == PseudoClass)
{
@@ -1857,16 +1857,16 @@
for (i=0; i < (ssize_t) image->colors; i++)
{
if ((GetPixelRedTraits(image) & UpdatePixelTrait) != 0)
- image->colormap[i].red=(MagickRealType) gamma_map[
+ image->colormap[i].red=(double) gamma_map[
ScaleQuantumToMap(ClampToQuantum(image->colormap[i].red))];
if ((GetPixelGreenTraits(image) & UpdatePixelTrait) != 0)
- image->colormap[i].green=(MagickRealType) gamma_map[
+ image->colormap[i].green=(double) gamma_map[
ScaleQuantumToMap(ClampToQuantum(image->colormap[i].green))];
if ((GetPixelBlueTraits(image) & UpdatePixelTrait) != 0)
- image->colormap[i].blue=(MagickRealType) gamma_map[
+ image->colormap[i].blue=(double) gamma_map[
ScaleQuantumToMap(ClampToQuantum(image->colormap[i].blue))];
if ((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0)
- image->colormap[i].alpha=(MagickRealType) gamma_map[
+ image->colormap[i].alpha=(double) gamma_map[
ScaleQuantumToMap(ClampToQuantum(image->colormap[i].alpha))];
}
}
@@ -1991,7 +1991,7 @@
typedef struct _HaldInfo
{
- MagickRealType
+ double
x,
y,
z;
@@ -2186,15 +2186,15 @@
%
*/
-static inline MagickRealType LevelPixel(const double black_point,
- const double white_point,const double gamma,const MagickRealType pixel)
+static inline double LevelPixel(const double black_point,
+ const double white_point,const double gamma,const double pixel)
{
double
level_pixel,
scale;
scale=(white_point != black_point) ? 1.0/(white_point-black_point) : 1.0;
- level_pixel=(MagickRealType) QuantumRange*pow(scale*((double) pixel-
+ level_pixel=(double) QuantumRange*pow(scale*((double) pixel-
black_point),1.0/gamma);
return(level_pixel);
}
@@ -2298,7 +2298,7 @@
if ((traits & UpdatePixelTrait) == 0)
continue;
q[i]=ClampToQuantum(LevelPixel(black_point,white_point,gamma,
- (MagickRealType) q[i]));
+ (double) q[i]));
}
q+=GetPixelChannels(image);
}
@@ -2673,7 +2673,7 @@
MagickBooleanType
status;
- MagickRealType
+ double
*histogram,
intensity;
@@ -2687,9 +2687,9 @@
*/
assert(image != (Image *) NULL);
assert(image->signature == MagickSignature);
- histogram=(MagickRealType *) AcquireQuantumMemory(MaxMap+1UL,
+ histogram=(double *) AcquireQuantumMemory(MaxMap+1UL,
sizeof(*histogram));
- if (histogram == (MagickRealType *) NULL)
+ if (histogram == (double *) NULL)
ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
image->filename);
/*
@@ -2732,7 +2732,7 @@
if (intensity >= white_point)
break;
}
- histogram=(MagickRealType *) RelinquishMagickMemory(histogram);
+ histogram=(double *) RelinquishMagickMemory(histogram);
status=LevelImage(image,(double) black,(double) white,1.0,exception);
return(status);
}
@@ -3349,7 +3349,7 @@
MagickOffsetType
progress;
- MagickRealType
+ double
*sigmoidal_map;
register ssize_t
@@ -3365,9 +3365,9 @@
assert(image->signature == MagickSignature);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
- sigmoidal_map=(MagickRealType *) AcquireQuantumMemory(MaxMap+1UL,
+ sigmoidal_map=(double *) AcquireQuantumMemory(MaxMap+1UL,
sizeof(*sigmoidal_map));
- if (sigmoidal_map == (MagickRealType *) NULL)
+ if (sigmoidal_map == (double *) NULL)
ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
image->filename);
(void) ResetMagickMemory(sigmoidal_map,0,(MaxMap+1)*sizeof(*sigmoidal_map));
@@ -3395,16 +3395,16 @@
if (contrast<4.0*MagickEpsilon)
for (i=0; i <= (ssize_t) MaxMap; i++)
sigmoidal_map[i]=
- (MagickRealType) ScaleMapToQuantum((MagickRealType) i);
+ (double) ScaleMapToQuantum((double) i);
else if (sharpen != MagickFalse)
for (i=0; i <= (ssize_t) MaxMap; i++)
sigmoidal_map[i]=
- (MagickRealType) ScaleMapToQuantum( (MagickRealType) (MaxMap*
+ (double) ScaleMapToQuantum( (double) (MaxMap*
SCALED_SIGMOIDAL(contrast,QuantumScale*midpoint,(double) i/MaxMap)));
else
for (i=0; i <= (ssize_t) MaxMap; i++)
sigmoidal_map[i]=
- (MagickRealType) ScaleMapToQuantum( (MagickRealType) (MaxMap*
+ (double) ScaleMapToQuantum( (double) (MaxMap*
INVERSE_SCALED_SIGMOIDAL(contrast,QuantumScale*midpoint,
(double) i/MaxMap)));
if (image->storage_class == PseudoClass)
@@ -3501,6 +3501,6 @@
}
}
image_view=DestroyCacheView(image_view);
- sigmoidal_map=(MagickRealType *) RelinquishMagickMemory(sigmoidal_map);
+ sigmoidal_map=(double *) RelinquishMagickMemory(sigmoidal_map);
return(status);
}
diff --git a/MagickCore/fx-private.h b/MagickCore/fx-private.h
index 74c916d..38d4e8a 100644
--- a/MagickCore/fx-private.h
+++ b/MagickCore/fx-private.h
@@ -30,9 +30,9 @@
*DestroyFxInfo(FxInfo *);
extern MagickPrivate MagickBooleanType
- FxEvaluateExpression(FxInfo *,MagickRealType *,ExceptionInfo *),
+ FxEvaluateExpression(FxInfo *,double *,ExceptionInfo *),
FxEvaluateChannelExpression(FxInfo *,const PixelChannel,const ssize_t,
- const ssize_t,MagickRealType *,ExceptionInfo *);
+ const ssize_t,double *,ExceptionInfo *);
#if defined(__cplusplus) || defined(c_plusplus)
}
diff --git a/MagickCore/fx.c b/MagickCore/fx.c
index 63a5edc..24fd9c7 100644
--- a/MagickCore/fx.c
+++ b/MagickCore/fx.c
@@ -992,7 +992,7 @@
height=color_matrix->height > 6 ? 6UL : color_matrix->height;
for (v=0; v < (ssize_t) height; v++)
{
- MagickRealType
+ double
sum;
sum=ColorMatrix[v][0]*GetPixelRed(image,p)+ColorMatrix[v][1]*
@@ -1094,11 +1094,11 @@
%
% The format of the FxEvaluateExpression method is:
%
-% MagickRealType FxEvaluateChannelExpression(FxInfo *fx_info,
+% double FxEvaluateChannelExpression(FxInfo *fx_info,
% const PixelChannel channel,const ssize_t x,const ssize_t y,
-% MagickRealType *alpha,Exceptioninfo *exception)
-% MagickRealType FxEvaluateExpression(FxInfo *fx_info,
-% MagickRealType *alpha,Exceptioninfo *exception)
+% double *alpha,Exceptioninfo *exception)
+% double FxEvaluateExpression(FxInfo *fx_info,
+% double *alpha,Exceptioninfo *exception)
%
% A description of each parameter follows:
%
@@ -1128,7 +1128,7 @@
return(y);
}
-static MagickRealType FxChannelStatistics(FxInfo *fx_info,Image *image,
+static double FxChannelStatistics(FxInfo *fx_info,Image *image,
PixelChannel channel,const char *symbol,ExceptionInfo *exception)
{
ChannelType
@@ -1239,9 +1239,9 @@
return(QuantumScale*StringToDouble(statistic,(char **) NULL));
}
-static MagickRealType
+static double
FxEvaluateSubexpression(FxInfo *,const PixelChannel,const ssize_t,
- const ssize_t,const char *,MagickRealType *,ExceptionInfo *);
+ const ssize_t,const char *,double *,ExceptionInfo *);
static MagickOffsetType FxGCD(MagickOffsetType alpha,MagickOffsetType beta)
{
@@ -1277,7 +1277,7 @@
return(subexpression);
}
-static MagickRealType FxGetSymbol(FxInfo *fx_info,const PixelChannel channel,
+static double FxGetSymbol(FxInfo *fx_info,const PixelChannel channel,
const ssize_t x,const ssize_t y,const char *expression,
ExceptionInfo *exception)
{
@@ -1296,7 +1296,7 @@
PixelInfo
pixel;
- MagickRealType
+ double
alpha,
beta;
@@ -1496,12 +1496,12 @@
}
case AlphaPixelChannel:
{
- MagickRealType
+ double
alpha;
if (pixel.matte == MagickFalse)
return(1.0);
- alpha=(MagickRealType) (QuantumScale*pixel.alpha);
+ alpha=(double) (QuantumScale*pixel.alpha);
return(alpha);
}
case IndexPixelChannel:
@@ -1523,7 +1523,7 @@
case 'a':
{
if (LocaleCompare(symbol,"a") == 0)
- return((MagickRealType) (QuantumScale*pixel.alpha));
+ return((double) (QuantumScale*pixel.alpha));
break;
}
case 'B':
@@ -1658,7 +1658,7 @@
case 'h':
{
if (LocaleCompare(symbol,"h") == 0)
- return((MagickRealType) image->rows);
+ return((double) image->rows);
if (LocaleCompare(symbol,"hue") == 0)
{
double
@@ -1690,14 +1690,14 @@
if (LocaleCompare(symbol,"intensity") == 0)
return(QuantumScale*GetPixelInfoIntensity(&pixel));
if (LocaleCompare(symbol,"i") == 0)
- return((MagickRealType) x);
+ return((double) x);
break;
}
case 'J':
case 'j':
{
if (LocaleCompare(symbol,"j") == 0)
- return((MagickRealType) y);
+ return((double) y);
break;
}
case 'L':
@@ -1741,7 +1741,7 @@
case 'n':
{
if (LocaleCompare(symbol,"n") == 0)
- return((MagickRealType) GetImageListLength(fx_info->images));
+ return((double) GetImageListLength(fx_info->images));
break;
}
case 'O':
@@ -1755,13 +1755,13 @@
case 'p':
{
if (LocaleCompare(symbol,"page.height") == 0)
- return((MagickRealType) image->page.height);
+ return((double) image->page.height);
if (LocaleCompare(symbol,"page.width") == 0)
- return((MagickRealType) image->page.width);
+ return((double) image->page.width);
if (LocaleCompare(symbol,"page.x") == 0)
- return((MagickRealType) image->page.x);
+ return((double) image->page.x);
if (LocaleCompare(symbol,"page.y") == 0)
- return((MagickRealType) image->page.y);
+ return((double) image->page.y);
break;
}
case 'R':
@@ -1799,14 +1799,14 @@
case 't':
{
if (LocaleCompare(symbol,"t") == 0)
- return((MagickRealType) GetImageIndexInList(fx_info->images));
+ return((double) GetImageIndexInList(fx_info->images));
break;
}
case 'W':
case 'w':
{
if (LocaleCompare(symbol,"w") == 0)
- return((MagickRealType) image->columns);
+ return((double) image->columns);
break;
}
case 'Y':
@@ -1821,10 +1821,10 @@
{
if (LocaleCompare(symbol,"z") == 0)
{
- MagickRealType
+ double
depth;
- depth=(MagickRealType) GetImageDepth(image,fx_info->exception);
+ depth=(double) GetImageDepth(image,fx_info->exception);
return(depth);
}
break;
@@ -1834,7 +1834,7 @@
}
value=(const char *) GetValueFromSplayTree(fx_info->symbols,symbol);
if (value != (const char *) NULL)
- return((MagickRealType) StringToDouble(value,(char **) NULL));
+ return((double) StringToDouble(value,(char **) NULL));
(void) ThrowMagickException(exception,GetMagickModule(),OptionError,
"UnableToParseExpression","'%s'",symbol);
return(0.0);
@@ -2096,15 +2096,15 @@
return(subexpression);
}
-static MagickRealType FxEvaluateSubexpression(FxInfo *fx_info,
+static double FxEvaluateSubexpression(FxInfo *fx_info,
const PixelChannel channel,const ssize_t x,const ssize_t y,
- const char *expression,MagickRealType *beta,ExceptionInfo *exception)
+ const char *expression,double *beta,ExceptionInfo *exception)
{
char
*q,
subexpression[MaxTextExtent];
- MagickRealType
+ double
alpha,
gamma;
@@ -2135,7 +2135,7 @@
case '~':
{
*beta=FxEvaluateSubexpression(fx_info,channel,x,y,++p,beta,exception);
- *beta=(MagickRealType) (~(size_t) *beta);
+ *beta=(double) (~(size_t) *beta);
return(*beta);
}
case '!':
@@ -2192,13 +2192,13 @@
case LeftShiftOperator:
{
gamma=FxEvaluateSubexpression(fx_info,channel,x,y,++p,beta,exception);
- *beta=(MagickRealType) ((size_t) (alpha+0.5) << (size_t) (gamma+0.5));
+ *beta=(double) ((size_t) (alpha+0.5) << (size_t) (gamma+0.5));
return(*beta);
}
case RightShiftOperator:
{
gamma=FxEvaluateSubexpression(fx_info,channel,x,y,++p,beta,exception);
- *beta=(MagickRealType) ((size_t) (alpha+0.5) >> (size_t) (gamma+0.5));
+ *beta=(double) ((size_t) (alpha+0.5) >> (size_t) (gamma+0.5));
return(*beta);
}
case '<':
@@ -2234,13 +2234,13 @@
case '&':
{
gamma=FxEvaluateSubexpression(fx_info,channel,x,y,++p,beta,exception);
- *beta=(MagickRealType) ((size_t) (alpha+0.5) & (size_t) (gamma+0.5));
+ *beta=(double) ((size_t) (alpha+0.5) & (size_t) (gamma+0.5));
return(*beta);
}
case '|':
{
gamma=FxEvaluateSubexpression(fx_info,channel,x,y,++p,beta,exception);
- *beta=(MagickRealType) ((size_t) (alpha+0.5) | (size_t) (gamma+0.5));
+ *beta=(double) ((size_t) (alpha+0.5) | (size_t) (gamma+0.5));
return(*beta);
}
case LogicalAndOperator:
@@ -2257,7 +2257,7 @@
}
case '?':
{
- MagickRealType
+ double
gamma;
(void) CopyMagickString(subexpression,++p,MaxTextExtent);
@@ -2342,7 +2342,7 @@
{
gamma=FxEvaluateSubexpression(fx_info,channel,x,y,expression+1,beta,
exception);
- return((MagickRealType) (~(size_t) (gamma+0.5)));
+ return((double) (~(size_t) (gamma+0.5)));
}
case 'A':
case 'a':
@@ -2351,21 +2351,21 @@
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+3,beta,
exception);
- return((MagickRealType) fabs((double) alpha));
+ return((double) fabs((double) alpha));
}
#if defined(MAGICKCORE_HAVE_ACOSH)
if (LocaleNCompare(expression,"acosh",5) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+5,beta,
exception);
- return((MagickRealType) acosh((double) alpha));
+ return((double) acosh((double) alpha));
}
#endif
if (LocaleNCompare(expression,"acos",4) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+4,beta,
exception);
- return((MagickRealType) acos((double) alpha));
+ return((double) acos((double) alpha));
}
#if defined(MAGICKCORE_HAVE_J1)
if (LocaleNCompare(expression,"airy",4) == 0)
@@ -2383,14 +2383,14 @@
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+5,beta,
exception);
- return((MagickRealType) asinh((double) alpha));
+ return((double) asinh((double) alpha));
}
#endif
if (LocaleNCompare(expression,"asin",4) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+4,beta,
exception);
- return((MagickRealType) asin((double) alpha));
+ return((double) asin((double) alpha));
}
if (LocaleNCompare(expression,"alt",3) == 0)
{
@@ -2402,21 +2402,21 @@
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+5,beta,
exception);
- return((MagickRealType) atan2((double) alpha,(double) *beta));
+ return((double) atan2((double) alpha,(double) *beta));
}
#if defined(MAGICKCORE_HAVE_ATANH)
if (LocaleNCompare(expression,"atanh",5) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+5,beta,
exception);
- return((MagickRealType) atanh((double) alpha));
+ return((double) atanh((double) alpha));
}
#endif
if (LocaleNCompare(expression,"atan",4) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+4,beta,
exception);
- return((MagickRealType) atan((double) alpha));
+ return((double) atan((double) alpha));
}
if (LocaleCompare(expression,"a") == 0)
return(FxGetSymbol(fx_info,channel,x,y,expression,exception));
@@ -2436,19 +2436,19 @@
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+4,beta,
exception);
- return((MagickRealType) ceil((double) alpha));
+ return((double) ceil((double) alpha));
}
if (LocaleNCompare(expression,"cosh",4) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+4,beta,
exception);
- return((MagickRealType) cosh((double) alpha));
+ return((double) cosh((double) alpha));
}
if (LocaleNCompare(expression,"cos",3) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+3,beta,
exception);
- return((MagickRealType) cos((double) alpha));
+ return((double) cos((double) alpha));
}
if (LocaleCompare(expression,"c") == 0)
return(FxGetSymbol(fx_info,channel,x,y,expression,exception));
@@ -2496,7 +2496,7 @@
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+3,beta,
exception);
- return((MagickRealType) (alpha/(*beta*(alpha-1.0)+1.0)));
+ return((double) (alpha/(*beta*(alpha-1.0)+1.0)));
}
break;
}
@@ -2504,15 +2504,15 @@
case 'e':
{
if (LocaleCompare(expression,"epsilon") == 0)
- return((MagickRealType) MagickEpsilon);
+ return((double) MagickEpsilon);
if (LocaleNCompare(expression,"exp",3) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+3,beta,
exception);
- return((MagickRealType) exp((double) alpha));
+ return((double) exp((double) alpha));
}
if (LocaleCompare(expression,"e") == 0)
- return((MagickRealType) 2.7182818284590452354);
+ return((double) 2.7182818284590452354);
break;
}
case 'F':
@@ -2522,7 +2522,7 @@
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+5,beta,
exception);
- return((MagickRealType) floor((double) alpha));
+ return((double) floor((double) alpha));
}
break;
}
@@ -2534,7 +2534,7 @@
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+5,beta,
exception);
gamma=exp((double) (-alpha*alpha/2.0))/sqrt(2.0*MagickPI);
- return((MagickRealType) gamma);
+ return((double) gamma);
}
if (LocaleNCompare(expression,"gcd",3) == 0)
{
@@ -2545,7 +2545,7 @@
exception);
gcd=FxGCD((MagickOffsetType) (alpha+0.5),(MagickOffsetType) (*beta+
0.5));
- return((MagickRealType) gcd);
+ return((double) gcd);
}
if (LocaleCompare(expression,"g") == 0)
return(FxGetSymbol(fx_info,channel,x,y,expression,exception));
@@ -2562,7 +2562,7 @@
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+5,beta,
exception);
- return((MagickRealType) hypot((double) alpha,(double) *beta));
+ return((double) hypot((double) alpha,(double) *beta));
}
break;
}
@@ -2582,14 +2582,14 @@
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+3,beta,
exception);
- return((MagickRealType) floor(alpha));
+ return((double) floor(alpha));
}
#if defined(MAGICKCORE_HAVE_ISNAN)
if (LocaleNCompare(expression,"isnan",5) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+5,beta,
exception);
- return((MagickRealType) !!isnan((double) alpha));
+ return((double) !!isnan((double) alpha));
}
#endif
if (LocaleCompare(expression,"i") == 0)
@@ -2606,7 +2606,7 @@
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+2,beta,
exception);
- return((MagickRealType) j0((double) alpha));
+ return((double) j0((double) alpha));
}
#endif
#if defined(MAGICKCORE_HAVE_J1)
@@ -2614,7 +2614,7 @@
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+2,beta,
exception);
- return((MagickRealType) j1((double) alpha));
+ return((double) j1((double) alpha));
}
#endif
#if defined(MAGICKCORE_HAVE_J1)
@@ -2624,7 +2624,7 @@
exception);
if (alpha == 0.0)
return(1.0);
- gamma=(MagickRealType) (2.0*j1((double) (MagickPI*alpha))/(MagickPI*
+ gamma=(double) (2.0*j1((double) (MagickPI*alpha))/(MagickPI*
alpha));
return(gamma);
}
@@ -2638,19 +2638,19 @@
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+2,beta,
exception);
- return((MagickRealType) log((double) alpha));
+ return((double) log((double) alpha));
}
if (LocaleNCompare(expression,"logtwo",6) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+6,beta,
exception);
- return((MagickRealType) log10((double) alpha))/log10(2.0);
+ return((double) log10((double) alpha))/log10(2.0);
}
if (LocaleNCompare(expression,"log",3) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+3,beta,
exception);
- return((MagickRealType) log10((double) alpha));
+ return((double) log10((double) alpha));
}
if (LocaleCompare(expression,"lightness") == 0)
return(FxGetSymbol(fx_info,channel,x,y,expression,exception));
@@ -2660,7 +2660,7 @@
case 'm':
{
if (LocaleCompare(expression,"MaxRGB") == 0)
- return((MagickRealType) QuantumRange);
+ return((double) QuantumRange);
if (LocaleNCompare(expression,"maxima",6) == 0)
break;
if (LocaleNCompare(expression,"max",3) == 0)
@@ -2695,7 +2695,7 @@
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+3,beta,
exception);
- return((MagickRealType) (alpha < MagickEpsilon));
+ return((double) (alpha < MagickEpsilon));
}
if (LocaleCompare(expression,"n") == 0)
return(FxGetSymbol(fx_info,channel,x,y,expression,exception));
@@ -2714,14 +2714,14 @@
case 'p':
{
if (LocaleCompare(expression,"phi") == 0)
- return((MagickRealType) MagickPHI);
+ return((double) MagickPHI);
if (LocaleCompare(expression,"pi") == 0)
- return((MagickRealType) MagickPI);
+ return((double) MagickPI);
if (LocaleNCompare(expression,"pow",3) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+3,beta,
exception);
- return((MagickRealType) pow((double) alpha,(double) *beta));
+ return((double) pow((double) alpha,(double) *beta));
}
if (LocaleCompare(expression,"p") == 0)
return(FxGetSymbol(fx_info,channel,x,y,expression,exception));
@@ -2731,21 +2731,21 @@
case 'q':
{
if (LocaleCompare(expression,"QuantumRange") == 0)
- return((MagickRealType) QuantumRange);
+ return((double) QuantumRange);
if (LocaleCompare(expression,"QuantumScale") == 0)
- return((MagickRealType) QuantumScale);
+ return((double) QuantumScale);
break;
}
case 'R':
case 'r':
{
if (LocaleNCompare(expression,"rand",4) == 0)
- return((MagickRealType) GetPseudoRandomValue(fx_info->random_info));
+ return((double) GetPseudoRandomValue(fx_info->random_info));
if (LocaleNCompare(expression,"round",5) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+5,beta,
exception);
- return((MagickRealType) floor((double) alpha+0.5));
+ return((double) floor((double) alpha+0.5));
}
if (LocaleCompare(expression,"r") == 0)
return(FxGetSymbol(fx_info,channel,x,y,expression,exception));
@@ -2768,7 +2768,7 @@
exception);
if (alpha == 0)
return(1.0);
- gamma=(MagickRealType) (sin((double) (MagickPI*alpha))/
+ gamma=(double) (sin((double) (MagickPI*alpha))/
(MagickPI*alpha));
return(gamma);
}
@@ -2776,25 +2776,25 @@
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+4,beta,
exception);
- return((MagickRealType) sinh((double) alpha));
+ return((double) sinh((double) alpha));
}
if (LocaleNCompare(expression,"sin",3) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+3,beta,
exception);
- return((MagickRealType) sin((double) alpha));
+ return((double) sin((double) alpha));
}
if (LocaleNCompare(expression,"sqrt",4) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+4,beta,
exception);
- return((MagickRealType) sqrt((double) alpha));
+ return((double) sqrt((double) alpha));
}
if (LocaleNCompare(expression,"squish",6) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+6,beta,
exception);
- return((MagickRealType) (1.0/(1.0+exp((double) (-alpha)))));
+ return((double) (1.0/(1.0+exp((double) (-alpha)))));
}
if (LocaleCompare(expression,"s") == 0)
return(FxGetSymbol(fx_info,channel,x,y,expression,exception));
@@ -2807,13 +2807,13 @@
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+4,beta,
exception);
- return((MagickRealType) tanh((double) alpha));
+ return((double) tanh((double) alpha));
}
if (LocaleNCompare(expression,"tan",3) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+3,beta,
exception);
- return((MagickRealType) tan((double) alpha));
+ return((double) tan((double) alpha));
}
if (LocaleCompare(expression,"Transparent") == 0)
return(0.0);
@@ -2822,8 +2822,8 @@
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+5,beta,
exception);
if (alpha >= 0.0)
- return((MagickRealType) floor((double) alpha));
- return((MagickRealType) ceil((double) alpha));
+ return((double) floor((double) alpha));
+ return((double) ceil((double) alpha));
}
if (LocaleCompare(expression,"t") == 0)
return(FxGetSymbol(fx_info,channel,x,y,expression,exception));
@@ -2853,7 +2853,7 @@
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+5,beta,
exception);
} while (fabs((double) alpha) >= MagickEpsilon);
- return((MagickRealType) *beta);
+ return((double) *beta);
}
if (LocaleCompare(expression,"w") == 0)
return(FxGetSymbol(fx_info,channel,x,y,expression,exception));
@@ -2884,7 +2884,7 @@
}
MagickPrivate MagickBooleanType FxEvaluateExpression(FxInfo *fx_info,
- MagickRealType *alpha,ExceptionInfo *exception)
+ double *alpha,ExceptionInfo *exception)
{
MagickBooleanType
status;
@@ -2895,7 +2895,7 @@
}
MagickExport MagickBooleanType FxPreprocessExpression(FxInfo *fx_info,
- MagickRealType *alpha,ExceptionInfo *exception)
+ double *alpha,ExceptionInfo *exception)
{
FILE
*file;
@@ -2913,9 +2913,9 @@
MagickPrivate MagickBooleanType FxEvaluateChannelExpression(FxInfo *fx_info,
const PixelChannel channel,const ssize_t x,const ssize_t y,
- MagickRealType *alpha,ExceptionInfo *exception)
+ double *alpha,ExceptionInfo *exception)
{
- MagickRealType
+ double
beta;
beta=0.0;
@@ -2974,7 +2974,7 @@
FxInfo
**fx_info;
- MagickRealType
+ double
alpha;
register ssize_t
@@ -3024,7 +3024,7 @@
MagickOffsetType
progress;
- MagickRealType
+ double
alpha;
ssize_t
@@ -3102,7 +3102,7 @@
}
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
- MagickRealType
+ double
alpha;
PixelChannel
@@ -3208,7 +3208,7 @@
MagickOffsetType
progress;
- MagickRealType
+ double
radius;
PointInfo
@@ -3267,7 +3267,7 @@
#endif
for (y=0; y < (ssize_t) image->rows; y++)
{
- MagickRealType
+ double
distance;
PointInfo
@@ -3413,7 +3413,7 @@
MagickOffsetType
scene;
- MagickRealType
+ double
alpha,
beta;
@@ -3479,7 +3479,7 @@
*image_view,
*morph_view;
- beta=(MagickRealType) (i+1.0)/(MagickRealType) (number_frames+1.0);
+ beta=(double) (i+1.0)/(double) (number_frames+1.0);
alpha=1.0-beta;
morph_image=ResizeImage(next,(size_t) (alpha*next->columns+beta*
GetNextImageInList(next)->columns+0.5),(size_t) (alpha*next->rows+beta*
@@ -3651,7 +3651,7 @@
*/
static inline Quantum PlasmaPixel(RandomInfo *random_info,
- const MagickRealType pixel,const MagickRealType noise)
+ const double pixel,const double noise)
{
Quantum
plasma;
@@ -3666,7 +3666,7 @@
const SegmentInfo *segment,size_t attenuate,size_t depth,
ExceptionInfo *exception)
{
- MagickRealType
+ double
plasma;
PixelChannel
@@ -3734,7 +3734,7 @@
/*
Average pixels and apply plasma.
*/
- plasma=(MagickRealType) QuantumRange/(2.0*attenuate);
+ plasma=(double) QuantumRange/(2.0*attenuate);
if ((segment->x1 != (double) x_mid) || (segment->x2 != (double) x_mid))
{
/*
@@ -4189,23 +4189,23 @@
}
for (x=0; x < (ssize_t) image->columns; x++)
{
- MagickRealType
+ double
intensity,
tone;
- intensity=(MagickRealType) GetPixelIntensity(image,p);
- tone=intensity > threshold ? (MagickRealType) QuantumRange : intensity+
- (MagickRealType) QuantumRange-threshold;
+ intensity=(double) GetPixelIntensity(image,p);
+ tone=intensity > threshold ? (double) QuantumRange : intensity+
+ (double) QuantumRange-threshold;
SetPixelRed(sepia_image,ClampToQuantum(tone),q);
- tone=intensity > (7.0*threshold/6.0) ? (MagickRealType) QuantumRange :
- intensity+(MagickRealType) QuantumRange-7.0*threshold/6.0;
+ tone=intensity > (7.0*threshold/6.0) ? (double) QuantumRange :
+ intensity+(double) QuantumRange-7.0*threshold/6.0;
SetPixelGreen(sepia_image,ClampToQuantum(tone),q);
tone=intensity < (threshold/6.0) ? 0 : intensity-threshold/6.0;
SetPixelBlue(sepia_image,ClampToQuantum(tone),q);
tone=threshold/7.0;
- if ((MagickRealType) GetPixelGreen(image,q) < tone)
+ if ((double) GetPixelGreen(image,q) < tone)
SetPixelGreen(sepia_image,ClampToQuantum(tone),q);
- if ((MagickRealType) GetPixelBlue(image,q) < tone)
+ if ((double) GetPixelBlue(image,q) < tone)
SetPixelBlue(sepia_image,ClampToQuantum(tone),q);
p+=GetPixelChannels(image);
q+=GetPixelChannels(sepia_image);
@@ -4479,7 +4479,7 @@
}
for (x=0; x < (ssize_t) random_image->columns; x++)
{
- MagickRealType
+ double
value;
register ssize_t
@@ -4611,12 +4611,12 @@
*/
for (i=0; i < (ssize_t) image->colors; i++)
{
- if ((MagickRealType) image->colormap[i].red > threshold)
+ if ((double) image->colormap[i].red > threshold)
image->colormap[i].red=QuantumRange-image->colormap[i].red;
- if ((MagickRealType) image->colormap[i].green > threshold)
+ if ((double) image->colormap[i].green > threshold)
image->colormap[i].green=QuantumRange-
image->colormap[i].green;
- if ((MagickRealType) image->colormap[i].blue > threshold)
+ if ((double) image->colormap[i].blue > threshold)
image->colormap[i].blue=QuantumRange-
image->colormap[i].blue;
}
@@ -4670,7 +4670,7 @@
if ((traits == UndefinedPixelTrait) ||
((traits & CopyPixelTrait) != 0))
continue;
- if ((MagickRealType) q[i] > threshold)
+ if ((double) q[i] > threshold)
q[i]=QuantumRange-q[i];
}
q+=GetPixelChannels(image);
@@ -5063,7 +5063,7 @@
MagickOffsetType
progress;
- MagickRealType
+ double
radius;
PointInfo
@@ -5119,7 +5119,7 @@
#endif
for (y=0; y < (ssize_t) image->rows; y++)
{
- MagickRealType
+ double
distance;
PointInfo
@@ -5183,7 +5183,7 @@
}
else
{
- MagickRealType
+ double
cosine,
factor,
sine;
@@ -5275,7 +5275,7 @@
MagickOffsetType
progress;
- MagickRealType
+ double
intensity;
PixelInfo
@@ -5332,16 +5332,16 @@
if ((flags & ChiValue) != 0)
color_vector.alpha=geometry_info.chi;
}
- intensity=(MagickRealType) GetPixelInfoIntensity(tint);
- color_vector.red=(MagickRealType) (color_vector.red*tint->red/100.0-
+ intensity=(double) GetPixelInfoIntensity(tint);
+ color_vector.red=(double) (color_vector.red*tint->red/100.0-
intensity);
- color_vector.green=(MagickRealType) (color_vector.green*tint->green/100.0-
+ color_vector.green=(double) (color_vector.green*tint->green/100.0-
intensity);
- color_vector.blue=(MagickRealType) (color_vector.blue*tint->blue/100.0-
+ color_vector.blue=(double) (color_vector.blue*tint->blue/100.0-
intensity);
- color_vector.black=(MagickRealType) (color_vector.black*tint->black/100.0-
+ color_vector.black=(double) (color_vector.black*tint->black/100.0-
intensity);
- color_vector.alpha=(MagickRealType) (color_vector.alpha*tint->alpha/100.0-
+ color_vector.alpha=(double) (color_vector.alpha*tint->alpha/100.0-
intensity);
/*
Tint image.
@@ -5380,7 +5380,7 @@
PixelInfo
pixel;
- MagickRealType
+ double
weight;
register ssize_t
@@ -5415,16 +5415,16 @@
}
GetPixelInfo(image,&pixel);
weight=QuantumScale*GetPixelRed(image,p)-0.5;
- pixel.red=(MagickRealType) GetPixelRed(image,p)+color_vector.red*
+ pixel.red=(double) GetPixelRed(image,p)+color_vector.red*
(1.0-(4.0*(weight*weight)));
weight=QuantumScale*GetPixelGreen(image,p)-0.5;
- pixel.green=(MagickRealType) GetPixelGreen(image,p)+color_vector.green*
+ pixel.green=(double) GetPixelGreen(image,p)+color_vector.green*
(1.0-(4.0*(weight*weight)));
weight=QuantumScale*GetPixelBlue(image,p)-0.5;
- pixel.blue=(MagickRealType) GetPixelBlue(image,p)+color_vector.blue*
+ pixel.blue=(double) GetPixelBlue(image,p)+color_vector.blue*
(1.0-(4.0*(weight*weight)));
weight=QuantumScale*GetPixelBlack(image,p)-0.5;
- pixel.black=(MagickRealType) GetPixelBlack(image,p)+color_vector.black*
+ pixel.black=(double) GetPixelBlack(image,p)+color_vector.black*
(1.0-(4.0*(weight*weight)));
SetPixelInfoPixel(tint_image,&pixel,q);
p+=GetPixelChannels(image);
@@ -5605,7 +5605,7 @@
MagickOffsetType
progress;
- MagickRealType
+ double
*sine_map;
register ssize_t
@@ -5637,9 +5637,9 @@
/*
Allocate sine map.
*/
- sine_map=(MagickRealType *) AcquireQuantumMemory((size_t) wave_image->columns,
+ sine_map=(double *) AcquireQuantumMemory((size_t) wave_image->columns,
sizeof(*sine_map));
- if (sine_map == (MagickRealType *) NULL)
+ if (sine_map == (double *) NULL)
{
wave_image=DestroyImage(wave_image);
ThrowImageException(ResourceLimitError,"MemoryAllocationFailed");
@@ -5700,7 +5700,7 @@
}
wave_view=DestroyCacheView(wave_view);
image_view=DestroyCacheView(image_view);
- sine_map=(MagickRealType *) RelinquishMagickMemory(sine_map);
+ sine_map=(double *) RelinquishMagickMemory(sine_map);
if (status == MagickFalse)
wave_image=DestroyImage(wave_image);
return(wave_image);
diff --git a/MagickCore/gem.c b/MagickCore/gem.c
index 8b0ba21..a4e8df1 100644
--- a/MagickCore/gem.c
+++ b/MagickCore/gem.c
@@ -934,7 +934,7 @@
if (gamma <= MagickEpsilon)
return(3UL);
alpha=MagickEpsilonReciprocal(2.0*gamma*gamma);
- beta=(double) MagickEpsilonReciprocal((MagickRealType) MagickSQ2PI*gamma);
+ beta=(double) MagickEpsilonReciprocal((double) MagickSQ2PI*gamma);
for (width=5; ; )
{
normalize=0.0;
@@ -974,7 +974,7 @@
if (gamma <= MagickEpsilon)
return(3UL);
alpha=MagickEpsilonReciprocal(2.0*gamma*gamma);
- beta=(double) MagickEpsilonReciprocal((MagickRealType) Magick2PI*gamma*gamma);
+ beta=(double) MagickEpsilonReciprocal((double) Magick2PI*gamma*gamma);
for (width=5; ; )
{
normalize=0.0;
diff --git a/MagickCore/image-private.h b/MagickCore/image-private.h
index 11d42a1..812a240 100644
--- a/MagickCore/image-private.h
+++ b/MagickCore/image-private.h
@@ -54,9 +54,9 @@
return((double) (MagickPI*degrees/180.0));
}
-static inline MagickRealType RadiansToDegrees(const MagickRealType radians)
+static inline double RadiansToDegrees(const double radians)
{
- return((MagickRealType) (180.0*radians/MagickPI));
+ return((double) (180.0*radians/MagickPI));
}
static inline unsigned char ScaleColor5to8(const unsigned int color)
diff --git a/MagickCore/image.c b/MagickCore/image.c
index af1dbb9..4a359a8 100644
--- a/MagickCore/image.c
+++ b/MagickCore/image.c
@@ -787,7 +787,7 @@
Image
*clone_image;
- MagickRealType
+ double
scale;
size_t
@@ -872,11 +872,11 @@
clone_image->cache=ReferencePixelCache(image->cache);
return(clone_image);
}
- scale=(MagickRealType) columns/(MagickRealType) image->columns;
+ scale=(double) columns/(double) image->columns;
clone_image->page.width=(size_t) floor(scale*image->page.width+0.5);
clone_image->page.x=(ssize_t) ceil(scale*image->page.x-0.5);
clone_image->tile_offset.x=(ssize_t) ceil(scale*image->tile_offset.x-0.5);
- scale=(MagickRealType) rows/(MagickRealType) image->rows;
+ scale=(double) rows/(double) image->rows;
clone_image->page.height=(size_t) floor(scale*image->page.height+0.5);
clone_image->page.y=(ssize_t) ceil(scale*image->page.y-0.5);
clone_image->tile_offset.y=(ssize_t) ceil(scale*image->tile_offset.y-0.5);
@@ -1679,13 +1679,13 @@
}
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
- MagickRealType
+ double
pixel;
traits=GetPixelChannelMapTraits(image,i);
if (traits == UndefinedPixelTrait)
continue;
- pixel=(MagickRealType) p[i];
+ pixel=(double) p[i];
if ((pixel < 0.0) || (pixel > QuantumRange) ||
(pixel != (QuantumAny) pixel))
break;
@@ -2070,10 +2070,10 @@
*/
static inline void FlattenPixelInfo(const Image *image,const PixelInfo *p,
- const MagickRealType alpha,const Quantum *q,const MagickRealType beta,
+ const double alpha,const Quantum *q,const double beta,
Quantum *composite)
{
- MagickRealType
+ double
Da,
gamma,
Sa;
@@ -2104,26 +2104,26 @@
{
case RedPixelChannel:
{
- composite[i]=ClampToQuantum(gamma*MagickOver_((MagickRealType) q[i],
- beta,(MagickRealType) p->red,alpha));
+ composite[i]=ClampToQuantum(gamma*MagickOver_((double) q[i],
+ beta,(double) p->red,alpha));
break;
}
case GreenPixelChannel:
{
- composite[i]=ClampToQuantum(gamma*MagickOver_((MagickRealType) q[i],
- beta,(MagickRealType) p->green,alpha));
+ composite[i]=ClampToQuantum(gamma*MagickOver_((double) q[i],
+ beta,(double) p->green,alpha));
break;
}
case BluePixelChannel:
{
- composite[i]=ClampToQuantum(gamma*MagickOver_((MagickRealType) q[i],
- beta,(MagickRealType) p->blue,alpha));
+ composite[i]=ClampToQuantum(gamma*MagickOver_((double) q[i],
+ beta,(double) p->blue,alpha));
break;
}
case BlackPixelChannel:
{
- composite[i]=ClampToQuantum(gamma*MagickOver_((MagickRealType) q[i],
- beta,(MagickRealType) p->black,alpha));
+ composite[i]=ClampToQuantum(gamma*MagickOver_((double) q[i],
+ beta,(double) p->black,alpha));
break;
}
case AlphaPixelChannel:
@@ -2274,7 +2274,7 @@
for (x=0; x < (ssize_t) image->columns; x++)
{
FlattenPixelInfo(image,&image->background_color,
- image->background_color.alpha,q,(MagickRealType)
+ image->background_color.alpha,q,(double)
GetPixelAlpha(image,q),q);
q+=GetPixelChannels(image);
}
diff --git a/MagickCore/layer.c b/MagickCore/layer.c
index 5a9de33..d1c5f6b 100644
--- a/MagickCore/layer.c
+++ b/MagickCore/layer.c
@@ -522,7 +522,7 @@
static MagickBooleanType ComparePixels(const ImageLayerMethod method,
const PixelInfo *p,const PixelInfo *q)
{
- MagickRealType
+ double
o1,
o2;
@@ -539,15 +539,15 @@
Pixel goes from opaque to transprency
*/
if (method == CompareClearLayer)
- return((MagickBooleanType) ( (o1 <= ((MagickRealType) QuantumRange/2.0)) &&
- (o2 > ((MagickRealType) QuantumRange/2.0)) ) );
+ return((MagickBooleanType) ( (o1 <= ((double) QuantumRange/2.0)) &&
+ (o2 > ((double) QuantumRange/2.0)) ) );
/*
overlay would change first pixel by second
*/
if (method == CompareOverlayLayer)
{
- if (o2 > ((MagickRealType) QuantumRange/2.0))
+ if (o2 > ((double) QuantumRange/2.0))
return MagickFalse;
return((MagickBooleanType) (IsFuzzyEquivalencePixelInfo(p,q) == MagickFalse));
}
diff --git a/MagickCore/magick-type.h b/MagickCore/magick-type.h
index 33a7961..4a12fe8 100644
--- a/MagickCore/magick-type.h
+++ b/MagickCore/magick-type.h
@@ -40,11 +40,6 @@
#define MaxColormapSize 256UL
#define MaxMap 255UL
-#if defined __arm__ || defined __thumb__
-typedef float MagickRealType;
-#else
-typedef double MagickRealType;
-#endif
#if defined(MAGICKCORE_HDRI_SUPPORT)
typedef float Quantum;
#define QuantumRange 255.0
@@ -58,11 +53,6 @@
#define MaxColormapSize 65536UL
#define MaxMap 65535UL
-#if defined __arm__ || defined __thumb__
-typedef float MagickRealType;
-#else
-typedef double MagickRealType;
-#endif
#if defined(MAGICKCORE_HDRI_SUPPORT)
typedef float Quantum;
#define QuantumRange 65535.0
@@ -76,7 +66,6 @@
#define MaxColormapSize 65536UL
#define MaxMap 65535UL
-typedef double MagickRealType;
#if defined(MAGICKCORE_HDRI_SUPPORT)
typedef float Quantum;
#define QuantumRange 4294967295.0
@@ -90,7 +79,6 @@
#define MaxColormapSize 65536UL
#define MaxMap 65535UL
-typedef long double MagickRealType;
typedef double Quantum;
#define QuantumRange 18446744073709551615.0
#define QuantumFormat "%g"
@@ -99,8 +87,8 @@
# error "MAGICKCORE_QUANTUM_DEPTH must be one of 8, 16, 32, or 64"
#endif
#endif
-#define MagickEpsilon ((MagickRealType) 1.0e-16)
-#define MagickHuge ((MagickRealType) 1.0/MagickEpsilon)
+#define MagickEpsilon (1.0e-16)
+#define MagickHuge (1.0/MagickEpsilon)
#define MagickPI 3.14159265358979323846264338327950288419716939937510L
#define QuantumScale ((double) 1.0/(double) QuantumRange)
diff --git a/MagickCore/morphology.c b/MagickCore/morphology.c
index b54949d..37a3aac 100644
--- a/MagickCore/morphology.c
+++ b/MagickCore/morphology.c
@@ -1438,8 +1438,8 @@
if (kernel == (KernelInfo *) NULL)
return(kernel);
kernel->type = type;
- kernel->values[3] = +(MagickRealType) MagickSQ2;
- kernel->values[5] = -(MagickRealType) MagickSQ2;
+ kernel->values[3] = +(double) MagickSQ2;
+ kernel->values[5] = -(double) MagickSQ2;
CalcKernelMetaData(kernel); /* recalculate meta-data */
break;
case 2:
@@ -1447,8 +1447,8 @@
if (kernel == (KernelInfo *) NULL)
return(kernel);
kernel->type = type;
- kernel->values[1] = kernel->values[3]= +(MagickRealType) MagickSQ2;
- kernel->values[5] = kernel->values[7]= -(MagickRealType) MagickSQ2;
+ kernel->values[1] = kernel->values[3]= +(double) MagickSQ2;
+ kernel->values[5] = kernel->values[7]= -(double) MagickSQ2;
CalcKernelMetaData(kernel); /* recalculate meta-data */
ScaleKernelInfo(kernel, (double) (1.0/2.0*MagickSQ2), NoValue);
break;
@@ -1463,8 +1463,8 @@
if (kernel == (KernelInfo *) NULL)
return(kernel);
kernel->type = type;
- kernel->values[3] = +(MagickRealType) MagickSQ2;
- kernel->values[5] = -(MagickRealType) MagickSQ2;
+ kernel->values[3] = +(double) MagickSQ2;
+ kernel->values[5] = -(double) MagickSQ2;
CalcKernelMetaData(kernel); /* recalculate meta-data */
ScaleKernelInfo(kernel, (double) (1.0/2.0*MagickSQ2), NoValue);
break;
@@ -1473,8 +1473,8 @@
if (kernel == (KernelInfo *) NULL)
return(kernel);
kernel->type = type;
- kernel->values[1] = +(MagickRealType) MagickSQ2;
- kernel->values[7] = +(MagickRealType) MagickSQ2;
+ kernel->values[1] = +(double) MagickSQ2;
+ kernel->values[7] = +(double) MagickSQ2;
CalcKernelMetaData(kernel);
ScaleKernelInfo(kernel, (double) (1.0/2.0*MagickSQ2), NoValue);
break;
@@ -1483,8 +1483,8 @@
if (kernel == (KernelInfo *) NULL)
return(kernel);
kernel->type = type;
- kernel->values[0] = +(MagickRealType) MagickSQ2;
- kernel->values[8] = -(MagickRealType) MagickSQ2;
+ kernel->values[0] = +(double) MagickSQ2;
+ kernel->values[8] = -(double) MagickSQ2;
CalcKernelMetaData(kernel);
ScaleKernelInfo(kernel, (double) (1.0/2.0*MagickSQ2), NoValue);
break;
@@ -1493,8 +1493,8 @@
if (kernel == (KernelInfo *) NULL)
return(kernel);
kernel->type = type;
- kernel->values[2] = -(MagickRealType) MagickSQ2;
- kernel->values[6] = +(MagickRealType) MagickSQ2;
+ kernel->values[2] = -(double) MagickSQ2;
+ kernel->values[6] = +(double) MagickSQ2;
CalcKernelMetaData(kernel);
ScaleKernelInfo(kernel, (double) (1.0/2.0*MagickSQ2), NoValue);
break;
@@ -2748,7 +2748,7 @@
** Weight the color channels with Alpha Channel so that
** transparent pixels are not part of the results.
*/
- MagickRealType
+ double
alpha, /* alpha weighting for colors : alpha */
gamma; /* divisor, sum of color alpha weighting */
size_t
@@ -2885,20 +2885,20 @@
min.green =
min.blue =
min.alpha =
- min.black = (MagickRealType) QuantumRange;
+ min.black = (double) QuantumRange;
max.red =
max.green =
max.blue =
max.alpha =
- max.black = (MagickRealType) 0;
+ max.black = (double) 0;
/* default result is the original pixel value */
- result.red = (MagickRealType) GetPixelRed(image,p+r*GetPixelChannels(image));
- result.green = (MagickRealType) GetPixelGreen(image,p+r*GetPixelChannels(image));
- result.blue = (MagickRealType) GetPixelBlue(image,p+r*GetPixelChannels(image));
+ result.red = (double) GetPixelRed(image,p+r*GetPixelChannels(image));
+ result.green = (double) GetPixelGreen(image,p+r*GetPixelChannels(image));
+ result.blue = (double) GetPixelBlue(image,p+r*GetPixelChannels(image));
result.black = 0.0;
if (image->colorspace == CMYKColorspace)
- result.black = (MagickRealType) GetPixelBlack(image,p+r*GetPixelChannels(image));
- result.alpha=(MagickRealType) GetPixelAlpha(image,p+r*GetPixelChannels(image));
+ result.black = (double) GetPixelBlack(image,p+r*GetPixelChannels(image));
+ result.alpha=(double) GetPixelAlpha(image,p+r*GetPixelChannels(image));
switch (method) {
case ConvolveMorphology:
@@ -2985,7 +2985,7 @@
** Weight the color channels with Alpha Channel so that
** transparent pixels are not part of the results.
*/
- MagickRealType
+ double
alpha, /* alpha weighting for colors : alpha */
gamma; /* divisor, sum of color alpha weighting */
size_t
@@ -4486,7 +4486,7 @@
{
if ( kernel->width == 3 && kernel->height == 3 )
{ /* Rotate a 3x3 square by 45 degree angle */
- MagickRealType t = kernel->values[0];
+ double t = kernel->values[0];
kernel->values[0] = kernel->values[3];
kernel->values[3] = kernel->values[6];
kernel->values[6] = kernel->values[7];
diff --git a/MagickCore/pixel-accessor.h b/MagickCore/pixel-accessor.h
index bbc57fc..496e8f9 100644
--- a/MagickCore/pixel-accessor.h
+++ b/MagickCore/pixel-accessor.h
@@ -31,18 +31,18 @@
#undef index
-static inline double CompandsRGB(const double intensity)
+static inline double CompandsRGB(const double pixel)
{
- if (intensity <= 0.0031308)
- return(intensity*12.92);
- return(1.055*pow(intensity,1.0/2.4)-0.055);
+ if (pixel <= (0.0031308*QuantumRange))
+ return(12.92*pixel);
+ return(1.055*QuantumRange*pow(QuantumScale*pixel,1.0/2.4)-0.055);
}
-static inline double DecompandsRGB(const double intensity)
+static inline double DecompandsRGB(const double pixel)
{
- if (intensity <= 0.04045)
- return(intensity/12.92);
- return(pow((intensity+0.055)/1.055,2.4));
+ if (pixel <= (0.04045*QuantumRange))
+ return(pixel/12.92);
+ return(QuantumRange*pow((QuantumScale*pixel+0.055)/1.055,2.4));
}
static inline Quantum GetPixela(const Image *restrict image,
@@ -220,9 +220,9 @@
if (pixel_info->colorspace != sRGBColorspace)
return(0.298839*pixel_info->red+0.586811*pixel_info->green+
0.114350*pixel_info->blue);
- red=QuantumRange*DecompandsRGB(QuantumScale*pixel_info->red);
- green=QuantumRange*DecompandsRGB(QuantumScale*pixel_info->green);
- blue=QuantumRange*DecompandsRGB(QuantumScale*pixel_info->blue);
+ red=DecompandsRGB(pixel_info->red);
+ green=DecompandsRGB(pixel_info->green);
+ blue=DecompandsRGB(pixel_info->blue);
return(0.298839*red+0.586811*green+0.114350*blue);
}
@@ -238,9 +238,9 @@
if (pixel_info->colorspace != sRGBColorspace)
return(0.21267*pixel_info->red+0.71516*pixel_info->green+
0.07217*pixel_info->blue);
- red=QuantumRange*DecompandsRGB(QuantumScale*pixel_info->red);
- green=QuantumRange*DecompandsRGB(QuantumScale*pixel_info->green);
- blue=QuantumRange*DecompandsRGB(QuantumScale*pixel_info->blue);
+ red=DecompandsRGB(pixel_info->red);
+ green=DecompandsRGB(pixel_info->green);
+ blue=DecompandsRGB(pixel_info->blue);
return(0.21267*red+0.71516*green+0.07217*blue);
}
@@ -259,11 +259,11 @@
0.298839*pixel[image->channel_map[RedPixelChannel].offset]+
0.586811*pixel[image->channel_map[GreenPixelChannel].offset]+
0.114350*pixel[image->channel_map[BluePixelChannel].offset]));
- red=QuantumRange*DecompandsRGB(QuantumScale*
+ red=DecompandsRGB((double)
pixel[image->channel_map[RedPixelChannel].offset]);
- green=QuantumRange*DecompandsRGB(QuantumScale*
+ green=DecompandsRGB((double)
pixel[image->channel_map[GreenPixelChannel].offset]);
- blue=QuantumRange*DecompandsRGB(QuantumScale*
+ blue=DecompandsRGB((double)
pixel[image->channel_map[BluePixelChannel].offset]);
return(ClampToQuantum(0.298839*red+0.586811*green+0.114350*blue));
}
@@ -289,11 +289,11 @@
0.298839*pixel[image->channel_map[RedPixelChannel].offset]+
0.586811*pixel[image->channel_map[GreenPixelChannel].offset]+
0.114350*pixel[image->channel_map[BluePixelChannel].offset]));
- red=QuantumRange*DecompandsRGB(QuantumScale*
+ red=DecompandsRGB((double)
pixel[image->channel_map[RedPixelChannel].offset]);
- green=QuantumRange*DecompandsRGB(QuantumScale*
+ green=DecompandsRGB((double)
pixel[image->channel_map[GreenPixelChannel].offset]);
- blue=QuantumRange*DecompandsRGB(QuantumScale*
+ blue=DecompandsRGB((double)
pixel[image->channel_map[BluePixelChannel].offset]);
return(ClampToQuantum(0.21267*red+0.71516*green+0.07217*blue));
}
diff --git a/MagickCore/pixel-private.h b/MagickCore/pixel-private.h
index 2eb0534..9614017 100644
--- a/MagickCore/pixel-private.h
+++ b/MagickCore/pixel-private.h
@@ -22,12 +22,12 @@
extern "C" {
#endif
-static inline MagickRealType MagickEpsilonReciprocal(const MagickRealType x)
+static inline double MagickEpsilonReciprocal(const double x)
{
- MagickRealType sign = x < (MagickRealType) 0.0 ? (MagickRealType) -1.0 :
- (MagickRealType) 1.0;
- return((sign*x) >= MagickEpsilon ? (MagickRealType) 1.0/x : sign*(
- (MagickRealType) 1.0/MagickEpsilon));
+ double sign = x < (double) 0.0 ? (double) -1.0 :
+ (double) 1.0;
+ return((sign*x) >= MagickEpsilon ? (double) 1.0/x : sign*(
+ (double) 1.0/MagickEpsilon));
}
#if defined(__cplusplus) || defined(c_plusplus)
diff --git a/MagickCore/pixel.c b/MagickCore/pixel.c
index 00f7beb..95bc8a7 100644
--- a/MagickCore/pixel.c
+++ b/MagickCore/pixel.c
@@ -2013,7 +2013,7 @@
pixel->green=0.0;
pixel->blue=0.0;
pixel->black=0.0;
- pixel->alpha=(MagickRealType) OpaqueAlpha;
+ pixel->alpha=(double) OpaqueAlpha;
pixel->index=0.0;
if (image == (const Image *) NULL)
return;
@@ -3985,15 +3985,15 @@
%
*/
-static inline double MagickMax(const MagickRealType x,const MagickRealType y)
+static inline double MagickMax(const double x,const double y)
{
if (x > y)
return(x);
return(y);
}
-static inline void CatromWeights(const MagickRealType x,
- MagickRealType (*weights)[4])
+static inline void CatromWeights(const double x,
+ double (*weights)[4])
{
/*
Nicolas Robidoux' 10 flops (4* + 5- + 1+) refactoring of the
@@ -4003,13 +4003,13 @@
input pixel location. Formulas originally derived for the VIPS
(Virtual Image Processing System) library.
*/
- MagickRealType
+ double
alpha,
beta,
gamma;
- alpha=(MagickRealType) 1.0-x;
- beta=(MagickRealType) (-0.5)*x*alpha;
+ alpha=(double) 1.0-x;
+ beta=(double) (-0.5)*x*alpha;
(*weights)[0]=alpha*beta;
(*weights)[3]=x*beta;
/*
@@ -4021,8 +4021,8 @@
(*weights)[2]=x-(*weights)[3]-gamma;
}
-static inline void SplineWeights(const MagickRealType x,
- MagickRealType (*weights)[4])
+static inline void SplineWeights(const double x,
+ double (*weights)[4])
{
/*
Nicolas Robidoux' 12 flops (6* + 5- + 1+) refactoring of the
@@ -4031,13 +4031,13 @@
third input pixel locations, and x is the position relative to the
second input pixel location.
*/
- MagickRealType
+ double
alpha,
beta;
- alpha=(MagickRealType) 1.0-x;
- (*weights)[3]=(MagickRealType) (1.0/6.0)*x*x*x;
- (*weights)[0]=(MagickRealType) (1.0/6.0)*alpha*alpha*alpha;
+ alpha=(double) 1.0-x;
+ (*weights)[3]=(double) (1.0/6.0)*x*x*x;
+ (*weights)[0]=(double) (1.0/6.0)*alpha*alpha*alpha;
beta=(*weights)[3]-(*weights)[0];
(*weights)[1]=alpha-(*weights)[0]+beta;
(*weights)[2]=x-(*weights)[3]-beta;
@@ -4050,7 +4050,7 @@
}
/*
-static inline ssize_t NearestNeighbor(const MagickRealType x)
+static inline ssize_t NearestNeighbor(const double x)
{
if (x >= 0.0)
return((ssize_t) (x+0.5));
@@ -4066,7 +4066,7 @@
MagickBooleanType
status;
- MagickRealType
+ double
alpha[16],
gamma,
pixels[16];
@@ -4133,7 +4133,7 @@
for (i=0; i < (ssize_t) count; i++)
{
alpha[i]=1.0;
- pixels[i]=(MagickRealType) p[i*GetPixelChannels(image)+channel];
+ pixels[i]=(double) p[i*GetPixelChannels(image)+channel];
}
else
for (i=0; i < (ssize_t) count; i++)
@@ -4166,7 +4166,7 @@
for (i=0; i < 4; i++)
{
alpha[i]=1.0;
- pixels[i]=(MagickRealType) p[i*GetPixelChannels(image)+channel];
+ pixels[i]=(double) p[i*GetPixelChannels(image)+channel];
}
else
for (i=0; i < 4; i++)
@@ -4188,7 +4188,7 @@
}
case CatromInterpolatePixel:
{
- MagickRealType
+ double
cx[4],
cy[4];
@@ -4203,7 +4203,7 @@
for (i=0; i < 16; i++)
{
alpha[i]=1.0;
- pixels[i]=(MagickRealType) p[i*GetPixelChannels(image)+channel];
+ pixels[i]=(double) p[i*GetPixelChannels(image)+channel];
}
else
for (i=0; i < 16; i++)
@@ -4212,9 +4212,9 @@
GetPixelChannels(image));
pixels[i]=alpha[i]*p[i*GetPixelChannels(image)+channel];
}
- CatromWeights((MagickRealType) (x-x_offset),&cx);
- CatromWeights((MagickRealType) (y-y_offset),&cy);
- gamma=(channel == AlphaPixelChannel ? (MagickRealType) 1.0 :
+ CatromWeights((double) (x-x_offset),&cx);
+ CatromWeights((double) (y-y_offset),&cy);
+ gamma=(channel == AlphaPixelChannel ? (double) 1.0 :
MagickEpsilonReciprocal(cy[0]*(cx[0]*alpha[0]+cx[1]*alpha[1]+cx[2]*
alpha[2]+cx[3]*alpha[3])+cy[1]*(cx[0]*alpha[4]+cx[1]*alpha[5]+cx[2]*
alpha[6]+cx[3]*alpha[7])+cy[2]*(cx[0]*alpha[8]+cx[1]*alpha[9]+cx[2]*
@@ -4306,7 +4306,7 @@
for (i=0; i < 4; i++)
{
alpha[i]=1.0;
- pixels[i]=(MagickRealType) p[i*GetPixelChannels(image)+channel];
+ pixels[i]=(double) p[i*GetPixelChannels(image)+channel];
}
else
for (i=0; i < 4; i++)
@@ -4381,7 +4381,7 @@
}
case SplineInterpolatePixel:
{
- MagickRealType
+ double
cx[4],
cy[4];
@@ -4396,7 +4396,7 @@
for (i=0; i < 16; i++)
{
alpha[i]=1.0;
- pixels[i]=(MagickRealType) p[i*GetPixelChannels(image)+channel];
+ pixels[i]=(double) p[i*GetPixelChannels(image)+channel];
}
else
for (i=0; i < 16; i++)
@@ -4405,9 +4405,9 @@
GetPixelChannels(image));
pixels[i]=alpha[i]*p[i*GetPixelChannels(image)+channel];
}
- SplineWeights((MagickRealType) (x-x_offset),&cx);
- SplineWeights((MagickRealType) (y-y_offset),&cy);
- gamma=(channel == AlphaPixelChannel ? (MagickRealType) 1.0 :
+ SplineWeights((double) (x-x_offset),&cx);
+ SplineWeights((double) (y-y_offset),&cy);
+ gamma=(channel == AlphaPixelChannel ? (double) 1.0 :
MagickEpsilonReciprocal(cy[0]*(cx[0]*alpha[0]+cx[1]*alpha[1]+cx[2]*
alpha[2]+cx[3]*alpha[3])+cy[1]*(cx[0]*alpha[4]+cx[1]*alpha[5]+cx[2]*
alpha[6]+cx[3]*alpha[7])+cy[2]*(cx[0]*alpha[8]+cx[1]*alpha[9]+cx[2]*
@@ -4474,7 +4474,7 @@
MagickBooleanType
status;
- MagickRealType
+ double
alpha[16],
gamma,
pixels[16];
@@ -4553,7 +4553,7 @@
(destination_traits == UndefinedPixelTrait))
continue;
for (j=0; j < (ssize_t) count; j++)
- pixels[j]=(MagickRealType) p[j*GetPixelChannels(source)+i];
+ pixels[j]=(double) p[j*GetPixelChannels(source)+i];
sum=0.0;
if ((traits & BlendPixelTrait) == 0)
{
@@ -4601,10 +4601,10 @@
delta.y=y-y_offset;
epsilon.x=1.0-delta.x;
epsilon.y=1.0-delta.y;
- pixels[0]=(MagickRealType) p[i];
- pixels[1]=(MagickRealType) p[GetPixelChannels(source)+i];
- pixels[2]=(MagickRealType) p[2*GetPixelChannels(source)+i];
- pixels[3]=(MagickRealType) p[3*GetPixelChannels(source)+i];
+ pixels[0]=(double) p[i];
+ pixels[1]=(double) p[GetPixelChannels(source)+i];
+ pixels[2]=(double) p[2*GetPixelChannels(source)+i];
+ pixels[3]=(double) p[3*GetPixelChannels(source)+i];
if ((traits & BlendPixelTrait) == 0)
{
gamma=((epsilon.y*(epsilon.x+delta.x)+delta.y*(epsilon.x+delta.x)));
@@ -4635,7 +4635,7 @@
}
case CatromInterpolatePixel:
{
- MagickRealType
+ double
cx[4],
cy[4];
@@ -4661,7 +4661,7 @@
for (j=0; j < 16; j++)
{
alpha[j]=1.0;
- pixels[j]=(MagickRealType) p[j*GetPixelChannels(source)+i];
+ pixels[j]=(double) p[j*GetPixelChannels(source)+i];
}
else
for (j=0; j < 16; j++)
@@ -4670,9 +4670,9 @@
GetPixelChannels(source));
pixels[j]=alpha[j]*p[j*GetPixelChannels(source)+i];
}
- CatromWeights((MagickRealType) (x-x_offset),&cx);
- CatromWeights((MagickRealType) (y-y_offset),&cy);
- gamma=((traits & BlendPixelTrait) ? (MagickRealType) (1.0) :
+ CatromWeights((double) (x-x_offset),&cx);
+ CatromWeights((double) (y-y_offset),&cy);
+ gamma=((traits & BlendPixelTrait) ? (double) (1.0) :
MagickEpsilonReciprocal(cy[0]*(cx[0]*alpha[0]+cx[1]*alpha[1]+cx[2]*
alpha[2]+cx[3]*alpha[3])+cy[1]*(cx[0]*alpha[4]+cx[1]*alpha[5]+cx[2]*
alpha[6]+cx[3]*alpha[7])+cy[2]*(cx[0]*alpha[8]+cx[1]*alpha[9]+cx[2]*
@@ -4799,10 +4799,10 @@
if ((traits == UndefinedPixelTrait) ||
(destination_traits == UndefinedPixelTrait))
continue;
- pixels[0]=(MagickRealType) p[i];
- pixels[1]=(MagickRealType) p[GetPixelChannels(source)+i];
- pixels[2]=(MagickRealType) p[2*GetPixelChannels(source)+i];
- pixels[3]=(MagickRealType) p[3*GetPixelChannels(source)+i];
+ pixels[0]=(double) p[i];
+ pixels[1]=(double) p[GetPixelChannels(source)+i];
+ pixels[2]=(double) p[2*GetPixelChannels(source)+i];
+ pixels[3]=(double) p[3*GetPixelChannels(source)+i];
if ((traits & BlendPixelTrait) == 0)
{
alpha[0]=1.0;
@@ -4889,7 +4889,7 @@
}
case SplineInterpolatePixel:
{
- MagickRealType
+ double
cx[4],
cy[4];
@@ -4915,7 +4915,7 @@
for (j=0; j < 16; j++)
{
alpha[j]=1.0;
- pixels[j]=(MagickRealType) p[j*GetPixelChannels(source)+i];
+ pixels[j]=(double) p[j*GetPixelChannels(source)+i];
}
else
for (j=0; j < 16; j++)
@@ -4924,9 +4924,9 @@
GetPixelChannels(source));
pixels[j]=alpha[j]*p[j*GetPixelChannels(source)+i];
}
- SplineWeights((MagickRealType) (x-x_offset),&cx);
- SplineWeights((MagickRealType) (y-y_offset),&cy);
- gamma=((traits & BlendPixelTrait) ? (MagickRealType) (1.0) :
+ SplineWeights((double) (x-x_offset),&cx);
+ SplineWeights((double) (y-y_offset),&cy);
+ gamma=((traits & BlendPixelTrait) ? (double) (1.0) :
MagickEpsilonReciprocal(cy[0]*(cx[0]*alpha[0]+cx[1]*alpha[1]+cx[2]*
alpha[2]+cx[3]*alpha[3])+cy[1]*(cx[0]*alpha[4]+cx[1]*alpha[5]+cx[2]*
alpha[6]+cx[3]*alpha[7])+cy[2]*(cx[0]*alpha[8]+cx[1]*alpha[9]+cx[2]*
@@ -4986,18 +4986,18 @@
*/
static inline void AlphaBlendPixelInfo(const Image *image,
- const Quantum *pixel,PixelInfo *pixel_info,MagickRealType *alpha)
+ const Quantum *pixel,PixelInfo *pixel_info,double *alpha)
{
if (image->matte == MagickFalse)
{
*alpha=1.0;
- pixel_info->red=(MagickRealType) GetPixelRed(image,pixel);
- pixel_info->green=(MagickRealType) GetPixelGreen(image,pixel);
- pixel_info->blue=(MagickRealType) GetPixelBlue(image,pixel);
+ pixel_info->red=(double) GetPixelRed(image,pixel);
+ pixel_info->green=(double) GetPixelGreen(image,pixel);
+ pixel_info->blue=(double) GetPixelBlue(image,pixel);
pixel_info->black=0.0;
if (image->colorspace == CMYKColorspace)
- pixel_info->black=(MagickRealType) GetPixelBlack(image,pixel);
- pixel_info->alpha=(MagickRealType) GetPixelAlpha(image,pixel);
+ pixel_info->black=(double) GetPixelBlack(image,pixel);
+ pixel_info->alpha=(double) GetPixelAlpha(image,pixel);
return;
}
*alpha=QuantumScale*GetPixelAlpha(image,pixel);
@@ -5007,7 +5007,7 @@
pixel_info->black=0.0;
if (image->colorspace == CMYKColorspace)
pixel_info->black=(*alpha*GetPixelBlack(image,pixel));
- pixel_info->alpha=(MagickRealType) GetPixelAlpha(image,pixel);
+ pixel_info->alpha=(double) GetPixelAlpha(image,pixel);
}
MagickExport MagickBooleanType InterpolatePixelInfo(const Image *image,
@@ -5017,7 +5017,7 @@
MagickBooleanType
status;
- MagickRealType
+ double
alpha[16],
gamma;
@@ -5195,7 +5195,7 @@
}
case CatromInterpolatePixel:
{
- MagickRealType
+ double
cx[4],
cy[4];
@@ -5208,8 +5208,8 @@
}
for (i=0; i < 16L; i++)
AlphaBlendPixelInfo(image,p+i*GetPixelChannels(image),pixels+i,alpha+i);
- CatromWeights((MagickRealType) (x-x_offset),&cx);
- CatromWeights((MagickRealType) (y-y_offset),&cy);
+ CatromWeights((double) (x-x_offset),&cx);
+ CatromWeights((double) (y-y_offset),&cy);
pixel->red=(cy[0]*(cx[0]*pixels[0].red+cx[1]*
pixels[1].red+cx[2]*pixels[2].red+cx[3]*
pixels[3].red)+cy[1]*(cx[0]*pixels[4].red+cx[1]*
@@ -5436,7 +5436,7 @@
}
case SplineInterpolatePixel:
{
- MagickRealType
+ double
cx[4],
cy[4];
@@ -5449,8 +5449,8 @@
}
for (i=0; i < 16L; i++)
AlphaBlendPixelInfo(image,p+i*GetPixelChannels(image),pixels+i,alpha+i);
- SplineWeights((MagickRealType) (x-x_offset),&cx);
- SplineWeights((MagickRealType) (y-y_offset),&cy);
+ SplineWeights((double) (x-x_offset),&cx);
+ SplineWeights((double) (y-y_offset),&cy);
pixel->red=(cy[0]*(cx[0]*pixels[0].red+cx[1]*
pixels[1].red+cx[2]*pixels[2].red+cx[3]*
pixels[3].red)+cy[1]*(cx[0]*pixels[4].red+cx[1]*
@@ -5532,16 +5532,16 @@
MagickExport MagickBooleanType IsFuzzyEquivalencePixel(const Image *source,
const Quantum *p,const Image *destination,const Quantum *q)
{
- MagickRealType
+ double
fuzz,
pixel;
- register MagickRealType
+ register double
distance,
scale;
- fuzz=MagickMax(source->fuzz,(MagickRealType) MagickSQ1_2)*MagickMax(
- destination->fuzz,(MagickRealType) MagickSQ1_2);
+ fuzz=MagickMax(source->fuzz,(double) MagickSQ1_2)*MagickMax(
+ destination->fuzz,(double) MagickSQ1_2);
scale=1.0;
distance=0.0;
if (source->matte != MagickFalse)
@@ -5549,7 +5549,7 @@
/*
Transparencies are involved - set alpha distance
*/
- pixel=GetPixelAlpha(source,p)-(MagickRealType)
+ pixel=GetPixelAlpha(source,p)-(double)
GetPixelAlpha(destination,q);
distance=pixel*pixel;
if (distance > fuzz)
@@ -5568,7 +5568,7 @@
*/
distance*=3.0; /* rescale appropriately */
fuzz*=3.0;
- pixel=GetPixelRed(source,p)-(MagickRealType) GetPixelRed(destination,q);
+ pixel=GetPixelRed(source,p)-(double) GetPixelRed(destination,q);
if ((source->colorspace == HSLColorspace) ||
(source->colorspace == HSBColorspace) ||
(source->colorspace == HWBColorspace))
@@ -5584,11 +5584,11 @@
distance+=scale*pixel*pixel;
if (distance > fuzz)
return(MagickFalse);
- pixel=GetPixelGreen(source,p)-(MagickRealType) GetPixelGreen(destination,q);
+ pixel=GetPixelGreen(source,p)-(double) GetPixelGreen(destination,q);
distance+=scale*pixel*pixel;
if (distance > fuzz)
return(MagickFalse);
- pixel=GetPixelBlue(source,p)-(MagickRealType) GetPixelBlue(destination,q);
+ pixel=GetPixelBlue(source,p)-(double) GetPixelBlue(destination,q);
distance+=scale*pixel*pixel;
if (distance > fuzz)
return(MagickFalse);
@@ -5642,25 +5642,25 @@
MagickExport MagickBooleanType IsFuzzyEquivalencePixelInfo(const PixelInfo *p,
const PixelInfo *q)
{
- MagickRealType
+ double
fuzz,
pixel;
- register MagickRealType
+ register double
scale,
distance;
if ((p->fuzz == 0.0) && (q->fuzz == 0.0))
return(IsPixelInfoEquivalent(p,q));
if (p->fuzz == 0.0)
- fuzz=MagickMax(q->fuzz,(MagickRealType) MagickSQ1_2)*MagickMax(q->fuzz,
- (MagickRealType) MagickSQ1_2);
+ fuzz=MagickMax(q->fuzz,(double) MagickSQ1_2)*MagickMax(q->fuzz,
+ (double) MagickSQ1_2);
else if (q->fuzz == 0.0)
- fuzz=MagickMax(p->fuzz,(MagickRealType) MagickSQ1_2)*MagickMax(p->fuzz,
- (MagickRealType) MagickSQ1_2);
+ fuzz=MagickMax(p->fuzz,(double) MagickSQ1_2)*MagickMax(p->fuzz,
+ (double) MagickSQ1_2);
else
- fuzz=MagickMax(p->fuzz,(MagickRealType) MagickSQ1_2)*MagickMax(q->fuzz,
- (MagickRealType) MagickSQ1_2);
+ fuzz=MagickMax(p->fuzz,(double) MagickSQ1_2)*MagickMax(q->fuzz,
+ (double) MagickSQ1_2);
scale=1.0;
distance=0.0;
if ((p->matte != MagickFalse) || (q->matte != MagickFalse))
@@ -5693,8 +5693,8 @@
distance+=pixel*pixel*scale;
if (distance > fuzz)
return(MagickFalse);
- scale*=(MagickRealType) (QuantumScale*(QuantumRange-p->black));
- scale*=(MagickRealType) (QuantumScale*(QuantumRange-q->black));
+ scale*=(double) (QuantumScale*(QuantumRange-p->black));
+ scale*=(double) (QuantumScale*(QuantumRange-q->black));
}
/*
RGB or CMY color cube.
diff --git a/MagickCore/property.c b/MagickCore/property.c
index e02a1c8..746496b 100644
--- a/MagickCore/property.c
+++ b/MagickCore/property.c
@@ -1981,7 +1981,7 @@
FxInfo
*fx_info;
- MagickRealType
+ double
alpha;
MagickStatusType
@@ -2100,22 +2100,22 @@
fx_info=AcquireFxInfo(image,property+6,exception);
status=FxEvaluateChannelExpression(fx_info,RedPixelChannel,0,0,
&alpha,exception);
- pixel.red=(MagickRealType) QuantumRange*alpha;
+ pixel.red=(double) QuantumRange*alpha;
status|=FxEvaluateChannelExpression(fx_info,GreenPixelChannel,0,0,
&alpha,exception);
- pixel.green=(MagickRealType) QuantumRange*alpha;
+ pixel.green=(double) QuantumRange*alpha;
status|=FxEvaluateChannelExpression(fx_info,BluePixelChannel,0,0,
&alpha,exception);
- pixel.blue=(MagickRealType) QuantumRange*alpha;
+ pixel.blue=(double) QuantumRange*alpha;
if (image->colorspace == CMYKColorspace)
{
status|=FxEvaluateChannelExpression(fx_info,BlackPixelChannel,0,0,
&alpha,exception);
- pixel.black=(MagickRealType) QuantumRange*alpha;
+ pixel.black=(double) QuantumRange*alpha;
}
status|=FxEvaluateChannelExpression(fx_info,AlphaPixelChannel,0,0,
&alpha,exception);
- pixel.alpha=(MagickRealType) QuantumRange*(1.0-alpha);
+ pixel.alpha=(double) QuantumRange*(1.0-alpha);
fx_info=DestroyFxInfo(fx_info);
if( IfMagickTrue(status) )
{
diff --git a/MagickCore/quantize.c b/MagickCore/quantize.c
index 84eee6a..0a2621b 100644
--- a/MagickCore/quantize.c
+++ b/MagickCore/quantize.c
@@ -220,7 +220,7 @@
*/
typedef struct _RealPixelInfo
{
- MagickRealType
+ double
red,
green,
blue,
@@ -239,7 +239,7 @@
RealPixelInfo
total_color;
- MagickRealType
+ double
quantize_error;
size_t
@@ -275,7 +275,7 @@
RealPixelInfo
target;
- MagickRealType
+ double
distance,
pruning_threshold,
next_threshold;
@@ -297,7 +297,7 @@
RealPixelInfo
error[ErrorQueueLength];
- MagickRealType
+ double
weights[ErrorQueueLength];
QuantizeInfo
@@ -435,49 +435,49 @@
static inline void AssociateAlphaPixel(const Image *image,
const CubeInfo *cube_info,const Quantum *pixel,RealPixelInfo *alpha_pixel)
{
- MagickRealType
+ double
alpha;
if ((cube_info->associate_alpha == MagickFalse) ||
(GetPixelAlpha(image,pixel)== OpaqueAlpha))
{
- alpha_pixel->red=(MagickRealType) GetPixelRed(image,pixel);
- alpha_pixel->green=(MagickRealType) GetPixelGreen(image,pixel);
- alpha_pixel->blue=(MagickRealType) GetPixelBlue(image,pixel);
- alpha_pixel->alpha=(MagickRealType) GetPixelAlpha(image,pixel);
+ alpha_pixel->red=(double) GetPixelRed(image,pixel);
+ alpha_pixel->green=(double) GetPixelGreen(image,pixel);
+ alpha_pixel->blue=(double) GetPixelBlue(image,pixel);
+ alpha_pixel->alpha=(double) GetPixelAlpha(image,pixel);
return;
}
- alpha=(MagickRealType) (QuantumScale*GetPixelAlpha(image,pixel));
+ alpha=(double) (QuantumScale*GetPixelAlpha(image,pixel));
alpha_pixel->red=alpha*GetPixelRed(image,pixel);
alpha_pixel->green=alpha*GetPixelGreen(image,pixel);
alpha_pixel->blue=alpha*GetPixelBlue(image,pixel);
- alpha_pixel->alpha=(MagickRealType) GetPixelAlpha(image,pixel);
+ alpha_pixel->alpha=(double) GetPixelAlpha(image,pixel);
}
static inline void AssociateAlphaPixelInfo(const Image *image,
const CubeInfo *cube_info,const PixelInfo *pixel,
RealPixelInfo *alpha_pixel)
{
- MagickRealType
+ double
alpha;
if ((cube_info->associate_alpha == MagickFalse) ||
(pixel->alpha == OpaqueAlpha))
{
- alpha_pixel->red=(MagickRealType) pixel->red;
- alpha_pixel->green=(MagickRealType) pixel->green;
- alpha_pixel->blue=(MagickRealType) pixel->blue;
- alpha_pixel->alpha=(MagickRealType) pixel->alpha;
+ alpha_pixel->red=(double) pixel->red;
+ alpha_pixel->green=(double) pixel->green;
+ alpha_pixel->blue=(double) pixel->blue;
+ alpha_pixel->alpha=(double) pixel->alpha;
return;
}
- alpha=(MagickRealType) (QuantumScale*pixel->alpha);
+ alpha=(double) (QuantumScale*pixel->alpha);
alpha_pixel->red=alpha*pixel->red;
alpha_pixel->green=alpha*pixel->green;
alpha_pixel->blue=alpha*pixel->blue;
- alpha_pixel->alpha=(MagickRealType) pixel->alpha;
+ alpha_pixel->alpha=(double) pixel->alpha;
}
-static inline Quantum ClampToUnsignedQuantum(const MagickRealType value)
+static inline Quantum ClampToUnsignedQuantum(const double value)
{
if (value <= 0.0)
return((Quantum) 0);
@@ -609,7 +609,7 @@
Find closest color among siblings and their children.
*/
cube.target=pixel;
- cube.distance=(MagickRealType) (4.0*(QuantumRange+1.0)*
+ cube.distance=(double) (4.0*(QuantumRange+1.0)*
(QuantumRange+1.0)+1.0);
ClosestColor(image,&cube,node_info->parent);
index=cube.color_number;
@@ -670,8 +670,8 @@
q=image->colormap;
for (i=0; i < (ssize_t) image->colors; i++)
{
- intensity=(double) ((MagickRealType) GetPixelInfoIntensity(q) <
- ((MagickRealType) QuantumRange/2.0) ? 0 : QuantumRange);
+ intensity=(double) ((double) GetPixelInfoIntensity(q) <
+ ((double) QuantumRange/2.0) ? 0 : QuantumRange);
q->red=intensity;
q->green=intensity;
q->blue=intensity;
@@ -771,7 +771,7 @@
MagickBooleanType
proceed;
- MagickRealType
+ double
bisect;
NodeInfo
@@ -803,10 +803,10 @@
else
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
(void) TransformImageColorspace((Image *) image,sRGBColorspace,exception);
- midpoint.red=(MagickRealType) QuantumRange/2.0;
- midpoint.green=(MagickRealType) QuantumRange/2.0;
- midpoint.blue=(MagickRealType) QuantumRange/2.0;
- midpoint.alpha=(MagickRealType) QuantumRange/2.0;
+ midpoint.red=(double) QuantumRange/2.0;
+ midpoint.green=(double) QuantumRange/2.0;
+ midpoint.blue=(double) QuantumRange/2.0;
+ midpoint.alpha=(double) QuantumRange/2.0;
error.alpha=0.0;
image_view=AcquireVirtualCacheView(image,exception);
for (y=0; y < (ssize_t) image->rows; y++)
@@ -844,7 +844,7 @@
}
AssociateAlphaPixel(image,cube_info,p,&pixel);
index=MaxTreeDepth-1;
- bisect=((MagickRealType) QuantumRange+1.0)/2.0;
+ bisect=((double) QuantumRange+1.0)/2.0;
mid=midpoint;
node_info=cube_info->root;
for (level=1; level <= MaxTreeDepth; level++)
@@ -939,7 +939,7 @@
}
AssociateAlphaPixel(image,cube_info,p,&pixel);
index=MaxTreeDepth-1;
- bisect=((MagickRealType) QuantumRange+1.0)/2.0;
+ bisect=((double) QuantumRange+1.0)/2.0;
mid=midpoint;
node_info=cube_info->root;
for (level=1; level <= cube_info->depth; level++)
@@ -1093,10 +1093,10 @@
ClosestColor(image,cube_info,node_info->child[i]);
if (node_info->number_unique != 0)
{
- MagickRealType
+ double
pixel;
- register MagickRealType
+ register double
alpha,
beta,
distance;
@@ -1116,8 +1116,8 @@
beta=1.0;
if (cube_info->associate_alpha != MagickFalse)
{
- alpha=(MagickRealType) (QuantumScale*p->alpha);
- beta=(MagickRealType) (QuantumScale*q->alpha);
+ alpha=(double) (QuantumScale*p->alpha);
+ beta=(double) (QuantumScale*q->alpha);
}
pixel=alpha*p->red-beta*q->red;
distance=pixel*pixel;
@@ -1237,7 +1237,7 @@
(void) DefineImageColormap(image,cube_info,node_info->child[i]);
if (node_info->number_unique != 0)
{
- register MagickRealType
+ register double
alpha;
register PixelInfo
@@ -1247,7 +1247,7 @@
Colormap entry is defined by the mean color in this cube.
*/
q=image->colormap+image->colors;
- alpha=(MagickRealType) ((MagickOffsetType) node_info->number_unique);
+ alpha=(double) ((MagickOffsetType) node_info->number_unique);
alpha=MagickEpsilonReciprocal(alpha);
if (cube_info->associate_alpha == MagickFalse)
{
@@ -1261,10 +1261,10 @@
}
else
{
- MagickRealType
+ double
opacity;
- opacity=(MagickRealType) (alpha*QuantumRange*
+ opacity=(double) (alpha*QuantumRange*
node_info->total_color.alpha);
q->alpha=(double) ClampToQuantum(opacity);
if (q->alpha == OpaqueAlpha)
@@ -1278,10 +1278,10 @@
}
else
{
- MagickRealType
+ double
gamma;
- gamma=(MagickRealType) (QuantumScale*q->alpha);
+ gamma=(double) (QuantumScale*q->alpha);
gamma=MagickEpsilonReciprocal(gamma);
q->red=(double) ClampToQuantum(alpha*gamma*QuantumRange*
node_info->total_color.red);
@@ -1580,11 +1580,11 @@
pixel.alpha+=3*previous[u-v].alpha/16;
}
}
- pixel.red=(MagickRealType) ClampToUnsignedQuantum(pixel.red);
- pixel.green=(MagickRealType) ClampToUnsignedQuantum(pixel.green);
- pixel.blue=(MagickRealType) ClampToUnsignedQuantum(pixel.blue);
+ pixel.red=(double) ClampToUnsignedQuantum(pixel.red);
+ pixel.green=(double) ClampToUnsignedQuantum(pixel.green);
+ pixel.blue=(double) ClampToUnsignedQuantum(pixel.blue);
if (cube.associate_alpha != MagickFalse)
- pixel.alpha=(MagickRealType) ClampToUnsignedQuantum(pixel.alpha);
+ pixel.alpha=(double) ClampToUnsignedQuantum(pixel.alpha);
i=CacheOffset(&cube,&pixel);
if (cube.cache[i] < 0)
{
@@ -1609,7 +1609,7 @@
Find closest color among siblings and their children.
*/
cube.target=pixel;
- cube.distance=(MagickRealType) (4.0*(QuantumRange+1.0)*(QuantumRange+
+ cube.distance=(double) (4.0*(QuantumRange+1.0)*(QuantumRange+
1.0)+1.0);
ClosestColor(image,&cube,node_info->parent);
cube.cache[i]=(ssize_t) cube.color_number;
@@ -1836,11 +1836,11 @@
if (cube_info->associate_alpha != MagickFalse)
pixel.alpha+=p->weights[i]*p->error[i].alpha;
}
- pixel.red=(MagickRealType) ClampToUnsignedQuantum(pixel.red);
- pixel.green=(MagickRealType) ClampToUnsignedQuantum(pixel.green);
- pixel.blue=(MagickRealType) ClampToUnsignedQuantum(pixel.blue);
+ pixel.red=(double) ClampToUnsignedQuantum(pixel.red);
+ pixel.green=(double) ClampToUnsignedQuantum(pixel.green);
+ pixel.blue=(double) ClampToUnsignedQuantum(pixel.blue);
if (cube_info->associate_alpha != MagickFalse)
- pixel.alpha=(MagickRealType) ClampToUnsignedQuantum(pixel.alpha);
+ pixel.alpha=(double) ClampToUnsignedQuantum(pixel.alpha);
i=CacheOffset(cube_info,&pixel);
if (p->cache[i] < 0)
{
@@ -1866,7 +1866,7 @@
Find closest color among siblings and their children.
*/
p->target=pixel;
- p->distance=(MagickRealType) (4.0*(QuantumRange+1.0)*((MagickRealType)
+ p->distance=(double) (4.0*(QuantumRange+1.0)*((double)
QuantumRange+1.0)+1.0);
ClosestColor(image,p,node_info->parent);
p->cache[i]=(ssize_t) p->color_number;
@@ -2006,7 +2006,7 @@
CubeInfo
*cube_info;
- MagickRealType
+ double
sum,
weight;
@@ -2189,7 +2189,7 @@
CacheView
*image_view;
- MagickRealType
+ double
alpha,
area,
beta,
@@ -2235,8 +2235,8 @@
index=1UL*GetPixelIndex(image,p);
if (image->matte != MagickFalse)
{
- alpha=(MagickRealType) (QuantumScale*GetPixelAlpha(image,p));
- beta=(MagickRealType) (QuantumScale*image->colormap[index].alpha);
+ alpha=(double) (QuantumScale*GetPixelAlpha(image,p));
+ beta=(double) (QuantumScale*image->colormap[index].alpha);
}
distance=fabs(alpha*GetPixelRed(image,p)-beta*
image->colormap[index].red);
@@ -2334,7 +2334,7 @@
%
*/
-static inline ssize_t MagickRound(MagickRealType x)
+static inline ssize_t MagickRound(double x)
{
/*
Round the fraction to nearest integer.
diff --git a/MagickCore/quantum-export.c b/MagickCore/quantum-export.c
index 4bd5300..461d358 100644
--- a/MagickCore/quantum-export.c
+++ b/MagickCore/quantum-export.c
@@ -3220,7 +3220,7 @@
}
if (quantum_info->alpha_type == AssociatedQuantumAlpha)
{
- MagickRealType
+ double
Sa;
register Quantum
diff --git a/MagickCore/quantum-import.c b/MagickCore/quantum-import.c
index ee83dde..9a04abc 100644
--- a/MagickCore/quantum-import.c
+++ b/MagickCore/quantum-import.c
@@ -2332,7 +2332,7 @@
{
p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelIndex(image,PushColormapIndex(image,ClampToQuantum(
- (MagickRealType) QuantumRange*HalfToSinglePrecision(pixel)),
+ (double) QuantumRange*HalfToSinglePrecision(pixel)),
&range_exception),q);
SetPixelInfoPixel(image,image->colormap+(ssize_t)
GetPixelIndex(image,q),q);
@@ -2535,7 +2535,7 @@
{
p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelIndex(image,PushColormapIndex(image,ClampToQuantum(
- (MagickRealType) QuantumRange*HalfToSinglePrecision(pixel)),
+ (double) QuantumRange*HalfToSinglePrecision(pixel)),
&range_exception),q);
SetPixelInfoPixel(image,image->colormap+(ssize_t)
GetPixelIndex(image,q),q);
@@ -3586,7 +3586,7 @@
}
if (quantum_info->alpha_type == DisassociatedQuantumAlpha)
{
- MagickRealType
+ double
gamma,
Sa;
diff --git a/MagickCore/quantum-private.h b/MagickCore/quantum-private.h
index bf94a15..86a7fa5 100644
--- a/MagickCore/quantum-private.h
+++ b/MagickCore/quantum-private.h
@@ -274,16 +274,16 @@
const QuantumAny range)
{
#if !defined(MAGICKCORE_HDRI_SUPPORT)
- return((Quantum) (((MagickRealType) QuantumRange*quantum)/range+0.5));
+ return((Quantum) (((double) QuantumRange*quantum)/range+0.5));
#else
- return((Quantum) (((MagickRealType) QuantumRange*quantum)/range));
+ return((Quantum) (((double) QuantumRange*quantum)/range));
#endif
}
static inline QuantumAny ScaleQuantumToAny(const Quantum quantum,
const QuantumAny range)
{
- return((QuantumAny) (((MagickRealType) range*quantum)/QuantumRange+0.5));
+ return((QuantumAny) (((double) range*quantum)/QuantumRange+0.5));
}
#if (MAGICKCORE_QUANTUM_DEPTH == 8)
@@ -311,7 +311,7 @@
#endif
}
-static inline Quantum ScaleMapToQuantum(const MagickRealType value)
+static inline Quantum ScaleMapToQuantum(const double value)
{
if (value <= 0.0)
return((Quantum) 0);
@@ -414,7 +414,7 @@
#endif
}
-static inline Quantum ScaleMapToQuantum(const MagickRealType value)
+static inline Quantum ScaleMapToQuantum(const double value)
{
if (value <= 0.0)
return((Quantum) 0);
@@ -503,7 +503,7 @@
return((Quantum) value);
}
-static inline Quantum ScaleMapToQuantum(const MagickRealType value)
+static inline Quantum ScaleMapToQuantum(const double value)
{
if (value <= 0.0)
return((Quantum) 0);
@@ -586,7 +586,7 @@
return((Quantum) (18446744073709551615.0*value));
}
-static inline Quantum ScaleMapToQuantum(const MagickRealType value)
+static inline Quantum ScaleMapToQuantum(const double value)
{
if (value <= 0.0)
return((Quantum) 0);
diff --git a/MagickCore/quantum.c b/MagickCore/quantum.c
index 408f846..5ac0bac 100644
--- a/MagickCore/quantum.c
+++ b/MagickCore/quantum.c
@@ -412,11 +412,11 @@
else
if (quantum_info->minimum == quantum_info->maximum)
{
- quantum_info->scale=(MagickRealType) QuantumRange/quantum_info->minimum;
+ quantum_info->scale=(double) QuantumRange/quantum_info->minimum;
quantum_info->minimum=0.0;
}
else
- quantum_info->scale=(MagickRealType) QuantumRange/(quantum_info->maximum-
+ quantum_info->scale=(double) QuantumRange/(quantum_info->maximum-
quantum_info->minimum);
option=GetImageOption(image_info,"quantum:scale");
if (option != (char *) NULL)
diff --git a/MagickCore/resample.c b/MagickCore/resample.c
index f30b4a6..7e080eb 100644
--- a/MagickCore/resample.c
+++ b/MagickCore/resample.c
@@ -499,7 +499,7 @@
color and the current background color */
/* image's average pixel color */
- weight = QuantumScale*((MagickRealType)
+ weight = QuantumScale*((double)
resample_filter->average_pixel.alpha);
resample_filter->average_pixel.red *= weight;
resample_filter->average_pixel.green *= weight;
@@ -507,7 +507,7 @@
divisor_c = weight;
/* background color */
- weight = QuantumScale*((MagickRealType)
+ weight = QuantumScale*((double)
resample_filter->image->background_color.alpha);
resample_filter->average_pixel.red +=
weight*resample_filter->image->background_color.red;
@@ -608,7 +608,7 @@
divisor_m += weight;
if (pixel->matte != MagickFalse)
- weight *= QuantumScale*((MagickRealType) GetPixelAlpha(resample_filter->image,pixels));
+ weight *= QuantumScale*((double) GetPixelAlpha(resample_filter->image,pixels));
pixel->red += weight*GetPixelRed(resample_filter->image,pixels);
pixel->green += weight*GetPixelGreen(resample_filter->image,pixels);
pixel->blue += weight*GetPixelBlue(resample_filter->image,pixels);
@@ -663,13 +663,13 @@
Finialize results of resampling
*/
divisor_m = 1.0/divisor_m;
- pixel->alpha = (MagickRealType) ClampToQuantum(divisor_m*pixel->alpha);
+ pixel->alpha = (double) ClampToQuantum(divisor_m*pixel->alpha);
divisor_c = 1.0/divisor_c;
- pixel->red = (MagickRealType) ClampToQuantum(divisor_c*pixel->red);
- pixel->green = (MagickRealType) ClampToQuantum(divisor_c*pixel->green);
- pixel->blue = (MagickRealType) ClampToQuantum(divisor_c*pixel->blue);
+ pixel->red = (double) ClampToQuantum(divisor_c*pixel->red);
+ pixel->green = (double) ClampToQuantum(divisor_c*pixel->green);
+ pixel->blue = (double) ClampToQuantum(divisor_c*pixel->blue);
if (pixel->colorspace == CMYKColorspace)
- pixel->black = (MagickRealType) ClampToQuantum(divisor_c*pixel->black);
+ pixel->black = (double) ClampToQuantum(divisor_c*pixel->black);
return(MagickTrue);
}
diff --git a/MagickCore/resize-private.h b/MagickCore/resize-private.h
index 3712f17..1ae28a1 100644
--- a/MagickCore/resize-private.h
+++ b/MagickCore/resize-private.h
@@ -25,9 +25,9 @@
typedef struct _ResizeFilter
ResizeFilter;
-extern MagickPrivate MagickRealType
+extern MagickPrivate double
GetResizeFilterSupport(const ResizeFilter *),
- GetResizeFilterWeight(const ResizeFilter *,const MagickRealType);
+ GetResizeFilterWeight(const ResizeFilter *,const double);
extern MagickPrivate ResizeFilter
*AcquireResizeFilter(const Image *,const FilterTypes,const MagickBooleanType,
diff --git a/MagickCore/resize.c b/MagickCore/resize.c
index 7d7af3c..a86318f 100644
--- a/MagickCore/resize.c
+++ b/MagickCore/resize.c
@@ -84,9 +84,9 @@
*/
struct _ResizeFilter
{
- MagickRealType
- (*filter)(const MagickRealType,const ResizeFilter *),
- (*window)(const MagickRealType,const ResizeFilter *),
+ double
+ (*filter)(const double,const ResizeFilter *),
+ (*window)(const double,const ResizeFilter *),
support, /* filter region of support - the filter support limit */
window_support, /* window support, usally equal to support (expert only) */
scale, /* dimension scaling to fit window support (usally 1.0) */
@@ -100,11 +100,11 @@
/*
Forward declaractions.
*/
-static MagickRealType
- I0(MagickRealType x),
- BesselOrderOne(MagickRealType),
- Sinc(const MagickRealType, const ResizeFilter *),
- SincFast(const MagickRealType, const ResizeFilter *);
+static double
+ I0(double x),
+ BesselOrderOne(double),
+ Sinc(const double, const ResizeFilter *),
+ SincFast(const double, const ResizeFilter *);
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -125,8 +125,8 @@
%
% The individual filter functions have this format...
%
-% static MagickRealtype *FilterName(const MagickRealType x,
-% const MagickRealType support)
+% static MagickRealtype *FilterName(const double x,
+% const double support)
%
% A description of each parameter follows:
%
@@ -139,7 +139,7 @@
%
*/
-static MagickRealType Blackman(const MagickRealType x,
+static double Blackman(const double x,
const ResizeFilter *magick_unused(resize_filter))
{
/*
@@ -149,11 +149,11 @@
Refactored by Chantal Racette and Nicolas Robidoux to one trig call and
five flops.
*/
- const MagickRealType cosine=cos((double) (MagickPI*x));
+ const double cosine=cos((double) (MagickPI*x));
return(0.34+cosine*(0.5+cosine*0.16));
}
-static MagickRealType Bohman(const MagickRealType x,
+static double Bohman(const double x,
const ResizeFilter *magick_unused(resize_filter))
{
/*
@@ -164,12 +164,12 @@
taking advantage of the fact that the support of Bohman is 1.0 (so that we
know that sin(pi x) >= 0).
*/
- const MagickRealType cosine=cos((double) (MagickPI*x));
- const MagickRealType sine=sqrt(1.0-cosine*cosine);
+ const double cosine=cos((double) (MagickPI*x));
+ const double sine=sqrt(1.0-cosine*cosine);
return((1.0-x)*cosine+(1.0/MagickPI)*sine);
}
-static MagickRealType Box(const MagickRealType magick_unused(x),
+static double Box(const double magick_unused(x),
const ResizeFilter *magick_unused(resize_filter))
{
/*
@@ -180,17 +180,17 @@
return(1.0);
}
-static MagickRealType Cosine(const MagickRealType x,
+static double Cosine(const double x,
const ResizeFilter *magick_unused(resize_filter))
{
/*
Cosine window function:
cos((pi/2)*x).
*/
- return((MagickRealType)cos((double) (MagickPI2*x)));
+ return((double)cos((double) (MagickPI2*x)));
}
-static MagickRealType CubicBC(const MagickRealType x,
+static double CubicBC(const double x,
const ResizeFilter *resize_filter)
{
/*
@@ -231,7 +231,7 @@
return(0.0);
}
-static MagickRealType Gaussian(const MagickRealType x,
+static double Gaussian(const double x,
const ResizeFilter *resize_filter)
{
/*
@@ -267,29 +267,29 @@
return(exp((double)(-resize_filter->coefficient[1]*x*x)));
}
-static MagickRealType Hanning(const MagickRealType x,
+static double Hanning(const double x,
const ResizeFilter *magick_unused(resize_filter))
{
/*
Cosine window function:
0.5+0.5*cos(pi*x).
*/
- const MagickRealType cosine=cos((double) (MagickPI*x));
+ const double cosine=cos((double) (MagickPI*x));
return(0.5+0.5*cosine);
}
-static MagickRealType Hamming(const MagickRealType x,
+static double Hamming(const double x,
const ResizeFilter *magick_unused(resize_filter))
{
/*
Offset cosine window function:
.54 + .46 cos(pi x).
*/
- const MagickRealType cosine=cos((double) (MagickPI*x));
+ const double cosine=cos((double) (MagickPI*x));
return(0.54+0.46*cosine);
}
-static MagickRealType Jinc(const MagickRealType x,
+static double Jinc(const double x,
const ResizeFilter *magick_unused(resize_filter))
{
/*
@@ -305,7 +305,7 @@
return(BesselOrderOne(MagickPI*x)/x);
}
-static MagickRealType Kaiser(const MagickRealType x,
+static double Kaiser(const double x,
const ResizeFilter *resize_filter)
{
/*
@@ -324,10 +324,10 @@
I0(resize_filter->coefficient[0]*sqrt((double) (1.0-x*x))));
}
-static MagickRealType Lagrange(const MagickRealType x,
+static double Lagrange(const double x,
const ResizeFilter *resize_filter)
{
- MagickRealType
+ double
value;
register ssize_t
@@ -358,7 +358,7 @@
return(value);
}
-static MagickRealType Quadratic(const MagickRealType x,
+static double Quadratic(const double x,
const ResizeFilter *magick_unused(resize_filter))
{
/*
@@ -371,7 +371,7 @@
return(0.0);
}
-static MagickRealType Sinc(const MagickRealType x,
+static double Sinc(const double x,
const ResizeFilter *magick_unused(resize_filter))
{
/*
@@ -380,13 +380,13 @@
*/
if (x != 0.0)
{
- const MagickRealType alpha=(MagickRealType) (MagickPI*x);
+ const double alpha=(double) (MagickPI*x);
return(sin((double) alpha)/alpha);
}
- return((MagickRealType) 1.0);
+ return((double) 1.0);
}
-static MagickRealType SincFast(const MagickRealType x,
+static double SincFast(const double x,
const ResizeFilter *magick_unused(resize_filter))
{
/*
@@ -415,72 +415,72 @@
*/
if (x > 4.0)
{
- const MagickRealType alpha=(MagickRealType) (MagickPI*x);
+ const double alpha=(double) (MagickPI*x);
return(sin((double) alpha)/alpha);
}
{
/*
The approximations only depend on x^2 (sinc is an even function).
*/
- const MagickRealType xx = x*x;
+ const double xx = x*x;
#if MAGICKCORE_QUANTUM_DEPTH <= 8
/*
Maximum absolute relative error 6.3e-6 < 1/2^17.
*/
- const MagickRealType c0 = 0.173610016489197553621906385078711564924e-2L;
- const MagickRealType c1 = -0.384186115075660162081071290162149315834e-3L;
- const MagickRealType c2 = 0.393684603287860108352720146121813443561e-4L;
- const MagickRealType c3 = -0.248947210682259168029030370205389323899e-5L;
- const MagickRealType c4 = 0.107791837839662283066379987646635416692e-6L;
- const MagickRealType c5 = -0.324874073895735800961260474028013982211e-8L;
- const MagickRealType c6 = 0.628155216606695311524920882748052490116e-10L;
- const MagickRealType c7 = -0.586110644039348333520104379959307242711e-12L;
- const MagickRealType p =
+ const double c0 = 0.173610016489197553621906385078711564924e-2L;
+ const double c1 = -0.384186115075660162081071290162149315834e-3L;
+ const double c2 = 0.393684603287860108352720146121813443561e-4L;
+ const double c3 = -0.248947210682259168029030370205389323899e-5L;
+ const double c4 = 0.107791837839662283066379987646635416692e-6L;
+ const double c5 = -0.324874073895735800961260474028013982211e-8L;
+ const double c6 = 0.628155216606695311524920882748052490116e-10L;
+ const double c7 = -0.586110644039348333520104379959307242711e-12L;
+ const double p =
c0+xx*(c1+xx*(c2+xx*(c3+xx*(c4+xx*(c5+xx*(c6+xx*c7))))));
return((xx-1.0)*(xx-4.0)*(xx-9.0)*(xx-16.0)*p);
#elif MAGICKCORE_QUANTUM_DEPTH <= 16
/*
Max. abs. rel. error 2.2e-8 < 1/2^25.
*/
- const MagickRealType c0 = 0.173611107357320220183368594093166520811e-2L;
- const MagickRealType c1 = -0.384240921114946632192116762889211361285e-3L;
- const MagickRealType c2 = 0.394201182359318128221229891724947048771e-4L;
- const MagickRealType c3 = -0.250963301609117217660068889165550534856e-5L;
- const MagickRealType c4 = 0.111902032818095784414237782071368805120e-6L;
- const MagickRealType c5 = -0.372895101408779549368465614321137048875e-8L;
- const MagickRealType c6 = 0.957694196677572570319816780188718518330e-10L;
- const MagickRealType c7 = -0.187208577776590710853865174371617338991e-11L;
- const MagickRealType c8 = 0.253524321426864752676094495396308636823e-13L;
- const MagickRealType c9 = -0.177084805010701112639035485248501049364e-15L;
- const MagickRealType p =
+ const double c0 = 0.173611107357320220183368594093166520811e-2L;
+ const double c1 = -0.384240921114946632192116762889211361285e-3L;
+ const double c2 = 0.394201182359318128221229891724947048771e-4L;
+ const double c3 = -0.250963301609117217660068889165550534856e-5L;
+ const double c4 = 0.111902032818095784414237782071368805120e-6L;
+ const double c5 = -0.372895101408779549368465614321137048875e-8L;
+ const double c6 = 0.957694196677572570319816780188718518330e-10L;
+ const double c7 = -0.187208577776590710853865174371617338991e-11L;
+ const double c8 = 0.253524321426864752676094495396308636823e-13L;
+ const double c9 = -0.177084805010701112639035485248501049364e-15L;
+ const double p =
c0+xx*(c1+xx*(c2+xx*(c3+xx*(c4+xx*(c5+xx*(c6+xx*(c7+xx*(c8+xx*c9))))))));
return((xx-1.0)*(xx-4.0)*(xx-9.0)*(xx-16.0)*p);
#else
/*
Max. abs. rel. error 1.2e-12 < 1/2^39.
*/
- const MagickRealType c0 = 0.173611111110910715186413700076827593074e-2L;
- const MagickRealType c1 = -0.289105544717893415815859968653611245425e-3L;
- const MagickRealType c2 = 0.206952161241815727624413291940849294025e-4L;
- const MagickRealType c3 = -0.834446180169727178193268528095341741698e-6L;
- const MagickRealType c4 = 0.207010104171026718629622453275917944941e-7L;
- const MagickRealType c5 = -0.319724784938507108101517564300855542655e-9L;
- const MagickRealType c6 = 0.288101675249103266147006509214934493930e-11L;
- const MagickRealType c7 = -0.118218971804934245819960233886876537953e-13L;
- const MagickRealType p =
+ const double c0 = 0.173611111110910715186413700076827593074e-2L;
+ const double c1 = -0.289105544717893415815859968653611245425e-3L;
+ const double c2 = 0.206952161241815727624413291940849294025e-4L;
+ const double c3 = -0.834446180169727178193268528095341741698e-6L;
+ const double c4 = 0.207010104171026718629622453275917944941e-7L;
+ const double c5 = -0.319724784938507108101517564300855542655e-9L;
+ const double c6 = 0.288101675249103266147006509214934493930e-11L;
+ const double c7 = -0.118218971804934245819960233886876537953e-13L;
+ const double p =
c0+xx*(c1+xx*(c2+xx*(c3+xx*(c4+xx*(c5+xx*(c6+xx*c7))))));
- const MagickRealType d0 = 1.0L;
- const MagickRealType d1 = 0.547981619622284827495856984100563583948e-1L;
- const MagickRealType d2 = 0.134226268835357312626304688047086921806e-2L;
- const MagickRealType d3 = 0.178994697503371051002463656833597608689e-4L;
- const MagickRealType d4 = 0.114633394140438168641246022557689759090e-6L;
- const MagickRealType q = d0+xx*(d1+xx*(d2+xx*(d3+xx*d4)));
+ const double d0 = 1.0L;
+ const double d1 = 0.547981619622284827495856984100563583948e-1L;
+ const double d2 = 0.134226268835357312626304688047086921806e-2L;
+ const double d3 = 0.178994697503371051002463656833597608689e-4L;
+ const double d4 = 0.114633394140438168641246022557689759090e-6L;
+ const double q = d0+xx*(d1+xx*(d2+xx*(d3+xx*d4)));
return((xx-1.0)*(xx-4.0)*(xx-9.0)*(xx-16.0)/q*p);
#endif
}
}
-static MagickRealType Triangle(const MagickRealType x,
+static double Triangle(const double x,
const ResizeFilter *magick_unused(resize_filter))
{
/*
@@ -493,7 +493,7 @@
return(0.0);
}
-static MagickRealType Welsh(const MagickRealType x,
+static double Welsh(const double x,
const ResizeFilter *magick_unused(resize_filter))
{
/*
@@ -699,7 +699,7 @@
filter_type,
window_type;
- MagickRealType
+ double
B,
C,
value;
@@ -771,8 +771,8 @@
*/
static struct
{
- MagickRealType
- (*function)(const MagickRealType,const ResizeFilter*),
+ double
+ (*function)(const double,const ResizeFilter*),
support, /* Default lobes/support size of the weighting filter. */
scale, /* Support when function used as a windowing function
Typically equal to the location of the first zero crossing. */
@@ -830,7 +830,7 @@
http://cose.math.bas.bg/webMathematica/webComputing/BesselZeros.jsp
using Jv-function with v=1, then dividing by PI.
*/
- static MagickRealType
+ static double
jinc_zeros[16] =
{
1.2196698912665045,
@@ -930,7 +930,7 @@
{
case BoxFilter:
/* Support for Cylindrical Box should be sqrt(2)/2 */
- resize_filter->support=(MagickRealType) MagickSQ1_2;
+ resize_filter->support=(double) MagickSQ1_2;
break;
case LanczosFilter:
case LanczosSharpFilter:
@@ -1000,7 +1000,7 @@
if (artifact != (const char *) NULL)
resize_filter->blur*=StringToDouble(artifact,(char **) NULL);
if (resize_filter->blur < MagickEpsilon)
- resize_filter->blur=(MagickRealType) MagickEpsilon;
+ resize_filter->blur=(double) MagickEpsilon;
/* Support Overrides */
artifact=GetImageArtifact(image,"filter:lobes");
@@ -1012,7 +1012,7 @@
lobes=(ssize_t) StringToLong(artifact);
if (lobes < 1)
lobes=1;
- resize_filter->support=(MagickRealType) lobes;
+ resize_filter->support=(double) lobes;
}
/* Convert a Jinc function lobes value to a real support value */
if (resize_filter->filter == Jinc)
@@ -1235,18 +1235,18 @@
%
% The format of the BesselOrderOne method is:
%
-% MagickRealType BesselOrderOne(MagickRealType x)
+% double BesselOrderOne(double x)
%
% A description of each parameter follows:
%
-% o x: MagickRealType value.
+% o x: double value.
%
*/
#undef I0
-static MagickRealType I0(MagickRealType x)
+static double I0(double x)
{
- MagickRealType
+ double
sum,
t,
y;
@@ -1263,15 +1263,15 @@
for (i=2; t > MagickEpsilon; i++)
{
sum+=t;
- t*=y/((MagickRealType) i*i);
+ t*=y/((double) i*i);
}
return(sum);
}
#undef J1
-static MagickRealType J1(MagickRealType x)
+static double J1(double x)
{
- MagickRealType
+ double
p,
q;
@@ -1315,9 +1315,9 @@
}
#undef P1
-static MagickRealType P1(MagickRealType x)
+static double P1(double x)
{
- MagickRealType
+ double
p,
q;
@@ -1355,9 +1355,9 @@
}
#undef Q1
-static MagickRealType Q1(MagickRealType x)
+static double Q1(double x)
{
- MagickRealType
+ double
p,
q;
@@ -1394,9 +1394,9 @@
return(p/q);
}
-static MagickRealType BesselOrderOne(MagickRealType x)
+static double BesselOrderOne(double x)
{
- MagickRealType
+ double
p,
q;
@@ -1462,14 +1462,14 @@
%
% The format of the GetResizeFilterSupport method is:
%
-% MagickRealType GetResizeFilterSupport(const ResizeFilter *resize_filter)
+% double GetResizeFilterSupport(const ResizeFilter *resize_filter)
%
% A description of each parameter follows:
%
% o filter: Image filter to use.
%
*/
-MagickPrivate MagickRealType GetResizeFilterSupport(
+MagickPrivate double GetResizeFilterSupport(
const ResizeFilter *resize_filter)
{
assert(resize_filter != (ResizeFilter *) NULL);
@@ -1494,8 +1494,8 @@
%
% The format of the GetResizeFilterWeight method is:
%
-% MagickRealType GetResizeFilterWeight(const ResizeFilter *resize_filter,
-% const MagickRealType x)
+% double GetResizeFilterWeight(const ResizeFilter *resize_filter,
+% const double x)
%
% A description of each parameter follows:
%
@@ -1504,10 +1504,10 @@
% o x: the point.
%
*/
-MagickPrivate MagickRealType GetResizeFilterWeight(
- const ResizeFilter *resize_filter,const MagickRealType x)
+MagickPrivate double GetResizeFilterWeight(
+ const ResizeFilter *resize_filter,const double x)
{
- MagickRealType
+ double
scale,
weight,
x_blur;
@@ -1636,7 +1636,7 @@
exception);
if (q == (Quantum *) NULL)
continue;
- offset.y=((MagickRealType) y+0.5)*scale.y-0.5;
+ offset.y=((double) y+0.5)*scale.y-0.5;
for (x=0; x < (ssize_t) resize_image->columns; x++)
{
register ssize_t
@@ -1662,7 +1662,7 @@
if ((traits == UndefinedPixelTrait) ||
(resize_traits == UndefinedPixelTrait))
continue;
- offset.x=((MagickRealType) x+0.5)*scale.x-0.5;
+ offset.x=((double) x+0.5)*scale.x-0.5;
status=InterpolatePixelChannels(image,image_view,resize_image,method,
offset.x,offset.y,q,exception);
}
@@ -2108,7 +2108,7 @@
typedef struct _ContributionInfo
{
- MagickRealType
+ double
weight;
ssize_t
@@ -2172,7 +2172,7 @@
}
static MagickBooleanType HorizontalFilter(const ResizeFilter *resize_filter,
- const Image *image,Image *resize_image,const MagickRealType x_factor,
+ const Image *image,Image *resize_image,const double x_factor,
const MagickSizeType span,MagickOffsetType *offset,ExceptionInfo *exception)
{
#define ResizeImageTag "Resize/Image"
@@ -2190,7 +2190,7 @@
MagickBooleanType
status;
- MagickRealType
+ double
scale,
support;
@@ -2210,7 +2210,7 @@
/*
Support too small even for nearest neighbour: Reduce to point sampling.
*/
- support=(MagickRealType) 0.5;
+ support=(double) 0.5;
scale=1.0;
}
contributions=AcquireContributionThreadSet((size_t) (2.0*support+3.0));
@@ -2230,7 +2230,7 @@
#endif
for (x=0; x < (ssize_t) resize_image->columns; x++)
{
- MagickRealType
+ double
bisect,
density;
@@ -2253,7 +2253,7 @@
if( IfMagickFalse(status) )
continue;
- bisect=(MagickRealType) (x+0.5)/x_factor+MagickEpsilon;
+ bisect=(double) (x+0.5)/x_factor+MagickEpsilon;
start=(ssize_t) MagickMax(bisect-support+0.5,0.0);
stop=(ssize_t) MagickMin(bisect+support+0.5,(double) image->columns);
density=0.0;
@@ -2262,7 +2262,7 @@
{
contribution[n].pixel=start+n;
contribution[n].weight=GetResizeFilterWeight(resize_filter,scale*
- ((MagickRealType) (start+n)-bisect+0.5));
+ ((double) (start+n)-bisect+0.5));
density+=contribution[n].weight;
}
if ((density != 0.0) && (density != 1.0))
@@ -2298,7 +2298,7 @@
}
for (i=0; i < (ssize_t) GetPixelChannels(resize_image); i++)
{
- MagickRealType
+ double
alpha,
gamma,
pixel;
@@ -2388,7 +2388,7 @@
}
static MagickBooleanType VerticalFilter(const ResizeFilter *resize_filter,
- const Image *image,Image *resize_image,const MagickRealType y_factor,
+ const Image *image,Image *resize_image,const double y_factor,
const MagickSizeType span,MagickOffsetType *offset,ExceptionInfo *exception)
{
CacheView
@@ -2407,7 +2407,7 @@
PixelInfo
zero;
- MagickRealType
+ double
scale,
support;
@@ -2427,7 +2427,7 @@
/*
Support too small even for nearest neighbour: Reduce to point sampling.
*/
- support=(MagickRealType) 0.5;
+ support=(double) 0.5;
scale=1.0;
}
contributions=AcquireContributionThreadSet((size_t) (2.0*support+3.0));
@@ -2448,7 +2448,7 @@
#endif
for (y=0; y < (ssize_t) resize_image->rows; y++)
{
- MagickRealType
+ double
bisect,
density;
@@ -2471,7 +2471,7 @@
if( IfMagickFalse(status) )
continue;
- bisect=(MagickRealType) (y+0.5)/y_factor+MagickEpsilon;
+ bisect=(double) (y+0.5)/y_factor+MagickEpsilon;
start=(ssize_t) MagickMax(bisect-support+0.5,0.0);
stop=(ssize_t) MagickMin(bisect+support+0.5,(double) image->rows);
density=0.0;
@@ -2480,7 +2480,7 @@
{
contribution[n].pixel=start+n;
contribution[n].weight=GetResizeFilterWeight(resize_filter,scale*
- ((MagickRealType) (start+n)-bisect+0.5));
+ ((double) (start+n)-bisect+0.5));
density+=contribution[n].weight;
}
if ((density != 0.0) && (density != 1.0))
@@ -2517,7 +2517,7 @@
}
for (i=0; i < (ssize_t) GetPixelChannels(resize_image); i++)
{
- MagickRealType
+ double
alpha,
gamma,
pixel;
@@ -2618,7 +2618,7 @@
MagickOffsetType
offset;
- MagickRealType
+ double
x_factor,
y_factor;
@@ -2651,8 +2651,8 @@
/*
Acquire resize filter.
*/
- x_factor=(MagickRealType) columns/(MagickRealType) image->columns;
- y_factor=(MagickRealType) rows/(MagickRealType) image->rows;
+ x_factor=(double) columns/(double) image->columns;
+ y_factor=(double) rows/(double) image->rows;
if ((x_factor*y_factor) > WorkLoadFactor)
filter_image=CloneImage(image,columns,image->rows,MagickTrue,exception);
else
@@ -2788,7 +2788,7 @@
ThrowImageException(ResourceLimitError,"MemoryAllocationFailed");
}
for (x=0; x < (ssize_t) sample_image->columns; x++)
- x_offset[x]=(ssize_t) (((MagickRealType) x+0.5)*image->columns/
+ x_offset[x]=(ssize_t) (((double) x+0.5)*image->columns/
sample_image->columns);
/*
Sample each row.
@@ -2817,7 +2817,7 @@
if( IfMagickFalse(status) )
continue;
- y_offset=(ssize_t) (((MagickRealType) y+0.5)*image->rows/
+ y_offset=(ssize_t) (((double) y+0.5)*image->rows/
sample_image->rows);
p=GetCacheViewVirtualPixels(image_view,0,y_offset,image->columns,1,
exception);
@@ -2929,7 +2929,7 @@
next_row,
proceed;
- MagickRealType
+ double
alpha,
gamma,
pixel[CompositePixelChannel],
@@ -2981,20 +2981,20 @@
/*
Allocate memory.
*/
- x_vector=(MagickRealType *) AcquireQuantumMemory((size_t) image->columns,
+ x_vector=(double *) AcquireQuantumMemory((size_t) image->columns,
GetPixelChannels(image)*sizeof(*x_vector));
scanline=x_vector;
if (image->rows != scale_image->rows)
- scanline=(MagickRealType *) AcquireQuantumMemory((size_t) image->columns,
+ scanline=(double *) AcquireQuantumMemory((size_t) image->columns,
GetPixelChannels(image)*sizeof(*scanline));
- scale_scanline=(MagickRealType *) AcquireQuantumMemory((size_t)
+ scale_scanline=(double *) AcquireQuantumMemory((size_t)
scale_image->columns,MaxPixelChannels*sizeof(*scale_scanline));
- y_vector=(MagickRealType *) AcquireQuantumMemory((size_t) image->columns,
+ y_vector=(double *) AcquireQuantumMemory((size_t) image->columns,
GetPixelChannels(image)*sizeof(*y_vector));
- if ((scanline == (MagickRealType *) NULL) ||
- (scale_scanline == (MagickRealType *) NULL) ||
- (x_vector == (MagickRealType *) NULL) ||
- (y_vector == (MagickRealType *) NULL))
+ if ((scanline == (double *) NULL) ||
+ (scale_scanline == (double *) NULL) ||
+ (x_vector == (double *) NULL) ||
+ (y_vector == (double *) NULL))
{
scale_image=DestroyImage(scale_image);
ThrowImageException(ResourceLimitError,"MemoryAllocationFailed");
@@ -3055,7 +3055,7 @@
traits=GetPixelChannelMapTraits(image,channel);
if ((traits & BlendPixelTrait) == 0)
{
- x_vector[x*GetPixelChannels(image)+i]=(MagickRealType) p[i];
+ x_vector[x*GetPixelChannels(image)+i]=(double) p[i];
continue;
}
alpha=QuantumScale*GetPixelAlpha(image,p);
@@ -3099,7 +3099,7 @@
traits=GetPixelChannelMapTraits(image,channel);
if ((traits & BlendPixelTrait) == 0)
{
- x_vector[x*GetPixelChannels(image)+i]=(MagickRealType)
+ x_vector[x*GetPixelChannels(image)+i]=(double)
p[i];
continue;
}
@@ -3146,7 +3146,7 @@
traits=GetPixelChannelMapTraits(image,channel);
if ((traits & BlendPixelTrait) == 0)
{
- x_vector[x*GetPixelChannels(image)+i]=(MagickRealType) p[i];
+ x_vector[x*GetPixelChannels(image)+i]=(double) p[i];
continue;
}
alpha=QuantumScale*GetPixelAlpha(image,p);
@@ -3325,11 +3325,11 @@
/*
Free allocated memory.
*/
- y_vector=(MagickRealType *) RelinquishMagickMemory(y_vector);
- scale_scanline=(MagickRealType *) RelinquishMagickMemory(scale_scanline);
+ y_vector=(double *) RelinquishMagickMemory(y_vector);
+ scale_scanline=(double *) RelinquishMagickMemory(scale_scanline);
if (scale_image->rows != image->rows)
- scanline=(MagickRealType *) RelinquishMagickMemory(scanline);
- x_vector=(MagickRealType *) RelinquishMagickMemory(x_vector);
+ scanline=(double *) RelinquishMagickMemory(scanline);
+ x_vector=(double *) RelinquishMagickMemory(x_vector);
scale_image->type=image->type;
return(scale_image);
}
@@ -3379,7 +3379,7 @@
Image
*thumbnail_image;
- MagickRealType
+ double
x_factor,
y_factor;
@@ -3395,8 +3395,8 @@
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
assert(exception != (ExceptionInfo *) NULL);
assert(exception->signature == MagickSignature);
- x_factor=(MagickRealType) columns/(MagickRealType) image->columns;
- y_factor=(MagickRealType) rows/(MagickRealType) image->rows;
+ x_factor=(double) columns/(double) image->columns;
+ y_factor=(double) rows/(double) image->rows;
if ((x_factor*y_factor) > 0.1)
thumbnail_image=ResizeImage(image,columns,rows,image->filter,exception);
else
diff --git a/MagickCore/segment.c b/MagickCore/segment.c
index 5ceefd9..d738fa1 100644
--- a/MagickCore/segment.c
+++ b/MagickCore/segment.c
@@ -124,7 +124,7 @@
*/
typedef struct _ExtentPacket
{
- MagickRealType
+ double
center;
ssize_t
@@ -150,14 +150,14 @@
typedef struct _IntervalTree
{
- MagickRealType
+ double
tau;
ssize_t
left,
right;
- MagickRealType
+ double
mean_stability,
stability;
@@ -168,7 +168,7 @@
typedef struct _ZeroCrossing
{
- MagickRealType
+ double
tau,
histogram[256];
@@ -189,7 +189,7 @@
/*
Method prototypes.
*/
-static MagickRealType
+static double
OptimalTau(const ssize_t *,const double,const double,const double,
const double,short *);
@@ -198,8 +198,8 @@
static void
InitializeHistogram(const Image *,ssize_t **,ExceptionInfo *),
- ScaleSpace(const ssize_t *,const MagickRealType,MagickRealType *),
- ZeroCrossHistogram(MagickRealType *,const MagickRealType,short *);
+ ScaleSpace(const ssize_t *,const double,double *),
+ ZeroCrossHistogram(double *,const double,short *);
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -219,8 +219,8 @@
% The format of the Classify method is:
%
% MagickBooleanType Classify(Image *image,short **extrema,
-% const MagickRealType cluster_threshold,
-% const MagickRealType weighting_exponent,
+% const double cluster_threshold,
+% const double weighting_exponent,
% const MagickBooleanType verbose,ExceptionInfo *exception)
%
% A description of each parameter follows.
@@ -231,7 +231,7 @@
% represent the peaks and valleys of the histogram for each color
% component.
%
-% o cluster_threshold: This MagickRealType represents the minimum number of
+% o cluster_threshold: This double represents the minimum number of
% pixels contained in a hexahedra before it can be considered valid
% (expressed as a percentage).
%
@@ -244,8 +244,8 @@
%
*/
static MagickBooleanType Classify(Image *image,short **extrema,
- const MagickRealType cluster_threshold,
- const MagickRealType weighting_exponent,const MagickBooleanType verbose,
+ const double cluster_threshold,
+ const double weighting_exponent,const MagickBooleanType verbose,
ExceptionInfo *exception)
{
#define SegmentImageTag "Segment/Image"
@@ -267,7 +267,7 @@
MagickOffsetType
progress;
- MagickRealType
+ double
*free_squares;
MagickStatusType
@@ -276,7 +276,7 @@
register ssize_t
i;
- register MagickRealType
+ register double
*squares;
size_t
@@ -387,11 +387,11 @@
Count this pixel.
*/
count++;
- cluster->red.center+=(MagickRealType) ScaleQuantumToChar(
+ cluster->red.center+=(double) ScaleQuantumToChar(
GetPixelRed(image,p));
- cluster->green.center+=(MagickRealType) ScaleQuantumToChar(
+ cluster->green.center+=(double) ScaleQuantumToChar(
GetPixelGreen(image,p));
- cluster->blue.center+=(MagickRealType) ScaleQuantumToChar(
+ cluster->blue.center+=(double) ScaleQuantumToChar(
GetPixelBlue(image,p));
cluster->count++;
break;
@@ -504,13 +504,13 @@
/*
Speed up distance calculations.
*/
- squares=(MagickRealType *) AcquireQuantumMemory(513UL,sizeof(*squares));
- if (squares == (MagickRealType *) NULL)
+ squares=(double *) AcquireQuantumMemory(513UL,sizeof(*squares));
+ if (squares == (double *) NULL)
ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
image->filename);
squares+=255;
for (i=(-255); i <= 255; i++)
- squares[i]=(MagickRealType) i*(MagickRealType) i;
+ squares[i]=(double) i*(double) i;
/*
Allocate image colormap.
*/
@@ -585,7 +585,7 @@
}
if (cluster == (Cluster *) NULL)
{
- MagickRealType
+ double
distance_squared,
local_minima,
numerator,
@@ -665,7 +665,7 @@
}
squares-=255;
free_squares=squares;
- free_squares=(MagickRealType *) RelinquishMagickMemory(free_squares);
+ free_squares=(double *) RelinquishMagickMemory(free_squares);
return(MagickTrue);
}
@@ -878,21 +878,21 @@
%
% The format of the DerivativeHistogram method is:
%
-% DerivativeHistogram(const MagickRealType *histogram,
-% MagickRealType *derivative)
+% DerivativeHistogram(const double *histogram,
+% double *derivative)
%
% A description of each parameter follows.
%
-% o histogram: Specifies an array of MagickRealTypes representing the number
+% o histogram: Specifies an array of doubles representing the number
% of pixels for each intensity of a particular color component.
%
-% o derivative: This array of MagickRealTypes is initialized by
+% o derivative: This array of doubles is initialized by
% DerivativeHistogram to the derivative of the histogram using central
% differencing.
%
*/
-static void DerivativeHistogram(const MagickRealType *histogram,
- MagickRealType *derivative)
+static void DerivativeHistogram(const double *histogram,
+ double *derivative)
{
register ssize_t
i,
@@ -935,7 +935,7 @@
%
% o image: the image.
%
-% o cluster_threshold: This MagickRealType represents the minimum number of
+% o cluster_threshold: This double represents the minimum number of
% pixels contained in a hexahedra before it can be considered valid
% (expressed as a percentage).
%
@@ -968,7 +968,7 @@
MagickBooleanType
proceed;
- MagickRealType
+ double
threshold;
register const Quantum
@@ -1119,11 +1119,11 @@
Count this pixel.
*/
count++;
- cluster->red.center+=(MagickRealType) ScaleQuantumToChar(
+ cluster->red.center+=(double) ScaleQuantumToChar(
GetPixelRed(image,p));
- cluster->green.center+=(MagickRealType) ScaleQuantumToChar(
+ cluster->green.center+=(double) ScaleQuantumToChar(
GetPixelGreen(image,p));
- cluster->blue.center+=(MagickRealType) ScaleQuantumToChar(
+ cluster->blue.center+=(double) ScaleQuantumToChar(
GetPixelBlue(image,p));
cluster->count++;
break;
@@ -1187,13 +1187,13 @@
}
}
threshold=(background->red.center+object->red.center)/2.0;
- pixel->red=(MagickRealType) ScaleCharToQuantum((unsigned char)
+ pixel->red=(double) ScaleCharToQuantum((unsigned char)
(threshold+0.5));
threshold=(background->green.center+object->green.center)/2.0;
- pixel->green=(MagickRealType) ScaleCharToQuantum((unsigned char)
+ pixel->green=(double) ScaleCharToQuantum((unsigned char)
(threshold+0.5));
threshold=(background->blue.center+object->blue.center)/2.0;
- pixel->blue=(MagickRealType) ScaleCharToQuantum((unsigned char)
+ pixel->blue=(double) ScaleCharToQuantum((unsigned char)
(threshold+0.5));
/*
Relinquish resources.
@@ -1327,7 +1327,7 @@
register ssize_t
count;
- register MagickRealType
+ register double
sum;
sum=0.0;
@@ -1337,7 +1337,7 @@
sum+=child->stability;
count++;
}
- node->mean_stability=sum/(MagickRealType) count;
+ node->mean_stability=sum/(double) count;
}
MeanStability(node->sibling);
MeanStability(node->child);
@@ -1465,7 +1465,7 @@
%
% The format of the OptimalTau method is:
%
-% MagickRealType OptimalTau(const ssize_t *histogram,const double max_tau,
+% double OptimalTau(const ssize_t *histogram,const double max_tau,
% const double min_tau,const double delta_tau,
% const double smooth_threshold,short *extrema)
%
@@ -1506,7 +1506,7 @@
node=(IntervalTree *) RelinquishMagickMemory(node);
}
-static MagickRealType OptimalTau(const ssize_t *histogram,const double max_tau,
+static double OptimalTau(const ssize_t *histogram,const double max_tau,
const double min_tau,const double delta_tau,const double smooth_threshold,
short *extrema)
{
@@ -1518,7 +1518,7 @@
MagickBooleanType
peak;
- MagickRealType
+ double
average_tau,
*derivative,
*second_derivative,
@@ -1562,11 +1562,11 @@
/*
Initialize zero crossing list.
*/
- derivative=(MagickRealType *) AcquireQuantumMemory(256,sizeof(*derivative));
- second_derivative=(MagickRealType *) AcquireQuantumMemory(256,
+ derivative=(double *) AcquireQuantumMemory(256,sizeof(*derivative));
+ second_derivative=(double *) AcquireQuantumMemory(256,
sizeof(*second_derivative));
- if ((derivative == (MagickRealType *) NULL) ||
- (second_derivative == (MagickRealType *) NULL))
+ if ((derivative == (double *) NULL) ||
+ (second_derivative == (double *) NULL))
ThrowFatalException(ResourceLimitFatalError,
"UnableToAllocateDerivatives");
i=0;
@@ -1585,14 +1585,14 @@
*/
zero_crossing[i].tau=0.0;
for (j=0; j <= 255; j++)
- zero_crossing[i].histogram[j]=(MagickRealType) histogram[j];
+ zero_crossing[i].histogram[j]=(double) histogram[j];
DerivativeHistogram(zero_crossing[i].histogram,derivative);
DerivativeHistogram(derivative,second_derivative);
ZeroCrossHistogram(second_derivative,smooth_threshold,
zero_crossing[i].crossings);
number_crossings=(size_t) i;
- derivative=(MagickRealType *) RelinquishMagickMemory(derivative);
- second_derivative=(MagickRealType *)
+ derivative=(double *) RelinquishMagickMemory(derivative);
+ second_derivative=(double *)
RelinquishMagickMemory(second_derivative);
/*
Ensure the scale-space fingerprints form lines in scale-space, not loops.
@@ -1679,7 +1679,7 @@
average_tau=0.0;
for (i=0; i < number_nodes; i++)
average_tau+=list[i]->tau;
- average_tau/=(MagickRealType) number_nodes;
+ average_tau/=(double) number_nodes;
/*
Relinquish resources.
*/
@@ -1704,20 +1704,20 @@
%
% The format of the ScaleSpace method is:
%
-% ScaleSpace(const ssize_t *histogram,const MagickRealType tau,
-% MagickRealType *scale_histogram)
+% ScaleSpace(const ssize_t *histogram,const double tau,
+% double *scale_histogram)
%
% A description of each parameter follows.
%
-% o histogram: Specifies an array of MagickRealTypes representing the number
+% o histogram: Specifies an array of doubles representing the number
% of pixels for each intensity of a particular color component.
%
*/
-static void ScaleSpace(const ssize_t *histogram,const MagickRealType tau,
- MagickRealType *scale_histogram)
+static void ScaleSpace(const ssize_t *histogram,const double tau,
+ double *scale_histogram)
{
- MagickRealType
+ double
alpha,
beta,
*gamma,
@@ -1727,8 +1727,8 @@
u,
x;
- gamma=(MagickRealType *) AcquireQuantumMemory(256,sizeof(*gamma));
- if (gamma == (MagickRealType *) NULL)
+ gamma=(double *) AcquireQuantumMemory(256,sizeof(*gamma));
+ if (gamma == (double *) NULL)
ThrowFatalException(ResourceLimitFatalError,
"UnableToAllocateGammaMap");
alpha=MagickEpsilonReciprocal(tau*sqrt(2.0*MagickPI));
@@ -1745,10 +1745,10 @@
{
sum=0.0;
for (u=0; u <= 255; u++)
- sum+=(MagickRealType) histogram[u]*gamma[MagickAbsoluteValue(x-u)];
+ sum+=(double) histogram[u]*gamma[MagickAbsoluteValue(x-u)];
scale_histogram[x]=alpha*sum;
}
- gamma=(MagickRealType *) RelinquishMagickMemory(gamma);
+ gamma=(double *) RelinquishMagickMemory(gamma);
}
/*
@@ -1881,12 +1881,12 @@
%
% The format of the ZeroCrossHistogram method is:
%
-% ZeroCrossHistogram(MagickRealType *second_derivative,
-% const MagickRealType smooth_threshold,short *crossings)
+% ZeroCrossHistogram(double *second_derivative,
+% const double smooth_threshold,short *crossings)
%
% A description of each parameter follows.
%
-% o second_derivative: Specifies an array of MagickRealTypes representing the
+% o second_derivative: Specifies an array of doubles representing the
% second derivative of the histogram of a particular color component.
%
% o crossings: This array of integers is initialized with
@@ -1894,8 +1894,8 @@
% of a particular color component.
%
*/
-static void ZeroCrossHistogram(MagickRealType *second_derivative,
- const MagickRealType smooth_threshold,short *crossings)
+static void ZeroCrossHistogram(double *second_derivative,
+ const double smooth_threshold,short *crossings)
{
register ssize_t
i;
diff --git a/MagickCore/shear.c b/MagickCore/shear.c
index 03601ed..0bb3fd9 100644
--- a/MagickCore/shear.c
+++ b/MagickCore/shear.c
@@ -95,8 +95,8 @@
% The format of the CropToFitImage method is:
%
% MagickBooleanType CropToFitImage(Image **image,
-% const MagickRealType x_shear,const MagickRealType x_shear,
-% const MagickRealType width,const MagickRealType height,
+% const double x_shear,const double x_shear,
+% const double width,const double height,
% const MagickBooleanType rotate,ExceptionInfo *exception)
%
% A description of each parameter follows.
@@ -109,8 +109,8 @@
%
*/
static MagickBooleanType CropToFitImage(Image **image,
- const MagickRealType x_shear,const MagickRealType y_shear,
- const MagickRealType width,const MagickRealType height,
+ const double x_shear,const double y_shear,
+ const double width,const double height,
const MagickBooleanType rotate,ExceptionInfo *exception)
{
Image
@@ -766,7 +766,7 @@
PixelInfo
background;
- MagickRealType
+ double
count;
ssize_t
@@ -1395,7 +1395,7 @@
%
% The format of the XShearImage method is:
%
-% MagickBooleanType XShearImage(Image *image,const MagickRealType degrees,
+% MagickBooleanType XShearImage(Image *image,const double degrees,
% const size_t width,const size_t height,
% const ssize_t x_offset,const ssize_t y_offset,ExceptionInfo *exception)
%
@@ -1403,7 +1403,7 @@
%
% o image: the image.
%
-% o degrees: A MagickRealType representing the shearing angle along the X
+% o degrees: A double representing the shearing angle along the X
% axis.
%
% o width, height, x_offset, y_offset: Defines a region of the image
@@ -1412,7 +1412,7 @@
% o exception: return any errors or warnings in this structure.
%
*/
-static MagickBooleanType XShearImage(Image *image,const MagickRealType degrees,
+static MagickBooleanType XShearImage(Image *image,const double degrees,
const size_t width,const size_t height,const ssize_t x_offset,
const ssize_t y_offset,ExceptionInfo *exception)
{
@@ -1461,7 +1461,7 @@
source,
destination;
- MagickRealType
+ double
area,
displacement;
@@ -1488,7 +1488,7 @@
continue;
}
p+=x_offset*GetPixelChannels(image);
- displacement=degrees*(MagickRealType) (y-height/2.0);
+ displacement=degrees*(double) (y-height/2.0);
if (displacement == 0.0)
continue;
if (displacement > 0.0)
@@ -1499,7 +1499,7 @@
direction=LEFT;
}
step=(ssize_t) floor((double) displacement);
- area=(MagickRealType) (displacement-step);
+ area=(double) (displacement-step);
step++;
pixel=background;
GetPixelInfo(image,&source);
@@ -1524,15 +1524,15 @@
continue;
}
GetPixelInfoPixel(image,p,&source);
- CompositePixelInfoAreaBlend(&pixel,(MagickRealType) pixel.alpha,
- &source,(MagickRealType) GetPixelAlpha(image,p),area,&destination);
+ CompositePixelInfoAreaBlend(&pixel,(double) pixel.alpha,
+ &source,(double) GetPixelAlpha(image,p),area,&destination);
SetPixelInfoPixel(image,&destination,q);
GetPixelInfoPixel(image,p,&pixel);
p+=GetPixelChannels(image);
q+=GetPixelChannels(image);
}
- CompositePixelInfoAreaBlend(&pixel,(MagickRealType) pixel.alpha,
- &background,(MagickRealType) background.alpha,area,&destination);
+ CompositePixelInfoAreaBlend(&pixel,(double) pixel.alpha,
+ &background,(double) background.alpha,area,&destination);
SetPixelInfoPixel(image,&destination,q);
q+=GetPixelChannels(image);
for (i=0; i < (step-1); i++)
@@ -1556,13 +1556,13 @@
if ((size_t) (x_offset+width+step-i) >= image->columns)
continue;
GetPixelInfoPixel(image,p,&source);
- CompositePixelInfoAreaBlend(&pixel,(MagickRealType) pixel.alpha,
- &source,(MagickRealType) GetPixelAlpha(image,p),area,&destination);
+ CompositePixelInfoAreaBlend(&pixel,(double) pixel.alpha,
+ &source,(double) GetPixelAlpha(image,p),area,&destination);
SetPixelInfoPixel(image,&destination,q);
GetPixelInfoPixel(image,p,&pixel);
}
- CompositePixelInfoAreaBlend(&pixel,(MagickRealType) pixel.alpha,
- &background,(MagickRealType) background.alpha,area,&destination);
+ CompositePixelInfoAreaBlend(&pixel,(double) pixel.alpha,
+ &background,(double) background.alpha,area,&destination);
q-=GetPixelChannels(image);
SetPixelInfoPixel(image,&destination,q);
for (i=0; i < (step-1); i++)
@@ -1611,7 +1611,7 @@
%
% The format of the YShearImage method is:
%
-% MagickBooleanType YShearImage(Image *image,const MagickRealType degrees,
+% MagickBooleanType YShearImage(Image *image,const double degrees,
% const size_t width,const size_t height,
% const ssize_t x_offset,const ssize_t y_offset,ExceptionInfo *exception)
%
@@ -1619,7 +1619,7 @@
%
% o image: the image.
%
-% o degrees: A MagickRealType representing the shearing angle along the Y
+% o degrees: A double representing the shearing angle along the Y
% axis.
%
% o width, height, x_offset, y_offset: Defines a region of the image
@@ -1628,7 +1628,7 @@
% o exception: return any errors or warnings in this structure.
%
*/
-static MagickBooleanType YShearImage(Image *image,const MagickRealType degrees,
+static MagickBooleanType YShearImage(Image *image,const double degrees,
const size_t width,const size_t height,const ssize_t x_offset,
const ssize_t y_offset,ExceptionInfo *exception)
{
@@ -1675,7 +1675,7 @@
ssize_t
step;
- MagickRealType
+ double
area,
displacement;
@@ -1704,7 +1704,7 @@
continue;
}
p+=y_offset*GetPixelChannels(image);
- displacement=degrees*(MagickRealType) (x-width/2.0);
+ displacement=degrees*(double) (x-width/2.0);
if (displacement == 0.0)
continue;
if (displacement > 0.0)
@@ -1715,7 +1715,7 @@
direction=UP;
}
step=(ssize_t) floor((double) displacement);
- area=(MagickRealType) (displacement-step);
+ area=(double) (displacement-step);
step++;
pixel=background;
GetPixelInfo(image,&source);
@@ -1740,16 +1740,16 @@
continue;
}
GetPixelInfoPixel(image,p,&source);
- CompositePixelInfoAreaBlend(&pixel,(MagickRealType) pixel.alpha,
- &source,(MagickRealType) GetPixelAlpha(image,p),area,
+ CompositePixelInfoAreaBlend(&pixel,(double) pixel.alpha,
+ &source,(double) GetPixelAlpha(image,p),area,
&destination);
SetPixelInfoPixel(image,&destination,q);
GetPixelInfoPixel(image,p,&pixel);
p+=GetPixelChannels(image);
q+=GetPixelChannels(image);
}
- CompositePixelInfoAreaBlend(&pixel,(MagickRealType) pixel.alpha,
- &background,(MagickRealType) background.alpha,area,&destination);
+ CompositePixelInfoAreaBlend(&pixel,(double) pixel.alpha,
+ &background,(double) background.alpha,area,&destination);
SetPixelInfoPixel(image,&destination,q);
q+=GetPixelChannels(image);
for (i=0; i < (step-1); i++)
@@ -1773,14 +1773,14 @@
if ((size_t) (y_offset+height+step-i) >= image->rows)
continue;
GetPixelInfoPixel(image,p,&source);
- CompositePixelInfoAreaBlend(&pixel,(MagickRealType) pixel.alpha,
- &source,(MagickRealType) GetPixelAlpha(image,p),area,
+ CompositePixelInfoAreaBlend(&pixel,(double) pixel.alpha,
+ &source,(double) GetPixelAlpha(image,p),area,
&destination);
SetPixelInfoPixel(image,&destination,q);
GetPixelInfoPixel(image,p,&pixel);
}
- CompositePixelInfoAreaBlend(&pixel,(MagickRealType) pixel.alpha,
- &background,(MagickRealType) background.alpha,area,&destination);
+ CompositePixelInfoAreaBlend(&pixel,(double) pixel.alpha,
+ &background,(double) background.alpha,area,&destination);
q-=GetPixelChannels(image);
SetPixelInfoPixel(image,&destination,q);
for (i=0; i < (step-1); i++)
@@ -1937,8 +1937,8 @@
shear_image=DestroyImage(shear_image);
return((Image *) NULL);
}
- status=CropToFitImage(&shear_image,shear.x,shear.y,(MagickRealType)
- image->columns,(MagickRealType) image->rows,MagickFalse,exception);
+ status=CropToFitImage(&shear_image,shear.x,shear.y,(double)
+ image->columns,(double) image->rows,MagickFalse,exception);
if (status == MagickFalse)
{
shear_image=DestroyImage(shear_image);
@@ -1999,7 +1999,7 @@
MagickBooleanType
status;
- MagickRealType
+ double
angle;
PointInfo
@@ -2101,8 +2101,8 @@
rotate_image=DestroyImage(rotate_image);
return((Image *) NULL);
}
- status=CropToFitImage(&rotate_image,shear.x,shear.y,(MagickRealType) width,
- (MagickRealType) height,MagickTrue,exception);
+ status=CropToFitImage(&rotate_image,shear.x,shear.y,(double) width,
+ (double) height,MagickTrue,exception);
if (status == MagickFalse)
{
rotate_image=DestroyImage(rotate_image);
diff --git a/MagickCore/statistic.c b/MagickCore/statistic.c
index 14130fa..3fbac20 100644
--- a/MagickCore/statistic.c
+++ b/MagickCore/statistic.c
@@ -131,7 +131,7 @@
typedef struct _PixelChannels
{
- MagickRealType
+ double
channel[CompositePixelChannel];
} PixelChannels;
@@ -207,7 +207,7 @@
*color_1,
*color_2;
- MagickRealType
+ double
distance;
register ssize_t
@@ -217,7 +217,7 @@
color_2=(const PixelChannels *) y;
distance=0.0;
for (i=0; i < MaxPixelChannels; i++)
- distance+=color_1->channel[i]-(MagickRealType) color_2->channel[i];
+ distance+=color_1->channel[i]-(double) color_2->channel[i];
return(distance < 0 ? -1 : distance > 0 ? 1 : 0);
}
@@ -232,10 +232,10 @@
return(y);
}
-static MagickRealType ApplyEvaluateOperator(RandomInfo *random_info,
- Quantum pixel,const MagickEvaluateOperator op,const MagickRealType value)
+static double ApplyEvaluateOperator(RandomInfo *random_info,
+ Quantum pixel,const MagickEvaluateOperator op,const double value)
{
- MagickRealType
+ double
result;
result=0.0;
@@ -245,12 +245,12 @@
break;
case AbsEvaluateOperator:
{
- result=(MagickRealType) fabs((double) (pixel+value));
+ result=(double) fabs((double) (pixel+value));
break;
}
case AddEvaluateOperator:
{
- result=(MagickRealType) (pixel+value);
+ result=(double) (pixel+value);
break;
}
case AddModulusEvaluateOperator:
@@ -267,12 +267,12 @@
}
case AndEvaluateOperator:
{
- result=(MagickRealType) ((size_t) pixel & (size_t) (value+0.5));
+ result=(double) ((size_t) pixel & (size_t) (value+0.5));
break;
}
case CosineEvaluateOperator:
{
- result=(MagickRealType) (QuantumRange*(0.5*cos((double) (2.0*MagickPI*
+ result=(double) (QuantumRange*(0.5*cos((double) (2.0*MagickPI*
QuantumScale*pixel*value))+0.5));
break;
}
@@ -283,91 +283,91 @@
}
case ExponentialEvaluateOperator:
{
- result=(MagickRealType) (QuantumRange*exp((double) (value*QuantumScale*
+ result=(double) (QuantumRange*exp((double) (value*QuantumScale*
pixel)));
break;
}
case GaussianNoiseEvaluateOperator:
{
- result=(MagickRealType) GenerateDifferentialNoise(random_info,pixel,
+ result=(double) GenerateDifferentialNoise(random_info,pixel,
GaussianNoise,value);
break;
}
case ImpulseNoiseEvaluateOperator:
{
- result=(MagickRealType) GenerateDifferentialNoise(random_info,pixel,
+ result=(double) GenerateDifferentialNoise(random_info,pixel,
ImpulseNoise,value);
break;
}
case LaplacianNoiseEvaluateOperator:
{
- result=(MagickRealType) GenerateDifferentialNoise(random_info,pixel,
+ result=(double) GenerateDifferentialNoise(random_info,pixel,
LaplacianNoise,value);
break;
}
case LeftShiftEvaluateOperator:
{
- result=(MagickRealType) ((size_t) pixel << (size_t) (value+0.5));
+ result=(double) ((size_t) pixel << (size_t) (value+0.5));
break;
}
case LogEvaluateOperator:
{
if ((QuantumScale*pixel) >= MagickEpsilon)
- result=(MagickRealType) (QuantumRange*log((double) (QuantumScale*value*
+ result=(double) (QuantumRange*log((double) (QuantumScale*value*
pixel+1.0))/log((double) (value+1.0)));
break;
}
case MaxEvaluateOperator:
{
- result=(MagickRealType) EvaluateMax((double) pixel,value);
+ result=(double) EvaluateMax((double) pixel,value);
break;
}
case MeanEvaluateOperator:
{
- result=(MagickRealType) (pixel+value);
+ result=(double) (pixel+value);
break;
}
case MedianEvaluateOperator:
{
- result=(MagickRealType) (pixel+value);
+ result=(double) (pixel+value);
break;
}
case MinEvaluateOperator:
{
- result=(MagickRealType) MagickMin((double) pixel,value);
+ result=(double) MagickMin((double) pixel,value);
break;
}
case MultiplicativeNoiseEvaluateOperator:
{
- result=(MagickRealType) GenerateDifferentialNoise(random_info,pixel,
+ result=(double) GenerateDifferentialNoise(random_info,pixel,
MultiplicativeGaussianNoise,value);
break;
}
case MultiplyEvaluateOperator:
{
- result=(MagickRealType) (value*pixel);
+ result=(double) (value*pixel);
break;
}
case OrEvaluateOperator:
{
- result=(MagickRealType) ((size_t) pixel | (size_t) (value+0.5));
+ result=(double) ((size_t) pixel | (size_t) (value+0.5));
break;
}
case PoissonNoiseEvaluateOperator:
{
- result=(MagickRealType) GenerateDifferentialNoise(random_info,pixel,
+ result=(double) GenerateDifferentialNoise(random_info,pixel,
PoissonNoise,value);
break;
}
case PowEvaluateOperator:
{
- result=(MagickRealType) (QuantumRange*pow((double) (QuantumScale*pixel),
+ result=(double) (QuantumRange*pow((double) (QuantumScale*pixel),
(double) value));
break;
}
case RightShiftEvaluateOperator:
{
- result=(MagickRealType) ((size_t) pixel >> (size_t) (value+0.5));
+ result=(double) ((size_t) pixel >> (size_t) (value+0.5));
break;
}
case SetEvaluateOperator:
@@ -377,46 +377,46 @@
}
case SineEvaluateOperator:
{
- result=(MagickRealType) (QuantumRange*(0.5*sin((double) (2.0*MagickPI*
+ result=(double) (QuantumRange*(0.5*sin((double) (2.0*MagickPI*
QuantumScale*pixel*value))+0.5));
break;
}
case SubtractEvaluateOperator:
{
- result=(MagickRealType) (pixel-value);
+ result=(double) (pixel-value);
break;
}
case SumEvaluateOperator:
{
- result=(MagickRealType) (pixel+value);
+ result=(double) (pixel+value);
break;
}
case ThresholdEvaluateOperator:
{
- result=(MagickRealType) (((MagickRealType) pixel <= value) ? 0 :
+ result=(double) (((double) pixel <= value) ? 0 :
QuantumRange);
break;
}
case ThresholdBlackEvaluateOperator:
{
- result=(MagickRealType) (((MagickRealType) pixel <= value) ? 0 : pixel);
+ result=(double) (((double) pixel <= value) ? 0 : pixel);
break;
}
case ThresholdWhiteEvaluateOperator:
{
- result=(MagickRealType) (((MagickRealType) pixel > value) ? QuantumRange :
+ result=(double) (((double) pixel > value) ? QuantumRange :
pixel);
break;
}
case UniformNoiseEvaluateOperator:
{
- result=(MagickRealType) GenerateDifferentialNoise(random_info,pixel,
+ result=(double) GenerateDifferentialNoise(random_info,pixel,
UniformNoise,value);
break;
}
case XorEvaluateOperator:
{
- result=(MagickRealType) ((size_t) pixel ^ (size_t) (value+0.5));
+ result=(double) ((size_t) pixel ^ (size_t) (value+0.5));
break;
}
}
@@ -713,7 +713,7 @@
case MeanEvaluateOperator:
{
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
- evaluate_pixel[x].channel[i]/=(MagickRealType) number_images;
+ evaluate_pixel[x].channel[i]/=(double) number_images;
break;
}
case MultiplyEvaluateOperator:
@@ -929,7 +929,7 @@
const size_t number_parameters,const double *parameters,
ExceptionInfo *exception)
{
- MagickRealType
+ double
result;
register ssize_t
@@ -953,7 +953,7 @@
}
case SinusoidFunction:
{
- MagickRealType
+ double
amplitude,
bias,
frequency,
@@ -966,13 +966,13 @@
phase=(number_parameters >= 2) ? parameters[1] : 0.0;
amplitude=(number_parameters >= 3) ? parameters[2] : 0.5;
bias=(number_parameters >= 4) ? parameters[3] : 0.5;
- result=(MagickRealType) (QuantumRange*(amplitude*sin((double) (2.0*
+ result=(double) (QuantumRange*(amplitude*sin((double) (2.0*
MagickPI*(frequency*QuantumScale*pixel+phase/360.0)))+bias));
break;
}
case ArcsinFunction:
{
- MagickRealType
+ double
bias,
center,
range,
@@ -993,13 +993,13 @@
if (result >= 1.0)
result=bias+range/2.0;
else
- result=(MagickRealType) (range/MagickPI*asin((double) result)+bias);
+ result=(double) (range/MagickPI*asin((double) result)+bias);
result*=QuantumRange;
break;
}
case ArctanFunction:
{
- MagickRealType
+ double
center,
bias,
range,
@@ -1012,8 +1012,8 @@
center=(number_parameters >= 2) ? parameters[1] : 0.5;
range=(number_parameters >= 3) ? parameters[2] : 1.0;
bias=(number_parameters >= 4) ? parameters[3] : 0.5;
- result=(MagickRealType) (MagickPI*slope*(QuantumScale*pixel-center));
- result=(MagickRealType) (QuantumRange*(range/MagickPI*atan((double)
+ result=(double) (MagickPI*slope*(QuantumScale*pixel-center));
+ result=(double) (QuantumRange*(range/MagickPI*atan((double)
result)+bias));
break;
}
@@ -1978,7 +1978,7 @@
static inline void GetMeanPixelList(PixelList *pixel_list,Quantum *pixel)
{
- MagickRealType
+ double
sum;
register SkipList
@@ -2000,7 +2000,7 @@
do
{
color=p->nodes[color].next[0];
- sum+=(MagickRealType) p->nodes[color].count*color;
+ sum+=(double) p->nodes[color].count*color;
count+=p->nodes[color].count;
} while (count < (ssize_t) pixel_list->length);
sum/=pixel_list->length;
@@ -2133,7 +2133,7 @@
static inline void GetStandardDeviationPixelList(PixelList *pixel_list,
Quantum *pixel)
{
- MagickRealType
+ double
sum,
sum_squared;
@@ -2160,9 +2160,9 @@
i;
color=p->nodes[color].next[0];
- sum+=(MagickRealType) p->nodes[color].count*color;
+ sum+=(double) p->nodes[color].count*color;
for (i=0; i < (ssize_t) p->nodes[color].count; i++)
- sum_squared+=((MagickRealType) color)*((MagickRealType) color);
+ sum_squared+=((double) color)*((double) color);
count+=p->nodes[color].count;
} while (count < (ssize_t) pixel_list->length);
sum/=pixel_list->length;
@@ -2189,7 +2189,7 @@
AddNodePixelList(pixel_list,index);
}
-static inline MagickRealType MagickAbsoluteValue(const MagickRealType x)
+static inline double MagickAbsoluteValue(const double x)
{
if (x < 0)
return(-x);
@@ -2371,14 +2371,14 @@
{
case GradientStatistic:
{
- MagickRealType
+ double
maximum,
minimum;
GetMinimumPixelList(pixel_list[id],&pixel);
- minimum=(MagickRealType) pixel;
+ minimum=(double) pixel;
GetMaximumPixelList(pixel_list[id],&pixel);
- maximum=(MagickRealType) pixel;
+ maximum=(double) pixel;
pixel=ClampToQuantum(MagickAbsoluteValue(maximum-minimum));
break;
}
diff --git a/MagickCore/threshold.c b/MagickCore/threshold.c
index 5bb88eb..429ea04 100644
--- a/MagickCore/threshold.c
+++ b/MagickCore/threshold.c
@@ -248,7 +248,7 @@
}
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
- MagickRealType
+ double
mean,
pixel;
@@ -290,8 +290,8 @@
}
pixels+=image->columns*GetPixelChannels(image);
}
- mean=(MagickRealType) (pixel/number_pixels+bias);
- SetPixelChannel(threshold_image,channel,(Quantum) ((MagickRealType)
+ mean=(double) (pixel/number_pixels+bias);
+ SetPixelChannel(threshold_image,channel,(Quantum) ((double)
p[center+i] <= mean ? 0 : QuantumRange),q);
}
p+=GetPixelChannels(image);
@@ -1281,7 +1281,7 @@
MagickOffsetType
progress;
- MagickRealType
+ double
levels[CompositePixelChannel];
register ssize_t
@@ -1477,7 +1477,7 @@
PixelInfo
threshold;
- MagickRealType
+ double
min_threshold,
max_threshold;
@@ -1502,7 +1502,7 @@
return(MagickFalse);
GetPixelInfo(image,&threshold);
min_threshold=0.0;
- max_threshold=(MagickRealType) QuantumRange;
+ max_threshold=(double) QuantumRange;
flags=ParseGeometry(thresholds,&geometry_info);
min_threshold=geometry_info.rho;
max_threshold=geometry_info.sigma;
@@ -1510,8 +1510,8 @@
max_threshold=min_threshold;
if (strchr(thresholds,'%') != (char *) NULL)
{
- max_threshold*=(MagickRealType) (0.01*QuantumRange);
- min_threshold*=(MagickRealType) (0.01*QuantumRange);
+ max_threshold*=(double) (0.01*QuantumRange);
+ min_threshold*=(double) (0.01*QuantumRange);
}
/*
Random threshold image.
@@ -1556,7 +1556,7 @@
}
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
- MagickRealType
+ double
threshold;
PixelChannel
@@ -1569,15 +1569,15 @@
traits=GetPixelChannelMapTraits(image,channel);
if ((traits & UpdatePixelTrait) == 0)
continue;
- if ((MagickRealType) q[i] < min_threshold)
+ if ((double) q[i] < min_threshold)
threshold=min_threshold;
else
- if ((MagickRealType) q[i] > max_threshold)
+ if ((double) q[i] > max_threshold)
threshold=max_threshold;
else
- threshold=(MagickRealType) (QuantumRange*
+ threshold=(double) (QuantumRange*
GetPseudoRandomValue(random_info[id]));
- q[i]=(MagickRealType) q[i] <= threshold ? 0 : QuantumRange;
+ q[i]=(double) q[i] <= threshold ? 0 : QuantumRange;
}
q+=GetPixelChannels(image);
}
diff --git a/MagickCore/transform.c b/MagickCore/transform.c
index ae45c8c..455a9cf 100644
--- a/MagickCore/transform.c
+++ b/MagickCore/transform.c
@@ -694,7 +694,7 @@
%
*/
-static inline ssize_t MagickRound(MagickRealType x)
+static inline ssize_t MagickRound(double x)
{
/*
Round the fraction to nearest integer.
@@ -766,18 +766,18 @@
{
if ((flags & AspectValue) == 0)
{
- crop.y=(ssize_t) MagickRound((MagickRealType) (offset.y-
+ crop.y=(ssize_t) MagickRound((double) (offset.y-
(geometry.y > 0 ? 0 : geometry.y)));
offset.y+=delta.y; /* increment now to find width */
- crop.height=(size_t) MagickRound((MagickRealType) (offset.y+
+ crop.height=(size_t) MagickRound((double) (offset.y+
(geometry.y < 0 ? 0 : geometry.y)));
}
else
{
- crop.y=(ssize_t) MagickRound((MagickRealType) (offset.y-
+ crop.y=(ssize_t) MagickRound((double) (offset.y-
(geometry.y > 0 ? geometry.y : 0)));
offset.y+=delta.y; /* increment now to find width */
- crop.height=(size_t) MagickRound((MagickRealType)
+ crop.height=(size_t) MagickRound((double)
(offset.y+(geometry.y < -1 ? geometry.y : 0)));
}
crop.height-=crop.y;
@@ -786,18 +786,18 @@
{
if ((flags & AspectValue) == 0)
{
- crop.x=(ssize_t) MagickRound((MagickRealType) (offset.x-
+ crop.x=(ssize_t) MagickRound((double) (offset.x-
(geometry.x > 0 ? 0 : geometry.x)));
offset.x+=delta.x; /* increment now to find height */
- crop.width=(size_t) MagickRound((MagickRealType) (offset.x+
+ crop.width=(size_t) MagickRound((double) (offset.x+
(geometry.x < 0 ? 0 : geometry.x)));
}
else
{
- crop.x=(ssize_t) MagickRound((MagickRealType) (offset.x-
+ crop.x=(ssize_t) MagickRound((double) (offset.x-
(geometry.x > 0 ? geometry.x : 0)));
offset.x+=delta.x; /* increment now to find height */
- crop.width=(size_t) MagickRound((MagickRealType) (offset.x+
+ crop.width=(size_t) MagickRound((double) (offset.x+
(geometry.x < 0 ? geometry.x : 0)));
}
crop.width-=crop.x;
diff --git a/MagickCore/xwindow-private.h b/MagickCore/xwindow-private.h
index 62c887c..098f529 100644
--- a/MagickCore/xwindow-private.h
+++ b/MagickCore/xwindow-private.h
@@ -596,19 +596,19 @@
extern MagickExport XrmDatabase
XGetResourceDatabase(Display *,const char *);
-static inline MagickRealType XPixelIntensity(const XColor *pixel)
+static inline double XPixelIntensity(const XColor *pixel)
{
double
blue,
green,
red;
- MagickRealType
+ double
intensity;
- red=QuantumRange*DecompandsRGB(QuantumScale*pixel->red);
- green=QuantumRange*DecompandsRGB(QuantumScale*pixel->green);
- blue=QuantumRange*DecompandsRGB(QuantumScale*pixel->blue);
+ red=DecompandsRGB(pixel->red);
+ green=DecompandsRGB(pixel->green);
+ blue=DecompandsRGB(pixel->blue);
intensity=0.298839*red+0.586811*green+0.114350*blue;
return(intensity);
}
diff --git a/MagickCore/xwindow.c b/MagickCore/xwindow.c
index d2c0156..9a2b866 100644
--- a/MagickCore/xwindow.c
+++ b/MagickCore/xwindow.c
@@ -206,7 +206,7 @@
static const char
*XVisualClassName(const int);
-static MagickRealType
+static double
blue_gamma = 1.0,
green_gamma = 1.0,
red_gamma = 1.0;
@@ -639,7 +639,7 @@
int
rotations;
- MagickRealType
+ double
normalized_degrees;
/*
@@ -904,7 +904,7 @@
i,
number_sizes;
- MagickRealType
+ double
scale_factor;
unsigned int
@@ -965,9 +965,9 @@
/*
Look for an icon size that maintains the aspect ratio of image.
*/
- scale_factor=(MagickRealType) icon_size->max_width/width;
- if (scale_factor > ((MagickRealType) icon_size->max_height/height))
- scale_factor=(MagickRealType) icon_size->max_height/height;
+ scale_factor=(double) icon_size->max_width/width;
+ if (scale_factor > ((double) icon_size->max_height/height))
+ scale_factor=(double) icon_size->max_height/height;
icon_width=(unsigned int) icon_size->min_width;
while ((int) icon_width < icon_size->max_width)
{
@@ -1034,10 +1034,10 @@
PixelInfo
pixel;
- MagickRealType
+ double
min_distance;
- register MagickRealType
+ register double
distance;
register int
@@ -1075,20 +1075,20 @@
number_colors=256;
(void) XQueryColors(display,colormap,colors,(int) number_colors);
}
- min_distance=3.0*((MagickRealType) QuantumRange+1.0)*((MagickRealType)
+ min_distance=3.0*((double) QuantumRange+1.0)*((double)
QuantumRange+1.0);
j=0;
for (i=0; i < (int) number_colors; i++)
{
- pixel.red=colors[i].red-(MagickRealType) color->red;
+ pixel.red=colors[i].red-(double) color->red;
distance=pixel.red*pixel.red;
if (distance > min_distance)
continue;
- pixel.green=colors[i].green-(MagickRealType) color->green;
+ pixel.green=colors[i].green-(double) color->green;
distance+=pixel.green*pixel.green;
if (distance > min_distance)
continue;
- pixel.blue=colors[i].blue-(MagickRealType) color->blue;
+ pixel.blue=colors[i].blue-(double) color->blue;
distance+=pixel.blue*pixel.blue;
if (distance > min_distance)
continue;
@@ -2555,7 +2555,7 @@
int
rotations;
- MagickRealType
+ double
normalized_degrees;
/*
@@ -3159,33 +3159,33 @@
/*
Set shadow color.
*/
- pixel->shadow_color.red=(unsigned short) (((MagickRealType)
+ pixel->shadow_color.red=(unsigned short) (((double)
pixel->matte_color.red*ScaleQuantumToShort(ShadowModulate))/65535L);
- pixel->shadow_color.green=(unsigned short) (((MagickRealType)
+ pixel->shadow_color.green=(unsigned short) (((double)
pixel->matte_color.green*ScaleQuantumToShort(ShadowModulate))/65535L);
- pixel->shadow_color.blue=(unsigned short) (((MagickRealType)
+ pixel->shadow_color.blue=(unsigned short) (((double)
pixel->matte_color.blue*ScaleQuantumToShort(ShadowModulate))/65535L);
pixel->shadow_color.pixel=XStandardPixel(map_info,&pixel->shadow_color);
pixel->shadow_color.flags=(char) (DoRed | DoGreen | DoBlue);
/*
Set depth color.
*/
- pixel->depth_color.red=(unsigned short) (((MagickRealType)
+ pixel->depth_color.red=(unsigned short) (((double)
pixel->matte_color.red*ScaleQuantumToShort(DepthModulate))/65535L);
- pixel->depth_color.green=(unsigned short) (((MagickRealType)
+ pixel->depth_color.green=(unsigned short) (((double)
pixel->matte_color.green*ScaleQuantumToShort(DepthModulate))/65535L);
- pixel->depth_color.blue=(unsigned short) (((MagickRealType)
+ pixel->depth_color.blue=(unsigned short) (((double)
pixel->matte_color.blue*ScaleQuantumToShort(DepthModulate))/65535L);
pixel->depth_color.pixel=XStandardPixel(map_info,&pixel->depth_color);
pixel->depth_color.flags=(char) (DoRed | DoGreen | DoBlue);
/*
Set trough color.
*/
- pixel->trough_color.red=(unsigned short) (((MagickRealType)
+ pixel->trough_color.red=(unsigned short) (((double)
pixel->matte_color.red*ScaleQuantumToShort(TroughModulate))/65535L);
- pixel->trough_color.green=(unsigned short) (((MagickRealType)
+ pixel->trough_color.green=(unsigned short) (((double)
pixel->matte_color.green*ScaleQuantumToShort(TroughModulate))/65535L);
- pixel->trough_color.blue=(unsigned short) (((MagickRealType)
+ pixel->trough_color.blue=(unsigned short) (((double)
pixel->matte_color.blue*ScaleQuantumToShort(TroughModulate))/65535L);
pixel->trough_color.pixel=XStandardPixel(map_info,&pixel->trough_color);
pixel->trough_color.flags=(char) (DoRed | DoGreen | DoBlue);
@@ -7695,10 +7695,10 @@
extern "C" {
#endif
-static inline MagickRealType DiversityPixelIntensity(
+static inline double DiversityPixelIntensity(
const DiversityPacket *pixel)
{
- MagickRealType
+ double
intensity;
intensity=0.298839*pixel->red+0.586811*pixel->green+0.114350*pixel->blue;
@@ -7739,7 +7739,7 @@
static inline Quantum ScaleXToQuantum(const size_t x,
const size_t scale)
{
- return((Quantum) (((MagickRealType) QuantumRange*x)/scale+0.5));
+ return((Quantum) (((double) QuantumRange*x)/scale+0.5));
}
MagickPrivate void XMakeStandardColormap(Display *display,