]> granicus.if.org Git - imagemagick/blobdiff - MagickCore/gem.c
(no commit message)
[imagemagick] / MagickCore / gem.c
index 440e2b1491d7c37117f7079ad41b5e3e810a15da..7085742e1137a56033a9274e6f1aeaa7c01935e0 100644 (file)
 %                    Graphic Gems - Graphic Support Methods                   %
 %                                                                             %
 %                               Software Design                               %
-%                                 John Cristy                                 %
+%                                    Cristy                                   %
 %                                 August 1996                                 %
 %                                                                             %
 %                                                                             %
-%  Copyright 1999-2013 ImageMagick Studio LLC, a non-profit organization      %
+%  Copyright 1999-2014 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  %
@@ -762,7 +762,7 @@ MagickPrivate void ConvertLCHabToRGB(const double luma,const double chroma,
   assert(red != (double *) NULL);
   assert(green != (double *) NULL);
   assert(blue != (double *) NULL);
-  ConvertLCHabToXYZ(100.0*luma,255.0*(chroma-0.5),360.0*(hue-0.5),&X,&Y,&Z);
+  ConvertLCHabToXYZ(100.0*luma,255.0*(chroma-0.5),360.0*hue,&X,&Y,&Z);
   ConvertXYZToRGB(X,Y,Z,red,green,blue);
 }
 \f
@@ -815,7 +815,7 @@ MagickPrivate void ConvertLCHuvToRGB(const double luma,const double chroma,
   assert(red != (double *) NULL);
   assert(green != (double *) NULL);
   assert(blue != (double *) NULL);
-  ConvertLCHuvToXYZ(100.0*luma,255.0*(chroma-0.5),360.0*(hue-0.5),&X,&Y,&Z)
+  ConvertLCHuvToXYZ(100.0*luma,255.0*(chroma-0.5),360.0*hue,&X,&Y,&Z);
   ConvertXYZToRGB(X,Y,Z,red,green,blue);
 }
 \f
@@ -1343,7 +1343,7 @@ static inline void ConvertXYZToLCHab(const double X,const double Y,
 
   ConvertXYZToLab(X,Y,Z,luma,&a,&b);
   *chroma=hypot(255.0*(a-0.5),255.0*(b-0.5))/255.0+0.5;
-  *hue=180.0*atan2(255.0*(b-0.5),255.0*(a-0.5))/MagickPI/360.0+0.5;
+  *hue=180.0*atan2(255.0*(b-0.5),255.0*(a-0.5))/MagickPI/360.0;
   if (*hue < 0.0)
     *hue+=1.0;
 }
@@ -1404,7 +1404,7 @@ static inline void ConvertXYZToLCHuv(const double X,const double Y,
 
   ConvertXYZToLuv(X,Y,Z,luma,&u,&v);
   *chroma=hypot(354.0*u-134.0,262.0*v-140.0)/255.0+0.5;
-  *hue=180.0*atan2(262.0*v-140.0,354.0*u-134.0)/MagickPI/360.0+0.5;
+  *hue=180.0*atan2(262.0*v-140.0,354.0*u-134.0)/MagickPI/360.0;
   if (*hue < 0.0)
     *hue+=1.0;
 }