]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Thu, 13 Oct 2011 18:03:11 +0000 (18:03 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Thu, 13 Oct 2011 18:03:11 +0000 (18:03 +0000)
MagickCore/identify.c
MagickCore/statistic.c

index 626362088fbe87a9d9cec668cc707402adea78bd..5b60422f46cd9765c3226447ca6bf652658f9727 100644 (file)
 %
 */
 
-static ssize_t PrintChannelFeatures(FILE *file,const ChannelType channel,
+static ssize_t PrintChannelFeatures(FILE *file,const PixelChannel channel,
   const char *name,const ChannelFeatures *channel_features)
 {
 #define PrintFeature(feature) \
@@ -208,7 +208,7 @@ static ssize_t PrintChannelFeatures(FILE *file,const ChannelType channel,
   return(n);
 }
 
-static ssize_t PrintChannelStatistics(FILE *file,const ChannelType channel,
+static ssize_t PrintChannelStatistics(FILE *file,const PixelChannel channel,
   const char *name,const double scale,
   const ChannelStatistics *channel_statistics)
 {
@@ -446,35 +446,35 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
         default:
         {
           (void) FormatLocaleFile(file,"    red: %.20g-bit\n",(double)
-            channel_statistics[RedChannel].depth);
+            channel_statistics[RedPixelChannel].depth);
           (void) FormatLocaleFile(file,"    green: %.20g-bit\n",(double)
-            channel_statistics[GreenChannel].depth);
+            channel_statistics[GreenPixelChannel].depth);
           (void) FormatLocaleFile(file,"    blue: %.20g-bit\n",(double)
-            channel_statistics[BlueChannel].depth);
+            channel_statistics[BluePixelChannel].depth);
           break;
         }
         case CMYKColorspace:
         {
           (void) FormatLocaleFile(file,"    cyan: %.20g-bit\n",(double)
-            channel_statistics[CyanChannel].depth);
+            channel_statistics[CyanPixelChannel].depth);
           (void) FormatLocaleFile(file,"    magenta: %.20g-bit\n",(double)
-            channel_statistics[MagentaChannel].depth);
+            channel_statistics[MagentaPixelChannel].depth);
           (void) FormatLocaleFile(file,"    yellow: %.20g-bit\n",(double)
-            channel_statistics[YellowChannel].depth);
+            channel_statistics[YellowPixelChannel].depth);
           (void) FormatLocaleFile(file,"    black: %.20g-bit\n",(double)
-            channel_statistics[BlackChannel].depth);
+            channel_statistics[BlackPixelChannel].depth);
           break;
         }
         case GRAYColorspace:
         {
           (void) FormatLocaleFile(file,"    gray: %.20g-bit\n",(double)
-            channel_statistics[GrayChannel].depth);
+            channel_statistics[GrayPixelChannel].depth);
           break;
         }
       }
       if (image->matte != MagickFalse)
         (void) FormatLocaleFile(file,"    alpha: %.20g-bit\n",(double)
-          channel_statistics[OpacityChannel].depth);
+          channel_statistics[AlphaPixelChannel].depth);
       scale=1;
       if (image->depth <= MAGICKCORE_QUANTUM_DEPTH)
         scale=QuantumRange/((size_t) QuantumRange >> ((size_t)
@@ -488,41 +488,41 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
         case RGBColorspace:
         default:
         {
-          (void) PrintChannelStatistics(file,RedChannel,"Red",1.0/scale,
-            channel_statistics);
-          (void) PrintChannelStatistics(file,GreenChannel,"Green",1.0/scale,
-            channel_statistics);
-          (void) PrintChannelStatistics(file,BlueChannel,"Blue",1.0/scale,
-            channel_statistics);
+          (void) PrintChannelStatistics(file,RedPixelChannel,"Red",1.0/
+            scale,channel_statistics);
+          (void) PrintChannelStatistics(file,GreenPixelChannel,"Green",1.0/
+            scale,channel_statistics);
+          (void) PrintChannelStatistics(file,BluePixelChannel,"Blue",1.0/
+            scale,channel_statistics);
           break;
         }
         case CMYKColorspace:
         {
-          (void) PrintChannelStatistics(file,CyanChannel,"Cyan",1.0/scale,
-            channel_statistics);
-          (void) PrintChannelStatistics(file,MagentaChannel,"Magenta",1.0/scale,
-            channel_statistics);
-          (void) PrintChannelStatistics(file,YellowChannel,"Yellow",1.0/scale,
-            channel_statistics);
-          (void) PrintChannelStatistics(file,BlackChannel,"Black",1.0/scale,
-            channel_statistics);
+          (void) PrintChannelStatistics(file,CyanPixelChannel,"Cyan",1.0/
+            scale,channel_statistics);
+          (void) PrintChannelStatistics(file,MagentaPixelChannel,"Magenta",1.0/
+            scale,channel_statistics);
+          (void) PrintChannelStatistics(file,YellowPixelChannel,"Yellow",1.0/
+            scale,channel_statistics);
+          (void) PrintChannelStatistics(file,BlackPixelChannel,"Black",1.0/
+            scale,channel_statistics);
           break;
         }
         case GRAYColorspace:
         {
-          (void) PrintChannelStatistics(file,GrayChannel,"Gray",1.0/scale,
-            channel_statistics);
+          (void) PrintChannelStatistics(file,GrayPixelChannel,"Gray",1.0/
+            scale,channel_statistics);
           break;
         }
       }
       if (image->matte != MagickFalse)
-        (void) PrintChannelStatistics(file,AlphaChannel,"Alpha",1.0/scale,
-          channel_statistics);
+        (void) PrintChannelStatistics(file,AlphaPixelChannel,"Alpha",1.0/
+          scale,channel_statistics);
       if (colorspace != GRAYColorspace)
         {
           (void) FormatLocaleFile(file,"  Image statistics:\n");
-          (void) PrintChannelStatistics(file,CompositeChannels,"Overall",1.0/
-            scale,channel_statistics);
+          (void) PrintChannelStatistics(file,MaxPixelChannels,"Overall",
+            1.0/scale,channel_statistics);
         }
       channel_statistics=(ChannelStatistics *) RelinquishMagickMemory(
         channel_statistics);
@@ -536,31 +536,36 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
         case RGBColorspace:
         default:
         {
-          (void) PrintChannelFeatures(file,RedChannel,"Red",channel_features);
-          (void) PrintChannelFeatures(file,GreenChannel,"Green",
+          (void) PrintChannelFeatures(file,RedPixelChannel,"Red",
+            channel_features);
+          (void) PrintChannelFeatures(file,GreenPixelChannel,"Green",
+            channel_features);
+          (void) PrintChannelFeatures(file,BluePixelChannel,"Blue",
             channel_features);
-          (void) PrintChannelFeatures(file,BlueChannel,"Blue",channel_features);
           break;
         }
         case CMYKColorspace:
         {
-          (void) PrintChannelFeatures(file,CyanChannel,"Cyan",channel_features);
-          (void) PrintChannelFeatures(file,MagentaChannel,"Magenta",
+          (void) PrintChannelFeatures(file,CyanPixelChannel,"Cyan",
+            channel_features);
+          (void) PrintChannelFeatures(file,MagentaPixelChannel,"Magenta",
             channel_features);
-          (void) PrintChannelFeatures(file,YellowChannel,"Yellow",
+          (void) PrintChannelFeatures(file,YellowPixelChannel,"Yellow",
             channel_features);
-          (void) PrintChannelFeatures(file,BlackChannel,"Black",
+          (void) PrintChannelFeatures(file,BlackPixelChannel,"Black",
             channel_features);
           break;
         }
         case GRAYColorspace:
         {
-          (void) PrintChannelFeatures(file,GrayChannel,"Gray",channel_features);
+          (void) PrintChannelFeatures(file,GrayPixelChannel,"Gray",
+            channel_features);
           break;
         }
       }
       if (image->matte != MagickFalse)
-        (void) PrintChannelFeatures(file,AlphaChannel,"Alpha",channel_features);
+        (void) PrintChannelFeatures(file,AlphaPixelChannel,"Alpha",
+          channel_features);
       channel_features=(ChannelFeatures *) RelinquishMagickMemory(
         channel_features);
     }
index f9cb703fc4473570e213d7bd8cde574f2ebe83e5..7166378540f3f961459508b797b285202f2ddcb5 100644 (file)
 %
 */
 
-typedef struct _WenusInfo
+typedef struct _PixelChannels
 {
   MagickRealType
     channel[MaxPixelChannels];
-} WenusInfo;
+} PixelChannels;
 
-static WenusInfo **DestroyPixelThreadSet(WenusInfo **pixels)
+static PixelChannels **DestroyPixelThreadSet(PixelChannels **pixels)
 {
   register ssize_t
     i;
 
-  assert(pixels != (WenusInfo **) NULL);
+  assert(pixels != (PixelChannels **) NULL);
   for (i=0; i < (ssize_t) GetOpenMPMaximumThreads(); i++)
-    if (pixels[i] != (WenusInfo *) NULL)
-      pixels[i]=(WenusInfo *) RelinquishMagickMemory(pixels[i]);
-  pixels=(WenusInfo **) RelinquishMagickMemory(pixels);
+    if (pixels[i] != (PixelChannels *) NULL)
+      pixels[i]=(PixelChannels *) RelinquishMagickMemory(pixels[i]);
+  pixels=(PixelChannels **) RelinquishMagickMemory(pixels);
   return(pixels);
 }
 
-static WenusInfo **AcquirePixelThreadSet(const Image *image,
+static PixelChannels **AcquirePixelThreadSet(const Image *image,
   const size_t number_images)
 {
   register ssize_t
     i;
 
-  WenusInfo
+  PixelChannels
     **pixels;
 
   size_t
@@ -161,9 +161,9 @@ static WenusInfo **AcquirePixelThreadSet(const Image *image,
     number_threads;
 
   number_threads=GetOpenMPMaximumThreads();
-  pixels=(WenusInfo **) AcquireQuantumMemory(number_threads,sizeof(*pixels));
-  if (pixels == (WenusInfo **) NULL)
-    return((WenusInfo **) NULL);
+  pixels=(PixelChannels **) AcquireQuantumMemory(number_threads,sizeof(*pixels));
+  if (pixels == (PixelChannels **) NULL)
+    return((PixelChannels **) NULL);
   (void) ResetMagickMemory(pixels,0,number_threads*sizeof(*pixels));
   for (i=0; i < (ssize_t) number_threads; i++)
   {
@@ -173,8 +173,8 @@ static WenusInfo **AcquirePixelThreadSet(const Image *image,
     length=image->columns;
     if (length < number_images)
       length=number_images;
-    pixels[i]=(WenusInfo *) AcquireQuantumMemory(length,sizeof(**pixels));
-    if (pixels[i] == (WenusInfo *) NULL)
+    pixels[i]=(PixelChannels *) AcquireQuantumMemory(length,sizeof(**pixels));
+    if (pixels[i] == (PixelChannels *) NULL)
       return(DestroyPixelThreadSet(pixels));
     for (j=0; j < (ssize_t) length; j++)
     {
@@ -201,7 +201,7 @@ extern "C" {
 
 static int IntensityCompare(const void *x,const void *y)
 {
-  const WenusInfo
+  const PixelChannels
     *color_1,
     *color_2;
 
@@ -211,8 +211,8 @@ static int IntensityCompare(const void *x,const void *y)
   register ssize_t
     i;
 
-  color_1=(const WenusInfo *) x;
-  color_2=(const WenusInfo *) y;
+  color_1=(const PixelChannels *) x;
+  color_2=(const PixelChannels *) y;
   distance=0.0;
   for (i=0; i < MaxPixelChannels; i++)
     distance+=color_1->channel[i]-(MagickRealType) color_2->channel[i];
@@ -435,7 +435,7 @@ MagickExport Image *EvaluateImages(const Image *images,
   MagickOffsetType
     progress;
 
-  WenusInfo
+  PixelChannels
     **restrict evaluate_pixels;
 
   RandomInfo
@@ -477,7 +477,7 @@ MagickExport Image *EvaluateImages(const Image *images,
     }
   number_images=GetImageListLength(images);
   evaluate_pixels=AcquirePixelThreadSet(images,number_images);
-  if (evaluate_pixels == (WenusInfo **) NULL)
+  if (evaluate_pixels == (PixelChannels **) NULL)
     {
       evaluate_image=DestroyImage(evaluate_image);
       (void) ThrowMagickException(exception,GetMagickModule(),
@@ -506,7 +506,7 @@ MagickExport Image *EvaluateImages(const Image *images,
       const int
         id = GetOpenMPThreadId();
 
-      register WenusInfo
+      register PixelChannels
         *evaluate_pixel;
 
       register Quantum
@@ -616,7 +616,7 @@ MagickExport Image *EvaluateImages(const Image *images,
         i,
         x;
 
-      register WenusInfo
+      register PixelChannels
         *evaluate_pixel;
 
       register Quantum