From: cristy Date: Thu, 8 Sep 2011 13:13:04 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~7046 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=000d38b77260f5159224b68b012393ece590e0ee;p=imagemagick --- diff --git a/MagickCore/enhance.c b/MagickCore/enhance.c index b985258d8..5114977d5 100644 --- a/MagickCore/enhance.c +++ b/MagickCore/enhance.c @@ -1155,7 +1155,7 @@ MagickExport MagickBooleanType ContrastStretchImage(Image *image, Stretch-contrast colormap. */ #if defined(MAGICKCORE_OPENMP_SUPPORT) - #pragma omp parallel for schedule(dynamic,4) shared(progress,status) + #pragma omp parallel for schedule(dynamic,4) shared(progress,status) #endif for (j=0; j < (ssize_t) image->colors; j++) { @@ -1163,33 +1163,33 @@ MagickExport MagickBooleanType ContrastStretchImage(Image *image, { i=GetPixelChannelMapChannel(image,RedPixelChannel); if (black[i] != white[i]) - image->colormap[i].red=ClampToQuantum(stretch_map[ + image->colormap[j].red=ClampToQuantum(stretch_map[ GetPixelChannels(image)*ScaleQuantumToMap( - image->colormap[i].red)]+i); + image->colormap[j].red)]+i); } if ((GetPixelGreenTraits(image) & UpdatePixelTrait) != 0) { i=GetPixelChannelMapChannel(image,GreenPixelChannel); if (black[i] != white[i]) - image->colormap[i].red=ClampToQuantum(stretch_map[ + image->colormap[j].green=ClampToQuantum(stretch_map[ GetPixelChannels(image)*ScaleQuantumToMap( - image->colormap[i].red)]+i); + image->colormap[j].green)]+i); } if ((GetPixelBlueTraits(image) & UpdatePixelTrait) != 0) { i=GetPixelChannelMapChannel(image,BluePixelChannel); if (black[i] != white[i]) - image->colormap[i].red=ClampToQuantum(stretch_map[ + image->colormap[j].blue=ClampToQuantum(stretch_map[ GetPixelChannels(image)*ScaleQuantumToMap( - image->colormap[i].red)]+i); + image->colormap[j].blue)]+i); } if ((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) { i=GetPixelChannelMapChannel(image,AlphaPixelChannel); if (black[i] != white[i]) - image->colormap[i].red=ClampToQuantum(stretch_map[ + image->colormap[j].alpha=ClampToQuantum(stretch_map[ GetPixelChannels(image)*ScaleQuantumToMap( - image->colormap[i].red)]+i); + image->colormap[j].alpha)]+i); } } }