]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Wed, 19 Jun 2013 16:37:02 +0000 (16:37 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Wed, 19 Jun 2013 16:37:02 +0000 (16:37 +0000)
tests/validate.c

index 2bd0561572b73570ed0c07b6a12b514a003ba9d1..3d3fc32f3cbcab42016b0887e386716e1b8daa31 100644 (file)
@@ -544,11 +544,12 @@ static inline void ConvertXYZToLCHab(const double X,const double Y,
     b;
 
   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;
+  *chroma=hypot(255.0*(a-0.5),255.0*(b-0.5));
+  *hue=180.0*atan2(255.0*(b-0.5),255.0*(a-0.5))/MagickPI;
+  *chroma=(*chroma)/255.0+0.5;
+  *hue=(*hue)/255.0+0.5;
   if (*hue < 0.0)
     *hue+=1.0;
-  *hue+=0.5;
 }
 
 static void ConvertRGBToLCHab(const double red,const double green,