active,
sync;
- MagickRealType
+ double
fill_opacity;
PixelInfo
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;
char
text[MaxTextExtent];
- MagickRealType
+ double
color;
color=0.0;
char
component[MaxTextExtent];
- MagickRealType
+ double
color;
color=0.0;
color=(*pixel);
if (color.depth > 8)
{
-#define SVGCompliant(component) ((MagickRealType) \
+#define SVGCompliant(component) ((double) \
ScaleCharToQuantum(ScaleQuantumToChar(ClampToQuantum(component))))
MagickStatusType
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)
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);
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;
GeometryInfo
geometry_info;
- MagickRealType
+ double
scale;
MagickStatusType
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);
if (colorspace[i] == '(')
break;
colorspace[i--]='\0';
- scale=(MagickRealType) ScaleCharToQuantum(1);
+ scale=(double) ScaleCharToQuantum(1);
icc_color=MagickFalse;
if (LocaleCompare(colorspace,"icc-color") == 0)
{
break;
colorspace[j--]='\0';
i+=j+3;
- scale=(MagickRealType) QuantumRange;
+ scale=(double) QuantumRange;
icc_color=MagickTrue;
}
LocaleLower(colorspace);
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)
{
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) ||
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);
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);
}
PixelInfo
pixel;
- MagickRealType
+ double
opacity;
register const ColorInfo
static inline void ConvertRGBToCMYK(PixelInfo *pixel)
{
- MagickRealType
+ double
black,
blue,
cyan,
}
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;
*/
typedef struct _TransformPacket
{
- MagickRealType
+ double
x,
y,
z;
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);
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);
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);
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);
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);
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);
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);
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);
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)
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(
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);
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);
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);
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);
#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;
}
#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;
}
#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;
}
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;
}
#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;
}
#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;
}
#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;
}
#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;
}
}
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);
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;
(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);
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);
{
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);
}
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
#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;
#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;
#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;
#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;
}
#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;
#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;
}
#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;
#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;
}
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);
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;
difference=MagickFalse;
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
- MagickRealType
+ double
distance;
PixelChannel
(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;
}
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
- MagickRealType
+ double
distance;
PixelChannel
(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;
}
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
- MagickRealType
+ double
distance;
PixelChannel
(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;
MagickBooleanType
status;
- MagickRealType
+ double
alpha,
area,
beta,
}
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
- MagickRealType
+ double
distance;
PixelChannel
}
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
- MagickRealType
+ double
distance;
PixelChannel
(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;
MagickOffsetType
progress;
- MagickRealType
+ double
area;
register ssize_t
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++)
distortion[CompositePixelChannel]=0.0;
for (i=0; i < MaxPixelChannels; i++)
{
- MagickRealType
+ double
gamma;
PixelChannel
}
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
- MagickRealType
+ double
distance;
PixelChannel
(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;
MagickBooleanType
status;
- MagickRealType
+ double
area,
maximum_error,
mean_error,
}
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
- MagickRealType
+ double
distance;
PixelChannel
(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;
#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;
}
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;
{
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:
}
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;
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);
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;
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);
}
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);
}
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)
}
for (x=0; x < (ssize_t) image->columns; x++)
{
- MagickRealType
+ double
alpha,
Da,
Dc,
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));
}
MagickOffsetType
progress;
- MagickRealType
+ double
amount,
destination_dissolve,
midpoint,
PixelInfo
pixel;
- MagickRealType
+ double
angle_range,
angle_start,
height,
/* rotate vectors if a rotation angle is given */
if ((flags & XValue) != 0 )
{
- MagickRealType
+ double
angle;
angle=DegreesToRadians(geometry_info.xi);
}
if (fabs(angle_range) > MagickEpsilon)
{
- MagickRealType
+ double
angle;
angle=angle_start+angle_range*QuantumScale*
PixelInfo
pixel;
- MagickRealType
+ double
horizontal_scale,
vertical_scale;
{
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
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;
}
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,
/*
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);
*/
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)
GetPixelInfo(composite_image,&source_pixel);
for (x=0; x < (ssize_t) image->columns; x++)
{
- MagickRealType
+ double
alpha,
Da,
Dc,
}
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
- MagickRealType
+ double
pixel;
PixelChannel
case SrcInCompositeOp:
case SrcOutCompositeOp:
{
- pixel=(MagickRealType) q[i];
+ pixel=(double) q[i];
if (channel == AlphaPixelChannel)
- pixel=(MagickRealType) TransparentAlpha;
+ pixel=(double) TransparentAlpha;
break;
}
case ClearCompositeOp:
{
if (channel == AlphaPixelChannel)
{
- pixel=(MagickRealType) TransparentAlpha;
+ pixel=(double) TransparentAlpha;
break;
}
pixel=0.0;
source);
break;
}
- pixel=(MagickRealType) source[channel];
+ pixel=(double) source[channel];
break;
}
default:
{
- pixel=(MagickRealType) source[channel];
+ pixel=(double) source[channel];
break;
}
}
double
sans;
- MagickRealType
+ double
pixel;
PixelChannel
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)
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:
}
case IntensityCompositeOp:
{
- pixel=(MagickRealType) GetPixelIntensity(composite_image,p);
+ pixel=(double) GetPixelIntensity(composite_image,p);
break;
}
case LightenIntensityCompositeOp:
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:
}
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;
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);
}
/*
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;
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);
}
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);
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
transparent_box = MagickTrue,
transparent_pen = MagickFalse;
- static MagickRealType
+ static double
degrees = 0.0;
static unsigned int
x,
y;
- MagickRealType
+ double
scale_factor;
RectangleInfo
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);
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,
x,
y;
- MagickRealType
+ double
blend,
scale_factor;
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);
Image
*crop_image;
- MagickRealType
+ double
scale_factor;
RectangleInfo
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);
x,
y;
- MagickRealType
+ double
degrees;
MagickStatusType
*/
static void XDrawPanRectangle(Display *display,XWindows *windows)
{
- MagickRealType
+ double
scale_factor;
RectangleInfo
/*
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);
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);
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)
Cursor
cursor;
- MagickRealType
+ double
x_factor,
y_factor;
/*
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/
x,
y;
- MagickRealType
+ double
scale_factor;
RectangleInfo
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;
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);
x,
y;
- MagickRealType
+ double
scale_factor;
MagickProgressMonitor
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);
x,
y;
- MagickRealType
+ double
normalized_degrees;
register int
x,
y;
- MagickRealType
+ double
scale_factor;
unsigned int
/*
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);
x,
y;
- MagickRealType
+ double
scale_factor;
register char
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);
/*
*distort_image,
*rotate_image;
- MagickRealType
+ double
angle;
PointInfo
SegmentInfo
bounds;
- MagickRealType
+ double
scanline;
PointInfo
typedef struct _ElementInfo
{
- MagickRealType
+ double
cx,
cy,
major,
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),
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);
\f
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DrawInfo
*clone_info;
- MagickRealType
+ double
mid;
PointInfo
DrawInfo
*clone_info;
- MagickRealType
+ double
length,
maximum_length,
offset,
register ssize_t
i;
- register MagickRealType
+ register double
dx,
dy;
proceed,
status;
- MagickRealType
+ double
angle,
factor,
primitive_extent;
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;
/*
{
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;
}
{
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;
}
case ArcPrimitive:
case EllipsePrimitive:
{
- MagickRealType
+ double
alpha,
beta,
radius;
%
*/
-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)
case UndefinedGradient:
case LinearGradient:
{
- MagickRealType
+ double
gamma,
length,
offset,
}
case RadialGradient:
{
- MagickRealType
+ double
length,
offset;
PixelInfo
zero;
- MagickRealType
+ double
length;
PointInfo
composite,
pixel;
- MagickRealType
+ double
alpha,
offset;
MagickBooleanType
antialias;
- MagickRealType
+ double
repeat;
antialias=MagickFalse;
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,
fill,
status;
- MagickRealType
+ double
mid;
PolygonInfo
const int
id = GetOpenMPThreadId();
- MagickRealType
+ double
fill_alpha,
stroke_alpha;
}
(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);
}
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;
}
&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 :
&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,
}
default:
{
- MagickRealType
+ double
mid,
scale;
%
%
*/
-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
}
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,
points[3],
radii;
- register MagickRealType
+ register double
cosine,
sine;
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;
static void TraceBezier(PrimitiveInfo *primitive_info,
const size_t number_coordinates)
{
- MagickRealType
+ double
alpha,
*coefficients,
weight;
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");
/*
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;
static void TraceEllipse(PrimitiveInfo *primitive_info,const PointInfo start,
const PointInfo stop,const PointInfo degrees)
{
- MagickRealType
+ double
delta,
step,
y;
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)
attribute,
last_attribute;
- MagickRealType
+ double
x,
y;
large_arc,
sweep;
- MagickRealType
+ double
angle;
PointInfo
}
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;
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,
MagickBooleanType
closed_path;
- MagickRealType
+ double
delta_theta,
dot_product,
mid,
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);
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;
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)
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)
}
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
- MagickRealType
+ double
alpha,
gamma,
pixel;
{
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++;
}
for (i=0; i < (ssize_t) GetPixelChannels(sharp_image); i++)
{
- MagickRealType
+ double
alpha,
gamma,
pixel;
{
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++;
}
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
- MagickRealType
+ double
alpha,
gamma,
pixel;
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++;
}
for (i=0; i < (ssize_t) GetPixelChannels(blur_image); i++)
{
- MagickRealType
+ double
alpha,
gamma,
pixel;
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;
}
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
- MagickRealType
+ double
alpha,
gamma,
pixel;
status=MagickFalse;
continue;
}
- alpha=(MagickRealType) (QuantumScale*GetPixelAlpha(image,r));
+ alpha=(double) (QuantumScale*GetPixelAlpha(image,r));
pixel+=(*k)*alpha*r[i];
gamma+=(*k)*alpha;
k++;
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:
MagickOffsetType
progress;
- MagickRealType
+ double
blur_radius,
*cos_theta,
offset,
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));
}
for (x=0; x < (ssize_t) image->columns; x++)
{
- MagickRealType
+ double
radius;
PointInfo
}
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
- MagickRealType
+ double
gamma,
pixel;
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);
}
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
- MagickRealType
+ double
alpha,
gamma,
intensity,
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)
{
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;
#endif
for (y=0; y < (ssize_t) image->rows; y++)
{
- MagickRealType
+ double
distance,
normal_distance,
shade;
MagickOffsetType
progress;
- MagickRealType
+ double
quantum_threshold;
ssize_t
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.
*/
}
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
- MagickRealType
+ double
pixel;
PixelChannel
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);
#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))));
}
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
if (intensity > black_point)
break;
}
- black[i]=(MagickRealType) j;
+ black[i]=(double) j;
intensity=0.0;
for (j=(ssize_t) MaxMap; j != 0; j--)
{
if (intensity > ((double) image->columns*image->rows-white_point))
break;
}
- white[i]=(MagickRealType) j;
+ white[i]=(double) j;
}
histogram=(double *) RelinquishMagickMemory(histogram);
/*
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])));
}
}
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]; \
}
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
- MagickRealType
+ double
aggregate,
distance,
distance_squared,
MagickOffsetType
progress;
- MagickRealType
+ double
black[CompositePixelChannel],
*equalize_map,
*histogram,
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);
}
#endif
for (i=0; i < (ssize_t) number_channels; i++)
{
- MagickRealType
+ double
intensity;
register ssize_t
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
}
}
image_view=DestroyCacheView(image_view);
- equalize_map=(MagickRealType *) RelinquishMagickMemory(equalize_map);
+ equalize_map=(double *) RelinquishMagickMemory(equalize_map);
return(status);
}
\f
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)
{
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))];
}
}
typedef struct _HaldInfo
{
- MagickRealType
+ double
x,
y,
z;
%
*/
-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);
}
if ((traits & UpdatePixelTrait) == 0)
continue;
q[i]=ClampToQuantum(LevelPixel(black_point,white_point,gamma,
- (MagickRealType) q[i]));
+ (double) q[i]));
}
q+=GetPixelChannels(image);
}
MagickBooleanType
status;
- MagickRealType
+ double
*histogram,
intensity;
*/
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);
/*
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);
}
MagickOffsetType
progress;
- MagickRealType
+ double
*sigmoidal_map;
register ssize_t
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));
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)
}
}
image_view=DestroyCacheView(image_view);
- sigmoidal_map=(MagickRealType *) RelinquishMagickMemory(sigmoidal_map);
+ sigmoidal_map=(double *) RelinquishMagickMemory(sigmoidal_map);
return(status);
}
*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)
}
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]*
%
% 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:
%
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
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)
{
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)
{
PixelInfo
pixel;
- MagickRealType
+ double
alpha,
beta;
}
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:
case 'a':
{
if (LocaleCompare(symbol,"a") == 0)
- return((MagickRealType) (QuantumScale*pixel.alpha));
+ return((double) (QuantumScale*pixel.alpha));
break;
}
case 'B':
case 'h':
{
if (LocaleCompare(symbol,"h") == 0)
- return((MagickRealType) image->rows);
+ return((double) image->rows);
if (LocaleCompare(symbol,"hue") == 0)
{
double
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':
case 'n':
{
if (LocaleCompare(symbol,"n") == 0)
- return((MagickRealType) GetImageListLength(fx_info->images));
+ return((double) GetImageListLength(fx_info->images));
break;
}
case 'O':
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':
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':
{
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;
}
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);
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;
case '~':
{
*beta=FxEvaluateSubexpression(fx_info,channel,x,y,++p,beta,exception);
- *beta=(MagickRealType) (~(size_t) *beta);
+ *beta=(double) (~(size_t) *beta);
return(*beta);
}
case '!':
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 '<':
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:
}
case '?':
{
- MagickRealType
+ double
gamma;
(void) CopyMagickString(subexpression,++p,MaxTextExtent);
{
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':
{
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)
{
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)
{
{
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));
{
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));
{
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;
}
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':
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+5,beta,
exception);
- return((MagickRealType) floor((double) alpha));
+ return((double) floor((double) alpha));
}
break;
}
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)
{
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));
{
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;
}
{
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)
{
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)
{
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)
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);
}
{
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));
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)
{
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));
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));
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));
exception);
if (alpha == 0)
return(1.0);
- gamma=(MagickRealType) (sin((double) (MagickPI*alpha))/
+ gamma=(double) (sin((double) (MagickPI*alpha))/
(MagickPI*alpha));
return(gamma);
}
{
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));
{
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);
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));
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));
}
MagickPrivate MagickBooleanType FxEvaluateExpression(FxInfo *fx_info,
- MagickRealType *alpha,ExceptionInfo *exception)
+ double *alpha,ExceptionInfo *exception)
{
MagickBooleanType
status;
}
MagickExport MagickBooleanType FxPreprocessExpression(FxInfo *fx_info,
- MagickRealType *alpha,ExceptionInfo *exception)
+ double *alpha,ExceptionInfo *exception)
{
FILE
*file;
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;
FxInfo
**fx_info;
- MagickRealType
+ double
alpha;
register ssize_t
MagickOffsetType
progress;
- MagickRealType
+ double
alpha;
ssize_t
}
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
- MagickRealType
+ double
alpha;
PixelChannel
MagickOffsetType
progress;
- MagickRealType
+ double
radius;
PointInfo
#endif
for (y=0; y < (ssize_t) image->rows; y++)
{
- MagickRealType
+ double
distance;
PointInfo
MagickOffsetType
scene;
- MagickRealType
+ double
alpha,
beta;
*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*
*/
static inline Quantum PlasmaPixel(RandomInfo *random_info,
- const MagickRealType pixel,const MagickRealType noise)
+ const double pixel,const double noise)
{
Quantum
plasma;
const SegmentInfo *segment,size_t attenuate,size_t depth,
ExceptionInfo *exception)
{
- MagickRealType
+ double
plasma;
PixelChannel
/*
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))
{
/*
}
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);
}
for (x=0; x < (ssize_t) random_image->columns; x++)
{
- MagickRealType
+ double
value;
register ssize_t
*/
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;
}
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);
MagickOffsetType
progress;
- MagickRealType
+ double
radius;
PointInfo
#endif
for (y=0; y < (ssize_t) image->rows; y++)
{
- MagickRealType
+ double
distance;
PointInfo
}
else
{
- MagickRealType
+ double
cosine,
factor,
sine;
MagickOffsetType
progress;
- MagickRealType
+ double
intensity;
PixelInfo
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.
PixelInfo
pixel;
- MagickRealType
+ double
weight;
register ssize_t
}
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);
MagickOffsetType
progress;
- MagickRealType
+ double
*sine_map;
register ssize_t
/*
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");
}
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);
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;
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;
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)
Image
*clone_image;
- MagickRealType
+ double
scale;
size_t
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);
}
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;
*/
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;
{
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:
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);
}
static MagickBooleanType ComparePixels(const ImageLayerMethod method,
const PixelInfo *p,const PixelInfo *q)
{
- MagickRealType
+ double
o1,
o2;
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));
}
#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
#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
#define MaxColormapSize 65536UL
#define MaxMap 65535UL
-typedef double MagickRealType;
#if defined(MAGICKCORE_HDRI_SUPPORT)
typedef float Quantum;
#define QuantumRange 4294967295.0
#define MaxColormapSize 65536UL
#define MaxMap 65535UL
-typedef long double MagickRealType;
typedef double Quantum;
#define QuantumRange 18446744073709551615.0
#define QuantumFormat "%g"
# 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)
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:
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;
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;
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;
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;
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;
** 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
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:
** 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
{
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];
#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,
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);
}
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);
}
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));
}
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));
}
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)
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;
%
*/
-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
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;
/*
(*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
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;
}
/*
-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));
MagickBooleanType
status;
- MagickRealType
+ double
alpha[16],
gamma,
pixels[16];
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++)
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++)
}
case CatromInterpolatePixel:
{
- MagickRealType
+ double
cx[4],
cy[4];
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++)
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]*
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++)
}
case SplineInterpolatePixel:
{
- MagickRealType
+ double
cx[4],
cy[4];
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++)
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]*
MagickBooleanType
status;
- MagickRealType
+ double
alpha[16],
gamma,
pixels[16];
(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)
{
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)));
}
case CatromInterpolatePixel:
{
- MagickRealType
+ double
cx[4],
cy[4];
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++)
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]*
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;
}
case SplineInterpolatePixel:
{
- MagickRealType
+ double
cx[4],
cy[4];
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++)
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]*
*/
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);
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,
MagickBooleanType
status;
- MagickRealType
+ double
alpha[16],
gamma;
}
case CatromInterpolatePixel:
{
- MagickRealType
+ double
cx[4],
cy[4];
}
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]*
}
case SplineInterpolatePixel:
{
- MagickRealType
+ double
cx[4],
cy[4];
}
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]*
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)
/*
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)
*/
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))
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);
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))
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.
FxInfo
*fx_info;
- MagickRealType
+ double
alpha;
MagickStatusType
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) )
{
*/
typedef struct _RealPixelInfo
{
- MagickRealType
+ double
red,
green,
blue,
RealPixelInfo
total_color;
- MagickRealType
+ double
quantize_error;
size_t
RealPixelInfo
target;
- MagickRealType
+ double
distance,
pruning_threshold,
next_threshold;
RealPixelInfo
error[ErrorQueueLength];
- MagickRealType
+ double
weights[ErrorQueueLength];
QuantizeInfo
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);
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;
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;
MagickBooleanType
proceed;
- MagickRealType
+ double
bisect;
NodeInfo
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++)
}
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++)
}
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++)
ClosestColor(image,cube_info,node_info->child[i]);
if (node_info->number_unique != 0)
{
- MagickRealType
+ double
pixel;
- register MagickRealType
+ register double
alpha,
beta,
distance;
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;
(void) DefineImageColormap(image,cube_info,node_info->child[i]);
if (node_info->number_unique != 0)
{
- register MagickRealType
+ register double
alpha;
register PixelInfo
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)
{
}
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)
}
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);
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)
{
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;
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)
{
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;
CubeInfo
*cube_info;
- MagickRealType
+ double
sum,
weight;
CacheView
*image_view;
- MagickRealType
+ double
alpha,
area,
beta,
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);
%
*/
-static inline ssize_t MagickRound(MagickRealType x)
+static inline ssize_t MagickRound(double x)
{
/*
Round the fraction to nearest integer.
}
if (quantum_info->alpha_type == AssociatedQuantumAlpha)
{
- MagickRealType
+ double
Sa;
register Quantum
{
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);
{
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);
}
if (quantum_info->alpha_type == DisassociatedQuantumAlpha)
{
- MagickRealType
+ double
gamma,
Sa;
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)
#endif
}
-static inline Quantum ScaleMapToQuantum(const MagickRealType value)
+static inline Quantum ScaleMapToQuantum(const double value)
{
if (value <= 0.0)
return((Quantum) 0);
#endif
}
-static inline Quantum ScaleMapToQuantum(const MagickRealType value)
+static inline Quantum ScaleMapToQuantum(const double value)
{
if (value <= 0.0)
return((Quantum) 0);
return((Quantum) value);
}
-static inline Quantum ScaleMapToQuantum(const MagickRealType value)
+static inline Quantum ScaleMapToQuantum(const double value)
{
if (value <= 0.0)
return((Quantum) 0);
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);
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)
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;
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;
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);
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);
}
\f
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,
*/
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) */
/*
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 *);
\f
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% 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:
%
%
*/
-static MagickRealType Blackman(const MagickRealType x,
+static double Blackman(const double x,
const ResizeFilter *magick_unused(resize_filter))
{
/*
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))
{
/*
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))
{
/*
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)
{
/*
return(0.0);
}
-static MagickRealType Gaussian(const MagickRealType x,
+static double Gaussian(const double x,
const ResizeFilter *resize_filter)
{
/*
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))
{
/*
return(BesselOrderOne(MagickPI*x)/x);
}
-static MagickRealType Kaiser(const MagickRealType x,
+static double Kaiser(const double x,
const ResizeFilter *resize_filter)
{
/*
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
return(value);
}
-static MagickRealType Quadratic(const MagickRealType x,
+static double Quadratic(const double x,
const ResizeFilter *magick_unused(resize_filter))
{
/*
return(0.0);
}
-static MagickRealType Sinc(const MagickRealType x,
+static double Sinc(const double x,
const ResizeFilter *magick_unused(resize_filter))
{
/*
*/
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))
{
/*
*/
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))
{
/*
return(0.0);
}
-static MagickRealType Welsh(const MagickRealType x,
+static double Welsh(const double x,
const ResizeFilter *magick_unused(resize_filter))
{
/*
filter_type,
window_type;
- MagickRealType
+ double
B,
C,
value;
*/
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. */
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,
{
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:
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");
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)
%
% 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;
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;
}
#undef P1
-static MagickRealType P1(MagickRealType x)
+static double P1(double x)
{
- MagickRealType
+ double
p,
q;
}
#undef Q1
-static MagickRealType Q1(MagickRealType x)
+static double Q1(double x)
{
- MagickRealType
+ double
p,
q;
return(p/q);
}
-static MagickRealType BesselOrderOne(MagickRealType x)
+static double BesselOrderOne(double x)
{
- MagickRealType
+ double
p,
q;
%
% 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);
%
% 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:
%
% 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;
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
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);
}
typedef struct _ContributionInfo
{
- MagickRealType
+ double
weight;
ssize_t
}
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"
MagickBooleanType
status;
- MagickRealType
+ double
scale,
support;
/*
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));
#endif
for (x=0; x < (ssize_t) resize_image->columns; x++)
{
- MagickRealType
+ double
bisect,
density;
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;
{
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))
}
for (i=0; i < (ssize_t) GetPixelChannels(resize_image); i++)
{
- MagickRealType
+ double
alpha,
gamma,
pixel;
}
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
PixelInfo
zero;
- MagickRealType
+ double
scale,
support;
/*
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));
#endif
for (y=0; y < (ssize_t) resize_image->rows; y++)
{
- MagickRealType
+ double
bisect,
density;
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;
{
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))
}
for (i=0; i < (ssize_t) GetPixelChannels(resize_image); i++)
{
- MagickRealType
+ double
alpha,
gamma,
pixel;
MagickOffsetType
offset;
- MagickRealType
+ double
x_factor,
y_factor;
/*
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
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.
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);
next_row,
proceed;
- MagickRealType
+ double
alpha,
gamma,
pixel[CompositePixelChannel],
/*
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");
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);
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;
}
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);
/*
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);
}
Image
*thumbnail_image;
- MagickRealType
+ double
x_factor,
y_factor;
(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
*/
typedef struct _ExtentPacket
{
- MagickRealType
+ double
center;
ssize_t
typedef struct _IntervalTree
{
- MagickRealType
+ double
tau;
ssize_t
left,
right;
- MagickRealType
+ double
mean_stability,
stability;
typedef struct _ZeroCrossing
{
- MagickRealType
+ double
tau,
histogram[256];
/*
Method prototypes.
*/
-static MagickRealType
+static double
OptimalTau(const ssize_t *,const double,const double,const double,
const double,short *);
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 *);
\f
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 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.
% 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).
%
%
*/
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"
MagickOffsetType
progress;
- MagickRealType
+ double
*free_squares;
MagickStatusType
register ssize_t
i;
- register MagickRealType
+ register double
*squares;
size_t
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;
/*
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.
*/
}
if (cluster == (Cluster *) NULL)
{
- MagickRealType
+ double
distance_squared,
local_minima,
numerator,
}
squares-=255;
free_squares=squares;
- free_squares=(MagickRealType *) RelinquishMagickMemory(free_squares);
+ free_squares=(double *) RelinquishMagickMemory(free_squares);
return(MagickTrue);
}
\f
%
% 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,
%
% 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).
%
MagickBooleanType
proceed;
- MagickRealType
+ double
threshold;
register const Quantum
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;
}
}
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.
register ssize_t
count;
- register MagickRealType
+ register double
sum;
sum=0.0;
sum+=child->stability;
count++;
}
- node->mean_stability=sum/(MagickRealType) count;
+ node->mean_stability=sum/(double) count;
}
MeanStability(node->sibling);
MeanStability(node->child);
%
% 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)
%
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)
{
MagickBooleanType
peak;
- MagickRealType
+ double
average_tau,
*derivative,
*second_derivative,
/*
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;
*/
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.
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.
*/
%
% 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,
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));
{
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);
}
\f
/*
%
% 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
% 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;
% 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.
%
*/
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
PixelInfo
background;
- MagickRealType
+ double
count;
ssize_t
%
% 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)
%
%
% 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
% 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)
{
source,
destination;
- MagickRealType
+ double
area,
displacement;
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)
direction=LEFT;
}
step=(ssize_t) floor((double) displacement);
- area=(MagickRealType) (displacement-step);
+ area=(double) (displacement-step);
step++;
pixel=background;
GetPixelInfo(image,&source);
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++)
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++)
%
% 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)
%
%
% 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
% 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)
{
ssize_t
step;
- MagickRealType
+ double
area,
displacement;
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)
direction=UP;
}
step=(ssize_t) floor((double) displacement);
- area=(MagickRealType) (displacement-step);
+ area=(double) (displacement-step);
step++;
pixel=background;
GetPixelInfo(image,&source);
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++)
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++)
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);
MagickBooleanType
status;
- MagickRealType
+ double
angle;
PointInfo
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);
typedef struct _PixelChannels
{
- MagickRealType
+ double
channel[CompositePixelChannel];
} PixelChannels;
*color_1,
*color_2;
- MagickRealType
+ double
distance;
register ssize_t
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);
}
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;
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:
}
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;
}
}
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:
}
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;
}
}
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:
const size_t number_parameters,const double *parameters,
ExceptionInfo *exception)
{
- MagickRealType
+ double
result;
register ssize_t
}
case SinusoidFunction:
{
- MagickRealType
+ double
amplitude,
bias,
frequency,
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,
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,
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;
}
static inline void GetMeanPixelList(PixelList *pixel_list,Quantum *pixel)
{
- MagickRealType
+ double
sum;
register SkipList
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;
static inline void GetStandardDeviationPixelList(PixelList *pixel_list,
Quantum *pixel)
{
- MagickRealType
+ double
sum,
sum_squared;
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;
AddNodePixelList(pixel_list,index);
}
-static inline MagickRealType MagickAbsoluteValue(const MagickRealType x)
+static inline double MagickAbsoluteValue(const double x)
{
if (x < 0)
return(-x);
{
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;
}
}
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
- MagickRealType
+ double
mean,
pixel;
}
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);
MagickOffsetType
progress;
- MagickRealType
+ double
levels[CompositePixelChannel];
register ssize_t
PixelInfo
threshold;
- MagickRealType
+ double
min_threshold,
max_threshold;
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;
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.
}
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
- MagickRealType
+ double
threshold;
PixelChannel
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);
}
%
*/
-static inline ssize_t MagickRound(MagickRealType x)
+static inline ssize_t MagickRound(double x)
{
/*
Round the fraction to nearest integer.
{
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;
{
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;
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);
}
static const char
*XVisualClassName(const int);
-static MagickRealType
+static double
blue_gamma = 1.0,
green_gamma = 1.0,
red_gamma = 1.0;
int
rotations;
- MagickRealType
+ double
normalized_degrees;
/*
i,
number_sizes;
- MagickRealType
+ double
scale_factor;
unsigned int
/*
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)
{
PixelInfo
pixel;
- MagickRealType
+ double
min_distance;
- register MagickRealType
+ register double
distance;
register int
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;
int
rotations;
- MagickRealType
+ double
normalized_degrees;
/*
/*
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);
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;
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,
GetPixelInfo(wand->image,&pixel);
pixel.colorspace=sRGBColorspace;
pixel.matte=packet->alpha != OpaqueAlpha ? MagickTrue : MagickFalse;
- pixel.red=(MagickRealType) packet->red;
- pixel.green=(MagickRealType) packet->green;
- pixel.blue=(MagickRealType) packet->blue;
- pixel.alpha=(MagickRealType) packet->alpha;
+ pixel.red=(double) packet->red;
+ pixel.green=(double) packet->green;
+ pixel.blue=(double) packet->blue;
+ pixel.alpha=(double) packet->alpha;
GetColorTuple(&pixel,MagickTrue,tuple);
(void) MvgPrintf(wand,"%s",tuple);
}
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=(double) (*image)->columns*(*image)->rows-
white_point;
(void) ContrastStretchImage(*image,black_point,white_point,
exception);
}
if (LocaleCompare("level",option+1) == 0)
{
- MagickRealType
+ double
black_point,
gamma,
white_point;
(void) SyncImageSettings(mogrify_info,*image,exception);
flags=ParseGeometry(argv[i+1],&geometry_info);
black_point=geometry_info.rho;
- white_point=(MagickRealType) QuantumRange;
+ white_point=(double) QuantumRange;
if ((flags & SigmaValue) != 0)
white_point=geometry_info.sigma;
gamma=1.0;
gamma=geometry_info.xi;
if ((flags & PercentValue) != 0)
{
- black_point*=(MagickRealType) (QuantumRange/100.0);
- white_point*=(MagickRealType) (QuantumRange/100.0);
+ black_point*=(double) (QuantumRange/100.0);
+ white_point*=(double) (QuantumRange/100.0);
}
if ((flags & SigmaValue) == 0)
- white_point=(MagickRealType) QuantumRange-black_point;
+ white_point=(double) QuantumRange-black_point;
if ((*option == '+') || ((flags & AspectValue) != 0))
(void) LevelizeImage(*image,black_point,white_point,gamma,
exception);
(void) SyncImageSettings(mogrify_info,*image,exception);
flags=ParseGeometry(argv[i+1],&geometry_info);
black_point=geometry_info.rho;
- white_point=(MagickRealType) (*image)->columns*(*image)->rows;
+ white_point=(double) (*image)->columns*(*image)->rows;
if ((flags & SigmaValue) != 0)
white_point=geometry_info.sigma;
if ((flags & PercentValue) != 0)
white_point*=(double) (*image)->columns*(*image)->rows/100.0;
}
if ((flags & SigmaValue) == 0)
- white_point=(MagickRealType) (*image)->columns*(*image)->rows-
+ white_point=(double) (*image)->columns*(*image)->rows-
black_point;
(void) LinearStretchImage(*image,black_point,white_point,exception);
break;
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=(double) _image->columns*_image->rows-
white_point;
(void) ContrastStretchImage(_image,black_point,white_point,
_exception);
}
if (LocaleCompare("level",option+1) == 0)
{
- MagickRealType
+ double
black_point,
gamma,
white_point;
if ((flags & RhoValue) == 0)
CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1);
black_point=geometry_info.rho;
- white_point=(MagickRealType) QuantumRange;
+ white_point=(double) QuantumRange;
if ((flags & SigmaValue) != 0)
white_point=geometry_info.sigma;
gamma=1.0;
gamma=geometry_info.xi;
if ((flags & PercentValue) != 0)
{
- black_point*=(MagickRealType) (QuantumRange/100.0);
- white_point*=(MagickRealType) (QuantumRange/100.0);
+ black_point*=(double) (QuantumRange/100.0);
+ white_point*=(double) (QuantumRange/100.0);
}
if ((flags & SigmaValue) == 0)
- white_point=(MagickRealType) QuantumRange-black_point;
+ white_point=(double) QuantumRange-black_point;
if (IfPlusOp || ((flags & AspectValue) != 0))
(void) LevelizeImage(_image,black_point,white_point,gamma,_exception);
else
if ((flags & RhoValue) == 0)
CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1);
black_point=geometry_info.rho;
- white_point=(MagickRealType) _image->columns*_image->rows;
+ white_point=(double) _image->columns*_image->rows;
if ((flags & SigmaValue) != 0)
white_point=geometry_info.sigma;
if ((flags & PercentValue) != 0)
white_point*=(double) _image->columns*_image->rows/100.0;
}
if ((flags & SigmaValue) == 0)
- white_point=(MagickRealType) _image->columns*_image->rows-
+ white_point=(double) _image->columns*_image->rows-
black_point;
(void) LinearStretchImage(_image,black_point,white_point,_exception);
break;
assert(wand->signature == WandSignature);
if (wand->debug != MagickFalse)
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
- wand->pixel.alpha=(MagickRealType) alpha;
+ wand->pixel.alpha=(double) alpha;
}
\f
/*
assert(wand->signature == WandSignature);
if (wand->debug != MagickFalse)
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
- wand->pixel.black=(MagickRealType) ClampToQuantum(QuantumRange*black);
+ wand->pixel.black=(double) ClampToQuantum(QuantumRange*black);
}
\f
/*
assert(wand->signature == WandSignature);
if (wand->debug != MagickFalse)
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
- wand->pixel.black=(MagickRealType) black;
+ wand->pixel.black=(double) black;
}
\f
/*
assert(wand->signature == WandSignature);
if (wand->debug != MagickFalse)
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
- wand->pixel.blue=(MagickRealType) ClampToQuantum(QuantumRange*blue);
+ wand->pixel.blue=(double) ClampToQuantum(QuantumRange*blue);
}
\f
/*
assert(wand->signature == WandSignature);
if (wand->debug != MagickFalse)
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
- wand->pixel.blue=(MagickRealType) blue;
+ wand->pixel.blue=(double) blue;
}
\f
/*
assert(wand->signature == WandSignature);
if (wand->debug != MagickFalse)
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
- wand->pixel.red=(MagickRealType) ClampToQuantum(QuantumRange*cyan);
+ wand->pixel.red=(double) ClampToQuantum(QuantumRange*cyan);
}
\f
/*
assert(wand->signature == WandSignature);
if (wand->debug != MagickFalse)
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
- wand->pixel.red=(MagickRealType) cyan;
+ wand->pixel.red=(double) cyan;
}
\f
/*
assert(wand->signature == WandSignature);
if (wand->debug != MagickFalse)
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
- wand->pixel.fuzz=(MagickRealType) fuzz;
+ wand->pixel.fuzz=(double) fuzz;
}
\f
/*
assert(wand->signature == WandSignature);
if (wand->debug != MagickFalse)
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
- wand->pixel.green=(MagickRealType) ClampToQuantum(QuantumRange*green);
+ wand->pixel.green=(double) ClampToQuantum(QuantumRange*green);
}
\f
/*
assert(wand->signature == WandSignature);
if (wand->debug != MagickFalse)
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
- wand->pixel.green=(MagickRealType) green;
+ wand->pixel.green=(double) green;
}
\f
/*
if (wand->debug != MagickFalse)
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
ConvertHSLToRGB(hue,saturation,lightness,&red,&green,&blue);
- wand->pixel.red=(MagickRealType) red;
- wand->pixel.green=(MagickRealType) green;
- wand->pixel.blue=(MagickRealType) blue;
+ wand->pixel.red=(double) red;
+ wand->pixel.green=(double) green;
+ wand->pixel.blue=(double) blue;
}
\f
/*
assert(wand->signature == WandSignature);
if (wand->debug != MagickFalse)
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
- wand->pixel.index=(MagickRealType) index;
+ wand->pixel.index=(double) index;
}
\f
/*
assert(wand->signature == WandSignature);
if (wand->debug != MagickFalse)
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
- wand->pixel.green=(MagickRealType) ClampToQuantum(QuantumRange*magenta);
+ wand->pixel.green=(double) ClampToQuantum(QuantumRange*magenta);
}
\f
/*
assert(wand->signature == WandSignature);
if (wand->debug != MagickFalse)
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
- wand->pixel.green=(MagickRealType) magenta;
+ wand->pixel.green=(double) magenta;
}
\f
/*
if (wand->debug != MagickFalse)
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
assert(pixel != (Quantum *) NULL);
- wand->pixel.red=(MagickRealType) GetPixelRed(image,pixel);
- wand->pixel.green=(MagickRealType) GetPixelGreen(image,pixel);
- wand->pixel.blue=(MagickRealType) GetPixelBlue(image,pixel);
- wand->pixel.black=(MagickRealType) GetPixelBlack(image,pixel);
- wand->pixel.alpha=(MagickRealType) GetPixelAlpha(image,pixel);
+ wand->pixel.red=(double) GetPixelRed(image,pixel);
+ wand->pixel.green=(double) GetPixelGreen(image,pixel);
+ wand->pixel.blue=(double) GetPixelBlue(image,pixel);
+ wand->pixel.black=(double) GetPixelBlack(image,pixel);
+ wand->pixel.alpha=(double) GetPixelAlpha(image,pixel);
wand->pixel.matte=GetPixelAlpha(image,pixel) != OpaqueAlpha ? MagickTrue :
MagickFalse;
}
assert(wand->signature == WandSignature);
if (wand->debug != MagickFalse)
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
- wand->pixel.red=(MagickRealType) ClampToQuantum(QuantumRange*red);
+ wand->pixel.red=(double) ClampToQuantum(QuantumRange*red);
}
\f
/*
assert(wand->signature == WandSignature);
if (wand->debug != MagickFalse)
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
- wand->pixel.red=(MagickRealType) red;
+ wand->pixel.red=(double) red;
}
\f
/*
assert(wand->signature == WandSignature);
if (wand->debug != MagickFalse)
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
- wand->pixel.blue=(MagickRealType) ClampToQuantum(QuantumRange*yellow);
+ wand->pixel.blue=(double) ClampToQuantum(QuantumRange*yellow);
}
\f
/*
assert(wand->signature == WandSignature);
if (wand->debug != MagickFalse)
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
- wand->pixel.blue=(MagickRealType) yellow;
+ wand->pixel.blue=(double) yellow;
}
ssize_t
integer_reference;
- MagickRealType
+ double
real_reference;
const char
white_point;
black_point=0.0;
- white_point=(MagickRealType) image->columns*image->rows;
+ white_point=(double) image->columns*image->rows;
gamma=1.0;
if (attribute_flag[0] != 0)
{
white_point;
black_point=0.0;
- white_point=(MagickRealType) image->columns*image->rows;
+ white_point=(double) image->columns*image->rows;
if (attribute_flag[0] != 0)
{
flags=ParseGeometry(argument_list[0].string_reference,
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=(double) image->columns*image->rows-
white_point;
}
if (attribute_flag[1] != 0)
white_point;
black_point=0.0;
- white_point=(MagickRealType) image->columns*image->rows;
+ white_point=(double) image->columns*image->rows;
if (attribute_flag[0] != 0)
{
flags=ParseGeometry(argument_list[0].string_reference,
}
else
{
- MagickRealType
+ double
alpha,
beta;
opacity=i;
continue;
}
- alpha=(MagickRealType) TransparentAlpha-(MagickRealType)
+ alpha=(double) TransparentAlpha-(double)
image->colormap[i].alpha;
- beta=(MagickRealType) TransparentAlpha-(MagickRealType)
+ beta=(double) TransparentAlpha-(double)
image->colormap[opacity].alpha;
if (alpha < beta)
opacity=i;
opacity=i;
continue;
}
- alpha=(Quantum) TransparentAlpha-(MagickRealType)
+ alpha=(Quantum) TransparentAlpha-(double)
image->colormap[i].alpha;
- beta=(Quantum) TransparentAlpha-(MagickRealType)
+ beta=(Quantum) TransparentAlpha-(double)
image->colormap[opacity].alpha;
if (alpha < beta)
opacity=i;
PixelInfo
*histogram;
- MagickRealType
+ double
maximum,
scale;
(maximum < histogram[x].blue))
maximum=histogram[x].blue;
}
- scale=(MagickRealType) histogram_image->rows/maximum;
+ scale=(double) histogram_image->rows/maximum;
/*
Initialize histogram image.
*/
image->rows=1;
image->matte=MagickTrue;
GetPixelInfo(image,&background);
- background.alpha=(MagickRealType) TransparentAlpha;
+ background.alpha=(double) TransparentAlpha;
if (image->colorspace == CMYKColorspace)
ConvertRGBToCMYK(&background);
for (y=0; y < (ssize_t) image->rows; y++)
(void) bluebits;
ReadBlobByte(image); /* reserved by Palm */
ReadBlobByte(image); /* reserved by Palm */
- transpix.red=(MagickRealType) (QuantumRange*ReadBlobByte(image)/31);
- transpix.green=(MagickRealType) (QuantumRange*ReadBlobByte(image)/63);
- transpix.blue=(MagickRealType) (QuantumRange*ReadBlobByte(image)/31);
+ transpix.red=(double) (QuantumRange*ReadBlobByte(image)/31);
+ transpix.green=(double) (QuantumRange*ReadBlobByte(image)/63);
+ transpix.blue=(double) (QuantumRange*ReadBlobByte(image)/31);
}
if (bits_per_pixel == 8)
{
double
gamma;
- fill_color.blue=(MagickRealType) ScaleCharToQuantum(*p++);
- fill_color.green=(MagickRealType) ScaleCharToQuantum(*p++);
- fill_color.red=(MagickRealType) ScaleCharToQuantum(*p++);
- fill_color.alpha=(MagickRealType) ScaleCharToQuantum(*p++);
+ fill_color.blue=(double) ScaleCharToQuantum(*p++);
+ fill_color.green=(double) ScaleCharToQuantum(*p++);
+ fill_color.red=(double) ScaleCharToQuantum(*p++);
+ fill_color.alpha=(double) ScaleCharToQuantum(*p++);
/*
Disassociate alpha.
*/
fill_color.blue*=gamma;
fill_color.green*=gamma;
fill_color.red*=gamma;
- CompositePixelOver(image,&fill_color,fill_color.alpha,q,(MagickRealType)
+ CompositePixelOver(image,&fill_color,fill_color.alpha,q,(double)
GetPixelAlpha(image,q),q);
q+=GetPixelChannels(image);
}
for (x=0; x < (ssize_t) image->columns; x++)
{
byte<<=1;
- if (GetPixelIntensity(image,p) < ((MagickRealType) QuantumRange/2.0))
+ if (GetPixelIntensity(image,p) < ((double) QuantumRange/2.0))
byte|=0x01;
bit++;
if (bit == 8)
break;
for (x=0; x < (ssize_t) image->columns; x++)
{
- pixel.red=(MagickRealType) PNMInteger(image,10,exception);
- pixel.green=(MagickRealType) PNMInteger(image,10,exception);
- pixel.blue=(MagickRealType) PNMInteger(image,10,exception);
+ pixel.red=(double) PNMInteger(image,10,exception);
+ pixel.green=(double) PNMInteger(image,10,exception);
+ pixel.blue=(double) PNMInteger(image,10,exception);
if (scale != (Quantum *) NULL)
{
- pixel.red=(MagickRealType) scale[ConstrainPixel(image,(ssize_t)
+ pixel.red=(double) scale[ConstrainPixel(image,(ssize_t)
pixel.red,max_value,exception)];
- pixel.green=(MagickRealType) scale[ConstrainPixel(image,
+ pixel.green=(double) scale[ConstrainPixel(image,
(ssize_t) pixel.green,max_value,exception)];
- pixel.blue=(MagickRealType) scale[ConstrainPixel(image,(ssize_t)
+ pixel.blue=(double) scale[ConstrainPixel(image,(ssize_t)
pixel.blue,max_value,exception)];
}
SetPixelRed(image,ClampToQuantum(pixel.red),q);
status=SetQuantumFormat(image,quantum_info,FloatingPointQuantumFormat);
if (status == MagickFalse)
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
- SetQuantumScale(quantum_info,(MagickRealType) QuantumRange*
+ SetQuantumScale(quantum_info,(double) QuantumRange*
fabs(quantum_scale));
extent=GetQuantumExtent(image,quantum_info,quantum_type);
for (y=0; y < (ssize_t) image->rows; y++)
MagickBooleanType
status;
- MagickRealType
+ double
height,
width;
for (x=0; x < (ssize_t) image->columns; x++)
{
byte<<=1;
- if (GetPixelIntensity(image,p) < (MagickRealType) (QuantumRange/2.0))
+ if (GetPixelIntensity(image,p) < (double) (QuantumRange/2.0))
byte|=0x01;
bit++;
if (bit == 8)
}
#endif
CompositePixelOver(image,&fill_color,fill_color.alpha,q,
- (MagickRealType) GetPixelAlpha(image,q),q);
+ (double) GetPixelAlpha(image,q),q);
q+=GetPixelChannels(image);
}
if (SyncAuthenticPixels(image,exception) == MagickFalse)
pixel=image->colormap[i];
pixel.colorspace=sRGBColorspace;
pixel.depth=8;
- pixel.alpha=(MagickRealType) OpaqueAlpha;
+ pixel.alpha=(double) OpaqueAlpha;
GetColorTuple(&pixel,MagickTrue,name);
if (transparent != MagickFalse)
if (i == (ssize_t) (colors-1))
else
if (min_value == max_value)
{
- scale_factor=(MagickRealType) QuantumRange/min_value;
+ scale_factor=(double) QuantumRange/min_value;
min_value=0;
}
else
- scale_factor=(MagickRealType) QuantumRange/(max_value-min_value);
+ scale_factor=(double) QuantumRange/(max_value-min_value);
}
/*
Convert pixels to Quantum size.
{
for (bit=0; bit < 8; bit++)
{
- if (GetPixelIntensity(image,q) < ((MagickRealType) QuantumRange/2.0))
+ if (GetPixelIntensity(image,q) < ((double) QuantumRange/2.0))
{
quantum=(size_t) GetPixelIndex(image,q);
quantum|=0x01;
if ((image->columns % 8) != 0)
{
for (bit=0; bit < (ssize_t) (image->columns % 8); bit++)
- if (GetPixelIntensity(image,q) < ((MagickRealType) QuantumRange/2.0))
+ if (GetPixelIntensity(image,q) < ((double) QuantumRange/2.0))
{
quantum=(size_t) GetPixelIndex(image,q);
quantum|=0x01;
for (x=0; x < (ssize_t) image->columns; x++)
{
byte>>=1;
- if (GetPixelIntensity(image,p) < ((MagickRealType) QuantumRange/2.0))
+ if (GetPixelIntensity(image,p) < ((double) QuantumRange/2.0))
byte|=0x80;
bit++;
if (bit == 8)
byte=0;
for (x=0; x < (ssize_t) image->columns; x++)
{
- if (GetPixelIntensity(image,p) >= ((MagickRealType) QuantumRange/2.0))
+ if (GetPixelIntensity(image,p) >= ((double) QuantumRange/2.0))
byte|=0x1 << (7-bit);
bit++;
if (bit == 8)
MagickWand
*magick_wand;
- MagickRealType
+ double
height,
width;
pixel=picon->colormap[i];
pixel.colorspace=sRGBColorspace;
pixel.depth=8;
- pixel.alpha=(MagickRealType) OpaqueAlpha;
+ pixel.alpha=(double) OpaqueAlpha;
(void) QueryColorname(image,&pixel,XPMCompliance,name,exception);
if (transparent != MagickFalse)
{
}
else
{
- MagickRealType
+ double
alpha,
beta;
opacity=i;
continue;
}
- alpha=(MagickRealType) TransparentAlpha-(MagickRealType)
+ alpha=(double) TransparentAlpha-(double)
image->colormap[i].alpha;
- beta=(MagickRealType) TransparentAlpha-(MagickRealType)
+ beta=(double) TransparentAlpha-(double)
image->colormap[opacity].alpha;
if (alpha < beta)
opacity=i;
opacity=i;
continue;
}
- alpha=(Quantum) TransparentAlpha-(MagickRealType)
+ alpha=(Quantum) TransparentAlpha-(double)
image->colormap[i].alpha;
- beta=(Quantum) TransparentAlpha-(MagickRealType)
+ beta=(Quantum) TransparentAlpha-(double)
image->colormap[opacity].alpha;
if (alpha < beta)
opacity=i;
pixel=image->colormap[i];
pixel.colorspace=sRGBColorspace;
pixel.depth=8;
- pixel.alpha=(MagickRealType) OpaqueAlpha;
+ pixel.alpha=(double) OpaqueAlpha;
(void) QueryColorname(image,&pixel,XPMCompliance,name,exception);
if (i == opacity)
(void) CopyMagickString(name,"None",MaxTextExtent);