Changeset 431

Show
Ignore:
Timestamp:
10/22/09 16:59:52 (5 months ago)
Author:
cristy
Message:
 
Location:
ImageMagick/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • ImageMagick/trunk/ChangeLog

    r430 r431  
    55  * Alpha blending is not required for ScaleImage(). 
    66  * Guassian noise operator is not longer discontinuous. 
     7  * Correct hue computation for the HSB colorspace. 
    78 
    892009-10-14  6.5.7-0 Pino Toscano  <pino@kde...> 
  • ImageMagick/trunk/magick/gem.c

    r430 r431  
    373373  if (delta == 0.0) 
    374374    return; 
    375   if ((MagickRealType) red == max) 
    376     *hue=(double) ((green-(MagickRealType) blue)/delta); 
     375  if (red == max) 
     376    *hue=((((max-blue)/6.0)+(delta/2.0))-(((max-green)/6.0)+(delta/2.0)))/delta; 
    377377  else 
    378     if ((MagickRealType) green == max) 
    379       *hue=(double) (2.0+(blue-(MagickRealType) red)/delta); 
     378    if (green == max) 
     379      *hue=(1.0/3.0)+((((max-red)/6.0)+(delta/2.0))-(((max-blue)/6.0)+ 
     380        (delta/2.0)))/delta; 
    380381    else 
    381       *hue=(double) (4.0+(red-(MagickRealType) green)/delta); 
    382   *hue/=6.0; 
     382      if (blue == max) 
     383        *hue=(2.0/3.0)+((((max-green)/6.0)+(delta/2.0))-(((max-red)/6.0)+ 
     384          (delta/2.0)))/delta; 
    383385  if (*hue < 0.0) 
    384386    *hue+=1.0; 
     387  if (*hue > 1.0) 
     388    *hue-=1.0; 
    385389} 
    386390