]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Fri, 5 Mar 2010 16:39:11 +0000 (16:39 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Fri, 5 Mar 2010 16:39:11 +0000 (16:39 +0000)
12 files changed:
ChangeLog
ImageMagick.spec
PerlMagick/Magick.xs
config/configure.xml
libtool
magick/statistic.c
magick/statistic.h
magick/version.h
wand/convert.c
wand/magick-image.c
wand/magick-image.h
wand/mogrify.c

index aba08442d217ae340c182c8d4742ed06a7a0e1c7..b2e32ee43cdae202656d40d23d4ebbbde3b4109e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2010-03-05  6.6.0-2 Cristy  <quetzlzacatenango@image...>
+  * add support for the -mip option (maximum intensity projection).
+
 2010-02-27  6.6.0-1 Cristy  <quetzlzacatenango@image...>
   * Check to see if ICON image width /height exceeds that of the image canvas.
   * Set the DPX descriptor to Luma only if the image type is not TrueColor.
index 3c224b5f8324b430da7bd5d161371190390ff08d..7a2a7030686d4bcc84364656bdd2627febee5ca4 100644 (file)
@@ -1,5 +1,5 @@
 %define VERSION  6.6.0
-%define Patchlevel  2
+%define Patchlevel  3
 
 Name:           ImageMagick
 Version:        %{VERSION}
index dd032d62beff6fab94b44ffed5bdcc7586316581..e384d1b642994377bc34257e97123684af3a8365 100644 (file)
@@ -6752,6 +6752,101 @@ MagickToMime(ref,name)
 #                                                                             #
 #                                                                             #
 #                                                                             #
+#   M a x i m u m I n t e n s i t y P r o j e c t i o n                       #
+#                                                                             #
+#                                                                             #
+#                                                                             #
+###############################################################################
+#
+#
+void
+MaximumIntensityProjection(ref)
+  Image::Magick ref=NO_INIT
+  ALIAS:
+    MaximumIntensityProjectionImage   = 1
+    maximumintensityprojection        = 2
+    maximumintensityprojectionimage   = 3
+  PPCODE:
+  {
+    AV
+      *av;
+
+    char
+      *p;
+
+    ExceptionInfo
+      *exception;
+
+    HV
+      *hv;
+
+    Image
+      *image;
+
+    struct PackageInfo
+      *info;
+
+    SV
+      *perl_exception,
+      *reference,
+      *rv,
+      *sv;
+
+    exception=AcquireExceptionInfo();
+    perl_exception=newSVpv("",0);
+    if (sv_isobject(ST(0)) == 0)
+      {
+        ThrowPerlException(exception,OptionError,"ReferenceIsNotMyType",
+          PackageName);
+        goto PerlException;
+      }
+    reference=SvRV(ST(0));
+    hv=SvSTASH(reference);
+    image=SetupList(aTHX_ reference,&info,(SV ***) NULL,exception);
+    if (image == (Image *) NULL)
+      {
+        ThrowPerlException(exception,OptionError,"NoImagesDefined",
+          PackageName);
+        goto PerlException;
+      }
+    image=MaximumIntensityProjectionImages(image,exception);
+    if ((image == (Image *) NULL) || (exception->severity >= ErrorException))
+      goto PerlException;
+    /*
+      Create blessed Perl array for the returned image.
+    */
+    av=newAV();
+    ST(0)=sv_2mortal(sv_bless(newRV((SV *) av),hv));
+    SvREFCNT_dec(av);
+    AddImageToRegistry(image);
+    rv=newRV(sv);
+    av_push(av,sv_bless(rv,hv));
+    SvREFCNT_dec(sv);
+    info=GetPackageInfo(aTHX_ (void *) av,info,exception);
+    (void) FormatMagickString(info->image_info->filename,MaxTextExtent,
+      "mip-%.*s",(int) (MaxTextExtent-9),
+      ((p=strrchr(image->filename,'/')) ? p+1 : image->filename));
+    (void) CopyMagickString(image->filename,info->image_info->filename,
+      MaxTextExtent);
+    SetImageInfo(info->image_info,0,exception);
+    exception=DestroyExceptionInfo(exception);
+    SvREFCNT_dec(perl_exception);
+    XSRETURN(1);
+
+  PerlException:
+    InheritPerlException(exception,perl_exception);
+    exception=DestroyExceptionInfo(exception);
+    sv_setiv(perl_exception,(IV) SvCUR(perl_exception) != 0);
+    SvPOK_on(perl_exception);
+    ST(0)=sv_2mortal(perl_exception);
+    XSRETURN(1);
+  }
+\f
+#
+###############################################################################
+#                                                                             #
+#                                                                             #
+#                                                                             #
 #   M o g r i f y                                                             #
 #                                                                             #
 #                                                                             #
index 80ed8fb6137de30aafed08801cbe436e7203d217..05792158ba4c023e048359edc72071ec3ca29450 100644 (file)
@@ -8,8 +8,8 @@
 <configuremap>
   <configure name="NAME" value="ImageMagick"/>
   <configure name="LIB_VERSION" value="0x660"/>
-  <configure name="LIB_VERSION_NUMBER" value="6,6,0,2"/>
-  <configure name="RELEASE_DATE" value="2010-03-04"/>
+  <configure name="LIB_VERSION_NUMBER" value="6,6,0,3"/>
+  <configure name="RELEASE_DATE" value="2010-03-05"/>
   <configure name="CONFIGURE" value="./configure "/>
   <configure name="PREFIX" value="/usr/local"/>
   <configure name="EXEC-PREFIX" value="/usr/local"/>
diff --git a/libtool b/libtool
index 4bb5684f5b3476b79ea2abcf441b6cf26da1058e..d9595fb6ce5deb984301f404581f1f90016f6c75 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.0-2
+# Generated automatically by config.status (ImageMagick) 6.6.0-3
 # Libtool was configured on host magick.imagemagick.org:
 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
 #
index 06aee46ea1544c7079847198a0959010a9ef7adc..2cb686b9bb18dfebdb786f15b0183472de127310 100644 (file)
 %
 %  The format of the AverageImages method is:
 %
-%      Image *AverageImages(Image *image,ExceptionInfo *exception)
+%      Image *AverageImages(Image *images,ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
 %
@@ -161,7 +161,7 @@ static MagickPixelPacket **AcquirePixelThreadSet(const Image *image)
   return(pixels);
 }
 
-MagickExport Image *AverageImages(const Image *image,ExceptionInfo *exception)
+MagickExport Image *AverageImages(const Image *images,ExceptionInfo *exception)
 {
 #define AverageImageTag  "Average/Image"
 
@@ -191,19 +191,23 @@ MagickExport Image *AverageImages(const Image *image,ExceptionInfo *exception)
   /*
     Ensure the image are the same size.
   */
-  assert(image != (Image *) NULL);
-  assert(image->signature == MagickSignature);
-  if (image->debug != MagickFalse)
-    (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
+  assert(images != (Image *) NULL);
+  assert(images->signature == MagickSignature);
+  if (images->debug != MagickFalse)
+    (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",images->filename);
   assert(exception != (ExceptionInfo *) NULL);
   assert(exception->signature == MagickSignature);
-  for (next=image; next != (Image *) NULL; next=GetNextImageInList(next))
-    if ((next->columns != image->columns) || (next->rows != image->rows))
-      ThrowImageException(OptionError,"ImageWidthsOrHeightsDiffer");
+  for (next=images; next != (Image *) NULL; next=GetNextImageInList(next))
+    if ((next->columns != images->columns) || (next->rows != images->rows))
+      {
+        (void) ThrowMagickException(exception,GetMagickModule(),OptionError,
+          "ImageWidthsOrHeightsDiffer","`%s'",images->filename);
+        return((Image *) NULL);
+      }
   /*
     Initialize average next attributes.
   */
-  average_image=CloneImage(image,image->columns,image->rows,MagickTrue,
+  average_image=CloneImage(images,images->columns,images->rows,MagickTrue,
     exception);
   if (average_image == (Image *) NULL)
     return((Image *) NULL);
@@ -213,19 +217,21 @@ MagickExport Image *AverageImages(const Image *image,ExceptionInfo *exception)
       average_image=DestroyImage(average_image);
       return((Image *) NULL);
     }
-  average_pixels=AcquirePixelThreadSet(image);
+  average_pixels=AcquirePixelThreadSet(images);
   if (average_pixels == (MagickPixelPacket **) NULL)
     {
       average_image=DestroyImage(average_image);
-      ThrowImageException(ResourceLimitError,"MemoryAllocationFailed");
+      (void) ThrowMagickException(exception,GetMagickModule(),
+        ResourceLimitError,"MemoryAllocationFailed","`%s'",images->filename);
+      return((Image *) NULL);
     }
   /*
     Average image pixels.
   */
   status=MagickTrue;
   progress=0;
-  GetMagickPixelPacket(image,&zero);
-  number_images=GetImageListLength(image);
+  GetMagickPixelPacket(images,&zero);
+  number_images=GetImageListLength(images);
   average_view=AcquireCacheView(average_image);
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
   #pragma omp parallel for schedule(dynamic) shared(progress,status)
@@ -270,7 +276,7 @@ MagickExport Image *AverageImages(const Image *image,ExceptionInfo *exception)
     average_pixel=average_pixels[id];
     for (x=0; x < (long) average_image->columns; x++)
       average_pixel[x]=zero;
-    next=image;
+    next=images;
     for (i=0; i < (long) number_images; i++)
     {
       register const IndexPacket
@@ -319,7 +325,7 @@ MagickExport Image *AverageImages(const Image *image,ExceptionInfo *exception)
     }
     if (SyncCacheViewAuthenticPixels(average_view,exception) == MagickFalse)
       status=MagickFalse;
-    if (image->progress_monitor != (MagickProgressMonitor) NULL)
+    if (images->progress_monitor != (MagickProgressMonitor) NULL)
       {
         MagickBooleanType
           proceed;
@@ -327,7 +333,7 @@ MagickExport Image *AverageImages(const Image *image,ExceptionInfo *exception)
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
         #pragma omp critical (MagickCore_AverageImages)
 #endif
-        proceed=SetImageProgress(image,AverageImageTag,progress++,
+        proceed=SetImageProgress(images,AverageImageTag,progress++,
           average_image->rows);
         if (proceed == MagickFalse)
           status=MagickFalse;
@@ -1120,3 +1126,106 @@ MagickExport ChannelStatistics *GetImageChannelStatistics(const Image *image,
   }
   return(channel_statistics);
 }
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%     M a x i m u m I n t e n s i t y P r o j e c t i o n I m a g e s         %
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  MaximumIntensityProjectionImages() returns the maximum intensity projection
+%  of an image sequence.
+%
+%  The format of the MaximumIntensityProjectionImages method is:
+%
+%      Image *MaximumIntensityProjectionImages(Image *images,
+%        ExceptionInfo *exception)
+%
+%  A description of each parameter follows:
+%
+%    o images: the image sequence.
+%
+%    o exception: return any errors or warnings in this structure.
+%
+*/
+MagickExport Image *MaximumIntensityProjectionImages(const Image *images,
+  ExceptionInfo *exception)
+{
+#define MaximumIntensityProjectionImageTag  "MaximumIntensityProjection/Image"
+
+  const Image
+    *next;
+
+  Image
+    *mip_image;
+
+  MagickBooleanType
+    status;
+
+  register long
+    i;
+
+  unsigned long
+    number_images;
+
+  /*
+    Ensure the image are the same size.
+  */
+  assert(images != (Image *) NULL);
+  assert(images->signature == MagickSignature);
+  if (images->debug != MagickFalse)
+    (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",images->filename);
+  assert(exception != (ExceptionInfo *) NULL);
+  assert(exception->signature == MagickSignature);
+  for (next=images; next != (Image *) NULL; next=GetNextImageInList(next))
+    if ((next->columns != images->columns) || (next->rows != images->rows))
+      {
+        (void) ThrowMagickException(exception,GetMagickModule(),OptionError,
+          "ImageWidthsOrHeightsDiffer","`%s'",images->filename);
+        return((Image *) NULL);
+      }
+  /*
+    Initialize mip_image next attributes.
+  */
+  mip_image=CloneImage(images,0,0,MagickTrue,exception);
+  if (mip_image == (Image *) NULL)
+    return((Image *) NULL);
+  if (SetImageStorageClass(mip_image,DirectClass) == MagickFalse)
+    {
+      InheritException(exception,&mip_image->exception);
+      mip_image=DestroyImage(mip_image);
+      return((Image *) NULL);
+    }
+  /*
+    Compute the maximum intensity projection.
+  */
+  i=0;
+  number_images=GetImageListLength(images);
+  for (next=images; next != (Image *) NULL; next=GetNextImageInList(next))
+  {
+    status=CompositeImage(mip_image,LightenCompositeOp,next,0,0);
+    if (status == MagickFalse)
+      {
+        InheritException(exception,&mip_image->exception);
+        mip_image=DestroyImage(mip_image);
+        break;
+      }
+    if (images->progress_monitor != (MagickProgressMonitor) NULL)
+      {
+        MagickBooleanType
+          proceed;
+
+#if defined(MAGICKCORE_OPENMP_SUPPORT)
+        #pragma omp critical (MagickCore_MaximumIntensityProjectionImages)
+#endif
+        proceed=SetImageProgress(images,MaximumIntensityProjectionImageTag,i++,
+          number_images);
+      }
+  }
+  return(mip_image);
+}
index 6237d64e7ca6ef341d7abc618bfc8e31188fbaaf..d834b7a4e46a6f8652bf26b0f0bae6bae75d4f07 100644 (file)
@@ -40,7 +40,8 @@ extern MagickExport ChannelStatistics
   *GetImageChannelStatistics(const Image *,ExceptionInfo *);
 
 extern MagickExport Image
-  *AverageImages(const Image *,ExceptionInfo *);
+  *AverageImages(const Image *,ExceptionInfo *),
+  *MaximumIntensityProjectionImages(const Image *,ExceptionInfo *);
 
 extern MagickExport MagickBooleanType
   GetImageChannelExtrema(const Image *,const ChannelType,unsigned long *,
index 4e7a80f413a06447fc865dccdd456fad1d5e4400..0cdc4632b190e6ab9f89714fd62f4a790220389b 100644 (file)
@@ -30,10 +30,10 @@ extern "C" {
 #define MagickLibVersion  0x660
 #define MagickLibVersionText  "6.6.0"
 #define MagickLibVersionNumber  3,0,0
-#define MagickLibAddendum  "-2"
+#define MagickLibAddendum  "-3"
 #define MagickLibInterface  3
 #define MagickLibMinInterface  3
-#define MagickReleaseDate  "2010-03-04"
+#define MagickReleaseDate  "2010-03-05"
 #define MagickChangeDate   "20100227"
 #define MagickAuthoritativeURL  "http://www.imagemagick.org"
 #define MagickHomeURL  "file:///usr/local/share/doc/ImageMagick-6.6.0/index.html"
index 964dafa9ef507550a5575e418f6bd8fc4b54f4b5..bad8dd72e5aaac8cd5cce697d608cd7c0018eef6 100644 (file)
@@ -302,6 +302,7 @@ static MagickBooleanType ConvertUsage(void)
       "-flatten             flatten a sequence of images",
       "-fx expression       apply mathematical expression to an image channel(s)",
       "-hald-clut           apply a Hald color lookup table to the image",
+      "-mip                 return the maximum intensity projection for an image sequence",
       "-morph value         morph an image sequence",
       "-mosaic              create a mosaic from an image sequence",
       "-process arguments   process the image with a custom image filter",
@@ -1881,6 +1882,8 @@ WandExport MagickBooleanType ConvertImageCommand(ImageInfo *image_info,
               ThrowConvertException(OptionError,"MissingArgument",option);
             break;
           }
+        if (LocaleCompare("mip",option+1) == 0)
+          break;
         if (LocaleCompare("median",option+1) == 0)
           {
             if (*option == '+')
index 433d054f29c71114697959b8e6670eeb8bcc7c6c..d0cdde69abd8effbc948fe1470c2fd9ec5c85e27 100644 (file)
@@ -6457,6 +6457,46 @@ WandExport MagickBooleanType MagickImportImagePixels(MagickWand *wand,
 %                                                                             %
 %                                                                             %
 %                                                                             %
+%   M a g i c k M a x i m u m I n t e n s i t y P r o j e c t i o n I m a g e %
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  MagickMaximumIntensityProjectionImages() returns the maximum intensity
+%  projection of an image sequence.
+%
+%  The format of the MagickMaximumIntensityProjectionImages method is:
+%
+%      MagickWand *MagickMaximumIntensityProjectionImages(MagickWand *wand)
+%
+%  A description of each parameter follows:
+%
+%    o wand: the magick wand.
+%
+*/
+WandExport MagickWand *MagickMaximumIntensityProjectionImages(MagickWand *wand)
+{
+  Image
+    *mip_image;
+
+  assert(wand != (MagickWand *) NULL);
+  assert(wand->signature == WandSignature);
+  if (wand->debug != MagickFalse)
+    (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
+  if (wand->images == (Image *) NULL)
+    return((MagickWand *) NULL);
+  mip_image=MaximumIntensityProjectionImages(wand->images,wand->exception);
+  if (mip_image == (Image *) NULL)
+    return((MagickWand *) NULL);
+  return(CloneMagickWandFromImages(wand,mip_image));
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
 %   M a g i c k I n v e r s e F o u r i e r T r a n s f o r m I m a g e       %
 %                                                                             %
 %                                                                             %
index e7314c6131216642abd02e97e56ea0c882a9354f..e2f9d505f5e0f2fa4cd42c5eeb5281f63cb0f00d 100644 (file)
@@ -386,6 +386,7 @@ extern WandExport MagickWand
   *MagickGetImageClipMask(MagickWand *),
   *MagickGetImageRegion(MagickWand *,const unsigned long,const unsigned long,
     const long,const long),
+  *MagickMaximumIntensityProjectionImages(MagickWand *),
   *MagickMergeImageLayers(MagickWand *,const ImageLayerMethod),
   *MagickMorphImages(MagickWand *,const unsigned long),
   *MagickMontageImage(MagickWand *,const DrawingWand *,const char *,
index 8720f4d9b454b86b8f00c07498961198b6d1df73..65302412b3d3fa1e742eca2279ad0229058defaa 100644 (file)
@@ -3796,6 +3796,7 @@ static MagickBooleanType MogrifyUsage(void)
       "-flatten             flatten a sequence of images",
       "-fx expression       apply mathematical expression to an image channel(s)",
       "-hald-clut           apply a Hald color lookup table to the image",
+      "-mip                 return the maximum intensity projection for an image sequence",
       "-morph value         morph an image sequence",
       "-mosaic              create a mosaic from an image sequence",
       "-process arguments   process the image with a custom image filter",
@@ -5334,6 +5335,8 @@ WandExport MagickBooleanType MogrifyImageCommand(ImageInfo *image_info,
               ThrowMogrifyException(OptionError,"MissingArgument",option);
             break;
           }
+        if (LocaleCompare("mip",option+1) == 0)
+          break;
         if (LocaleCompare("modulate",option+1) == 0)
           {
             if (*option == '+')
@@ -8087,6 +8090,23 @@ WandExport MagickBooleanType MogrifyImageList(ImageInfo *image_info,
             i++;
             break;
           }
+        if (LocaleCompare("mip",option+1) == 0)
+          {
+            Image
+              *morph_image;
+
+            (void) SyncImagesSettings(image_info,*images);
+            morph_image=MorphImages(*images,StringToUnsignedLong(argv[i+1]),
+              exception);
+            if (morph_image == (Image *) NULL)
+              {
+                status=MagickFalse;
+                break;
+              }
+            *images=DestroyImageList(*images);
+            *images=morph_image;
+            break;
+          }
         if (LocaleCompare("morph",option+1) == 0)
           {
             Image