]> granicus.if.org Git - imagemagick/blobdiff - MagickCore/fourier.c
(no commit message)
[imagemagick] / MagickCore / fourier.c
index 36f04ce5efaee62f57bf0ceaa83bd86321b2765e..2ccd3cee3e211293b37e938f00f814bce0f81284 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,8 +288,7 @@ 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++)
   {
@@ -300,43 +300,37 @@ static MagickBooleanType ForwardFourier(const FourierInfo *fourier_info,
     {
       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,7 +339,9 @@ 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,
@@ -356,43 +352,37 @@ static MagickBooleanType ForwardFourier(const FourierInfo *fourier_info,
     {
       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
@@ -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;
               }
@@ -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,7 +1053,7 @@ 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)
@@ -1092,37 +1066,32 @@ static MagickBooleanType InverseFourierTransform(FourierInfo *fourier_info,
     {
       switch (fourier_info->channel)
       {
-        case RedChannel:
+        case RedPixelChannel:
         default:
         {
           SetPixelRed(image,ClampToQuantum(QuantumRange*source[i]),q);
           break;
         }
-        case GreenChannel:
+        case GreenPixelChannel:
         {
           SetPixelGreen(image,ClampToQuantum(QuantumRange*source[i]),q);
           break;
         }
-        case BlueChannel:
+        case BluePixelChannel:
         {
           SetPixelBlue(image,ClampToQuantum(QuantumRange*source[i]),q);
           break;
         }
-        case BlackChannel:
+        case BlackPixelChannel:
         {
           SetPixelBlack(image,ClampToQuantum(QuantumRange*source[i]),q);
           break;
         }
-        case AlphaChannel:
+        case AlphaPixelChannel:
         {
           SetPixelAlpha(image,ClampToQuantum(QuantumRange*source[i]),q);
           break;
         }
-        case GrayChannels:
-        {
-          SetPixelGray(image,ClampToQuantum(QuantumRange*source[i]),q);
-          break;
-        }
       }
       i++;
       q+=GetPixelChannels(image);
@@ -1137,7 +1106,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
@@ -1174,7 +1143,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 +1152,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 +1162,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 +1195,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 +1231,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 +1248,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 +1262,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 +1276,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 +1290,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;
           }