]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sun, 28 Nov 2010 01:57:36 +0000 (01:57 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sun, 28 Nov 2010 01:57:36 +0000 (01:57 +0000)
ChangeLog
ImageMagick.spec
config/configure.xml
libtool
magick/option.c
magick/statistic.c
magick/statistic.h
magick/version.h
version.sh

index 142be849c6fcc9a260c8902f3d4435202a2ab9b7..d7509d35ff7528697575d7a43a01361516c8f5e5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2010-11-27  6.6.6-0 Cristy  <quetzlzacatenango@image...>
+  * Add support for -evaluate-sequence median.
+
 2010-11-26  6.6.6-0 Glenn Randers-Pehrson <glennrp@image...>
   * Fixed two more cases where the PNG encoder lost transparency (reference
 http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=17516).
index 1d8116d977a79ae709da0267d4d3f1bc66dc036b..8bfc9c9f1f917afb3b73d5186329767711fbd0f3 100644 (file)
@@ -1,5 +1,5 @@
 %global VERSION  6.6.6
-%global Patchlevel  1
+%global Patchlevel  0
 
 Name:           ImageMagick
 Version:        %{VERSION}
index 31ffb0135708e082a56743d73c2a865d39077636..8ab6278064ad3120347aefcf845d2953d0072aca 100644 (file)
@@ -8,7 +8,7 @@
 <configuremap>
   <configure name="NAME" value="ImageMagick"/>
   <configure name="LIB_VERSION" value="0x666"/>
-  <configure name="LIB_VERSION_NUMBER" value="6,6,6,1"/>
+  <configure name="LIB_VERSION_NUMBER" value="6,6,6,0"/>
   <configure name="RELEASE_DATE" value="2010-11-27"/>
   <configure name="CONFIGURE" value="./configure "/>
   <configure name="PREFIX" value="/usr/local"/>
diff --git a/libtool b/libtool
index 242009877a0fd3e5361903118f8a51fa53bcf3d2..05ea275a9d9e272f98b2f99e4d00fc2c421db36d 100755 (executable)
--- a/libtool
+++ b/libtool
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 # libtool - Provide generalized library-building support services.
-# Generated automatically by config.status (ImageMagick) 6.6.6-1
+# Generated automatically by config.status (ImageMagick) 6.6.6-0
 # Libtool was configured on host magick.imagemagick.org:
 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
 #
index 62f30d37c2cc6023a8a0f7247341649d8c0e7bda..f70c15bc1dcb0ab25311e0a4f924f9b8fcbbc0a2 100644 (file)
@@ -912,6 +912,7 @@ static const OptionInfo
     { "Log", (ssize_t) LogEvaluateOperator, MagickFalse },
     { "Max", (ssize_t) MaxEvaluateOperator, MagickFalse },
     { "Mean", (ssize_t) MeanEvaluateOperator, MagickFalse },
+    { "Median", (ssize_t) MedianEvaluateOperator, MagickFalse },
     { "Min", (ssize_t) MinEvaluateOperator, MagickFalse },
     { "MultiplicativeNoise", (ssize_t) MultiplicativeNoiseEvaluateOperator, MagickFalse },
     { "Multiply", (ssize_t) MultiplyEvaluateOperator, MagickFalse },
index f2655e8f4f9ab0846f81fc1ce59b32a6c3ac4e30..d0bd6b37683c95c58bc24e4bd1c8a166085c7572 100644 (file)
@@ -145,7 +145,8 @@ static MagickPixelPacket **DestroyPixelThreadSet(MagickPixelPacket **pixels)
   return(pixels);
 }
 
-static MagickPixelPacket **AcquirePixelThreadSet(const Image *image)
+static MagickPixelPacket **AcquirePixelThreadSet(const Image *image,
+  const size_t number_images)
 {
   register ssize_t
     i,
@@ -155,6 +156,7 @@ static MagickPixelPacket **AcquirePixelThreadSet(const Image *image)
     **pixels;
 
   size_t
+    length,
     number_threads;
 
   number_threads=GetOpenMPMaximumThreads();
@@ -165,11 +167,14 @@ static MagickPixelPacket **AcquirePixelThreadSet(const Image *image)
   (void) ResetMagickMemory(pixels,0,number_threads*sizeof(*pixels));
   for (i=0; i < (ssize_t) number_threads; i++)
   {
-    pixels[i]=(MagickPixelPacket *) AcquireQuantumMemory(image->columns,
+    length=image->columns;
+    if (length < number_images)
+      length=number_images;
+    pixels[i]=(MagickPixelPacket *) AcquireQuantumMemory(length,
       sizeof(**pixels));
     if (pixels[i] == (MagickPixelPacket *) NULL)
       return(DestroyPixelThreadSet(pixels));
-    for (j=0; j < (ssize_t) image->columns; j++)
+    for (j=0; j < (ssize_t) length; j++)
       GetMagickPixelPacket(image,&pixels[i][j]);
   }
   return(pixels);
@@ -182,6 +187,30 @@ static inline double MagickMax(const double x,const double y)
   return(y);
 }
 
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
+static int IntensityCompare(const void *x,const void *y)
+{
+  const MagickPixelPacket
+    *color_1,
+    *color_2;
+
+  int
+    intensity;
+
+  color_1=(const MagickPixelPacket *) x;
+  color_2=(const MagickPixelPacket *) y;
+  intensity=(int) MagickPixelIntensity(color_2)-
+    (int) MagickPixelIntensity(color_1);
+  return(intensity);
+}
+
+#if defined(__cplusplus) || defined(c_plusplus)
+}
+#endif
+
 static inline double MagickMin(const double x,const double y)
 {
   if (x < y)
@@ -283,6 +312,11 @@ static MagickRealType ApplyEvaluateOperator(RandomInfo *random_info,
       result=(MagickRealType) (pixel+value);
       break;
     }
+    case MedianEvaluateOperator:
+    {
+      result=(MagickRealType) (pixel+value);
+      break;
+    }
     case MinEvaluateOperator:
     {
       result=(MagickRealType) MagickMin((double) pixel,value);
@@ -441,7 +475,8 @@ MagickExport Image *EvaluateImages(const Image *images,
       evaluate_image=DestroyImage(evaluate_image);
       return((Image *) NULL);
     }
-  evaluate_pixels=AcquirePixelThreadSet(images);
+  number_images=GetImageListLength(images);
+  evaluate_pixels=AcquirePixelThreadSet(images,number_images);
   if (evaluate_pixels == (MagickPixelPacket **) NULL)
     {
       evaluate_image=DestroyImage(evaluate_image);
@@ -456,127 +491,236 @@ MagickExport Image *EvaluateImages(const Image *images,
   progress=0;
   GetMagickPixelPacket(images,&zero);
   random_info=AcquireRandomInfoThreadSet();
-  number_images=GetImageListLength(images);
   evaluate_view=AcquireCacheView(evaluate_image);
+  if (op == MedianEvaluateOperator)
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
   #pragma omp parallel for schedule(dynamic) shared(progress,status)
 #endif
-  for (y=0; y < (ssize_t) evaluate_image->rows; y++)
-  {
-    CacheView
-      *image_view;
+    for (y=0; y < (ssize_t) evaluate_image->rows; y++)
+    {
+      CacheView
+        *image_view;
 
-    const Image
-      *next;
+      const Image
+        *next;
 
-    const int
-      id = GetOpenMPThreadId();
+      const int
+        id = GetOpenMPThreadId();
 
-    MagickPixelPacket
-      pixel;
+      MagickPixelPacket
+        pixel;
 
-    register IndexPacket
-      *restrict evaluate_indexes;
+      register IndexPacket
+        *restrict evaluate_indexes;
 
-    register ssize_t
-      i,
-      x;
+      register MagickPixelPacket
+        *evaluate_pixel;
 
-    register MagickPixelPacket
-      *evaluate_pixel;
+      register PixelPacket
+        *restrict q;
 
-    register PixelPacket
-      *restrict q;
+      register ssize_t
+        x;
 
-    if (status == MagickFalse)
-      continue;
-    q=QueueCacheViewAuthenticPixels(evaluate_view,0,y,evaluate_image->columns,1,
-      exception);
-    if (q == (PixelPacket *) NULL)
-      {
-        status=MagickFalse;
+      if (status == MagickFalse)
         continue;
-      }
-    evaluate_indexes=GetCacheViewAuthenticIndexQueue(evaluate_view);
-    pixel=zero;
-    evaluate_pixel=evaluate_pixels[id];
-    for (x=0; x < (ssize_t) evaluate_image->columns; x++)
-      evaluate_pixel[x]=zero;
-    next=images;
-    for (i=0; i < (ssize_t) number_images; i++)
-    {
-      register const IndexPacket
-        *indexes;
-
-      register const PixelPacket
-        *p;
+      q=QueueCacheViewAuthenticPixels(evaluate_view,0,y,evaluate_image->columns,
+        1,exception);
+      if (q == (PixelPacket *) NULL)
+        {
+          status=MagickFalse;
+          continue;
+        }
+      evaluate_indexes=GetCacheViewAuthenticIndexQueue(evaluate_view);
+      pixel=zero;
+      evaluate_pixel=evaluate_pixels[id];
+      for (x=0; x < (ssize_t) evaluate_image->columns; x++)
+      {
+        register ssize_t
+          i;
 
-      image_view=AcquireCacheView(next);
-      p=GetCacheViewVirtualPixels(image_view,0,y,next->columns,1,exception);
-      if (p == (const PixelPacket *) NULL)
+        for (i=0; i < (ssize_t) number_images; i++)
+          evaluate_pixel[i]=zero;
+        next=images;
+        for (i=0; i < (ssize_t) number_images; i++)
         {
+          register const IndexPacket
+            *indexes;
+
+          register const PixelPacket
+            *p;
+
+          image_view=AcquireCacheView(next);
+          p=GetCacheViewVirtualPixels(image_view,x,y,1,1,exception);
+          if (p == (const PixelPacket *) NULL)
+            {
+              image_view=DestroyCacheView(image_view);
+              break;
+            }
+          indexes=GetCacheViewVirtualIndexQueue(image_view);
+          evaluate_pixel[i].red=ApplyEvaluateOperator(random_info[id],
+            p->red,op,evaluate_pixel[i].red);
+          evaluate_pixel[i].green=ApplyEvaluateOperator(random_info[id],
+            p->green,op,evaluate_pixel[i].green);
+          evaluate_pixel[i].blue=ApplyEvaluateOperator(random_info[id],
+            p->blue,op,evaluate_pixel[i].blue);
+          evaluate_pixel[i].opacity=ApplyEvaluateOperator(random_info[id],
+            p->opacity,op,evaluate_pixel[i].opacity);
+          if (evaluate_image->colorspace == CMYKColorspace)
+            evaluate_pixel[i].index=ApplyEvaluateOperator(random_info[id],
+              *indexes,op,evaluate_pixel[i].index);
           image_view=DestroyCacheView(image_view);
-          break;
+          next=GetNextImageInList(next);
         }
-      indexes=GetCacheViewVirtualIndexQueue(image_view);
-      for (x=0; x < (ssize_t) next->columns; x++)
-      {
-        evaluate_pixel[x].red=ApplyEvaluateOperator(random_info[id],p->red,
-          i == 0 ? AddEvaluateOperator : op,evaluate_pixel[x].red);
-        evaluate_pixel[x].green=ApplyEvaluateOperator(random_info[id],p->green,
-          i == 0 ? AddEvaluateOperator : op,evaluate_pixel[x].green);
-        evaluate_pixel[x].blue=ApplyEvaluateOperator(random_info[id],p->blue,
-          i == 0 ? AddEvaluateOperator : op,evaluate_pixel[x].blue);
-        evaluate_pixel[x].opacity=ApplyEvaluateOperator(random_info[id],
-          p->opacity,i == 0 ? AddEvaluateOperator : op,
-          evaluate_pixel[x].opacity);
+        qsort((void *) evaluate_pixel,number_images,sizeof(*evaluate_pixel),
+          IntensityCompare);
+        q->red=ClampToQuantum(evaluate_pixel[i/2].red);
+        q->green=ClampToQuantum(evaluate_pixel[i/2].green);
+        q->blue=ClampToQuantum(evaluate_pixel[i/2].blue);
+        if (evaluate_image->matte == MagickFalse)
+          q->opacity=ClampToQuantum(evaluate_pixel[i/2].opacity);
+        else
+          q->opacity=ClampToQuantum(QuantumRange-evaluate_pixel[i/2].opacity);
         if (evaluate_image->colorspace == CMYKColorspace)
-          evaluate_pixel[x].index=ApplyEvaluateOperator(random_info[id],
-            indexes[x],i == 0 ? AddEvaluateOperator : op,
-            evaluate_pixel[x].index);
-        p++;
+          evaluate_indexes[i]=ClampToQuantum(evaluate_pixel[i/2].index);
+        q++;
       }
-      image_view=DestroyCacheView(image_view);
-      next=GetNextImageInList(next);
+      if (SyncCacheViewAuthenticPixels(evaluate_view,exception) == MagickFalse)
+        status=MagickFalse;
+      if (images->progress_monitor != (MagickProgressMonitor) NULL)
+        {
+          MagickBooleanType
+            proceed;
+
+#if defined(MAGICKCORE_OPENMP_SUPPORT)
+          #pragma omp critical (MagickCore_EvaluateImages)
+#endif
+          proceed=SetImageProgress(images,EvaluateImageTag,progress++,
+            evaluate_image->rows);
+          if (proceed == MagickFalse)
+            status=MagickFalse;
+        }
     }
-    if (op == MeanEvaluateOperator)
+  else
+#if defined(MAGICKCORE_OPENMP_SUPPORT)
+  #pragma omp parallel for schedule(dynamic) shared(progress,status)
+#endif
+    for (y=0; y < (ssize_t) evaluate_image->rows; y++)
+    {
+      CacheView
+        *image_view;
+
+      const Image
+        *next;
+
+      const int
+        id = GetOpenMPThreadId();
+
+      MagickPixelPacket
+        pixel;
+
+      register IndexPacket
+        *restrict evaluate_indexes;
+
+      register ssize_t
+        i,
+        x;
+
+      register MagickPixelPacket
+        *evaluate_pixel;
+
+      register PixelPacket
+        *restrict q;
+
+      if (status == MagickFalse)
+        continue;
+      q=QueueCacheViewAuthenticPixels(evaluate_view,0,y,evaluate_image->columns,
+        1,exception);
+      if (q == (PixelPacket *) NULL)
+        {
+          status=MagickFalse;
+          continue;
+        }
+      evaluate_indexes=GetCacheViewAuthenticIndexQueue(evaluate_view);
+      pixel=zero;
+      evaluate_pixel=evaluate_pixels[id];
       for (x=0; x < (ssize_t) evaluate_image->columns; x++)
+        evaluate_pixel[x]=zero;
+      next=images;
+      for (i=0; i < (ssize_t) number_images; i++)
       {
-        evaluate_pixel[x].red/=number_images;
-        evaluate_pixel[x].green/=number_images;
-        evaluate_pixel[x].blue/=number_images;
-        evaluate_pixel[x].opacity/=number_images;
-        evaluate_pixel[x].index/=number_images;
+        register const IndexPacket
+          *indexes;
+
+        register const PixelPacket
+          *p;
+
+        image_view=AcquireCacheView(next);
+        p=GetCacheViewVirtualPixels(image_view,0,y,next->columns,1,exception);
+        if (p == (const PixelPacket *) NULL)
+          {
+            image_view=DestroyCacheView(image_view);
+            break;
+          }
+        indexes=GetCacheViewVirtualIndexQueue(image_view);
+        for (x=0; x < (ssize_t) next->columns; x++)
+        {
+          evaluate_pixel[x].red=ApplyEvaluateOperator(random_info[id],
+            p->red,i == 0 ? AddEvaluateOperator : op,evaluate_pixel[x].red);
+          evaluate_pixel[x].green=ApplyEvaluateOperator(random_info[id],
+            p->green,i == 0 ? AddEvaluateOperator : op,evaluate_pixel[x].green);
+          evaluate_pixel[x].blue=ApplyEvaluateOperator(random_info[id],
+            p->blue,i == 0 ? AddEvaluateOperator : op,evaluate_pixel[x].blue);
+          evaluate_pixel[x].opacity=ApplyEvaluateOperator(random_info[id],
+            p->opacity,i == 0 ? AddEvaluateOperator : op,
+            evaluate_pixel[x].opacity);
+          if (evaluate_image->colorspace == CMYKColorspace)
+            evaluate_pixel[x].index=ApplyEvaluateOperator(random_info[id],
+              indexes[x],i == 0 ? AddEvaluateOperator : op,
+              evaluate_pixel[x].index);
+          p++;
+        }
+        image_view=DestroyCacheView(image_view);
+        next=GetNextImageInList(next);
       }
-    for (x=0; x < (ssize_t) evaluate_image->columns; x++)
-    {
-      q->red=ClampToQuantum(evaluate_pixel[x].red);
-      q->green=ClampToQuantum(evaluate_pixel[x].green);
-      q->blue=ClampToQuantum(evaluate_pixel[x].blue);
-      if (evaluate_image->matte == MagickFalse)
-        q->opacity=ClampToQuantum(evaluate_pixel[x].opacity);
-      else
-        q->opacity=ClampToQuantum(QuantumRange-evaluate_pixel[x].opacity);
-      if (evaluate_image->colorspace == CMYKColorspace)
-        evaluate_indexes[x]=ClampToQuantum(evaluate_pixel[x].index);
-      q++;
-    }
-    if (SyncCacheViewAuthenticPixels(evaluate_view,exception) == MagickFalse)
-      status=MagickFalse;
-    if (images->progress_monitor != (MagickProgressMonitor) NULL)
+      if (op == MeanEvaluateOperator)
+        for (x=0; x < (ssize_t) evaluate_image->columns; x++)
+        {
+          evaluate_pixel[x].red/=number_images;
+          evaluate_pixel[x].green/=number_images;
+          evaluate_pixel[x].blue/=number_images;
+          evaluate_pixel[x].opacity/=number_images;
+          evaluate_pixel[x].index/=number_images;
+        }
+      for (x=0; x < (ssize_t) evaluate_image->columns; x++)
       {
-        MagickBooleanType
-          proceed;
+        q->red=ClampToQuantum(evaluate_pixel[x].red);
+        q->green=ClampToQuantum(evaluate_pixel[x].green);
+        q->blue=ClampToQuantum(evaluate_pixel[x].blue);
+        if (evaluate_image->matte == MagickFalse)
+          q->opacity=ClampToQuantum(evaluate_pixel[x].opacity);
+        else
+          q->opacity=ClampToQuantum(QuantumRange-evaluate_pixel[x].opacity);
+        if (evaluate_image->colorspace == CMYKColorspace)
+          evaluate_indexes[x]=ClampToQuantum(evaluate_pixel[x].index);
+        q++;
+      }
+      if (SyncCacheViewAuthenticPixels(evaluate_view,exception) == MagickFalse)
+        status=MagickFalse;
+      if (images->progress_monitor != (MagickProgressMonitor) NULL)
+        {
+          MagickBooleanType
+            proceed;
 
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
-        #pragma omp critical (MagickCore_EvaluateImages)
+          #pragma omp critical (MagickCore_EvaluateImages)
 #endif
-        proceed=SetImageProgress(images,EvaluateImageTag,progress++,
-          evaluate_image->rows);
-        if (proceed == MagickFalse)
-          status=MagickFalse;
-      }
-  }
+          proceed=SetImageProgress(images,EvaluateImageTag,progress++,
+            evaluate_image->rows);
+          if (proceed == MagickFalse)
+            status=MagickFalse;
+        }
+    }
   evaluate_view=DestroyCacheView(evaluate_view);
   evaluate_pixels=DestroyPixelThreadSet(evaluate_pixels);
   random_info=DestroyRandomInfoThreadSet(random_info);
index e16807440ab6254a25fc77d055547a48654d6909..880864a52143708eafa444b078a56b55157aaefc 100644 (file)
@@ -72,7 +72,8 @@ typedef enum
   AddModulusEvaluateOperator,
   MeanEvaluateOperator,
   AbsEvaluateOperator,
-  ExponentialEvaluateOperator
+  ExponentialEvaluateOperator,
+  MedianEvaluateOperator
 } MagickEvaluateOperator;
 
 typedef enum
index 66263aa121012cd86239c9c20f092c00f14f56d6..a4f87816674bb7a654031bea040e4f1aebf2770f 100644 (file)
@@ -30,11 +30,11 @@ extern "C" {
 #define MagickLibVersion  0x666
 #define MagickLibVersionText  "6.6.6"
 #define MagickLibVersionNumber  4,0,0
-#define MagickLibAddendum  "-1"
+#define MagickLibAddendum  "-0"
 #define MagickLibInterface  4
 #define MagickLibMinInterface  4
 #define MagickReleaseDate  "2010-11-27"
-#define MagickChangeDate   "20101126"
+#define MagickChangeDate   "20101127"
 #define MagickAuthoritativeURL  "http://www.imagemagick.org"
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
 #define MagickOpenMPFeature  "OpenMP "
index 58a1405e33785f8800c49436308be1b7b20915c6..eebc4193c860b59164dd54065b3a399fbf3a25bb 100644 (file)
@@ -12,7 +12,7 @@ PACKAGE_NAME='ImageMagick'
 # PACKAGE_NAME (e.g. "1.0.0").
 PACKAGE_VERSION='6.6.6'
 PACKAGE_LIB_VERSION="0x666"
-PACKAGE_RELEASE="1"
+PACKAGE_RELEASE="0"
 PACKAGE_LIB_VERSION_NUMBER="6,6,6,${PACKAGE_RELEASE}"
 PACKAGE_RELEASE_DATE=`date +%F`
 PACKAGE_STRING="$PACKAGE_NAME $PACKAGE_VERSION"