From: cristy Date: Sun, 24 Jun 2012 19:30:30 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~5359 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d265ede8dfa3bc0d9960e6aac1992aedcb6baafd;p=imagemagick --- diff --git a/MagickCore/colorspace.c b/MagickCore/colorspace.c index 520181a93..db83e6b9b 100644 --- a/MagickCore/colorspace.c +++ b/MagickCore/colorspace.c @@ -1591,9 +1591,9 @@ static inline void ConvertXYZTosRGB(const double x,const double y, r=3.1338561*x-1.6168667*y-0.4906146*z; g=(-0.9787684*x+1.9161415*y+0.0334540*z); b=0.0719453*x-0.2289914*y+1.4052427*z; - *red=RoundToQuantum((MagickRealType) QuantumRange*CompandsRGB(r)); - *green=RoundToQuantum((MagickRealType) QuantumRange*CompandsRGB(g)); - *blue=RoundToQuantum((MagickRealType) QuantumRange*CompandsRGB(b)); + *red=ClampToQuantum((MagickRealType) QuantumRange*CompandsRGB(r)); + *green=ClampToQuantum((MagickRealType) QuantumRange*CompandsRGB(g)); + *blue=ClampToQuantum((MagickRealType) QuantumRange*CompandsRGB(b)); } static inline void ConvertCMYKTosRGB(PixelInfo *pixel) diff --git a/MagickCore/quantum.h b/MagickCore/quantum.h index ce4a08099..6c0b077d4 100644 --- a/MagickCore/quantum.h +++ b/MagickCore/quantum.h @@ -24,8 +24,6 @@ extern "C" { #include "MagickCore/semaphore.h" -#define RoundToQuantum(quantum) ClampToQuantum(quantum) - typedef enum { UndefinedEndian, diff --git a/MagickCore/threshold.c b/MagickCore/threshold.c index c0dfd8eac..599bf63ce 100644 --- a/MagickCore/threshold.c +++ b/MagickCore/threshold.c @@ -1381,7 +1381,7 @@ MagickExport MagickBooleanType OrderedPosterizeImage(Image *image, threshold=(ssize_t) (QuantumScale*q[i]*(levels[n]*(map->divisor-1)+1)); level=threshold/(map->divisor-1); threshold-=level*(map->divisor-1); - q[i]=RoundToQuantum((MagickRealType) (level+(threshold >= + q[i]=ClampToQuantum((MagickRealType) (level+(threshold >= map->levels[(x % map->width)+map->width*(y % map->height)]))* QuantumRange/levels[n]); n++;