]> granicus.if.org Git - imagemagick/commitdiff
http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=28043
authorCristy <urban-warrior@imagemagick.org>
Sun, 9 Aug 2015 16:15:50 +0000 (12:15 -0400)
committerCristy <urban-warrior@imagemagick.org>
Sun, 9 Aug 2015 16:15:50 +0000 (12:15 -0400)
Magick++/lib/Image.cpp
MagickCore/effect.c
MagickCore/effect.h
MagickWand/magick-image.c
MagickWand/magick-image.h
MagickWand/mogrify.c
MagickWand/operation.c
PerlMagick/Magick.xs
PerlMagick/quantum/quantum.xs.in
coders/msl.c
config/configure.xml [new file with mode: 0644]

index 60098bdb486df95873f831bb6a820865043016aa..4c68be710d1240d9642430f7d9de7d10dcc543ae 100644 (file)
@@ -4415,8 +4415,7 @@ void Magick::Image::spread(const size_t amount_)
     *newImage;
 
   GetPPException;
-  newImage=SpreadImage(constImage(),amount_,image()->interpolate,
-    exceptionInfo);
+  newImage=SpreadImage(constImage(),amount_,exceptionInfo);
   replaceImage(newImage);
   ThrowImageException;
 }
index 5b374d9eb95528190d12b4181023b88a453598f4..dcd7a16f53f979047296be0b13e048461d47d252 100644 (file)
@@ -2250,9 +2250,9 @@ MagickExport Image *PreviewImage(const Image *image,const PreviewType preview,
       }
       case SpreadPreview:
       {
-        preview_image=SpreadImage(thumbnail,radius,thumbnail->interpolate,
-          exception);
-        (void) FormatLocaleString(label,MagickPathExtent,"spread %g",radius+0.5);
+        preview_image=SpreadImage(thumbnail,radius,exception);
+        (void) FormatLocaleString(label,MagickPathExtent,"spread %g",
+          radius+0.5);
         break;
       }
       case SolarizePreview:
@@ -3411,7 +3411,7 @@ MagickExport Image *SharpenImage(const Image *image,const double radius,
 %  The format of the SpreadImage method is:
 %
 %      Image *SpreadImage(const Image *image,const double radius,
-%        const PixelInterpolateMethod method,ExceptionInfo *exception)
+%        ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
 %
@@ -3419,13 +3419,22 @@ MagickExport Image *SharpenImage(const Image *image,const double radius,
 %
 %    o radius:  choose a random pixel in a neighborhood of this extent.
 %
-%    o method:  the pixel interpolation method.
-%
 %    o exception: return any errors or warnings in this structure.
 %
 */
+
+static void inline SwapPixelComponent(Quantum *p,Quantum *q)
+{
+  Quantum
+    pixel;
+
+  pixel=(*p);
+  (*p)=(*q);
+  (*q)=pixel;
+}
+
 MagickExport Image *SpreadImage(const Image *image,const double radius,
-  const PixelInterpolateMethod method,ExceptionInfo *exception)
+  ExceptionInfo *exception)
 {
 #define SpreadImageTag  "Spread/Image"
 
@@ -3443,7 +3452,7 @@ MagickExport Image *SpreadImage(const Image *image,const double radius,
     progress;
 
   RandomInfo
-    **restrict random_info;
+    *restrict random_info;
 
   size_t
     width;
@@ -3451,11 +3460,6 @@ MagickExport Image *SpreadImage(const Image *image,const double radius,
   ssize_t
     y;
 
-#if defined(MAGICKCORE_OPENMP_SUPPORT)
-  unsigned long
-    key;
-#endif
-
   /*
     Initialize spread image attributes.
   */
@@ -3465,72 +3469,65 @@ MagickExport Image *SpreadImage(const Image *image,const double radius,
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
   assert(exception != (ExceptionInfo *) NULL);
   assert(exception->signature == MagickCoreSignature);
-  spread_image=CloneImage(image,image->columns,image->rows,MagickTrue,
-    exception);
+  spread_image=CloneImage(image,0,0,MagickTrue,exception);
   if (spread_image == (Image *) NULL)
     return((Image *) NULL);
-  if (SetImageStorageClass(spread_image,DirectClass,exception) == MagickFalse)
-    {
-      spread_image=DestroyImage(spread_image);
-      return((Image *) NULL);
-    }
   /*
     Spread image.
   */
   status=MagickTrue;
   progress=0;
   width=GetOptimalKernelWidth1D(radius,0.5);
-  random_info=AcquireRandomInfoThreadSet();
-  image_view=AcquireVirtualCacheView(image,exception);
+  random_info=AcquireRandomInfo();
+  image_view=AcquireAuthenticCacheView(spread_image,exception);
   spread_view=AcquireAuthenticCacheView(spread_image,exception);
-#if defined(MAGICKCORE_OPENMP_SUPPORT)
-  key=GetRandomSecretKey(random_info[0]);
-  #pragma omp parallel for schedule(static,4) shared(progress,status) \
-    magick_threads(image,spread_image,image->rows,key == ~0UL)
-#endif
   for (y=0; y < (ssize_t) image->rows; y++)
   {
-    const int
-      id = GetOpenMPThreadId();
-
-    register Quantum
-      *restrict q;
-
     register ssize_t
       x;
 
     if (status == MagickFalse)
       continue;
-    q=QueueCacheViewAuthenticPixels(spread_view,0,y,spread_image->columns,1,
-      exception);
-    if (q == (Quantum *) NULL)
-      {
-        status=MagickFalse;
-        continue;
-      }
     for (x=0; x < (ssize_t) image->columns; x++)
     {
-      PointInfo
-        point;
-
-      point.x=GetPseudoRandomValue(random_info[id]);
-      point.y=GetPseudoRandomValue(random_info[id]);
-      status=InterpolatePixelChannels(image,image_view,spread_image,
-        method == UndefinedInterpolatePixel ? NearestInterpolatePixel : method,
-        (double) x+width*(point.x-0.5),(double) y+width*(point.y-0.5),q,
-        exception);
-      q+=GetPixelChannels(spread_image);
+      register Quantum
+        *restrict p,
+        *restrict q;
+
+      register ssize_t
+        i;
+
+      ssize_t
+        x_offset,
+        y_offset;
+
+      for ( ; ; )
+      {
+        x_offset=(ssize_t) (x+width*GetPseudoRandomValue(random_info));
+        y_offset=(ssize_t) (y+width*GetPseudoRandomValue(random_info));
+        if ((x_offset >= 0) && (x_offset < image->columns) &&
+            (y_offset >= 0) && (y_offset < image->rows))
+          break;
+      }
+      p=GetCacheViewAuthenticPixels(image_view,x_offset,y_offset,1,1,exception);
+      q=GetCacheViewAuthenticPixels(spread_view,x,y,1,1,exception);
+      if ((p == (Quantum *) NULL) || (q == (Quantum *) NULL))
+        {
+          status=MagickFalse;
+          continue;
+        }
+      for (i=0; i < (ssize_t) GetPixelChannels(spread_image); i++)
+        SwapPixelComponent(p+i,q+i);
+      if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
+        status=MagickFalse;
+      if (SyncCacheViewAuthenticPixels(spread_view,exception) == MagickFalse)
+        status=MagickFalse;
     }
-    if (SyncCacheViewAuthenticPixels(spread_view,exception) == MagickFalse)
-      status=MagickFalse;
     if (image->progress_monitor != (MagickProgressMonitor) NULL)
       {
         MagickBooleanType
           proceed;
 
-#if defined(MAGICKCORE_OPENMP_SUPPORT)
-        #pragma omp critical (MagickCore_SpreadImage)
-#endif
         proceed=SetImageProgress(image,SpreadImageTag,progress++,image->rows);
         if (proceed == MagickFalse)
           status=MagickFalse;
@@ -3538,7 +3535,7 @@ MagickExport Image *SpreadImage(const Image *image,const double radius,
   }
   spread_view=DestroyCacheView(spread_view);
   image_view=DestroyCacheView(image_view);
-  random_info=DestroyRandomInfoThreadSet(random_info);
+  random_info=DestroyRandomInfo(random_info);
   if (status == MagickFalse)
     spread_image=DestroyImage(spread_image);
   return(spread_image);
index 8302a8f9ed592a7e2090de3f2c091ed036f13e64..2c35952475d83cff446d3195268534397da91bfc 100644 (file)
@@ -78,8 +78,7 @@ extern MagickExport Image
   *ShadeImage(const Image *,const MagickBooleanType,const double,const double,
     ExceptionInfo *),
   *SharpenImage(const Image *,const double,const double,ExceptionInfo *),
-  *SpreadImage(const Image *,const double,const PixelInterpolateMethod,
-    ExceptionInfo *),
+  *SpreadImage(const Image *,const double,ExceptionInfo *),
   *UnsharpMaskImage(const Image *,const double,const double,const double,
     const double,ExceptionInfo *);
 
index 522ac3b453abb20b96b7f4d87924dd91e26c5e94..cdc5bcaf67e17b53df9e9134207a8019225fe8a2 100644 (file)
@@ -11264,20 +11264,17 @@ WandExport MagickBooleanType MagickSpliceImage(MagickWand *wand,
 %
 %  The format of the MagickSpreadImage method is:
 %
-%      MagickBooleanType MagickSpreadImage(MagickWand *wand,const double radius,
-%        const PixelInterpolateMethod method)
-%
+%      MagickBooleanType MagickSpreadImage(MagickWand *wand,const double radius)
+%        
 %  A description of each parameter follows:
 %
 %    o wand: the magick wand.
 %
 %    o radius:  Choose a random pixel in a neighborhood of this extent.
 %
-%    o method: the pixel interpolation method.
-%
 */
 WandExport MagickBooleanType MagickSpreadImage(MagickWand *wand,
-  const double radius,const PixelInterpolateMethod method)
+  const double radius)
 {
   Image
     *spread_image;
@@ -11288,7 +11285,7 @@ WandExport MagickBooleanType MagickSpreadImage(MagickWand *wand,
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   if (wand->images == (Image *) NULL)
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
-  spread_image=SpreadImage(wand->images,radius,method,wand->exception);
+  spread_image=SpreadImage(wand->images,radius,wand->exception);
   if (spread_image == (Image *) NULL)
     return(MagickFalse);
   ReplaceImageInList(&wand->images,spread_image);
index fb886542c847dd3aa25982c01b8a713f77dd2edc..1f36650d033a0f4a52e40678f89d45de36efa0bb 100644 (file)
@@ -296,7 +296,7 @@ extern WandExport MagickBooleanType
     const double *),
   MagickSpliceImage(MagickWand *,const size_t,const size_t,const ssize_t,
     const ssize_t),
-  MagickSpreadImage(MagickWand *,const double,const PixelInterpolateMethod),
+  MagickSpreadImage(MagickWand *,const double),
   MagickStatisticImage(MagickWand *,const StatisticType,const size_t,
     const size_t),
   MagickStripImage(MagickWand *),
index 10f20135ddcb7cd0b8d813b8f5a9c2e10458cca2..212fea50b7f1beddd999737692844e3ce13ef61a 100644 (file)
@@ -2946,8 +2946,7 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc,
             */
             (void) SyncImageSettings(mogrify_info,*image,exception);
             (void) ParseGeometry(argv[i+1],&geometry_info);
-            mogrify_image=SpreadImage(*image,geometry_info.rho,
-              interpolate_method,exception);
+            mogrify_image=SpreadImage(*image,geometry_info.rho,exception);
             break;
           }
         if (LocaleCompare("statistic",option+1) == 0)
index e18705119d1572d347cf0414d74da22f79daf3b7..dbd4f9397b04f550e69c5cc7f0d120efe35c6758 100644 (file)
@@ -3320,8 +3320,7 @@ static MagickBooleanType CLISimpleOperatorImage(MagickCLI *cli_wand,
           flags=ParseGeometry(arg1,&geometry_info);
           if ((flags & RhoValue) == 0)
             CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg2);
-          new_image=SpreadImage(_image,geometry_info.rho,_image->interpolate,
-               _exception);
+          new_image=SpreadImage(_image,geometry_info.rho,_exception);
           break;
         }
       if (LocaleCompare("statistic",option+1) == 0)
index 428df7d0e043b55ea88cca3f4bd8d0c93bf08ec8..2af911a3e0191108ad50092cd7c3ad83dc0dc316 100644 (file)
@@ -260,8 +260,7 @@ static struct
     { "Shear", { {"geometry", StringReference}, {"x", RealReference},
       {"y", RealReference}, { "fill", StringReference},
       {"color", StringReference} } },
-    { "Spread", { {"radius", RealReference},
-      {"interpolate", MagickInterpolateOptions} } },
+    { "Spread", { {"radius", RealReference} } },
     { "Swirl", { {"degrees", RealReference},
       {"interpolate", MagickInterpolateOptions} } },
     { "Resize", { {"geometry", StringReference}, {"width", IntegerReference},
@@ -8281,16 +8280,9 @@ Mogrify(ref,...)
         }
         case 29:  /* Spread */
         {
-          PixelInterpolateMethod
-            method;
-
           if (attribute_flag[0] == 0)
             argument_list[0].real_reference=1.0;
-          method=UndefinedInterpolatePixel;
-          if (attribute_flag[1] != 0)
-            method=(PixelInterpolateMethod) argument_list[1].integer_reference;
-          image=SpreadImage(image,argument_list[0].real_reference,method,
-            exception);
+          image=SpreadImage(image,argument_list[0].real_reference,exception);
           break;
         }
         case 30:  /* Swirl */
index 418ac4fb7adc9f305282975cb71d7d6e3d341dc0..21f4ccd3878411ef251ffdd126b1522845de1b3c 100644 (file)
@@ -260,8 +260,7 @@ static struct
     { "Shear", { {"geometry", StringReference}, {"x", RealReference},
       {"y", RealReference}, { "fill", StringReference},
       {"color", StringReference} } },
-    { "Spread", { {"radius", RealReference},
-      {"interpolate", MagickInterpolateOptions} } },
+    { "Spread", { {"radius", RealReference} } },
     { "Swirl", { {"degrees", RealReference},
       {"interpolate", MagickInterpolateOptions} } },
     { "Resize", { {"geometry", StringReference}, {"width", IntegerReference},
@@ -8281,16 +8280,9 @@ Mogrify(ref,...)
         }
         case 29:  /* Spread */
         {
-          PixelInterpolateMethod
-            method;
-
           if (attribute_flag[0] == 0)
             argument_list[0].real_reference=1.0;
-          method=UndefinedInterpolatePixel;
-          if (attribute_flag[1] != 0)
-            method=(PixelInterpolateMethod) argument_list[1].integer_reference;
-          image=SpreadImage(image,argument_list[0].real_reference,method,
-            exception);
+          image=SpreadImage(image,argument_list[0].real_reference,exception);
           break;
         }
         case 30:  /* Swirl */
index 33abebde0bf28ae792ab455b8a7a7859f4626442..084f78007a0ff3efc7710fd6a735c25d7ffff352 100644 (file)
@@ -6755,7 +6755,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
               }
             }
           spread_image=SpreadImage(msl_info->image[n],geometry_info.rho,
-            msl_info->image[n]->interpolate,msl_info->exception);
+            msl_info->exception);
           if (spread_image == (Image *) NULL)
             break;
           msl_info->image[n]=DestroyImage(msl_info->image[n]);
diff --git a/config/configure.xml b/config/configure.xml
new file mode 100644 (file)
index 0000000..d3c28cc
--- /dev/null
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE configuremap [
+<!ELEMENT configuremap (configure)+>
+<!ELEMENT configure (#PCDATA)>
+<!ATTLIST configure name CDATA #REQUIRED>
+<!ATTLIST configure value CDATA #REQUIRED>
+]>
+<configuremap>
+  <configure name="CC" value="gcc"/>
+  <configure name="CFLAGS" value="-I/usr/include/libxml2  -I/usr/include/libpng16   -pthread -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libdrm -I/usr/include/libpng16  -pthread -I/usr/include/OpenEXR -I/usr/include/libdrm    -I/usr/include/freetype2 -I/usr/include/libpng16  -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16  -pthread     -fopenmp -g -O2 -Wall -mtune=sandybridge -fexceptions -pthread -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16"/>
+  <configure name="CODER_PATH" value="/usr/local/lib/ImageMagick-7.0.0/modules-Q16HDRI/coders"/>
+  <configure name="CONFIGURE_PATH" value="/usr/local/etc/ImageMagick-7/"/>
+  <configure name="CONFIGURE" value="./configure "/>
+  <configure name="COPYRIGHT" value="Copyright (C) 1999-2015 ImageMagick Studio LLC"/>
+  <configure name="CPPFLAGS" value="-I/usr/local/include/ImageMagick-7"/>
+  <configure name="CXXFLAGS" value="-g -O2 -pthread"/>
+  <configure name="CXX" value="g++"/>
+  <configure name="DEFS" value="-DHAVE_CONFIG_H"/>
+  <configure name="DELEGATES" value="bzlib djvu mpeg fftw fpx fontconfig freetype jbig jng jpeg lcms lzma openexr pango png ps tiff webp wmf x xml zlib"/>
+  <configure name="DISTCHECK_CONFIG_FLAGS" value=" --disable-deprecated  --with-quantum-depth=16  --with-jemalloc=no  --with-umem=no  --with-autotrace=no  --with-gslib=no  --with-fontpath=  --with-rsvg=no  --with-perl=no "/>
+  <configure name="DOCUMENTATION_PATH" value="/usr/local/share/doc/ImageMagick-7"/>
+  <configure name="EXEC-PREFIX" value="/usr/local"/>
+  <configure name="EXECUTABLE_PATH" value="/usr/local/bin"/>
+  <configure name="FEATURES" value="DPC HDRI Cipher OpenMP"/>
+  <configure name="FILTER_PATH" value="/usr/local/lib/ImageMagick-7.0.0/modules-Q16HDRI/filters"/>
+  <configure name="HOST" value="x86_64-unknown-linux-gnu"/>
+  <configure name="INCLUDE_PATH" value="/usr/local/include/ImageMagick-7"/>
+  <configure name="LDFLAGS" value="-L/usr/local/lib  "/>
+  <configure name="LIBRARY_PATH" value="/usr/local/lib/ImageMagick-7.0.0"/>
+  <configure name="LIBS" value=" -ljbig -llcms2  -ltiff -lfreetype  -ljpeg   -lpng16   -ldjvulibre  -lfftw3  -lfpx -lfontconfig -lfreetype  -lwebp -lwmflite  -lXext -lXt   -lSM -lICE -lX11  -llzma  -lbz2 -lIlmImf -lImath -lHalf -lIex -lIexMath -lIlmThread -pthread   -lpangocairo-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lcairo   -lxml2   -L/usr/lib64 -lz   -lm -lgomp    "/>
+  <configure name="LIB_VERSION_NUMBER" value="7,0,0,0"/>
+  <configure name="LIB_VERSION" value="0x700"/>
+  <configure name="NAME" value="ImageMagick"/>
+  <configure name="PCFLAGS" value="-fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16"/>
+  <configure name="PREFIX" value="/usr/local"/>
+  <configure name="QuantumDepth" value="16"/>
+  <configure name="RELEASE_DATE" value="2015-08-09"/>
+  <configure name="SHAREARCH_PATH" value="/usr/local/lib/ImageMagick-7.0.0/config-Q16HDRI"/>
+  <configure name="SHARE_PATH" value="/usr/local/share/ImageMagick-7"/>
+  <configure name="SVN_REVISION" value="Unversioned" />
+  <configure name="TARGET_CPU" value="x86_64"/>
+  <configure name="TARGET_OS" value="linux-gnu"/>
+  <configure name="TARGET_VENDOR" value="unknown"/>
+  <configure name="VERSION" value="7.0.0"/>
+  <configure name="WEBSITE" value="http://www.imagemagick.org"/>
+</configuremap>