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

index 6f12c2c66799bbeca89a3d1b3cec9024392a5f18..4771b9ea035a4aee5e84c0997401a47f052fefc4 100644 (file)
@@ -185,7 +185,6 @@ MagickExport Image *FrameImage(const Image *image,const FrameInfo *frame_info,
 
   PixelInfo
     accentuate,
-    border,
     highlight,
     interior,
     matte,
@@ -241,39 +240,39 @@ MagickExport Image *FrameImage(const Image *image,const FrameInfo *frame_info,
   /*
     Initialize 3D effects color.
   */
-  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);
+  interior=image->border_color;
+  matte=image->matte_color;
+  accentuate=matte;
   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;
-  GetPixelInfo(frame_image,&highlight);
+  highlight=matte;
   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;
-  GetPixelInfo(frame_image,&shadow);
+  shadow=matte;
   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;
-  GetPixelInfo(frame_image,&trough);
+  trough=matte;
   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 b934e1b7c220c0b00810a5d468447df167449ab2..daade12ff40e1fbb8499a551160cf509979d9c06 100644 (file)
@@ -2311,8 +2311,7 @@ MagickExport Image *DistortImage(const Image *image,DistortImageMethod method,
       */
       validity = 1.0;
 
-      GetPixelInfo(distort_image,&invalid);
-      SetPixelInfoPacket(distort_image,&distort_image->matte_color,&invalid);
+      invalid=distort_image->matte_color;
       if (distort_image->colorspace == CMYKColorspace)
         ConvertRGBToCMYK(&invalid);   /* what about other color spaces? */
       for (i=0; i < (ssize_t) distort_image->columns; i++)
index af17ac2907f4c32feca2a7c586f7b4ec977e1c5f..816268bdb7976e212b52ca85fadb61e2aa9ce76b 100644 (file)
@@ -257,7 +257,7 @@ static CubeInfo *ClassifyImageColors(const Image *image,
       }
       for (i=0; i < (ssize_t) node_info->number_unique; i++)
       {
-        SetPixelInfoPacket(image,&node_info->list[i],&target);
+        target=node_info->list[i];
         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++)
       {
-        SetPixelInfoPacket(image,&node_info->list[i],&target);
+        target=node_info->list[i];
         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++)
       {
-        SetPixelInfoPacket(image,&node_info->list[i],&target);
+        target=node_info->list[i];
         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++)
   {
-    SetPixelInfoPacket(image,p,&pixel);
+    pixel=(*p);
     (void) CopyMagickString(tuple,"(",MaxTextExtent);
     ConcatenateColorComponent(&pixel,RedPixelChannel,X11Compliance,tuple);
     (void) ConcatenateMagickString(tuple,",",MaxTextExtent);
index ba1c16def6976bca916a48f82858d9911b70e5b4..d6d7501d8d740e8d62277b06e7da180eb8bc5e95 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++)
           {
-            SetPixelInfoPacket(image,p,&pixel);
+            pixel=(*p);
             (void) CopyMagickString(tuple,"(",MaxTextExtent);
             ConcatenateColorComponent(&pixel,RedPixelChannel,X11Compliance,
               tuple);
index c31f1a3633d8c02631fdaa841c533a0f8f2c0b28..0e25f8a283872147c73b06bceceec370df3ae965 100644 (file)
@@ -2433,9 +2433,6 @@ MagickExport MagickBooleanType SetImageAlphaChannel(Image *image,
       PixelInfo
         background;
 
-      PixelInfo
-        pixel;
-
       ssize_t
         y;
 
@@ -2446,9 +2443,7 @@ MagickExport MagickBooleanType SetImageAlphaChannel(Image *image,
         break;
       if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse)
         break;
-      GetPixelInfo(image,&background);
-      SetPixelInfoPacket(image,&image->background_color,&background);
-      SetPacketPixelInfo(image,&background,&pixel);
+      background=image->background_color;
       image_view=AcquireCacheView(image);
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
       #pragma omp parallel for schedule(dynamic,4) shared(status)
@@ -2506,8 +2501,7 @@ MagickExport MagickBooleanType SetImageAlphaChannel(Image *image,
           /*
             Reset all color channels to background color.
           */
-          GetPixelInfo(image,&background);
-          SetPixelInfoPacket(image,&(image->background_color),&background);
+          background=image->background_color;
           (void) LevelImageColors(image,&background,&background,MagickTrue,
             exception);
         }
@@ -2603,8 +2597,7 @@ MagickExport MagickBooleanType SetImageBackgroundColor(Image *image,
     return(MagickFalse);
   if (image->background_color.alpha != OpaqueAlpha)
     image->matte=MagickTrue;
-  GetPixelInfo(image,&background);
-  SetPixelInfoPacket(image,&image->background_color,&background);
+  background=image->background_color;
   SetPacketPixelInfo(image,&background,&pixel);
   /*
     Set image background color.
index 5d13857cb5d53851bcfe1dc723c4f7ae4af7274d..75f1a15190308a6f52bf6e74314d0508fbc4ed39 100644 (file)
@@ -138,7 +138,6 @@ MagickExport MagickBooleanType FloodfillPaintImage(Image *image,
     status;
 
   PixelInfo
-    fill,
     pixel;
 
   PixelInfo
@@ -202,7 +201,6 @@ MagickExport MagickBooleanType FloodfillPaintImage(Image *image,
   s=segment_stack;
   PushSegmentStack(y,x,x,1);
   PushSegmentStack(y+1,x,x,-1);
-  GetPixelInfo(image,&fill);
   GetPixelInfo(image,&pixel);
   image_view=AcquireCacheView(image);
   floodplane_view=AcquireCacheView(floodplane_image);
@@ -335,17 +333,16 @@ MagickExport MagickBooleanType FloodfillPaintImage(Image *image,
       if (GetPixelAlpha(floodplane_image,p) != OpaqueAlpha)
         {
           (void) GetFillColor(draw_info,x,y,&fill_color,exception);
-          SetPixelInfoPacket(image,&fill_color,&fill);
           if ((GetPixelRedTraits(image) & UpdatePixelTrait) != 0)
-            SetPixelRed(image,ClampToQuantum(fill.red),q);
+            SetPixelRed(image,ClampToQuantum(fill_color.red),q);
           if ((GetPixelGreenTraits(image) & UpdatePixelTrait) != 0)
-            SetPixelGreen(image,ClampToQuantum(fill.green),q);
+            SetPixelGreen(image,ClampToQuantum(fill_color.green),q);
           if ((GetPixelBlueTraits(image) & UpdatePixelTrait) != 0)
-            SetPixelBlue(image,ClampToQuantum(fill.blue),q);
+            SetPixelBlue(image,ClampToQuantum(fill_color.blue),q);
           if ((GetPixelBlackTraits(image) & UpdatePixelTrait) != 0)
-            SetPixelBlack(image,ClampToQuantum(fill.black),q);
+            SetPixelBlack(image,ClampToQuantum(fill_color.black),q);
           if ((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0)
-            SetPixelAlpha(image,ClampToQuantum(fill.alpha),q);
+            SetPixelAlpha(image,ClampToQuantum(fill_color.alpha),q);
         }
       p+=GetPixelChannels(floodplane_image);
       q+=GetPixelChannels(image);
@@ -456,9 +453,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);
-  SetPixelInfoPacket(image,start_color,&gradient->stops[0].color);
+  gradient->stops[0].color=(*start_color);
   gradient->stops[0].offset=0.0;
-  SetPixelInfoPacket(image,stop_color,&gradient->stops[1].color);
+  gradient->stops[1].color=(*stop_color);
   gradient->stops[1].offset=1.0;
   /*
     Draw a gradient on the image.
index a6df124533348565cd56e0de903cbe9497686c51..2897a109dc8261a3f45144645a5fb61f04b6c20f 100644 (file)
@@ -31,8 +31,8 @@ extern MagickExport Image
 extern MagickExport MagickBooleanType
   FloodfillPaintImage(Image *,const DrawInfo *,const PixelInfo *,const ssize_t,
     const ssize_t,const MagickBooleanType,ExceptionInfo *),
-  GradientImage(Image *,const GradientType,const SpreadMethod,
-    const PixelInfo *,const PixelInfo *,ExceptionInfo *),
+  GradientImage(Image *,const GradientType,const SpreadMethod,const PixelInfo *,
+    const PixelInfo *,ExceptionInfo *),
   OpaquePaintImage(Image *,const PixelInfo *,const PixelInfo *,
     const MagickBooleanType,ExceptionInfo *),
   TransparentPaintImage(Image *,const PixelInfo *,
index c480fd69f40fb837dedbc742782213b3f58b1e54..8720997264975459720228ff319835bacddaad76 100644 (file)
@@ -525,19 +525,6 @@ 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 384faee803bdcde0b0006c1c1e4e40c7a493800b..d0b0157896e77cf91212030a7b34763740f9b0d5 100644 (file)
@@ -1476,16 +1476,15 @@ static MagickBooleanType XShearImage(Image *image,const MagickRealType degrees,
   ssize_t
     y;
 
+  /*
+    X shear image.
+  */
   assert(image != (Image *) NULL);
   assert(image->signature == MagickSignature);
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
-  GetPixelInfo(image,&background);
-  SetPixelInfoPacket(image,&image->background_color,&background);
-  /*
-    X shear image.
-  */
   status=MagickTrue;
+  background=image->background_color;
   progress=0;
   image_view=AcquireCacheView(image);
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
@@ -1692,17 +1691,16 @@ static MagickBooleanType YShearImage(Image *image,const MagickRealType degrees,
   ssize_t
     x;
 
+  /*
+    Y Shear image.
+  */
   assert(image != (Image *) NULL);
   assert(image->signature == MagickSignature);
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
-  GetPixelInfo(image,&background);
-  SetPixelInfoPacket(image,&image->background_color,&background);
-  /*
-    Y Shear image.
-  */
   status=MagickTrue;
   progress=0;
+  background=image->background_color;
   image_view=AcquireCacheView(image);
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
   #pragma omp parallel for schedule(dynamic,4) shared(progress, status)
index 5aa037b62064611b0d2a06d190a6f19a8904afe5..89102c5b5d30b930ffdd89129de23be4ff5ef43b 100644 (file)
@@ -2466,7 +2466,7 @@ WandExport char *DrawGetVectorGraphics(DrawingWand *wand)
       if (CurrentContext->fill.alpha != OpaqueAlpha)
         pixel.matte=CurrentContext->fill.alpha != OpaqueAlpha ?
           MagickTrue : MagickFalse;
-      SetPixelInfoPacket(wand->image,&CurrentContext->fill,&pixel);
+      pixel=CurrentContext->fill;
       GetColorTuple(&pixel,MagickTrue,value);
       (void) SetXMLTreeContent(child,value);
     }
@@ -2532,7 +2532,7 @@ WandExport char *DrawGetVectorGraphics(DrawingWand *wand)
       if (CurrentContext->stroke.alpha != OpaqueAlpha)
         pixel.matte=CurrentContext->stroke.alpha != OpaqueAlpha ?
           MagickTrue : MagickFalse;
-      SetPixelInfoPacket(wand->image,&CurrentContext->stroke,&pixel);
+      pixel=CurrentContext->stroke;
       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;
-      SetPixelInfoPacket(wand->image,&CurrentContext->undercolor,&pixel);
+      pixel=CurrentContext->undercolor;
       GetColorTuple(&pixel,MagickTrue,value);
       (void) SetXMLTreeContent(child,value);
     }
index b73476e323b6d58a5b294e3fd5bd3d07a8e4c354..c70f7be8aeac691e1631d27ac76803f531ca24e5 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);
-  SetPixelInfoPacket(*image,&(*image)->background_color,&fill);
+  fill=(*image)->background_color;
   attenuate=1.0;
   compose=(*image)->compose;
   interpolate_method=UndefinedInterpolatePixel;
index b63e4a3bcece01140ab13e5ae11ed0ce4295b16a..1db89b78f6cde68991bcdb8e781f45194b096e77 100644 (file)
@@ -1588,7 +1588,7 @@ MagickExport MagickBooleanType ApplyImageOperator(MagickWand *wand,
   quantize_info=AcquireQuantizeInfo(image_info);
   SetGeometryInfo(&geometry_info);
   GetPixelInfo(*image,&fill);
-  SetPixelInfoPacket(*image,&(*image)->background_color,&fill);
+  fill=(*image)->background_color;
   channel=image_info->channel;
   format=GetImageOption(image_info,"format");
 
index fd1fa99b60952fb98579198f41bf83097371f12e..8baf5412e6b3cd2a34aba5b0f1680dc4c190522b 100644 (file)
@@ -513,8 +513,7 @@ static Image *ReadPALMImage(const ImageInfo *image_info,
     if (flags & PALM_HAS_TRANSPARENCY_FLAG)
       {
         if (bits_per_pixel != 16)
-          SetPixelInfoPacket(image,image->colormap+(mask-transparentIndex),
-            &transpix);
+          transpix=image->colormap[mask-transparentIndex];
         (void) TransparentPaintImage(image,&transpix,(Quantum) TransparentAlpha,
           MagickFalse,exception);
       }
index 3dc11fcb3c329cf05db5197a0676db9f549c4412..4bed55e5671effa54334e7c96039018b2b7308cb 100644 (file)
@@ -174,12 +174,12 @@ static MagickBooleanType WriteUILImage(const ImageInfo *image_info,Image *image,
     status,
     transparent;
 
-  PixelInfo
-    pixel;
-
   MagickSizeType
     number_pixels;
 
+  PixelInfo
+    pixel;
+
   register const Quantum
     *p;
 
@@ -303,7 +303,7 @@ static MagickBooleanType WriteUILImage(const ImageInfo *image_info,Image *image,
     /*
       Define UIL color.
     */
-    SetPixelInfoPacket(image,image->colormap+i,&pixel);
+    pixel=image->colormap[i];
     pixel.colorspace=RGBColorspace;
     pixel.depth=8;
     pixel.alpha=(MagickRealType) OpaqueAlpha;
index 4ac87217c7fb466ce341d2910a451e81974a30ff..dc579abd2045622805bc74c04a871890216fd25e 100644 (file)
@@ -737,7 +737,7 @@ static MagickBooleanType WritePICONImage(const ImageInfo *image_info,
     /*
       Define XPM color.
     */
-    SetPixelInfoPacket(image,picon->colormap+i,&pixel);
+    pixel=picon->colormap[i];
     pixel.colorspace=RGBColorspace;
     pixel.depth=8;
     pixel.alpha=(MagickRealType) OpaqueAlpha;
@@ -973,7 +973,7 @@ static MagickBooleanType WriteXPMImage(const ImageInfo *image_info,Image *image,
     /*
       Define XPM color.
     */
-    SetPixelInfoPacket(image,image->colormap+i,&pixel);
+    pixel=image->colormap[i];
     pixel.colorspace=RGBColorspace;
     pixel.depth=8;
     pixel.alpha=(MagickRealType) OpaqueAlpha;