]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Tue, 13 Apr 2010 01:18:27 +0000 (01:18 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Tue, 13 Apr 2010 01:18:27 +0000 (01:18 +0000)
ChangeLog
magick/gem.c

index 1178f4724e29bd98bf9ef0a589bf55448af6f612..19fb1f15a1705809365e9ff85d0fb3d465aa05b0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,7 @@
-2010-04-8  6.6.1-2 Cristy  <quetzlzacatenango@image...>
+2010-04-12  6.6.1-3 Cristy  <quetzlzacatenango@image...>
+  * For HSL to RGB, if color temperature is less than 0, set RGB to lightness.
+
+2010-04-08  6.6.1-2 Cristy  <quetzlzacatenango@image...>
   * Improve support for device link profiles.
 
 2010-04-06  6.6.1-1 Anthony Thyssen <A.Thyssen@griffith...>
index 5a173f92c03a096c2d39ad44042c82b26355ac36..5a1784d857b0e54adb4bc0a39b2cec6b328e47e6 100644 (file)
@@ -98,20 +98,18 @@ MagickExport void ConvertHSBToRGB(const double hue,const double saturation,
   assert(red != (Quantum *) NULL);
   assert(green != (Quantum *) NULL);
   assert(blue != (Quantum *) NULL);
-  if (saturation == 0.0)
+  h=6.0*(hue-floor(hue));
+  f=h-floor((double) h);
+  p=brightness*(1.0-saturation);
+  q=brightness*(1.0-saturation*f);
+  t=brightness*(1.0-(saturation*(1.0-f)));
+  if ((saturation == 0.0) || (p < 0.0))
     {
       *red=ClampToQuantum((MagickRealType) QuantumRange*brightness);
       *green=(*red);
       *blue=(*red);
       return;
     }
-  h=6.0*(hue-floor(hue));
-  f=h-floor((double) h);
-  p=brightness*(1.0-saturation);
-  q=brightness*(1.0-saturation*f);
-  t=brightness*(1.0-(saturation*(1.0-f)));
-  if (p < 0.0)
-    return;
   switch ((int) h)
   {
     case 0:
@@ -220,20 +218,18 @@ MagickExport void ConvertHSLToRGB(const double hue,const double saturation,
   assert(red != (Quantum *) NULL);
   assert(green != (Quantum *) NULL);
   assert(blue != (Quantum *) NULL);
-  if (saturation == 0)
+  if (lightness < 0.5)
+    m2=lightness*(saturation+1.0);
+  else
+    m2=(lightness+saturation)-(lightness*saturation);
+  m1=2.0*lightness-m2;
+  if ((saturation == 0.0) || (m1 < 0.0))
     {
       *red=ClampToQuantum((MagickRealType) QuantumRange*lightness);
       *green=(*red);
       *blue=(*red);
       return;
     }
-  if (lightness < 0.5)
-    m2=lightness*(saturation+1.0);
-  else
-    m2=(lightness+saturation)-(lightness*saturation);
-  m1=2.0*lightness-m2;
-  if (m1 <= 0.0)
-    return;
   r=ConvertHueToRGB(m1,m2,hue+1.0/3.0);
   g=ConvertHueToRGB(m1,m2,hue);
   b=ConvertHueToRGB(m1,m2,hue-1.0/3.0);