]> granicus.if.org Git - imagemagick/blobdiff - MagickCore/colormap.c
(no commit message)
[imagemagick] / MagickCore / colormap.c
index 5da424225bfa20113c255f70f2e445aef7bd5c5c..04644882fd30461b3170e43cc3b48f0cff8b297c 100644 (file)
 %                        MagickCore Colormap Methods                          %
 %                                                                             %
 %                              Software Design                                %
-%                                John Cristy                                  %
+%                                   Cristy                                    %
 %                                 July 1992                                   %
 %                                                                             %
 %                                                                             %
-%  Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization      %
+%  Copyright 1999-2014 ImageMagick Studio LLC, a non-profit organization      %
 %  dedicated to making software imaging solutions freely available.           %
 %                                                                             %
 %  You may not use this file except in compliance with the License.  You may  %
@@ -42,6 +42,7 @@
   Include declarations.
 */
 #include "MagickCore/studio.h"
+#include "MagickCore/attribute.h"
 #include "MagickCore/blob.h"
 #include "MagickCore/cache-view.h"
 #include "MagickCore/cache.h"
 #include "MagickCore/pixel-accessor.h"
 #include "MagickCore/quantize.h"
 #include "MagickCore/quantum.h"
+#include "MagickCore/resource_.h"
 #include "MagickCore/semaphore.h"
 #include "MagickCore/string_.h"
+#include "MagickCore/thread-private.h"
 #include "MagickCore/token.h"
 #include "MagickCore/utility.h"
 #include "MagickCore/xml-tree.h"
@@ -141,7 +144,7 @@ MagickExport MagickBooleanType AcquireImageColormap(Image *image,
 
     pixel=(double) (i*(QuantumRange/MagickMax(colors-1,1)));
     GetPixelInfo(image,image->colormap+i);
-    image->colormap[i].matte=MagickTrue;
+    image->colormap[i].alpha_trait=BlendPixelTrait;
     image->colormap[i].red=pixel;
     image->colormap[i].green=pixel;
     image->colormap[i].blue=pixel;
@@ -201,9 +204,10 @@ MagickExport MagickBooleanType CycleColormapImage(Image *image,
   if (image->storage_class == DirectClass)
     (void) SetImageType(image,PaletteType,exception);
   status=MagickTrue;
-  image_view=AcquireCacheView(image);
+  image_view=AcquireAuthenticCacheView(image,exception);
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
-  #pragma omp parallel for schedule(static,4) shared(status)
+  #pragma omp parallel for schedule(static,4) \
+    magick_threads(image,image,1,1)
 #endif
   for (y=0; y < (ssize_t) image->rows; y++)
   {
@@ -327,7 +331,8 @@ MagickExport MagickBooleanType SortColormapByIntensity(Image *image,
     Assign index values to colormap entries.
   */
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
-  #pragma omp parallel for schedule(static,4) shared(status)
+  #pragma omp parallel for schedule(static,4) shared(status) \
+    magick_threads(image,image,1,1)
 #endif
   for (i=0; i < (ssize_t) image->colors; i++)
     image->colormap[i].alpha=(double) i;
@@ -345,7 +350,7 @@ MagickExport MagickBooleanType SortColormapByIntensity(Image *image,
   for (i=0; i < (ssize_t) image->colors; i++)
     pixels[(ssize_t) image->colormap[i].alpha]=(unsigned short) i;
   status=MagickTrue;
-  image_view=AcquireCacheView(image);
+  image_view=AcquireAuthenticCacheView(image,exception);
   for (y=0; y < (ssize_t) image->rows; y++)
   {
     Quantum