]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Tue, 25 Oct 2011 11:40:59 +0000 (11:40 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Tue, 25 Oct 2011 11:40:59 +0000 (11:40 +0000)
13 files changed:
MagickCore/decorate.c
MagickCore/distort.c
MagickCore/histogram.c
MagickCore/identify.c
MagickCore/image.c
MagickCore/magick-config.h
MagickCore/paint.c
MagickCore/pixel-accessor.h
MagickCore/shear.c
MagickWand/drawing-wand.c
MagickWand/mogrify.c
coders/avs.c
coders/palm.c

index 4771b9ea035a4aee5e84c0997401a47f052fefc4..6f12c2c66799bbeca89a3d1b3cec9024392a5f18 100644 (file)
@@ -185,6 +185,7 @@ MagickExport Image *FrameImage(const Image *image,const FrameInfo *frame_info,
 
   PixelInfo
     accentuate,
+    border,
     highlight,
     interior,
     matte,
@@ -240,39 +241,39 @@ MagickExport Image *FrameImage(const Image *image,const FrameInfo *frame_info,
   /*
     Initialize 3D effects color.
   */
-  interior=image->border_color;
-  matte=image->matte_color;
-  accentuate=matte;
+  GetPixelInfo(frame_image,&interior);
+  SetPixelInfoPacket(frame_image,&image->border_color,&interior);
+  GetPixelInfo(frame_image,&matte);
+  matte.colorspace=RGBColorspace;
+  SetPixelInfoPacket(frame_image,&image->matte_color,&matte);
+  GetPixelInfo(frame_image,&border);
+  border.colorspace=RGBColorspace;
+  SetPixelInfoPacket(frame_image,&image->border_color,&border);
+  GetPixelInfo(frame_image,&accentuate);
   accentuate.red=(MagickRealType) (QuantumScale*((QuantumRange-
     AccentuateModulate)*matte.red+(QuantumRange*AccentuateModulate)));
   accentuate.green=(MagickRealType) (QuantumScale*((QuantumRange-
     AccentuateModulate)*matte.green+(QuantumRange*AccentuateModulate)));
   accentuate.blue=(MagickRealType) (QuantumScale*((QuantumRange-
     AccentuateModulate)*matte.blue+(QuantumRange*AccentuateModulate)));
-  accentuate.black=(MagickRealType) (QuantumScale*((QuantumRange-
-    AccentuateModulate)*matte.black+(QuantumRange*AccentuateModulate)));
   accentuate.alpha=matte.alpha;
-  highlight=matte;
+  GetPixelInfo(frame_image,&highlight);
   highlight.red=(MagickRealType) (QuantumScale*((QuantumRange-
     HighlightModulate)*matte.red+(QuantumRange*HighlightModulate)));
   highlight.green=(MagickRealType) (QuantumScale*((QuantumRange-
     HighlightModulate)*matte.green+(QuantumRange*HighlightModulate)));
   highlight.blue=(MagickRealType) (QuantumScale*((QuantumRange-
     HighlightModulate)*matte.blue+(QuantumRange*HighlightModulate)));
-  highlight.black=(MagickRealType) (QuantumScale*((QuantumRange-
-    HighlightModulate)*matte.black+(QuantumRange*HighlightModulate)));
   highlight.alpha=matte.alpha;
-  shadow=matte;
+  GetPixelInfo(frame_image,&shadow);
   shadow.red=QuantumScale*matte.red*ShadowModulate;
   shadow.green=QuantumScale*matte.green*ShadowModulate;
   shadow.blue=QuantumScale*matte.blue*ShadowModulate;
-  shadow.black=QuantumScale*matte.black*ShadowModulate;
   shadow.alpha=matte.alpha;
-  trough=matte;
+  GetPixelInfo(frame_image,&trough);
   trough.red=QuantumScale*matte.red*TroughModulate;
   trough.green=QuantumScale*matte.green*TroughModulate;
   trough.blue=QuantumScale*matte.blue*TroughModulate;
-  trough.black=QuantumScale*matte.black*TroughModulate;
   trough.alpha=matte.alpha;
   status=MagickTrue;
   progress=0;
index 5d1be362deb051d128eb12214915296415cb4ff8..b934e1b7c220c0b00810a5d468447df167449ab2 100644 (file)
@@ -2311,7 +2311,10 @@ MagickExport Image *DistortImage(const Image *image,DistortImageMethod method,
       */
       validity = 1.0;
 
-      invalid=distort_image->matte_color;
+      GetPixelInfo(distort_image,&invalid);
+      SetPixelInfoPacket(distort_image,&distort_image->matte_color,&invalid);
+      if (distort_image->colorspace == CMYKColorspace)
+        ConvertRGBToCMYK(&invalid);   /* what about other color spaces? */
       for (i=0; i < (ssize_t) distort_image->columns; i++)
       {
         /* map pixel coordinate to distortion space coordinate */
index 816268bdb7976e212b52ca85fadb61e2aa9ce76b..af17ac2907f4c32feca2a7c586f7b4ec977e1c5f 100644 (file)
@@ -257,7 +257,7 @@ static CubeInfo *ClassifyImageColors(const Image *image,
       }
       for (i=0; i < (ssize_t) node_info->number_unique; i++)
       {
-        target=node_info->list[i];
+        SetPixelInfoPacket(image,&node_info->list[i],&target);
         if (IsPixelInfoEquivalent(&pixel,&target) != MagickFalse)
           break;
       }
@@ -725,7 +725,7 @@ MagickExport MagickBooleanType IsHistogramImage(const Image *image,
         break;
       for (i=0; i < (ssize_t) node_info->number_unique; i++)
       {
-        target=node_info->list[i];
+        SetPixelInfoPacket(image,&node_info->list[i],&target);
         if (IsPixelInfoEquivalent(&pixel,&target) != MagickFalse)
           break;
       }
@@ -885,7 +885,7 @@ MagickExport MagickBooleanType IsPaletteImage(const Image *image,
         break;
       for (i=0; i < (ssize_t) node_info->number_unique; i++)
       {
-        target=node_info->list[i];
+        SetPixelInfoPacket(image,&node_info->list[i],&target);
         if (IsPixelInfoEquivalent(&pixel,&target) != MagickFalse)
           break;
       }
@@ -1134,7 +1134,7 @@ MagickExport size_t GetNumberColors(const Image *image,FILE *file,
   status=MagickTrue;
   for (i=0; i < (ssize_t) number_colors; i++)
   {
-    pixel=(*p);
+    SetPixelInfoPacket(image,p,&pixel);
     (void) CopyMagickString(tuple,"(",MaxTextExtent);
     ConcatenateColorComponent(&pixel,RedPixelChannel,X11Compliance,tuple);
     (void) ConcatenateMagickString(tuple,",",MaxTextExtent);
index d6d7501d8d740e8d62277b06e7da180eb8bc5e95..ba1c16def6976bca916a48f82858d9911b70e5b4 100644 (file)
@@ -647,7 +647,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
           p=image->colormap;
           for (i=0; i < (ssize_t) image->colors; i++)
           {
-            pixel=(*p);
+            SetPixelInfoPacket(image,p,&pixel);
             (void) CopyMagickString(tuple,"(",MaxTextExtent);
             ConcatenateColorComponent(&pixel,RedPixelChannel,X11Compliance,
               tuple);
index 742d48058856ca53aa8d87c2ca9155417507480c..c31f1a3633d8c02631fdaa841c533a0f8f2c0b28 100644 (file)
@@ -2433,6 +2433,9 @@ MagickExport MagickBooleanType SetImageAlphaChannel(Image *image,
       PixelInfo
         background;
 
+      PixelInfo
+        pixel;
+
       ssize_t
         y;
 
@@ -2443,7 +2446,9 @@ MagickExport MagickBooleanType SetImageAlphaChannel(Image *image,
         break;
       if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse)
         break;
-      background=image->background_color;
+      GetPixelInfo(image,&background);
+      SetPixelInfoPacket(image,&image->background_color,&background);
+      SetPacketPixelInfo(image,&background,&pixel);
       image_view=AcquireCacheView(image);
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
       #pragma omp parallel for schedule(dynamic,4) shared(status)
@@ -2501,7 +2506,8 @@ MagickExport MagickBooleanType SetImageAlphaChannel(Image *image,
           /*
             Reset all color channels to background color.
           */
-          background=image->background_color;
+          GetPixelInfo(image,&background);
+          SetPixelInfoPacket(image,&(image->background_color),&background);
           (void) LevelImageColors(image,&background,&background,MagickTrue,
             exception);
         }
@@ -2583,6 +2589,9 @@ MagickExport MagickBooleanType SetImageBackgroundColor(Image *image,
   PixelInfo
     background;
 
+  PixelInfo
+    pixel;
+
   ssize_t
     y;
 
@@ -2595,11 +2604,13 @@ MagickExport MagickBooleanType SetImageBackgroundColor(Image *image,
   if (image->background_color.alpha != OpaqueAlpha)
     image->matte=MagickTrue;
   GetPixelInfo(image,&background);
-  background=image->background_color;
+  SetPixelInfoPacket(image,&image->background_color,&background);
+  SetPacketPixelInfo(image,&background,&pixel);
   /*
     Set image background color.
   */
   status=MagickTrue;
+  pixel.black=0;
   image_view=AcquireCacheView(image);
   for (y=0; y < (ssize_t) image->rows; y++)
   {
index 1bf8a49589d630cc52cae03c5f5cf4430e70a50e..cc7a5e5cbb35be8fd816332ead61dbeb4aa10cdb 100644 (file)
 #endif
 
 /* Define if you have the <lcms2.h> header file. */
-/* #undef HAVE_LCMS2_H */
+#ifndef MAGICKCORE_HAVE_LCMS2_H
+#define MAGICKCORE_HAVE_LCMS2_H 1
+#endif
 
 /* Define if you have the <lcms2/lcms2.h> header file. */
 /* #undef HAVE_LCMS2_LCMS2_H */
 
 /* Define if you have the <lcms.h> header file. */
-#ifndef MAGICKCORE_HAVE_LCMS_H
-#define MAGICKCORE_HAVE_LCMS_H 1
-#endif
+/* #undef HAVE_LCMS_H */
 
 /* Define if you have the <lcms/lcms.h> header file. */
 /* #undef HAVE_LCMS_LCMS_H */
 #endif
 
 /* Define if you have LQR library */
-#ifndef MAGICKCORE_LQR_DELEGATE
-#define MAGICKCORE_LQR_DELEGATE 1
-#endif
+/* #undef LQR_DELEGATE */
 
 /* Define if using libltdl to support dynamically loadable modules */
 #ifndef MAGICKCORE_LTDL_DELEGATE
 
 /* Define to the system default library search path. */
 #ifndef MAGICKCORE_LT_DLSEARCH_PATH
-#define MAGICKCORE_LT_DLSEARCH_PATH "/lib64:/usr/lib64:/lib:/usr/lib:/usr/lib64/R/lib:/usr/lib64/atlas:/opt/modules/pkg/intel/f77/10.0.025/lib:/opt/intel/lib/intel64:/usr/lib64/llvm:/usr/local/lib:/usr/lib64/mysql:/usr/lib64/nvidia:/usr/lib64/qt-3.3/lib:/usr/lib64/tracker-0.12:/usr/lib64/xulrunner-2"
+#define MAGICKCORE_LT_DLSEARCH_PATH "/lib64:/usr/lib64:/lib:/usr/lib:/usr/lib64/R/lib:/usr/lib64/alliance/lib:/usr/lib64/atlas:/opt/modules/pkg/intel/f77/10.0.025/lib:/usr/lib64/kicad:/usr/lib/llvm:/usr/lib64/llvm:/usr/local/lib:/usr/lib64/mpich2/lib/:/usr/lib64/mysql:/usr/lib64/nvidia:/usr/lib64/octave/3.4.2:/usr/lib64/openmotif:/usr/lib64/qt-3.3/lib:/usr/lib64/tcl8.5/tclx8.4:/usr/lib/wine/:/usr/lib64/wine/:/usr/lib64/xulrunner-2"
 #endif
 
 /* The archive extension */
 #endif
 
 /* Define if you have WEBP library */
-#ifndef MAGICKCORE_WEBP_DELEGATE
-#define MAGICKCORE_WEBP_DELEGATE 1
-#endif
+/* #undef WEBP_DELEGATE */
 
 /* Define to use the Windows GDI32 library */
 /* #undef WINGDI32_DELEGATE */
 /* #undef _MINIX */
 
 /* Define this for the OpenCL Accelerator */
-/* #undef _OPENCL */
+#ifndef MAGICKCORE__OPENCL
+#define MAGICKCORE__OPENCL 1
+#endif
 
 /* Define to 2 if the system does not provide POSIX.1 features except with
    this defined. */
index 5dc2bd31d6cc7b4efceff1cdacb26af2a0af0eca..5d13857cb5d53851bcfe1dc723c4f7ae4af7274d 100644 (file)
@@ -335,7 +335,7 @@ MagickExport MagickBooleanType FloodfillPaintImage(Image *image,
       if (GetPixelAlpha(floodplane_image,p) != OpaqueAlpha)
         {
           (void) GetFillColor(draw_info,x,y,&fill_color,exception);
-          fill=fill_color;
+          SetPixelInfoPacket(image,&fill_color,&fill);
           if ((GetPixelRedTraits(image) & UpdatePixelTrait) != 0)
             SetPixelRed(image,ClampToQuantum(fill.red),q);
           if ((GetPixelGreenTraits(image) & UpdatePixelTrait) != 0)
@@ -456,9 +456,9 @@ MagickExport MagickBooleanType GradientImage(Image *image,
     sizeof(*gradient->stops));
   for (i=0; i < (ssize_t) gradient->number_stops; i++)
     GetPixelInfo(image,&gradient->stops[i].color);
-  gradient->stops[0].color=(*start_color);
+  SetPixelInfoPacket(image,start_color,&gradient->stops[0].color);
   gradient->stops[0].offset=0.0;
-  gradient->stops[1].color=(*stop_color);
+  SetPixelInfoPacket(image,stop_color,&gradient->stops[1].color);
   gradient->stops[1].offset=1.0;
   /*
     Draw a gradient on the image.
index 8720997264975459720228ff319835bacddaad76..c480fd69f40fb837dedbc742782213b3f58b1e54 100644 (file)
@@ -525,6 +525,19 @@ static inline void SetPixelInfo(const Image *image,const Quantum *pixel,
       pixel[image->channel_map[IndexPixelChannel].channel];
 }
 
+static inline void SetPixelInfoPacket(const Image *image,
+  const PixelInfo *pixel,PixelInfo *pixel_info)
+{
+  pixel_info->red=(MagickRealType) pixel->red;
+  pixel_info->green=(MagickRealType) pixel->green;
+  pixel_info->blue=(MagickRealType) pixel->blue;
+  pixel_info->alpha=(MagickRealType) pixel->alpha;
+  if (image->colorspace == CMYKColorspace)
+    pixel_info->black=(MagickRealType) pixel->black;
+  if (image->storage_class == PseudoClass)
+    pixel_info->index=(MagickRealType) pixel->index;
+}
+
 static inline void SetPixelMagenta(const Image *image,const Quantum magenta,
   Quantum *pixel)
 {
index 7377f5966b16e5b042babaeaea529982e24ce1c4..384faee803bdcde0b0006c1c1e4e40c7a493800b 100644 (file)
@@ -1480,7 +1480,8 @@ static MagickBooleanType XShearImage(Image *image,const MagickRealType degrees,
   assert(image->signature == MagickSignature);
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
-  background=image->background_color;
+  GetPixelInfo(image,&background);
+  SetPixelInfoPacket(image,&image->background_color,&background);
   /*
     X shear image.
   */
@@ -1695,7 +1696,8 @@ static MagickBooleanType YShearImage(Image *image,const MagickRealType degrees,
   assert(image->signature == MagickSignature);
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
-  background=image->background_color;
+  GetPixelInfo(image,&background);
+  SetPixelInfoPacket(image,&image->background_color,&background);
   /*
     Y Shear image.
   */
index 8827cda6a2a266d7553afcfed9496e63356d3bc5..5aa037b62064611b0d2a06d190a6f19a8904afe5 100644 (file)
@@ -2464,17 +2464,17 @@ WandExport char *DrawGetVectorGraphics(DrawingWand *wand)
   if (child != (XMLTreeInfo *) NULL)
     {
       if (CurrentContext->fill.alpha != OpaqueAlpha)
-        pixel.matte=CurrentContext->fill.alpha != OpaqueAlpha ? MagickTrue :
-          MagickFalse;
-      pixel=CurrentContext->fill;
+        pixel.matte=CurrentContext->fill.alpha != OpaqueAlpha ?
+          MagickTrue : MagickFalse;
+      SetPixelInfoPacket(wand->image,&CurrentContext->fill,&pixel);
       GetColorTuple(&pixel,MagickTrue,value);
       (void) SetXMLTreeContent(child,value);
     }
   child=AddChildToXMLTree(xml_info,"fill-alpha",0);
   if (child != (XMLTreeInfo *) NULL)
     {
-      (void) FormatLocaleString(value,MaxTextExtent,"%g",(double) QuantumScale*
-        CurrentContext->fill.alpha);
+      (void) FormatLocaleString(value,MaxTextExtent,"%g",
+        (double) QuantumScale*CurrentContext->fill.alpha);
       (void) SetXMLTreeContent(child,value);
     }
   child=AddChildToXMLTree(xml_info,"fill-rule",0);
@@ -2532,7 +2532,7 @@ WandExport char *DrawGetVectorGraphics(DrawingWand *wand)
       if (CurrentContext->stroke.alpha != OpaqueAlpha)
         pixel.matte=CurrentContext->stroke.alpha != OpaqueAlpha ?
           MagickTrue : MagickFalse;
-      pixel=CurrentContext->stroke;
+      SetPixelInfoPacket(wand->image,&CurrentContext->stroke,&pixel);
       GetColorTuple(&pixel,MagickTrue,value);
       (void) SetXMLTreeContent(child,value);
     }
@@ -2625,7 +2625,7 @@ WandExport char *DrawGetVectorGraphics(DrawingWand *wand)
       if (CurrentContext->undercolor.alpha != OpaqueAlpha)
         pixel.matte=CurrentContext->undercolor.alpha != OpaqueAlpha ?
           MagickTrue : MagickFalse;
-      pixel=CurrentContext->undercolor;
+      SetPixelInfoPacket(wand->image,&CurrentContext->undercolor,&pixel);
       GetColorTuple(&pixel,MagickTrue,value);
       (void) SetXMLTreeContent(child,value);
     }
index c70f7be8aeac691e1631d27ac76803f531ca24e5..b73476e323b6d58a5b294e3fd5bd3d07a8e4c354 100644 (file)
@@ -678,7 +678,7 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc,
   quantize_info=AcquireQuantizeInfo(mogrify_info);
   SetGeometryInfo(&geometry_info);
   GetPixelInfo(*image,&fill);
-  fill=(*image)->background_color;
+  SetPixelInfoPacket(*image,&(*image)->background_color,&fill);
   attenuate=1.0;
   compose=(*image)->compose;
   interpolate_method=UndefinedInterpolatePixel;
index 970544390b62e8297e4e7c0286473c8a9e093dbc..54eb1e88351dd62868c07690138cc8633eb2aae2 100644 (file)
@@ -141,6 +141,7 @@ static Image *ReadAVSImage(const ImageInfo *image_info,ExceptionInfo *exception)
   /*
     Read AVS X image.
   */
+  image->matte=MagickTrue;
   width=ReadBlobMSBLong(image);
   height=ReadBlobMSBLong(image);
   if (EOFBlob(image) != MagickFalse)
@@ -152,7 +153,6 @@ static Image *ReadAVSImage(const ImageInfo *image_info,ExceptionInfo *exception)
     /*
       Convert AVS raster image to pixel packets.
     */
-    image->matte=MagickTrue;
     image->columns=width;
     image->rows=height;
     image->depth=8;
index 8baf5412e6b3cd2a34aba5b0f1680dc4c190522b..fd1fa99b60952fb98579198f41bf83097371f12e 100644 (file)
@@ -513,7 +513,8 @@ static Image *ReadPALMImage(const ImageInfo *image_info,
     if (flags & PALM_HAS_TRANSPARENCY_FLAG)
       {
         if (bits_per_pixel != 16)
-          transpix=image->colormap[mask-transparentIndex];
+          SetPixelInfoPacket(image,image->colormap+(mask-transparentIndex),
+            &transpix);
         (void) TransparentPaintImage(image,&transpix,(Quantum) TransparentAlpha,
           MagickFalse,exception);
       }