]> granicus.if.org Git - imagemagick/blobdiff - MagickCore/fourier.c
(no commit message)
[imagemagick] / MagickCore / fourier.c
index b7fbf67679b6a470d7cc058988213d599096a5e0..06906635762a893379566e85be9ebe0759ea2253 100644 (file)
@@ -19,7 +19,7 @@
 %                                 July 2009                                   %
 %                                                                             %
 %                                                                             %
-%  Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization      %
+%  Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization      %
 %  dedicated to making software imaging solutions freely available.           %
 %                                                                             %
 %  You may not use this file except in compliance with the License.  You may  %
@@ -55,6 +55,7 @@
 #include "MagickCore/pixel-accessor.h"
 #include "MagickCore/property.h"
 #include "MagickCore/quantum-private.h"
+#include "MagickCore/resource_.h"
 #include "MagickCore/thread-private.h"
 #if defined(MAGICKCORE_FFTW_DELEGATE)
 #if defined(MAGICKCORE_HAVE_COMPLEX_H)
@@ -80,7 +81,7 @@
 */
 typedef struct _FourierInfo
 {
-  ChannelType
+  PixelChannel
     channel;
 
   MagickBooleanType
@@ -249,7 +250,7 @@ static MagickBooleanType ForwardFourier(const FourierInfo *fourier_info,
   if (phase_image == (Image *) NULL)
     {
       (void) ThrowMagickException(exception,GetMagickModule(),ImageError,
-        "ImageSequenceRequired","`%s'",image->filename);
+        "TwoOrMoreImagesRequired","'%s'",image->filename);
       return(MagickFalse);
     }
   /*
@@ -266,7 +267,7 @@ static MagickBooleanType ForwardFourier(const FourierInfo *fourier_info,
   if (phase_source == (double *) NULL)
     {
       (void) ThrowMagickException(exception,GetMagickModule(),
-        ResourceLimitError,"MemoryAllocationFailed","`%s'",image->filename);
+        ResourceLimitError,"MemoryAllocationFailed","'%s'",image->filename);
       magnitude_source=(double *) RelinquishMagickMemory(magnitude_source);
       return(MagickFalse);
     }
@@ -287,56 +288,49 @@ static MagickBooleanType ForwardFourier(const FourierInfo *fourier_info,
           i++;
         }
     }
-  magnitude_view=AcquireCacheView(magnitude_image);
-  phase_view=AcquireCacheView(phase_image);
+  magnitude_view=AcquireAuthenticCacheView(magnitude_image,exception);
   i=0L;
   for (y=0L; y < (ssize_t) fourier_info->height; y++)
   {
     q=GetCacheViewAuthenticPixels(magnitude_view,0L,y,fourier_info->height,1UL,
       exception);
-    if (q == (const Quantum *) NULL)
+    if (q == (Quantum *) NULL)
       break;
     for (x=0L; x < (ssize_t) fourier_info->width; x++)
     {
       switch (fourier_info->channel)
       {
-        case RedChannel:
+        case RedPixelChannel:
         default:
         {
           SetPixelRed(magnitude_image,ClampToQuantum(QuantumRange*
             magnitude_source[i]),q);
           break;
         }
-        case GreenChannel:
+        case GreenPixelChannel:
         {
           SetPixelGreen(magnitude_image,ClampToQuantum(QuantumRange*
             magnitude_source[i]),q);
           break;
         }
-        case BlueChannel:
+        case BluePixelChannel:
         {
           SetPixelBlue(magnitude_image,ClampToQuantum(QuantumRange*
             magnitude_source[i]),q);
           break;
         }
-        case BlackChannel:
+        case BlackPixelChannel:
         {
           SetPixelBlack(magnitude_image,ClampToQuantum(QuantumRange*
             magnitude_source[i]),q);
           break;
         }
-        case AlphaChannel:
+        case AlphaPixelChannel:
         {
           SetPixelAlpha(magnitude_image,ClampToQuantum(QuantumRange*
             magnitude_source[i]),q);
           break;
         }
-        case GrayChannels:
-        {
-          SetPixelGray(magnitude_image,ClampToQuantum(QuantumRange*
-            magnitude_source[i]),q);
-          break;
-        }
       }
       i++;
       q+=GetPixelChannels(magnitude_image);
@@ -345,54 +339,50 @@ static MagickBooleanType ForwardFourier(const FourierInfo *fourier_info,
     if (status == MagickFalse)
       break;
   }
+  magnitude_view=DestroyCacheView(magnitude_view);
   i=0L;
+  phase_view=AcquireAuthenticCacheView(phase_image,exception);
   for (y=0L; y < (ssize_t) fourier_info->height; y++)
   {
     q=GetCacheViewAuthenticPixels(phase_view,0L,y,fourier_info->height,1UL,
       exception);
-    if (q == (const Quantum *) NULL)
+    if (q == (Quantum *) NULL)
       break;
     for (x=0L; x < (ssize_t) fourier_info->width; x++)
     {
       switch (fourier_info->channel)
       {
-        case RedChannel:
+        case RedPixelChannel:
         default:
         {
           SetPixelRed(phase_image,ClampToQuantum(QuantumRange*
             phase_source[i]),q);
           break;
         }
-        case GreenChannel:
+        case GreenPixelChannel:
         {
           SetPixelGreen(phase_image,ClampToQuantum(QuantumRange*
             phase_source[i]),q);
           break;
         }
-        case BlueChannel:
+        case BluePixelChannel:
         {
           SetPixelBlue(phase_image,ClampToQuantum(QuantumRange*
             phase_source[i]),q);
           break;
         }
-        case BlackChannel:
+        case BlackPixelChannel:
         {
           SetPixelBlack(phase_image,ClampToQuantum(QuantumRange*
             phase_source[i]),q);
           break;
         }
-        case AlphaChannel:
+        case AlphaPixelChannel:
         {
           SetPixelAlpha(phase_image,ClampToQuantum(QuantumRange*
             phase_source[i]),q);
           break;
         }
-        case GrayChannels:
-        {
-          SetPixelGray(phase_image,ClampToQuantum(QuantumRange*
-            phase_source[i]),q);
-          break;
-        }
       }
       i++;
       q+=GetPixelChannels(phase_image);
@@ -402,7 +392,6 @@ static MagickBooleanType ForwardFourier(const FourierInfo *fourier_info,
       break;
    }
   phase_view=DestroyCacheView(phase_view);
-  magnitude_view=DestroyCacheView(magnitude_view);
   phase_source=(double *) RelinquishMagickMemory(phase_source);
   magnitude_source=(double *) RelinquishMagickMemory(magnitude_source);
   return(status);
@@ -442,13 +431,13 @@ static MagickBooleanType ForwardFourierTransform(FourierInfo *fourier_info,
   if (source == (double *) NULL)
     {
       (void) ThrowMagickException(exception,GetMagickModule(),
-        ResourceLimitError,"MemoryAllocationFailed","`%s'",image->filename);
+        ResourceLimitError,"MemoryAllocationFailed","'%s'",image->filename);
       return(MagickFalse);
     }
   ResetMagickMemory(source,0,fourier_info->height*fourier_info->width*
     sizeof(*source));
   i=0L;
-  image_view=AcquireCacheView(image);
+  image_view=AcquireVirtualCacheView(image,exception);
   for (y=0L; y < (ssize_t) fourier_info->height; y++)
   {
     p=GetCacheViewVirtualPixels(image_view,0L,y,fourier_info->width,1UL,
@@ -459,37 +448,32 @@ static MagickBooleanType ForwardFourierTransform(FourierInfo *fourier_info,
     {
       switch (fourier_info->channel)
       {
-        case RedChannel:
+        case RedPixelChannel:
         default:
         {
           source[i]=QuantumScale*GetPixelRed(image,p);
           break;
         }
-        case GreenChannel:
+        case GreenPixelChannel:
         {
           source[i]=QuantumScale*GetPixelGreen(image,p);
           break;
         }
-        case BlueChannel:
+        case BluePixelChannel:
         {
           source[i]=QuantumScale*GetPixelBlue(image,p);
           break;
         }
-        case BlackChannel:
+        case BlackPixelChannel:
         {
           source[i]=QuantumScale*GetPixelBlack(image,p);
           break;
         }
-        case AlphaChannel:
+        case AlphaPixelChannel:
         {
           source[i]=QuantumScale*GetPixelAlpha(image,p);
           break;
         }
-        case GrayChannels:
-        {
-          source[i]=QuantumScale*GetPixelGray(image,p);
-          break;
-        }
       }
       i++;
       p+=GetPixelChannels(image);
@@ -501,7 +485,7 @@ static MagickBooleanType ForwardFourierTransform(FourierInfo *fourier_info,
   if (fourier == (fftw_complex *) NULL)
     {
       (void) ThrowMagickException(exception,GetMagickModule(),
-        ResourceLimitError,"MemoryAllocationFailed","`%s'",image->filename);
+        ResourceLimitError,"MemoryAllocationFailed","'%s'",image->filename);
       source=(double *) RelinquishMagickMemory(source);
       return(MagickFalse);
     }
@@ -554,7 +538,7 @@ static MagickBooleanType ForwardFourierTransform(FourierInfo *fourier_info,
 }
 
 static MagickBooleanType ForwardFourierTransformChannel(const Image *image,
-  const ChannelType channel,const MagickBooleanType modulus,
+  const PixelChannel channel,const MagickBooleanType modulus,
   Image *fourier_image,ExceptionInfo *exception)
 {
   double
@@ -581,7 +565,7 @@ static MagickBooleanType ForwardFourierTransformChannel(const Image *image,
       fourier_info.width=(extent & 0x01) == 1 ? extent+1UL : extent;
     }
   fourier_info.height=fourier_info.width;
-  fourier_info.center=(ssize_t) floor((double) fourier_info.width/2.0)+1L;
+  fourier_info.center=(ssize_t) floor((double) fourier_info.width/2L)+1L;
   fourier_info.channel=channel;
   fourier_info.modulus=modulus;
   magnitude=(double *) AcquireQuantumMemory((size_t) fourier_info.height,
@@ -589,7 +573,7 @@ static MagickBooleanType ForwardFourierTransformChannel(const Image *image,
   if (magnitude == (double *) NULL)
     {
       (void) ThrowMagickException(exception,GetMagickModule(),
-        ResourceLimitError,"MemoryAllocationFailed","`%s'",image->filename);
+        ResourceLimitError,"MemoryAllocationFailed","'%s'",image->filename);
       return(MagickFalse);
     }
   phase=(double *) AcquireQuantumMemory((size_t) fourier_info.height,
@@ -597,7 +581,7 @@ static MagickBooleanType ForwardFourierTransformChannel(const Image *image,
   if (phase == (double *) NULL)
     {
       (void) ThrowMagickException(exception,GetMagickModule(),
-        ResourceLimitError,"MemoryAllocationFailed","`%s'",image->filename);
+        ResourceLimitError,"MemoryAllocationFailed","'%s'",image->filename);
       magnitude=(double *) RelinquishMagickMemory(magnitude);
       return(MagickFalse);
     }
@@ -606,7 +590,7 @@ static MagickBooleanType ForwardFourierTransformChannel(const Image *image,
   if (fourier == (fftw_complex *) NULL)
     {
       (void) ThrowMagickException(exception,GetMagickModule(),
-        ResourceLimitError,"MemoryAllocationFailed","`%s'",image->filename);
+        ResourceLimitError,"MemoryAllocationFailed","'%s'",image->filename);
       phase=(double *) RelinquishMagickMemory(phase);
       magnitude=(double *) RelinquishMagickMemory(magnitude);
       return(MagickFalse);
@@ -632,7 +616,7 @@ MagickExport Image *ForwardFourierTransformImage(const Image *image,
 #if !defined(MAGICKCORE_FFTW_DELEGATE)
   (void) modulus;
   (void) ThrowMagickException(exception,GetMagickModule(),
-    MissingDelegateWarning,"DelegateLibrarySupportNotBuiltIn","`%s' (FFTW)",
+    MissingDelegateWarning,"DelegateLibrarySupportNotBuiltIn","'%s' (FFTW)",
     image->filename);
 #else
   {
@@ -674,7 +658,7 @@ MagickExport Image *ForwardFourierTransformImage(const Image *image,
             status=MagickTrue;
             is_gray=IsImageGray(image,exception);
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
-  #pragma omp parallel sections
+            #pragma omp parallel sections
 #endif
             {
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
@@ -686,10 +670,10 @@ MagickExport Image *ForwardFourierTransformImage(const Image *image,
 
                 if (is_gray != MagickFalse)
                   thread_status=ForwardFourierTransformChannel(image,
-                    GrayChannels,modulus,fourier_image,exception);
+                    GrayPixelChannel,modulus,fourier_image,exception);
                 else
                   thread_status=ForwardFourierTransformChannel(image,
-                    RedChannel,modulus,fourier_image,exception);
+                    RedPixelChannel,modulus,fourier_image,exception);
                 if (thread_status == MagickFalse)
                   status=thread_status;
               }
@@ -703,7 +687,7 @@ MagickExport Image *ForwardFourierTransformImage(const Image *image,
                 thread_status=MagickTrue;
                 if (is_gray == MagickFalse)
                   thread_status=ForwardFourierTransformChannel(image,
-                    GreenChannel,modulus,fourier_image,exception);
+                    GreenPixelChannel,modulus,fourier_image,exception);
                 if (thread_status == MagickFalse)
                   status=thread_status;
               }
@@ -717,7 +701,7 @@ MagickExport Image *ForwardFourierTransformImage(const Image *image,
                 thread_status=MagickTrue;
                 if (is_gray == MagickFalse)
                   thread_status=ForwardFourierTransformChannel(image,
-                    BlueChannel,modulus,fourier_image,exception);
+                    BluePixelChannel,modulus,fourier_image,exception);
                 if (thread_status == MagickFalse)
                   status=thread_status;
               }
@@ -731,7 +715,7 @@ MagickExport Image *ForwardFourierTransformImage(const Image *image,
                 thread_status=MagickTrue;
                 if (image->colorspace == CMYKColorspace)
                   thread_status=ForwardFourierTransformChannel(image,
-                    BlackChannel,modulus,fourier_image,exception);
+                    BlackPixelChannel,modulus,fourier_image,exception);
                 if (thread_status == MagickFalse)
                   status=thread_status;
               }
@@ -745,7 +729,7 @@ MagickExport Image *ForwardFourierTransformImage(const Image *image,
                 thread_status=MagickTrue;
                 if (image->matte != MagickFalse)
                   thread_status=ForwardFourierTransformChannel(image,
-                    AlphaChannel,modulus,fourier_image,exception);
+                    AlphaPixelChannel,modulus,fourier_image,exception);
                 if (thread_status == MagickFalse)
                   status=thread_status;
               }
@@ -808,7 +792,7 @@ static MagickBooleanType InverseQuadrantSwap(const size_t width,
   /*
     Swap quadrants.
   */
-  center=(ssize_t) floor((double) width/2.0)+1L;
+  center=(ssize_t) floor((double) width/2L)+1L;
   for (y=1L; y < (ssize_t) height; y++)
     for (x=0L; x < (ssize_t) (width/2L+1L); x++)
       destination[center*(height-y)-x+width/2L]=source[y*width+x];
@@ -854,7 +838,7 @@ static MagickBooleanType InverseFourier(FourierInfo *fourier_info,
   if (magnitude_source == (double *) NULL)
     {
       (void) ThrowMagickException(exception,GetMagickModule(),
-        ResourceLimitError,"MemoryAllocationFailed","`%s'",
+        ResourceLimitError,"MemoryAllocationFailed","'%s'",
         magnitude_image->filename);
       return(MagickFalse);
     }
@@ -863,13 +847,13 @@ static MagickBooleanType InverseFourier(FourierInfo *fourier_info,
   if (phase_source == (double *) NULL)
     {
       (void) ThrowMagickException(exception,GetMagickModule(),
-        ResourceLimitError,"MemoryAllocationFailed","`%s'",
+        ResourceLimitError,"MemoryAllocationFailed","'%s'",
         magnitude_image->filename);
       magnitude_source=(double *) RelinquishMagickMemory(magnitude_source);
       return(MagickFalse);
     }
   i=0L;
-  magnitude_view=AcquireCacheView(magnitude_image);
+  magnitude_view=AcquireVirtualCacheView(magnitude_image,exception);
   for (y=0L; y < (ssize_t) fourier_info->height; y++)
   {
     p=GetCacheViewVirtualPixels(magnitude_view,0L,y,fourier_info->width,1UL,
@@ -880,44 +864,39 @@ static MagickBooleanType InverseFourier(FourierInfo *fourier_info,
     {
       switch (fourier_info->channel)
       {
-        case RedChannel:
+        case RedPixelChannel:
         default:
         {
           magnitude_source[i]=QuantumScale*GetPixelRed(magnitude_image,p);
           break;
         }
-        case GreenChannel:
+        case GreenPixelChannel:
         {
           magnitude_source[i]=QuantumScale*GetPixelGreen(magnitude_image,p);
           break;
         }
-        case BlueChannel:
+        case BluePixelChannel:
         {
           magnitude_source[i]=QuantumScale*GetPixelBlue(magnitude_image,p);
           break;
         }
-        case BlackChannel:
+        case BlackPixelChannel:
         {
           magnitude_source[i]=QuantumScale*GetPixelBlack(magnitude_image,p);
           break;
         }
-        case AlphaChannel:
+        case AlphaPixelChannel:
         {
           magnitude_source[i]=QuantumScale*GetPixelAlpha(magnitude_image,p);
           break;
         }
-        case GrayChannels:
-        {
-          magnitude_source[i]=QuantumScale*GetPixelGray(magnitude_image,p);
-          break;
-        }
       }
       i++;
       p+=GetPixelChannels(magnitude_image);
     }
   }
   i=0L;
-  phase_view=AcquireCacheView(phase_image);
+  phase_view=AcquireVirtualCacheView(phase_image,exception);
   for (y=0L; y < (ssize_t) fourier_info->height; y++)
   {
     p=GetCacheViewVirtualPixels(phase_view,0,y,fourier_info->width,1,
@@ -928,37 +907,32 @@ static MagickBooleanType InverseFourier(FourierInfo *fourier_info,
     {
       switch (fourier_info->channel)
       {
-        case RedChannel:
+        case RedPixelChannel:
         default:
         {
           phase_source[i]=QuantumScale*GetPixelRed(phase_image,p);
           break;
         }
-        case GreenChannel:
+        case GreenPixelChannel:
         {
           phase_source[i]=QuantumScale*GetPixelGreen(phase_image,p);
           break;
         }
-        case BlueChannel:
+        case BluePixelChannel:
         {
           phase_source[i]=QuantumScale*GetPixelBlue(phase_image,p);
           break;
         }
-        case BlackChannel:
+        case BlackPixelChannel:
         {
           phase_source[i]=QuantumScale*GetPixelBlack(phase_image,p);
           break;
         }
-        case AlphaChannel:
+        case AlphaPixelChannel:
         {
           phase_source[i]=QuantumScale*GetPixelAlpha(phase_image,p);
           break;
         }
-        case GrayChannels:
-        {
-          phase_source[i]=QuantumScale*GetPixelGray(phase_image,p);
-          break;
-        }
       }
       i++;
       p+=GetPixelChannels(phase_image);
@@ -982,7 +956,7 @@ static MagickBooleanType InverseFourier(FourierInfo *fourier_info,
   if (magnitude == (double *) NULL)
     {
       (void) ThrowMagickException(exception,GetMagickModule(),
-        ResourceLimitError,"MemoryAllocationFailed","`%s'",
+        ResourceLimitError,"MemoryAllocationFailed","'%s'",
         magnitude_image->filename);
       magnitude_source=(double *) RelinquishMagickMemory(magnitude_source);
       phase_source=(double *) RelinquishMagickMemory(phase_source);
@@ -996,7 +970,7 @@ static MagickBooleanType InverseFourier(FourierInfo *fourier_info,
   if (phase == (double *) NULL)
     {
       (void) ThrowMagickException(exception,GetMagickModule(),
-        ResourceLimitError,"MemoryAllocationFailed","`%s'",
+        ResourceLimitError,"MemoryAllocationFailed","'%s'",
         magnitude_image->filename);
       phase_source=(double *) RelinquishMagickMemory(phase_source);
       return(MagickFalse);
@@ -1066,7 +1040,7 @@ static MagickBooleanType InverseFourierTransform(FourierInfo *fourier_info,
   if (source == (double *) NULL)
     {
       (void) ThrowMagickException(exception,GetMagickModule(),
-        ResourceLimitError,"MemoryAllocationFailed","`%s'",image->filename);
+        ResourceLimitError,"MemoryAllocationFailed","'%s'",image->filename);
       return(MagickFalse);
     }
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
@@ -1079,51 +1053,47 @@ static MagickBooleanType InverseFourierTransform(FourierInfo *fourier_info,
     fftw_destroy_plan(fftw_c2r_plan);
   }
   i=0L;
-  image_view=AcquireCacheView(image);
+  image_view=AcquireAuthenticCacheView(image,exception);
   for (y=0L; y < (ssize_t) fourier_info->height; y++)
   {
     if (y >= (ssize_t) image->rows)
       break;
     q=GetCacheViewAuthenticPixels(image_view,0L,y,fourier_info->width >
       image->columns ? image->columns : fourier_info->width,1UL,exception);
-    if (q == (const Quantum *) NULL)
+    if (q == (Quantum *) NULL)
       break;
     for (x=0L; x < (ssize_t) fourier_info->width; x++)
     {
-      switch (fourier_info->channel)
-      {
-        case RedChannel:
-        default:
-        {
-          SetPixelRed(image,ClampToQuantum(QuantumRange*source[i]),q);
-          break;
-        }
-        case GreenChannel:
-        {
-          SetPixelGreen(image,ClampToQuantum(QuantumRange*source[i]),q);
-          break;
-        }
-        case BlueChannel:
-        {
-          SetPixelBlue(image,ClampToQuantum(QuantumRange*source[i]),q);
-          break;
-        }
-        case BlackChannel:
-        {
-          SetPixelBlack(image,ClampToQuantum(QuantumRange*source[i]),q);
-          break;
-        }
-        case AlphaChannel:
-        {
-          SetPixelAlpha(image,ClampToQuantum(QuantumRange*source[i]),q);
-          break;
-        }
-        case GrayChannels:
+      if (x < (ssize_t) image->columns)
+        switch (fourier_info->channel)
         {
-          SetPixelGray(image,ClampToQuantum(QuantumRange*source[i]),q);
-          break;
+          case RedPixelChannel:
+          default:
+          {
+            SetPixelRed(image,ClampToQuantum(QuantumRange*source[i]),q);
+            break;
+          }
+          case GreenPixelChannel:
+          {
+            SetPixelGreen(image,ClampToQuantum(QuantumRange*source[i]),q);
+            break;
+          }
+          case BluePixelChannel:
+          {
+            SetPixelBlue(image,ClampToQuantum(QuantumRange*source[i]),q);
+            break;
+          }
+          case BlackPixelChannel:
+          {
+            SetPixelBlack(image,ClampToQuantum(QuantumRange*source[i]),q);
+            break;
+          }
+          case AlphaPixelChannel:
+          {
+            SetPixelAlpha(image,ClampToQuantum(QuantumRange*source[i]),q);
+            break;
+          }
         }
-      }
       i++;
       q+=GetPixelChannels(image);
     }
@@ -1137,7 +1107,7 @@ static MagickBooleanType InverseFourierTransform(FourierInfo *fourier_info,
 
 static MagickBooleanType InverseFourierTransformChannel(
   const Image *magnitude_image,const Image *phase_image,
-  const ChannelType channel,const MagickBooleanType modulus,
+  const PixelChannel channel,const MagickBooleanType modulus,
   Image *fourier_image,ExceptionInfo *exception)
 {
   double
@@ -1166,7 +1136,7 @@ static MagickBooleanType InverseFourierTransformChannel(
       fourier_info.width=(extent & 0x01) == 1 ? extent+1UL : extent;
     }
   fourier_info.height=fourier_info.width;
-  fourier_info.center=(ssize_t) floor((double) fourier_info.width/2.0)+1L;
+  fourier_info.center=(ssize_t) floor((double) fourier_info.width/2L)+1L;
   fourier_info.channel=channel;
   fourier_info.modulus=modulus;
   magnitude=(double *) AcquireQuantumMemory((size_t) fourier_info.height,
@@ -1174,7 +1144,7 @@ static MagickBooleanType InverseFourierTransformChannel(
   if (magnitude == (double *) NULL)
     {
       (void) ThrowMagickException(exception,GetMagickModule(),
-        ResourceLimitError,"MemoryAllocationFailed","`%s'",
+        ResourceLimitError,"MemoryAllocationFailed","'%s'",
         magnitude_image->filename);
       return(MagickFalse);
     }
@@ -1183,7 +1153,7 @@ static MagickBooleanType InverseFourierTransformChannel(
   if (phase == (double *) NULL)
     {
       (void) ThrowMagickException(exception,GetMagickModule(),
-        ResourceLimitError,"MemoryAllocationFailed","`%s'",
+        ResourceLimitError,"MemoryAllocationFailed","'%s'",
         magnitude_image->filename);
       magnitude=(double *) RelinquishMagickMemory(magnitude);
       return(MagickFalse);
@@ -1193,7 +1163,7 @@ static MagickBooleanType InverseFourierTransformChannel(
   if (fourier == (fftw_complex *) NULL)
     {
       (void) ThrowMagickException(exception,GetMagickModule(),
-        ResourceLimitError,"MemoryAllocationFailed","`%s'",
+        ResourceLimitError,"MemoryAllocationFailed","'%s'",
         magnitude_image->filename);
       phase=(double *) RelinquishMagickMemory(phase);
       magnitude=(double *) RelinquishMagickMemory(magnitude);
@@ -1226,14 +1196,14 @@ MagickExport Image *InverseFourierTransformImage(const Image *magnitude_image,
   if (phase_image == (Image *) NULL)
     {
       (void) ThrowMagickException(exception,GetMagickModule(),ImageError,
-        "ImageSequenceRequired","`%s'",magnitude_image->filename);
+        "TwoOrMoreImagesRequired","'%s'",magnitude_image->filename);
       return((Image *) NULL);
     }
 #if !defined(MAGICKCORE_FFTW_DELEGATE)
   fourier_image=(Image *) NULL;
   (void) modulus;
   (void) ThrowMagickException(exception,GetMagickModule(),
-    MissingDelegateWarning,"DelegateLibrarySupportNotBuiltIn","`%s' (FFTW)",
+    MissingDelegateWarning,"DelegateLibrarySupportNotBuiltIn","'%s' (FFTW)",
     magnitude_image->filename);
 #else
   {
@@ -1262,10 +1232,10 @@ MagickExport Image *InverseFourierTransformImage(const Image *magnitude_image,
 
             if (is_gray != MagickFalse)
               thread_status=InverseFourierTransformChannel(magnitude_image,
-                phase_image,GrayChannels,modulus,fourier_image,exception);
+                phase_image,GrayPixelChannel,modulus,fourier_image,exception);
             else
               thread_status=InverseFourierTransformChannel(magnitude_image,
-                phase_image,RedChannel,modulus,fourier_image,exception);
+                phase_image,RedPixelChannel,modulus,fourier_image,exception);
             if (thread_status == MagickFalse)
               status=thread_status;
           }
@@ -1279,7 +1249,7 @@ MagickExport Image *InverseFourierTransformImage(const Image *magnitude_image,
             thread_status=MagickTrue;
             if (is_gray == MagickFalse)
               thread_status=InverseFourierTransformChannel(magnitude_image,
-                phase_image,GreenChannel,modulus,fourier_image,exception);
+                phase_image,GreenPixelChannel,modulus,fourier_image,exception);
             if (thread_status == MagickFalse)
               status=thread_status;
           }
@@ -1293,7 +1263,7 @@ MagickExport Image *InverseFourierTransformImage(const Image *magnitude_image,
             thread_status=MagickTrue;
             if (is_gray == MagickFalse)
               thread_status=InverseFourierTransformChannel(magnitude_image,
-                phase_image,BlueChannel,modulus,fourier_image,exception);
+                phase_image,BluePixelChannel,modulus,fourier_image,exception);
             if (thread_status == MagickFalse)
               status=thread_status;
           }
@@ -1307,7 +1277,7 @@ MagickExport Image *InverseFourierTransformImage(const Image *magnitude_image,
             thread_status=MagickTrue;
             if (magnitude_image->colorspace == CMYKColorspace)
               thread_status=InverseFourierTransformChannel(magnitude_image,
-                phase_image,BlackChannel,modulus,fourier_image,exception);
+                phase_image,BlackPixelChannel,modulus,fourier_image,exception);
             if (thread_status == MagickFalse)
               status=thread_status;
           }
@@ -1321,7 +1291,7 @@ MagickExport Image *InverseFourierTransformImage(const Image *magnitude_image,
             thread_status=MagickTrue;
             if (magnitude_image->matte != MagickFalse)
               thread_status=InverseFourierTransformChannel(magnitude_image,
-                phase_image,AlphaChannel,modulus,fourier_image,exception);
+                phase_image,AlphaPixelChannel,modulus,fourier_image,exception);
             if (thread_status == MagickFalse)
               status=thread_status;
           }