]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Tue, 5 Jul 2011 14:39:26 +0000 (14:39 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Tue, 5 Jul 2011 14:39:26 +0000 (14:39 +0000)
18 files changed:
MagickCore/compare.c
MagickCore/compare.h
MagickCore/layer.c
MagickCore/layer.h
MagickCore/magick-config.h
MagickCore/methods.h
MagickCore/pixel.c
MagickCore/pixel.h
MagickCore/version.h
MagickWand/compare.c
MagickWand/compare.h
MagickWand/magick-image.c
MagickWand/magick-image.h
MagickWand/mogrify.c
PerlMagick/Magick.xs
config/configure.xml
tests/validate.c
utilities/compare.c

index 9d177c6f493509e031e4bffcb4aa45e804ff6a40..1575b065e67d84400ed12b79fccb58f96f8df355 100644 (file)
 %                                                                             %
 %                                                                             %
 %                                                                             %
-%   C o m p a r e I m a g e C h a n n e l s                                   %
+%   C o m p a r e I m a g e                                                   %
 %                                                                             %
 %                                                                             %
 %                                                                             %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
-%  CompareImageChannels() compares one or more image channels of an image
-%  to a reconstructed image and returns the difference image.
+%  CompareImages() compares one or more pixel channels of an image to a 
+%  reconstructed image and returns the difference image.
 %
-%  The format of the CompareImageChannels method is:
+%  The format of the CompareImages method is:
 %
-%      Image *CompareImageChannels(const Image *image,
-%        const Image *reconstruct_image,const ChannelType channel,
+%      Image *CompareImages(const Image *image,const Image *reconstruct_image,
 %        const MetricType metric,double *distortion,ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
@@ -94,8 +93,6 @@
 %
 %    o reconstruct_image: the reconstruct image.
 %
-%    o channel: the channel.
-%
 %    o metric: the metric.
 %
 %    o distortion: the computed distortion between the images.
 %    o exception: return any errors or warnings in this structure.
 %
 */
-
 MagickExport Image *CompareImages(Image *image,const Image *reconstruct_image,
   const MetricType metric,double *distortion,ExceptionInfo *exception)
-{
-  Image
-    *highlight_image;
-
-  highlight_image=CompareImageChannels(image,reconstruct_image,CompositeChannels,
-    metric,distortion,exception);
-  return(highlight_image);
-}
-
-MagickExport Image *CompareImageChannels(Image *image,
-  const Image *reconstruct_image,const ChannelType channel,
-  const MetricType metric,double *distortion,ExceptionInfo *exception)
 {
   CacheView
     *highlight_view,
@@ -155,8 +139,8 @@ MagickExport Image *CompareImageChannels(Image *image,
   if ((reconstruct_image->columns != image->columns) ||
       (reconstruct_image->rows != image->rows))
     ThrowImageException(ImageError,"ImageSizeDiffers");
-  status=GetImageChannelDistortion(image,reconstruct_image,channel,metric,
-    distortion,exception);
+  status=GetImageDistortion(image,reconstruct_image,metric,distortion,
+    exception);
   if (status == MagickFalse)
     return((Image *) NULL);
   difference_image=CloneImage(image,0,0,MagickTrue,exception);
@@ -244,7 +228,7 @@ MagickExport Image *CompareImageChannels(Image *image,
       SetPixelInfo(image,p,&pixel);
       SetPixelInfo(reconstruct_image,q,&reconstruct_pixel);
       difference=MagickFalse;
-      if (channel == CompositeChannels)
+      if (image->sync == MagickTrue)
         {
           if (IsFuzzyEquivalencePixelInfo(&pixel,&reconstruct_pixel) == MagickFalse)
             difference=MagickTrue;
@@ -297,20 +281,20 @@ MagickExport Image *CompareImageChannels(Image *image,
 %                                                                             %
 %                                                                             %
 %                                                                             %
-%   G e t I m a g e C h a n n e l D i s t o r t i o n                         %
+%   G e t I m a g e D i s t o r t i o n                                       %
 %                                                                             %
 %                                                                             %
 %                                                                             %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
-%  GetImageChannelDistortion() compares one or more image channels of an image
-%  to a reconstructed image and returns the specified distortion metric.
+%  GetImageDistortion() compares one or more pixel channels of an image to a 
+%  reconstructed image and returns the specified distortion metric.
 %
-%  The format of the CompareImageChannels method is:
+%  The format of the CompareImages method is:
 %
-%      MagickBooleanType GetImageChannelDistortion(const Image *image,
-%        const Image *reconstruct_image,const ChannelType channel,
-%        const MetricType metric,double *distortion,ExceptionInfo *exception)
+%      MagickBooleanType GetImageDistortion(const Image *image,
+%        const Image *reconstruct_image,const MetricType metric,
+%        double *distortion,ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
 %
@@ -318,8 +302,6 @@ MagickExport Image *CompareImageChannels(Image *image,
 %
 %    o reconstruct_image: the reconstruct image.
 %
-%    o channel: the channel.
-%
 %    o metric: the metric.
 %
 %    o distortion: the computed distortion between the images.
@@ -328,21 +310,8 @@ MagickExport Image *CompareImageChannels(Image *image,
 %
 */
 
-MagickExport MagickBooleanType GetImageDistortion(Image *image,
-  const Image *reconstruct_image,const MetricType metric,double *distortion,
-  ExceptionInfo *exception)
-{
-  MagickBooleanType
-    status;
-
-  status=GetImageChannelDistortion(image,reconstruct_image,CompositeChannels,
-    metric,distortion,exception);
-  return(status);
-}
-
 static MagickBooleanType GetAbsoluteDistortion(const Image *image,
-  const Image *reconstruct_image,const ChannelType channel,double *distortion,
-  ExceptionInfo *exception)
+  const Image *reconstruct_image,double *distortion,ExceptionInfo *exception)
 {
   CacheView
     *image_view,
@@ -431,8 +400,7 @@ static MagickBooleanType GetAbsoluteDistortion(const Image *image,
   return(status);
 }
 
-static size_t GetNumberChannels(const Image *image,
-  const ChannelType channel)
+static size_t GetNumberChannels(const Image *image)
 {
   size_t
     channels;
@@ -454,8 +422,7 @@ static size_t GetNumberChannels(const Image *image,
 }
 
 static MagickBooleanType GetFuzzDistortion(const Image *image,
-  const Image *reconstruct_image,const ChannelType channel,
-  double *distortion,ExceptionInfo *exception)
+  const Image *reconstruct_image,double *distortion,ExceptionInfo *exception)
 {
   CacheView
     *image_view,
@@ -560,17 +527,15 @@ static MagickBooleanType GetFuzzDistortion(const Image *image,
   if (((GetPixelAlphaTraits(image) & ActivePixelTrait) != 0) &&
       ((image->matte != MagickFalse) ||
       (reconstruct_image->matte != MagickFalse)))
-    distortion[CompositeChannels]/=(double)
-      (GetNumberChannels(image,channel)-1);
+    distortion[CompositeChannels]/=(double) (GetNumberChannels(image)-1);
   else
-    distortion[CompositeChannels]/=(double) GetNumberChannels(image,channel);
+    distortion[CompositeChannels]/=(double) GetNumberChannels(image);
   distortion[CompositeChannels]=sqrt(distortion[CompositeChannels]);
   return(status);
 }
 
 static MagickBooleanType GetMeanAbsoluteDistortion(const Image *image,
-  const Image *reconstruct_image,const ChannelType channel,
-  double *distortion,ExceptionInfo *exception)
+  const Image *reconstruct_image,double *distortion,ExceptionInfo *exception)
 {
   CacheView
     *image_view,
@@ -670,13 +635,12 @@ static MagickBooleanType GetMeanAbsoluteDistortion(const Image *image,
   image_view=DestroyCacheView(image_view);
   for (i=0; i <= (ssize_t) CompositeChannels; i++)
     distortion[i]/=((double) image->columns*image->rows);
-  distortion[CompositeChannels]/=(double) GetNumberChannels(image,channel);
+  distortion[CompositeChannels]/=(double) GetNumberChannels(image);
   return(status);
 }
 
 static MagickBooleanType GetMeanErrorPerPixel(Image *image,
-  const Image *reconstruct_image,const ChannelType channel,double *distortion,
-  ExceptionInfo *exception)
+  const Image *reconstruct_image,double *distortion,ExceptionInfo *exception)
 {
   CacheView
     *image_view,
@@ -805,8 +769,7 @@ static MagickBooleanType GetMeanErrorPerPixel(Image *image,
 }
 
 static MagickBooleanType GetMeanSquaredDistortion(const Image *image,
-  const Image *reconstruct_image,const ChannelType channel,
-  double *distortion,ExceptionInfo *exception)
+  const Image *reconstruct_image,double *distortion,ExceptionInfo *exception)
 {
   CacheView
     *image_view,
@@ -907,13 +870,13 @@ static MagickBooleanType GetMeanSquaredDistortion(const Image *image,
   image_view=DestroyCacheView(image_view);
   for (i=0; i <= (ssize_t) CompositeChannels; i++)
     distortion[i]/=((double) image->columns*image->rows);
-  distortion[CompositeChannels]/=(double) GetNumberChannels(image,channel);
+  distortion[CompositeChannels]/=(double) GetNumberChannels(image);
   return(status);
 }
 
 static MagickBooleanType GetNormalizedCrossCorrelationDistortion(
-  const Image *image,const Image *reconstruct_image,const ChannelType channel,
-  double *distortion,ExceptionInfo *exception)
+  const Image *image,const Image *reconstruct_image,double *distortion,
+  ExceptionInfo *exception)
 {
 #define SimilarityImageTag  "Similarity/Image"
 
@@ -1048,7 +1011,7 @@ static MagickBooleanType GetNormalizedCrossCorrelationDistortion(
     distortion[CompositeChannels]+=distortion[BlackChannel]*
       distortion[BlackChannel];
   distortion[CompositeChannels]=sqrt(distortion[CompositeChannels]/
-    GetNumberChannels(image,channel));
+    GetNumberChannels(image));
   /*
     Free resources.
   */
@@ -1060,8 +1023,7 @@ static MagickBooleanType GetNormalizedCrossCorrelationDistortion(
 }
 
 static MagickBooleanType GetPeakAbsoluteDistortion(const Image *image,
-  const Image *reconstruct_image,const ChannelType channel,
-  double *distortion,ExceptionInfo *exception)
+  const Image *reconstruct_image,double *distortion,ExceptionInfo *exception)
 {
   CacheView
     *image_view,
@@ -1172,14 +1134,12 @@ static MagickBooleanType GetPeakAbsoluteDistortion(const Image *image,
 }
 
 static MagickBooleanType GetPeakSignalToNoiseRatio(const Image *image,
-  const Image *reconstruct_image,const ChannelType channel,
-  double *distortion,ExceptionInfo *exception)
+  const Image *reconstruct_image,double *distortion,ExceptionInfo *exception)
 {
   MagickBooleanType
     status;
 
-  status=GetMeanSquaredDistortion(image,reconstruct_image,channel,distortion,
-    exception);
+  status=GetMeanSquaredDistortion(image,reconstruct_image,distortion,exception);
   if ((GetPixelRedTraits(image) & ActivePixelTrait) != 0)
     distortion[RedChannel]=20.0*log10((double) 1.0/sqrt(
       distortion[RedChannel]));
@@ -1203,14 +1163,12 @@ static MagickBooleanType GetPeakSignalToNoiseRatio(const Image *image,
 }
 
 static MagickBooleanType GetRootMeanSquaredDistortion(const Image *image,
-  const Image *reconstruct_image,const ChannelType channel,
-  double *distortion,ExceptionInfo *exception)
+  const Image *reconstruct_image,double *distortion,ExceptionInfo *exception)
 {
   MagickBooleanType
     status;
 
-  status=GetMeanSquaredDistortion(image,reconstruct_image,channel,distortion,
-    exception);
+  status=GetMeanSquaredDistortion(image,reconstruct_image,distortion,exception);
   if ((GetPixelRedTraits(image) & ActivePixelTrait) != 0)
     distortion[RedChannel]=sqrt(distortion[RedChannel]);
   if ((GetPixelGreenTraits(image) & ActivePixelTrait) != 0)
@@ -1227,9 +1185,9 @@ static MagickBooleanType GetRootMeanSquaredDistortion(const Image *image,
   return(status);
 }
 
-MagickExport MagickBooleanType GetImageChannelDistortion(Image *image,
-  const Image *reconstruct_image,const ChannelType channel,
-  const MetricType metric,double *distortion,ExceptionInfo *exception)
+MagickExport MagickBooleanType GetImageDistortion(Image *image,
+  const Image *reconstruct_image,const MetricType metric,double *distortion,
+  ExceptionInfo *exception)
 {
   double
     *channel_distortion;
@@ -1267,31 +1225,31 @@ MagickExport MagickBooleanType GetImageChannelDistortion(Image *image,
   {
     case AbsoluteErrorMetric:
     {
-      status=GetAbsoluteDistortion(image,reconstruct_image,channel,
-        channel_distortion,exception);
+      status=GetAbsoluteDistortion(image,reconstruct_image,channel_distortion,
+        exception);
       break;
     }
     case FuzzErrorMetric:
     {
-      status=GetFuzzDistortion(image,reconstruct_image,channel,
-        channel_distortion,exception);
+      status=GetFuzzDistortion(image,reconstruct_image,channel_distortion,
+        exception);
       break;
     }
     case MeanAbsoluteErrorMetric:
     {
-      status=GetMeanAbsoluteDistortion(image,reconstruct_image,channel,
+      status=GetMeanAbsoluteDistortion(image,reconstruct_image,
         channel_distortion,exception);
       break;
     }
     case MeanErrorPerPixelMetric:
     {
-      status=GetMeanErrorPerPixel(image,reconstruct_image,channel,
-        channel_distortion,exception);
+      status=GetMeanErrorPerPixel(image,reconstruct_image,channel_distortion,
+        exception);
       break;
     }
     case MeanSquaredErrorMetric:
     {
-      status=GetMeanSquaredDistortion(image,reconstruct_image,channel,
+      status=GetMeanSquaredDistortion(image,reconstruct_image,
         channel_distortion,exception);
       break;
     }
@@ -1299,24 +1257,24 @@ MagickExport MagickBooleanType GetImageChannelDistortion(Image *image,
     default:
     {
       status=GetNormalizedCrossCorrelationDistortion(image,reconstruct_image,
-        channel,channel_distortion,exception);
+        channel_distortion,exception);
       break;
     }
     case PeakAbsoluteErrorMetric:
     {
-      status=GetPeakAbsoluteDistortion(image,reconstruct_image,channel,
+      status=GetPeakAbsoluteDistortion(image,reconstruct_image,
         channel_distortion,exception);
       break;
     }
     case PeakSignalToNoiseRatioMetric:
     {
-      status=GetPeakSignalToNoiseRatio(image,reconstruct_image,channel,
+      status=GetPeakSignalToNoiseRatio(image,reconstruct_image,
         channel_distortion,exception);
       break;
     }
     case RootMeanSquaredErrorMetric:
     {
-      status=GetRootMeanSquaredDistortion(image,reconstruct_image,channel,
+      status=GetRootMeanSquaredDistortion(image,reconstruct_image,
         channel_distortion,exception);
       break;
     }
@@ -1331,19 +1289,19 @@ MagickExport MagickBooleanType GetImageChannelDistortion(Image *image,
 %                                                                             %
 %                                                                             %
 %                                                                             %
-%   G e t I m a g e C h a n n e l D i s t o r t i o n s                       %
+%   G e t I m a g e D i s t o r t i o n s                                     %
 %                                                                             %
 %                                                                             %
 %                                                                             %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
-%  GetImageChannelDistrortion() compares the image channels of an image to a
+%  GetImageDistrortion() compares the pixel channels of an image to a
 %  reconstructed image and returns the specified distortion metric for each
 %  channel.
 %
-%  The format of the CompareImageChannels method is:
+%  The format of the CompareImages method is:
 %
-%      double *GetImageChannelDistortions(const Image *image,
+%      double *GetImageDistortions(const Image *image,
 %        const Image *reconstruct_image,const MetricType metric,
 %        ExceptionInfo *exception)
 %
@@ -1358,7 +1316,7 @@ MagickExport MagickBooleanType GetImageChannelDistortion(Image *image,
 %    o exception: return any errors or warnings in this structure.
 %
 */
-MagickExport double *GetImageChannelDistortions(Image *image,
+MagickExport double *GetImageDistortions(Image *image,
   const Image *reconstruct_image,const MetricType metric,
   ExceptionInfo *exception)
 {
@@ -1401,31 +1359,31 @@ MagickExport double *GetImageChannelDistortions(Image *image,
   {
     case AbsoluteErrorMetric:
     {
-      status=GetAbsoluteDistortion(image,reconstruct_image,CompositeChannels,
-        channel_distortion,exception);
+      status=GetAbsoluteDistortion(image,reconstruct_image,channel_distortion,
+        exception);
       break;
     }
     case FuzzErrorMetric:
     {
-      status=GetFuzzDistortion(image,reconstruct_image,CompositeChannels,
-        channel_distortion,exception);
+      status=GetFuzzDistortion(image,reconstruct_image,channel_distortion,
+        exception);
       break;
     }
     case MeanAbsoluteErrorMetric:
     {
-      status=GetMeanAbsoluteDistortion(image,reconstruct_image,CompositeChannels,
+      status=GetMeanAbsoluteDistortion(image,reconstruct_image,
         channel_distortion,exception);
       break;
     }
     case MeanErrorPerPixelMetric:
     {
-      status=GetMeanErrorPerPixel(image,reconstruct_image,CompositeChannels,
-        channel_distortion,exception);
+      status=GetMeanErrorPerPixel(image,reconstruct_image,channel_distortion,
+        exception);
       break;
     }
     case MeanSquaredErrorMetric:
     {
-      status=GetMeanSquaredDistortion(image,reconstruct_image,CompositeChannels,
+      status=GetMeanSquaredDistortion(image,reconstruct_image,
         channel_distortion,exception);
       break;
     }
@@ -1433,24 +1391,24 @@ MagickExport double *GetImageChannelDistortions(Image *image,
     default:
     {
       status=GetNormalizedCrossCorrelationDistortion(image,reconstruct_image,
-        CompositeChannels,channel_distortion,exception);
+        channel_distortion,exception);
       break;
     }
     case PeakAbsoluteErrorMetric:
     {
-      status=GetPeakAbsoluteDistortion(image,reconstruct_image,CompositeChannels,
+      status=GetPeakAbsoluteDistortion(image,reconstruct_image,
         channel_distortion,exception);
       break;
     }
     case PeakSignalToNoiseRatioMetric:
     {
-      status=GetPeakSignalToNoiseRatio(image,reconstruct_image,CompositeChannels,
+      status=GetPeakSignalToNoiseRatio(image,reconstruct_image,
         channel_distortion,exception);
       break;
     }
     case RootMeanSquaredErrorMetric:
     {
-      status=GetRootMeanSquaredDistortion(image,reconstruct_image,CompositeChannels,
+      status=GetRootMeanSquaredDistortion(image,reconstruct_image,
         channel_distortion,exception);
       break;
     }
index bccb13363ea73a4fb72902d9fcd87856ca7b4ed4..714fea4474888ffd2a0a942df7e9b7d76f37b335 100644 (file)
@@ -39,20 +39,15 @@ typedef enum
 } MetricType;
 
 extern MagickExport double
-  *GetImageChannelDistortions(Image *,const Image *,const MetricType,
-    ExceptionInfo *);
+  *GetImageDistortions(Image *,const Image *,const MetricType,ExceptionInfo *);
 
 extern MagickExport Image
-  *CompareImageChannels(Image *,const Image *,const ChannelType,
-    const MetricType,double *,ExceptionInfo *),
   *CompareImages(Image *,const Image *,const MetricType,double *,
     ExceptionInfo *),
   *SimilarityImage(Image *,const Image *,RectangleInfo *,double *,
     ExceptionInfo *);
 
 extern MagickExport MagickBooleanType
-  GetImageChannelDistortion(Image *,const Image *,const ChannelType,
-    const MetricType,double *,ExceptionInfo *),
   GetImageDistortion(Image *,const Image *,const MetricType,double *,
     ExceptionInfo *),
   IsImagesEqual(Image *,const Image *);
index b4e440d66badb03c5f72b79eea68062a124bc9e8..2c90494e441056a009802da8d2d592ac783cf817 100644 (file)
@@ -508,7 +508,7 @@ MagickExport Image *DisposeImages(const Image *image,ExceptionInfo *exception)
 %  ComparePixels() Compare the two pixels and return true if the pixels
 %  differ according to the given LayerType comparision method.
 %
-%  This currently only used internally by CompareImageBounds(). It is
+%  This currently only used internally by CompareImagesBounds(). It is
 %  doubtful that this sub-routine will be useful outside this module.
 %
 %  The format of the ComparePixels method is:
@@ -572,16 +572,16 @@ static MagickBooleanType ComparePixels(const ImageLayerMethod method,
 %                                                                             %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
-%  CompareImageBounds() Given two images return the smallest rectangular area
+%  CompareImagesBounds() Given two images return the smallest rectangular area
 %  by which the two images differ, accourding to the given 'Compare...'
 %  layer method.
 %
 %  This currently only used internally in this module, but may eventually
 %  be used by other modules.
 %
-%  The format of the CompareImageBounds method is:
+%  The format of the CompareImagesBounds method is:
 %
-%      RectangleInfo *CompareImageBounds(const ImageLayerMethod method,
+%      RectangleInfo *CompareImagesBounds(const ImageLayerMethod method,
 %        const Image *image1, const Image *image2, ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
@@ -595,7 +595,7 @@ static MagickBooleanType ComparePixels(const ImageLayerMethod method,
 %
 */
 
-static RectangleInfo CompareImageBounds(const Image *image1,const Image *image2,
+static RectangleInfo CompareImagesBounds(const Image *image1,const Image *image2,
   const ImageLayerMethod method,ExceptionInfo *exception)
 {
   RectangleInfo
@@ -725,7 +725,7 @@ static RectangleInfo CompareImageBounds(const Image *image1,const Image *image2,
 %                                                                             %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
-%  CompareImageLayers() compares each image with the next in a sequence and
+%  CompareImagesLayers() compares each image with the next in a sequence and
 %  returns the minimum bounding region of all the pixel differences (of the
 %  ImageLayerMethod specified) it discovers.
 %
@@ -736,9 +736,9 @@ static RectangleInfo CompareImageBounds(const Image *image1,const Image *image2,
 %  No GIF dispose methods are applied, so GIF animations must be coalesced
 %  before applying this image operator to find differences to them.
 %
-%  The format of the CompareImageLayers method is:
+%  The format of the CompareImagesLayers method is:
 %
-%      Image *CompareImageLayers(const Image *images,
+%      Image *CompareImagesLayers(const Image *images,
 %        const ImageLayerMethod method,ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
@@ -752,7 +752,7 @@ static RectangleInfo CompareImageBounds(const Image *image1,const Image *image2,
 %
 */
 
-MagickExport Image *CompareImageLayers(const Image *image,
+MagickExport Image *CompareImagesLayers(const Image *image,
   const ImageLayerMethod method, ExceptionInfo *exception)
 {
   Image
@@ -818,7 +818,7 @@ MagickExport Image *CompareImageLayers(const Image *image,
       }
     (void) CompositeImage(image_a,CopyCompositeOp,next,next->page.x,
                            next->page.y);
-    bounds[i]=CompareImageBounds(image_b,image_a,method,exception);
+    bounds[i]=CompareImagesBounds(image_b,image_a,method,exception);
 
     image_b=DestroyImage(image_b);
     i++;
@@ -1014,7 +1014,7 @@ static Image *OptimizeLayerFrames(const Image *image,
   (void) FormatLocaleFile(stderr, "frame %.20g :-\n", (double) i);
 #endif
   disposals[0]=NoneDispose;
-  bounds[0]=CompareImageBounds(prev_image,curr,CompareAnyLayer,exception);
+  bounds[0]=CompareImagesBounds(prev_image,curr,CompareAnyLayer,exception);
 #if DEBUG_OPT_FRAME
   (void) FormatLocaleFile(stderr, "overlay: %.20gx%.20g%+.20g%+.20g\n\n",
     (double) bounds[i].width,(double) bounds[i].height,
@@ -1039,7 +1039,7 @@ static Image *OptimizeLayerFrames(const Image *image,
     /*
       Assume none disposal is the best
     */
-    bounds[i]=CompareImageBounds(curr->previous,curr,CompareAnyLayer,exception);
+    bounds[i]=CompareImagesBounds(curr->previous,curr,CompareAnyLayer,exception);
     cleared=IsBoundsCleared(curr->previous,curr,&bounds[i],exception);
     disposals[i-1]=NoneDispose;
 #if DEBUG_OPT_FRAME
@@ -1069,7 +1069,7 @@ static Image *OptimizeLayerFrames(const Image *image,
         /*
           Compare a none disposal against a previous disposal
         */
-        try_bounds=CompareImageBounds(prev_image,curr,CompareAnyLayer,exception);
+        try_bounds=CompareImagesBounds(prev_image,curr,CompareAnyLayer,exception);
         try_cleared=IsBoundsCleared(prev_image,curr,&try_bounds,exception);
 #if DEBUG_OPT_FRAME
     (void) FormatLocaleFile(stderr, "test_prev: %.20gx%.20g%+.20g%+.20g%s\n",
@@ -1108,9 +1108,9 @@ static Image *OptimizeLayerFrames(const Image *image,
                 prev_image=DestroyImage(prev_image);
                 return((Image *) NULL);
               }
-            dup_bounds=CompareImageBounds(dup_image,curr,CompareClearLayer,exception);
+            dup_bounds=CompareImagesBounds(dup_image,curr,CompareClearLayer,exception);
             ClearBounds(dup_image,&dup_bounds);
-            try_bounds=CompareImageBounds(dup_image,curr,CompareAnyLayer,exception);
+            try_bounds=CompareImagesBounds(dup_image,curr,CompareAnyLayer,exception);
             if ( cleared ||
                    dup_bounds.width*dup_bounds.height
                       +try_bounds.width*try_bounds.height
@@ -1140,7 +1140,7 @@ static Image *OptimizeLayerFrames(const Image *image,
           }
         bgnd_bounds=bounds[i-1]; /* interum bounds of the previous image */
         ClearBounds(bgnd_image,&bgnd_bounds);
-        try_bounds=CompareImageBounds(bgnd_image,curr,CompareAnyLayer,exception);
+        try_bounds=CompareImagesBounds(bgnd_image,curr,CompareAnyLayer,exception);
         try_cleared=IsBoundsCleared(bgnd_image,curr,&try_bounds,exception);
 #if DEBUG_OPT_FRAME
     (void) FormatLocaleFile(stderr, "background: %s\n",
@@ -1154,7 +1154,7 @@ static Image *OptimizeLayerFrames(const Image *image,
               include the pixels that are cleared.  This guaranteed
               to work, though may not be the most optimized solution.
             */
-            try_bounds=CompareImageBounds(curr->previous,curr,CompareClearLayer,exception);
+            try_bounds=CompareImagesBounds(curr->previous,curr,CompareClearLayer,exception);
 #if DEBUG_OPT_FRAME
             (void) FormatLocaleFile(stderr, "expand_clear: %.20gx%.20g%+.20g%+.20g%s\n",
                 (double) try_bounds.width,(double) try_bounds.height,
@@ -1211,18 +1211,18 @@ static Image *OptimizeLayerFrames(const Image *image,
  * to see, or writet he image at this point it is hard to tell what is wrong!
  * Only CompareOverlay seemed to return something sensible.
  */
-            try_bounds=CompareImageBounds(bgnd_image,curr,CompareClearLayer,exception);
+            try_bounds=CompareImagesBounds(bgnd_image,curr,CompareClearLayer,exception);
             (void) FormatLocaleFile(stderr, "expand_ctst: %.20gx%.20g%+.20g%+.20g\n",
                 (double) try_bounds.width,(double) try_bounds.height,
                 (double) try_bounds.x,(double) try_bounds.y );
-            try_bounds=CompareImageBounds(bgnd_image,curr,CompareAnyLayer,exception);
+            try_bounds=CompareImagesBounds(bgnd_image,curr,CompareAnyLayer,exception);
             try_cleared=IsBoundsCleared(bgnd_image,curr,&try_bounds,exception);
             (void) FormatLocaleFile(stderr, "expand_any : %.20gx%.20g%+.20g%+.20g%s\n",
                 (double) try_bounds.width,(double) try_bounds.height,
                 (double) try_bounds.x,(double) try_bounds.y,
                 try_cleared?"   (pixels cleared)":"");
 #endif
-            try_bounds=CompareImageBounds(bgnd_image,curr,CompareOverlayLayer,exception);
+            try_bounds=CompareImagesBounds(bgnd_image,curr,CompareOverlayLayer,exception);
 #if DEBUG_OPT_FRAME
             try_cleared=IsBoundsCleared(bgnd_image,curr,&try_bounds,exception);
             (void) FormatLocaleFile(stderr, "expand_test: %.20gx%.20g%+.20g%+.20g%s\n",
@@ -1609,7 +1609,7 @@ MagickExport void RemoveDuplicateLayers(Image **images,
     if ( curr->columns != next->columns || curr->rows != next->rows
          || curr->page.x != next->page.x || curr->page.y != next->page.y )
       continue;
-    bounds=CompareImageBounds(curr,next,CompareAnyLayer,exception);
+    bounds=CompareImagesBounds(curr,next,CompareAnyLayer,exception);
     if ( bounds.x < 0 ) {
       /*
         the two images are the same, merge time delays and delete one.
index 9da131c3eb5e72366eac154bcfc3f0253ba300a8..20540db5bd63c58bb43281bcf6aafb1ddaff89eb 100644 (file)
@@ -57,7 +57,7 @@ typedef enum
 extern MagickExport Image
   *CoalesceImages(const Image *,ExceptionInfo *),
   *DisposeImages(const Image *,ExceptionInfo *),
-  *CompareImageLayers(const Image *,const ImageLayerMethod,ExceptionInfo *),
+  *CompareImagesLayers(const Image *,const ImageLayerMethod,ExceptionInfo *),
   *MergeImageLayers(Image *,const ImageLayerMethod,ExceptionInfo *),
   *OptimizeImageLayers(const Image *,ExceptionInfo *),
   *OptimizePlusImageLayers(const Image *,ExceptionInfo *);
index 9002a55f6ee8504fd986a62d36a0ca552edfb250..2f9648ec388052894fc27d24593a384f3abb65e9 100644 (file)
@@ -12,9 +12,7 @@
 /* #undef AUTOTRACE_DELEGATE */
 
 /* Define if coders and filters are to be built as modules. */
-#ifndef MAGICKCORE_BUILD_MODULES
-#define MAGICKCORE_BUILD_MODULES 1
-#endif
+/* #undef BUILD_MODULES */
 
 /* Define if you have the bzip2 library */
 #ifndef MAGICKCORE_BZLIB_DELEGATE
@@ -56,9 +54,7 @@
 #endif
 
 /* Define if you have DJVU library */
-#ifndef MAGICKCORE_DJVU_DELEGATE
-#define MAGICKCORE_DJVU_DELEGATE 1
-#endif
+/* #undef DJVU_DELEGATE */
 
 /* Directory where ImageMagick documents live. */
 #ifndef MAGICKCORE_DOCUMENTATION_PATH
@@ -80,9 +76,7 @@
 #endif
 
 /* Define if you have FFTW library */
-#ifndef MAGICKCORE_FFTW_DELEGATE
-#define MAGICKCORE_FFTW_DELEGATE 1
-#endif
+/* #undef FFTW_DELEGATE */
 
 /* Location of filter modules */
 #ifndef MAGICKCORE_FILTER_PATH
 #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 JBIG library */
-#ifndef MAGICKCORE_JBIG_DELEGATE
-#define MAGICKCORE_JBIG_DELEGATE 1
-#endif
+/* #undef JBIG_DELEGATE */
 
 /* Define if you have JPEG version 2 "Jasper" library */
 #ifndef MAGICKCORE_JP2_DELEGATE
 #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:/usr/local/lib:/usr/lib64/mysql:/usr/lib64/qt-3.3/lib:/usr/lib64/xulrunner-2"
+#define MAGICKCORE_LT_DLSEARCH_PATH "/lib64:/usr/lib64:/lib:/usr/lib:/usr/lib64/atlas:/usr/lib64/mysql:/usr/lib64/qt-3.3/lib:/usr/lib64/tcl8.5/tclx8.4:/usr/lib64/tcl8.5:/usr/lib/wine/:/usr/lib64/wine/:/usr/lib64/xulrunner-2"
 #endif
 
 /* The archive extension */
 /* #undef NO_MINUS_C_MINUS_O */
 
 /* Define if you have OPENEXR library */
-#ifndef MAGICKCORE_OPENEXR_DELEGATE
-#define MAGICKCORE_OPENEXR_DELEGATE 1
-#endif
+/* #undef OPENEXR_DELEGATE */
 
 /* Define to the address where bug reports for this package should be sent. */
 #ifndef MAGICKCORE_PACKAGE_BUGREPORT
 #endif
 
 /* Define if you have RSVG library */
-#ifndef MAGICKCORE_RSVG_DELEGATE
-#define MAGICKCORE_RSVG_DELEGATE 1
-#endif
+/* #undef RSVG_DELEGATE */
 
 /* Define to the type of arg 1 for `select'. */
 #ifndef MAGICKCORE_SELECT_TYPE_ARG1
 
 
 /* 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 WITH_DMALLOC */
 
 /* Define if you have WMF library */
-#ifndef MAGICKCORE_WMF_DELEGATE
-#define MAGICKCORE_WMF_DELEGATE 1
-#endif
+/* #undef WMF_DELEGATE */
 
 /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
    significant byte first (like Motorola and SPARC, unlike Intel). */
index bd545a154fbea3d273dbe6ba7b1ad9ab818b9b22..c787e45e32dbb04d144a9f205842ff16c301f2f2 100644 (file)
@@ -183,8 +183,8 @@ extern "C" {
 #define CombineImages  PrependMagickMethod(CombineImages)
 #define CompareHashmapStringInfo  PrependMagickMethod(CompareHashmapStringInfo)
 #define CompareHashmapString  PrependMagickMethod(CompareHashmapString)
-#define CompareImageChannels  PrependMagickMethod(CompareImageChannels)
-#define CompareImageLayers  PrependMagickMethod(CompareImageLayers)
+#define CompareImages  PrependMagickMethod(CompareImages)
+#define CompareImagesLayers  PrependMagickMethod(CompareImagesLayers)
 #define CompareImages  PrependMagickMethod(CompareImages)
 #define CompareSplayTreeStringInfo  PrependMagickMethod(CompareSplayTreeStringInfo)
 #define CompareSplayTreeString  PrependMagickMethod(CompareSplayTreeString)
@@ -421,8 +421,8 @@ extern "C" {
 #define GetImageAttribute  PrependMagickMethod(GetImageAttribute)
 #define GetImageBoundingBox  PrependMagickMethod(GetImageBoundingBox)
 #define GetImageDepth  PrependMagickMethod(GetImageDepth)
-#define GetImageChannelDistortion  PrependMagickMethod(GetImageChannelDistortion)
-#define GetImageChannelDistortions  PrependMagickMethod(GetImageChannelDistortions)
+#define GetImageDistortion  PrependMagickMethod(GetImageDistortion)
+#define GetImageDistortions  PrependMagickMethod(GetImageDistortions)
 #define GetImageChannelExtrema  PrependMagickMethod(GetImageChannelExtrema)
 #define GetImageChannelKurtosis  PrependMagickMethod(GetImageChannelKurtosis)
 #define GetImageChannelMean  PrependMagickMethod(GetImageChannelMean)
index 489215d7432294e24c7d8fcbe26f432e5f44346c..325615c30ffc13a098f4044f3bfc96ffaf925a26 100644 (file)
@@ -4435,32 +4435,26 @@ MagickExport MagickBooleanType IsFuzzyEquivalencePixelPacket(const Image *image,
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
 %  SetPixelComponentMap() sets the pixel component map from the specified
-%  string map.
+%  channel mask.
 %
 %  The format of the SetPixelComponentMap method is:
 %
-%      void SetPixelComponentMap(Image *image,const char *components)
+%      void SetPixelComponentMap(Image *image,const ChannelType channel)
 %
 %  A description of each parameter follows:
 %
 %    o image: the image.
 %
-%    o components: One or more pixel components separated by commas.
+%    o channel: the channel mask.
 %
 */
-MagickExport void SetPixelComponentMap(Image *image,const char *components)
+MagickExport void SetPixelComponentMap(Image *image,const ChannelType channel)
 {
   register ssize_t
     i;
 
-  ssize_t
-    channel;
-
   for (i=0; i < MaxPixelComponents; i++)
     image->component_map[i].traits=UndefinedPixelTrait;
-  channel=(ChannelType) ParseChannelOption(components);
-  if (channel < 0)
-    channel=DefaultChannels;
   image->sync=(channel & SyncChannels) != 0 ? MagickTrue : MagickFalse;
   if ((channel & RedChannel) != 0)
     SetPixelRedTraits(image,ActivePixelTrait);
index 523bb2ea99fe67de053046f664bccea9666fbc3b..b614ea9ae61ad373914ebb99bd8e35a0e57ecdd1 100644 (file)
@@ -160,7 +160,7 @@ extern MagickExport PixelInfo
 extern MagickExport void
   StandardPixelComponentMap(Image *),
   GetPixelInfo(const Image *,PixelInfo *),
-  SetPixelComponentMap(Image *,const char *);
+  SetPixelComponentMap(Image *,const ChannelType);
 
 #if defined(__cplusplus) || defined(c_plusplus)
 }
index 52875919c7a125a3b8e64e65e33d21dec533919f..aa2cfd8384f7d14737aa2b873d848a6e337f897f 100644 (file)
@@ -27,14 +27,14 @@ extern "C" {
 */
 #define MagickPackageName "ImageMagick"
 #define MagickCopyright  "Copyright (C) 1999-2011 ImageMagick Studio LLC"
-#define MagickSVNRevision  "exported"
+#define MagickSVNRevision  "4693"
 #define MagickLibVersion  0x700
 #define MagickLibVersionText  "7.0.0"
 #define MagickLibVersionNumber  5,0,0
 #define MagickLibAddendum  "-0"
 #define MagickLibInterface  5
 #define MagickLibMinInterface  5
-#define MagickReleaseDate  "2011-07-04"
+#define MagickReleaseDate  "2011-07-05"
 #define MagickChangeDate   "20110701"
 #define MagickAuthoritativeURL  "http://www.imagemagick.org"
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
index ad328ca1200e56cc895a5b8e1047cad4da4cb51f..18d29f8ea96c203d9ad03a5d2a32c2c87d81358c 100644 (file)
 %                                                                             %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
-%  CompareImageCommand() compares two images and returns the difference between
+%  CompareImagesCommand() compares two images and returns the difference between
 %  them as a distortion metric and as a new image visually annotating their
 %  differences.
 %
-%  The format of the CompareImageCommand method is:
+%  The format of the CompareImagesCommand method is:
 %
-%      MagickBooleanType CompareImageCommand(ImageInfo *image_info,int argc,
+%      MagickBooleanType CompareImagesCommand(ImageInfo *image_info,int argc,
 %        char **argv,char **metadata,ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
@@ -171,7 +171,7 @@ static MagickBooleanType CompareUsage(void)
   return(MagickFalse);
 }
 
-WandExport MagickBooleanType CompareImageCommand(ImageInfo *image_info,
+WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info,
   int argc,char **argv,char **metadata,ExceptionInfo *exception)
 {
 #define DefaultDissimilarityThreshold  0.31830988618379067154
@@ -209,9 +209,6 @@ WandExport MagickBooleanType CompareImageCommand(ImageInfo *image_info,
   const char
     *format;
 
-  ChannelType
-    channels;
-
   double
     dissimilarity_threshold,
     distortion,
@@ -273,7 +270,6 @@ WandExport MagickBooleanType CompareImageCommand(ImageInfo *image_info,
     }
   if (argc < 3)
     return(CompareUsage());
-  channels=CompositeChannels;
   difference_image=NewImageList();
   similarity_image=NewImageList();
   dissimilarity_threshold=DefaultDissimilarityThreshold;
@@ -397,7 +393,7 @@ WandExport MagickBooleanType CompareImageCommand(ImageInfo *image_info,
             if (channel < 0)
               ThrowCompareException(OptionError,"UnrecognizedChannelType",
                 argv[i]);
-            channels=(ChannelType) channel;
+            SetPixelComponentMap(image,(ChannelType) channel);
             break;
           }
         if (LocaleCompare("colorspace",option+1) == 0)
@@ -954,8 +950,8 @@ WandExport MagickBooleanType CompareImageCommand(ImageInfo *image_info,
     }
   if ((reconstruct_image->columns == image->columns) &&
       (reconstruct_image->rows == image->rows))
-    difference_image=CompareImageChannels(image,reconstruct_image,channels,
-      metric,&distortion,exception);
+    difference_image=CompareImages(image,reconstruct_image,metric,&distortion,
+      exception);
   else
     if (similarity_image == (Image *) NULL)
       ThrowCompareException(OptionError,"ImageWidthsOrHeightsDiffer",
@@ -970,14 +966,14 @@ WandExport MagickBooleanType CompareImageCommand(ImageInfo *image_info,
         */
         composite_image=CloneImage(image,0,0,MagickTrue,exception);
         if (composite_image == (Image *) NULL)
-          difference_image=CompareImageChannels(image,reconstruct_image,
-            channels,metric,&distortion,exception);
+          difference_image=CompareImages(image,reconstruct_image,metric,
+            &distortion,exception);
         else
           {
             (void) CompositeImage(composite_image,CopyCompositeOp,
               reconstruct_image,offset.x,offset.y);
-            difference_image=CompareImageChannels(image,composite_image,
-              channels,metric,&distortion,exception);
+            difference_image=CompareImages(image,composite_image,metric,
+              &distortion,exception);
             if (difference_image != (Image *) NULL)
               {
                 difference_image->page.x=offset.x;
@@ -1052,7 +1048,7 @@ WandExport MagickBooleanType CompareImageCommand(ImageInfo *image_info,
           double
             *channel_distortion;
 
-          channel_distortion=GetImageChannelDistortions(image,reconstruct_image,
+          channel_distortion=GetImageDistortions(image,reconstruct_image,
             metric,&image->exception);
           (void) FormatLocaleFile(stderr,"Image: %s\n",image->filename);
           if ((reconstruct_image->columns != image->columns) ||
index 6ec0b6e64029d41fc02a203cfa2e6fb6a83793eb..a698510e644c79ec8567b33cdb685b79160c5f20 100644 (file)
@@ -23,7 +23,7 @@ extern "C" {
 #endif
 
 extern WandExport MagickBooleanType
-  CompareImageCommand(ImageInfo *,int,char **,char **,ExceptionInfo *);
+  CompareImagesCommand(ImageInfo *,int,char **,char **,ExceptionInfo *);
 
 #if defined(__cplusplus) || defined(c_plusplus)
 }
index 110ff1bc33686ee046efbf37b1dbac5ed204cfca..5f7ce97cf7c03f0932122e3252ef2ae16bfd225d 100644 (file)
@@ -1760,76 +1760,19 @@ WandExport MagickBooleanType MagickCommentImage(MagickWand *wand,
 %                                                                             %
 %                                                                             %
 %                                                                             %
-%   M a g i c k C o m p a r e I m a g e C h a n n e l s                       %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  MagickCompareImageChannels() compares one or more image channels of an image
-%  to a reconstructed image and returns the difference image.
-%
-%  The format of the MagickCompareImageChannels method is:
-%
-%      MagickWand *MagickCompareImageChannels(MagickWand *wand,
-%        const MagickWand *reference,const ChannelType channel,
-%        const MetricType metric,double *distortion)
-%
-%  A description of each parameter follows:
-%
-%    o wand: the magick wand.
-%
-%    o reference: the reference wand.
-%
-%    o channel: the channel.
-%
-%    o metric: the metric.
-%
-%    o distortion: the computed distortion between the images.
-%
-*/
-WandExport MagickWand *MagickCompareImageChannels(MagickWand *wand,
-  const MagickWand *reference,const ChannelType channel,const MetricType metric,
-  double *distortion)
-{
-  Image
-    *compare_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) || (reference->images == (Image *) NULL))
-    {
-      (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
-        "ContainsNoImages","`%s'",wand->name);
-      return((MagickWand *) NULL);
-    }
-  compare_image=CompareImageChannels(wand->images,reference->images,channel,
-    metric,distortion,&wand->images->exception);
-  if (compare_image == (Image *) NULL)
-    return((MagickWand *) NULL);
-  return(CloneMagickWandFromImages(wand,compare_image));
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
 %   M a g i c k C o m p a r e I m a g e L a y e r s                           %
 %                                                                             %
 %                                                                             %
 %                                                                             %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
-%  MagickCompareImageLayers() compares each image with the next in a sequence
+%  MagickCompareImagesLayers() compares each image with the next in a sequence
 %  and returns the maximum bounding region of any pixel differences it
 %  discovers.
 %
-%  The format of the MagickCompareImageLayers method is:
+%  The format of the MagickCompareImagesLayers method is:
 %
-%      MagickWand *MagickCompareImageLayers(MagickWand *wand,
+%      MagickWand *MagickCompareImagesLayers(MagickWand *wand,
 %        const ImageLayerMethod method)
 %
 %  A description of each parameter follows:
@@ -1839,7 +1782,7 @@ WandExport MagickWand *MagickCompareImageChannels(MagickWand *wand,
 %    o method: the compare method.
 %
 */
-WandExport MagickWand *MagickCompareImageLayers(MagickWand *wand,
+WandExport MagickWand *MagickCompareImagesLayers(MagickWand *wand,
   const ImageLayerMethod method)
 {
   Image
@@ -1851,7 +1794,7 @@ WandExport MagickWand *MagickCompareImageLayers(MagickWand *wand,
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   if (wand->images == (Image *) NULL)
     return((MagickWand *) NULL);
-  layers_image=CompareImageLayers(wand->images,method,wand->exception);
+  layers_image=CompareImagesLayers(wand->images,method,wand->exception);
   if (layers_image == (Image *) NULL)
     return((MagickWand *) NULL);
   return(CloneMagickWandFromImages(wand,layers_image));
@@ -2409,7 +2352,7 @@ WandExport MagickWand *MagickDeconstructImages(MagickWand *wand)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   if (wand->images == (Image *) NULL)
     return((MagickWand *) NULL);
-  deconstruct_image=CompareImageLayers(wand->images,CompareAnyLayer,
+  deconstruct_image=CompareImagesLayers(wand->images,CompareAnyLayer,
     wand->exception);
   if (deconstruct_image == (Image *) NULL)
     return((MagickWand *) NULL);
@@ -4161,112 +4104,6 @@ WandExport MagickBooleanType MagickGetImageBorderColor(MagickWand *wand,
 %                                                                             %
 %                                                                             %
 %                                                                             %
-%   M a g i c k G e t I m a g e C h a n n e l D i s t o r t i o n             %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  MagickGetImageChannelDistortion() compares one or more image channels of an
-%  image to a reconstructed image and returns the specified distortion metric.
-%
-%  The format of the MagickGetImageChannelDistortion method is:
-%
-%      MagickBooleanType MagickGetImageChannelDistortion(MagickWand *wand,
-%        const MagickWand *reference,const ChannelType channel,
-%        const MetricType metric,double *distortion)
-%
-%  A description of each parameter follows:
-%
-%    o wand: the magick wand.
-%
-%    o reference: the reference wand.
-%
-%    o channel: the channel.
-%
-%    o metric: the metric.
-%
-%    o distortion: the computed distortion between the images.
-%
-*/
-WandExport MagickBooleanType MagickGetImageChannelDistortion(MagickWand *wand,
-  const MagickWand *reference,const ChannelType channel,const MetricType metric,
-  double *distortion)
-{
-  MagickBooleanType
-    status;
-
-  assert(wand != (MagickWand *) NULL);
-  assert(wand->signature == WandSignature);
-  if (wand->debug != MagickFalse)
-    (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  assert(reference != (MagickWand *) NULL);
-  assert(reference->signature == WandSignature);
-  if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
-    ThrowWandException(WandError,"ContainsNoImages",wand->name);
-  status=GetImageChannelDistortion(wand->images,reference->images,channel,
-    metric,distortion,&wand->images->exception);
-  return(status);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%   M a g i c k G e t I m a g e C h a n n e l D i s t o r t i o n s           %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  MagickGetImageChannelDistortions() compares one or more image channels of an
-%  image to a reconstructed image and returns the specified distortion metrics.
-%
-%  Use MagickRelinquishMemory() to free the metrics when you are done with them.
-%
-%  The format of the MagickGetImageChannelDistortion method is:
-%
-%      double *MagickGetImageChannelDistortion(MagickWand *wand,
-%        const MagickWand *reference,const MetricType metric)
-%
-%  A description of each parameter follows:
-%
-%    o wand: the magick wand.
-%
-%    o reference: the reference wand.
-%
-%    o metric: the metric.
-%
-*/
-WandExport double *MagickGetImageChannelDistortions(MagickWand *wand,
-  const MagickWand *reference,const MetricType metric)
-{
-  double
-    *channel_distortion;
-
-  assert(wand != (MagickWand *) NULL);
-  assert(wand->signature == WandSignature);
-  if (wand->debug != MagickFalse)
-    (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  assert(reference != (MagickWand *) NULL);
-  assert(reference->signature == WandSignature);
-  if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
-    {
-      (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
-        "ContainsNoImages","`%s'",wand->name);
-      return((double *) NULL);
-    }
-  channel_distortion=GetImageChannelDistortions(wand->images,reference->images,
-    metric,&wand->images->exception);
-  return(channel_distortion);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
 %   M a g i c k G e t I m a g e C h a n n e l F e a t u r e s                 %
 %                                                                             %
 %                                                                             %
@@ -4806,6 +4643,43 @@ WandExport size_t MagickGetImageDepth(MagickWand *wand)
 %                                                                             %
 %                                                                             %
 %                                                                             %
+%   M a g i c k G e t I m a g e D i s p o s e                                 %
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  MagickGetImageDispose() gets the image disposal method.
+%
+%  The format of the MagickGetImageDispose method is:
+%
+%      DisposeType MagickGetImageDispose(MagickWand *wand)
+%
+%  A description of each parameter follows:
+%
+%    o wand: the magick wand.
+%
+*/
+WandExport DisposeType MagickGetImageDispose(MagickWand *wand)
+{
+  assert(wand != (MagickWand *) NULL);
+  assert(wand->signature == WandSignature);
+  if (wand->debug != MagickFalse)
+    (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
+  if (wand->images == (Image *) NULL)
+    {
+      (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
+        "ContainsNoImages","`%s'",wand->name);
+      return(UndefinedDispose);
+    }
+  return((DisposeType) wand->images->dispose);
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
 %   M a g i c k G e t I m a g e D i s t o r t i o n                           %
 %                                                                             %
 %                                                                             %
@@ -4838,7 +4712,6 @@ WandExport MagickBooleanType MagickGetImageDistortion(MagickWand *wand,
   MagickBooleanType
     status;
 
-
   assert(wand != (MagickWand *) NULL);
   assert(wand->signature == WandSignature);
   if (wand->debug != MagickFalse)
@@ -4855,36 +4728,52 @@ WandExport MagickBooleanType MagickGetImageDistortion(MagickWand *wand,
 %                                                                             %
 %                                                                             %
 %                                                                             %
-%   M a g i c k G e t I m a g e D i s p o s e                                 %
+%   M a g i c k G e t I m a g e D i s t o r t i o n s                         %
 %                                                                             %
 %                                                                             %
 %                                                                             %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
-%  MagickGetImageDispose() gets the image disposal method.
+%  MagickGetImageDistortions() compares one or more pixel channels of an
+%  image to a reconstructed image and returns the specified distortion metrics.
 %
-%  The format of the MagickGetImageDispose method is:
+%  Use MagickRelinquishMemory() to free the metrics when you are done with them.
 %
-%      DisposeType MagickGetImageDispose(MagickWand *wand)
+%  The format of the MagickGetImageDistortion method is:
+%
+%      double *MagickGetImageDistortion(MagickWand *wand,
+%        const MagickWand *reference,const MetricType metric)
 %
 %  A description of each parameter follows:
 %
 %    o wand: the magick wand.
 %
+%    o reference: the reference wand.
+%
+%    o metric: the metric.
+%
 */
-WandExport DisposeType MagickGetImageDispose(MagickWand *wand)
+WandExport double *MagickGetImageDistortions(MagickWand *wand,
+  const MagickWand *reference,const MetricType metric)
 {
+  double
+    *channel_distortion;
+
   assert(wand != (MagickWand *) NULL);
   assert(wand->signature == WandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  if (wand->images == (Image *) NULL)
+  assert(reference != (MagickWand *) NULL);
+  assert(reference->signature == WandSignature);
+  if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL))
     {
       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
         "ContainsNoImages","`%s'",wand->name);
-      return(UndefinedDispose);
+      return((double *) NULL);
     }
-  return((DisposeType) wand->images->dispose);
+  channel_distortion=GetImageDistortions(wand->images,reference->images,
+    metric,&wand->images->exception);
+  return(channel_distortion);
 }
 \f
 /*
index 07f0ebc7234172997813d0c526909cf43f47e974..ee0719d91bca20b9d934fda1bd35721a8d726b0a 100644 (file)
@@ -48,7 +48,7 @@ extern WandExport DisposeType
   MagickGetImageDispose(MagickWand *);
 
 extern WandExport double
-  *MagickGetImageChannelDistortions(MagickWand *,const MagickWand *,
+  *MagickGetImageDistortions(MagickWand *,const MagickWand *,
     const MetricType),
   MagickGetImageFuzz(MagickWand *),
   MagickGetImageGamma(MagickWand *),
@@ -172,8 +172,6 @@ extern WandExport MagickBooleanType
   MagickGetImageBackgroundColor(MagickWand *,PixelWand *),
   MagickGetImageBluePrimary(MagickWand *,double *,double *),
   MagickGetImageBorderColor(MagickWand *,PixelWand *),
-  MagickGetImageChannelDistortion(MagickWand *,const MagickWand *,
-    const ChannelType,const MetricType,double *),
   MagickGetImageChannelKurtosis(MagickWand *,const ChannelType,double *,
     double *),
   MagickGetImageChannelMean(MagickWand *,const ChannelType,double *,double *),
@@ -373,11 +371,9 @@ extern WandExport MagickWand
   *MagickAppendImages(MagickWand *,const MagickBooleanType),
   *MagickCoalesceImages(MagickWand *),
   *MagickCombineImages(MagickWand *,const ChannelType),
-  *MagickCompareImageChannels(MagickWand *,const MagickWand *,const ChannelType,
-    const MetricType,double *),
   *MagickCompareImages(MagickWand *,const MagickWand *,const MetricType,
     double *),
-  *MagickCompareImageLayers(MagickWand *,const ImageLayerMethod),
+  *MagickCompareImagesLayers(MagickWand *,const ImageLayerMethod),
   *MagickDeconstructImages(MagickWand *),
   *MagickEvaluateImages(MagickWand *,const MagickEvaluateOperator),
   *MagickFxImage(MagickWand *,const char *),
index 47843430868272abc0950db526bf9bd463503628..aa29b8914602e65874d2cef1dbd1542f16798560 100644 (file)
@@ -84,7 +84,7 @@
 %    o image_info: the image info.
 %
 %    o command: Choose from ConvertImageCommand, IdentifyImageCommand,
-%      MogrifyImageCommand, CompositeImageCommand, CompareImageCommand,
+%      MogrifyImageCommand, CompositeImageCommand, CompareImagesCommand,
 %      ConjureImageCommand, StreamImageCommand, ImportImageCommand,
 %      DisplayImageCommand, or AnimateImageCommand.
 %
@@ -978,7 +978,7 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc,
               channel=DefaultChannels;
             else
               channel=(ChannelType) ParseChannelOption(argv[i+1]);
-            SetPixelComponentMap(*image,argv[i+1]);
+            SetPixelComponentMap(*image,channel);
             break;
           }
         if (LocaleCompare("charcoal",option+1) == 0)
@@ -7503,7 +7503,7 @@ This has been merged completely into MogrifyImage()
               *deconstruct_image;
 
             (void) SyncImagesSettings(mogrify_info,*images);
-            deconstruct_image=CompareImageLayers(*images,CompareAnyLayer,
+            deconstruct_image=CompareImagesLayers(*images,CompareAnyLayer,
               exception);
             if (deconstruct_image == (Image *) NULL)
               {
@@ -7760,7 +7760,7 @@ This has been merged completely into MogrifyImage()
               case CompareOverlayLayer:
               default:
               {
-                layers=CompareImageLayers(*images,method,exception);
+                layers=CompareImagesLayers(*images,method,exception);
                 break;
               }
               case MergeLayer:
index 91d00da717960673ef353ebc42b9dee1e46332e7..a07b4358478583110fbe9da12911240edec91826 100644 (file)
@@ -3065,7 +3065,7 @@ void
 Compare(ref,...)
   Image::Magick ref=NO_INIT
   ALIAS:
-    CompareImage = 1
+    CompareImages = 1
     compare      = 2
     compareimage = 3
   PPCODE:
@@ -3076,9 +3076,6 @@ Compare(ref,...)
     char
       *attribute;
 
-    ChannelType
-      channel;
-
     double
       distortion;
 
@@ -3141,7 +3138,6 @@ Compare(ref,...)
     /*
       Get attribute.
     */
-    channel=DefaultChannels;
     reconstruct_image=image;
     metric=RootMeanSquaredErrorMetric;
     for (i=2; i < items; i+=2)
@@ -3164,7 +3160,7 @@ Compare(ref,...)
                     "UnrecognizedType",SvPV(ST(i),na));
                   return;
                 }
-              channel=(ChannelType) option;
+              SetPixelComponentMap(image,(ChannelType) option);
               break;
             }
           ThrowPerlException(exception,OptionError,"UnrecognizedAttribute",
@@ -3224,8 +3220,8 @@ Compare(ref,...)
         }
       }
     }
-    difference_image=CompareImageChannels(image,reconstruct_image,channel,
-      metric,&distortion,exception);
+    difference_image=CompareImages(image,reconstruct_image,metric,&distortion,
+      exception);
     if (difference_image != (Image *) NULL)
       {
         difference_image->error.mean_error_per_pixel=distortion;
@@ -3264,7 +3260,7 @@ void
 CompareLayers(ref)
   Image::Magick ref=NO_INIT
   ALIAS:
-    CompareImageLayers   = 1
+    CompareImagesLayers   = 1
     comparelayers        = 2
     compareimagelayers   = 3
   PPCODE:
@@ -3360,7 +3356,7 @@ CompareLayers(ref)
         }
       }
     }
-    image=CompareImageLayers(image,method,exception);
+    image=CompareImagesLayers(image,method,exception);
     if ((image == (Image *) NULL) || (exception->severity >= ErrorException))
       goto PerlException;
     for ( ; image; image=image->next)
@@ -6048,9 +6044,6 @@ GetPixel(ref,...)
     char
       *attribute;
 
-    ChannelType
-      channel;
-
     ExceptionInfo
       *exception;
 
@@ -6094,7 +6087,6 @@ GetPixel(ref,...)
           PackageName);
         goto PerlException;
       }
-    channel=DefaultChannels;
     normalize=MagickTrue;
     region.x=0;
     region.y=0;
@@ -6122,7 +6114,7 @@ GetPixel(ref,...)
                     SvPV(ST(i),na));
                   return;
                 }
-               channel=(ChannelType) option;
+              SetPixelComponentMap(image,(ChannelType) option);
               break;
             }
           ThrowPerlException(exception,OptionError,"UnrecognizedAttribute",
@@ -6725,7 +6717,7 @@ Layers(ref,...)
       case CompareOverlayLayer:
       default:
       {
-        layers=CompareImageLayers(image,method,exception);
+        layers=CompareImagesLayers(image,method,exception);
         break;
       }
       case MergeLayer:
@@ -8720,7 +8712,7 @@ Mogrify(ref,...)
           invert=MagickFalse;
           if (attribute_flag[6] != 0)
             invert=(MagickBooleanType) argument_list[6].integer_reference;
-          SetPixelComponentMap(image,"alpha");
+          SetPixelComponentMap(image,AlphaChannel);
           (void) FloodfillPaintImage(image,AlphaChannel,draw_info,&target,
             geometry.x,geometry.y,invert);
           StandardPixelComponentMap(image);
@@ -9082,7 +9074,7 @@ Mogrify(ref,...)
         }
         case 65:  /* Deconstruct */
         {
-          image=CompareImageLayers(image,CompareAnyLayer,exception);
+          image=CompareImagesLayers(image,CompareAnyLayer,exception);
           break;
         }
         case 66:  /* GaussianBlur */
index 6c115378b1f276df94e1e798b98d6c03feb8780f..a52548649defb6a4290934d90fdb96ba02983121 100644 (file)
@@ -11,7 +11,7 @@
   <configure name="LIB_VERSION" value="0x700"/>
   <configure name="LIB_VERSION_NUMBER" value="7,0,0,0"/>
   <configure name="SVN_REVISION" value="4693" />
-  <configure name="RELEASE_DATE" value="2011-07-02"/>
+  <configure name="RELEASE_DATE" value="2011-07-05"/>
   <configure name="CONFIGURE" value="./configure "/>
   <configure name="PREFIX" value="/usr/local"/>
   <configure name="EXEC-PREFIX" value="/usr/local"/>
index cd3d9472840dc4de9288b493fdcc780fc72fd66e..e414d26611dae8bef9448700dbf4183c0d9819a9 100644 (file)
@@ -120,7 +120,7 @@ static size_t ValidateCompareCommand(ImageInfo *image_info,
         (*fail)++;
         continue;
       }
-    status=CompareImageCommand(image_info,number_arguments,arguments,
+    status=CompareImagesCommand(image_info,number_arguments,arguments,
       (char **) NULL,exception);
     for (j=0; j < number_arguments; j++)
       arguments[j]=DestroyString(arguments[j]);
@@ -612,7 +612,7 @@ static size_t ValidateImageFormatsInMemory(ImageInfo *image_info,
       if (reference_image->colorspace != RGBColorspace)
         fuzz+=0.3;
       fuzz+=MagickEpsilon;
-      difference_image=CompareImageChannels(reference_image,reconstruct_image,
+      difference_image=CompareImages(reference_image,reconstruct_image,
         CompositeChannels,MeanSquaredErrorMetric,&distortion,exception);
       reconstruct_image=DestroyImage(reconstruct_image);
       reference_image=DestroyImage(reference_image);
@@ -828,7 +828,7 @@ static size_t ValidateImageFormatsOnDisk(ImageInfo *image_info,
       if (reference_image->colorspace != RGBColorspace)
         fuzz+=0.3;
       fuzz+=MagickEpsilon;
-      difference_image=CompareImageChannels(reference_image,reconstruct_image,
+      difference_image=CompareImages(reference_image,reconstruct_image,
         CompositeChannels,MeanSquaredErrorMetric,&distortion,exception);
       reconstruct_image=DestroyImage(reconstruct_image);
       reference_image=DestroyImage(reference_image);
@@ -1006,7 +1006,7 @@ static size_t ValidateImportExportPixels(ImageInfo *image_info,
       /*
         Compare reference to reconstruct image.
       */
-      difference_image=CompareImageChannels(reference_image,reconstruct_image,
+      difference_image=CompareImages(reference_image,reconstruct_image,
         CompositeChannels,MeanSquaredErrorMetric,&distortion,exception);
       reconstruct_image=DestroyImage(reconstruct_image);
       reference_image=DestroyImage(reference_image);
index 403ff36da6d1d29ee3d29a5c539c9c8e5e824b9c..32af5da115569ac13a1a04cb8eddb0e120adb9b5 100644 (file)
@@ -76,7 +76,7 @@ int main(int argc,char **argv)
   exception=AcquireExceptionInfo();
   image_info=AcquireImageInfo();
   metadata=(char *) NULL;
-  status=MagickCommandGenesis(image_info,CompareImageCommand,argc,argv,
+  status=MagickCommandGenesis(image_info,CompareImagesCommand,argc,argv,
     &metadata,exception);
   if (metadata != (char *) NULL)
     metadata=DestroyString(metadata);