% August 1996 %
% %
% %
-% Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2013 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
b=0.0;
if ((0.0 <= h) && (h < 1.0))
{
- r=c;
- g=x;
+ r=c;
+ g=x;
}
else
if ((1.0 <= h) && (h < 2.0))
{
- r=x;
- g=c;
+ r=x;
+ g=c;
}
else
if ((2.0 <= h) && (h < 3.0))
{
- g=c;
- b=x;
+ g=c;
+ b=x;
}
else
if ((3.0 <= h) && (h < 4.0))
{
- g=x;
- b=c;
+ g=x;
+ b=c;
}
else
if ((4.0 <= h) && (h < 5.0))
{
- r=x;
- b=c;
+ r=x;
+ b=c;
}
else
if ((5.0 <= h) && (h < 6.0))
{
- r=c;
- b=x;
+ r=c;
+ b=x;
}
- m=luma-0.298839*r+0.586811*g+0.114350*b;
+ m=luma-(0.298839f*r+0.586811f*g+0.114350f*b);
*red=QuantumRange*(r+m);
*green=QuantumRange*(g+m);
*blue=QuantumRange*(b+m);
max=MagickMax(r,MagickMax(g,b));
c=max-(double) MagickMin(r,MagickMin(g,b));
h=0.0;
- if (c == 0)
+ if (c == 0.0)
h=0.0;
else
if (red == max)
- h=fmod((g-b)/c,6.0);
+ h=fmod((g-b)/c+6.0,6.0);
else
if (green == max)
h=((b-r)/c)+2.0;
h=((r-g)/c)+4.0;
*hue=(h/6.0);
*chroma=QuantumScale*c;
- *luma=QuantumScale*(0.298839*r+0.586811*g+0.114350*b);
+ *luma=QuantumScale*(0.298839f*r+0.586811f*g+0.114350f*b);
}
\f
/*
gamma=fabs(sigma);
if (gamma <= MagickEpsilon)
return(3UL);
- alpha=MagickEpsilonReciprocal(2.0*gamma*gamma);
- beta=(double) MagickEpsilonReciprocal((double) MagickSQ2PI*gamma);
+ alpha=PerceptibleReciprocal(2.0*gamma*gamma);
+ beta=(double) PerceptibleReciprocal((double) MagickSQ2PI*gamma);
for (width=5; ; )
{
normalize=0.0;
gamma=fabs(sigma);
if (gamma <= MagickEpsilon)
return(3UL);
- alpha=MagickEpsilonReciprocal(2.0*gamma*gamma);
- beta=(double) MagickEpsilonReciprocal((double) Magick2PI*gamma*gamma);
+ alpha=PerceptibleReciprocal(2.0*gamma*gamma);
+ beta=(double) PerceptibleReciprocal((double) Magick2PI*gamma*gamma);
for (width=5; ; )
{
normalize=0.0;