]> granicus.if.org Git - imagemagick/blobdiff - MagickCore/property.c
(no commit message)
[imagemagick] / MagickCore / property.c
index 0c85008ed61938134c74b846b3e9386f486ebc3a..460c85b6c897b2193b668b46fc51a9c480c2d9b7 100644 (file)
@@ -1295,8 +1295,7 @@ static MagickBooleanType GetEXIFProperty(const Image *image,
             case EXIF_FMT_BYTE:
             case EXIF_FMT_UNDEFINED:
             {
-              EXIFMultipleValues(1,"%.20g",(double)
-                (*(unsigned char *) p1));
+              EXIFMultipleValues(1,"%.20g",(double) (*(unsigned char *) p1));
               break;
             }
             case EXIF_FMT_SBYTE:
@@ -1474,8 +1473,7 @@ static MagickBooleanType GetEXIFProperty(const Image *image,
   return(status);
 }
 
-static MagickBooleanType GetXMPProperty(const Image *image,
-  const char *property)
+static MagickBooleanType GetXMPProperty(const Image *image,const char *property)
 {
   char
     *xmp_profile;
@@ -2014,8 +2012,8 @@ MagickExport const char *GetImageProperty(const Image *image,
       if (LocaleNCompare("fx:",property,3) == 0)
         {
           fx_info=AcquireFxInfo(image,property+3);
-          status=FxEvaluateChannelExpression(fx_info,DefaultChannels,0,0,&alpha,
-            exception);
+          status=FxEvaluateChannelExpression(fx_info,IntensityPixelChannel,0,0,
+            &alpha,exception);
           fx_info=DestroyFxInfo(fx_info);
           if (status != MagickFalse)
             {
@@ -2060,23 +2058,23 @@ MagickExport const char *GetImageProperty(const Image *image,
 
           GetPixelInfo(image,&pixel);
           fx_info=AcquireFxInfo(image,property+6);
-          status=FxEvaluateChannelExpression(fx_info,RedChannel,0,0,&alpha,
-            exception);
+          status=FxEvaluateChannelExpression(fx_info,RedPixelChannel,0,0,
+            &alpha,exception);
           pixel.red=(MagickRealType) QuantumRange*alpha;
-          status|=FxEvaluateChannelExpression(fx_info,GreenChannel,0,0,&alpha,
-            exception);
+          status|=FxEvaluateChannelExpression(fx_info,GreenPixelChannel,0,0,
+            &alpha,exception);
           pixel.green=(MagickRealType) QuantumRange*alpha;
-          status|=FxEvaluateChannelExpression(fx_info,BlueChannel,0,0,&alpha,
-            exception);
+          status|=FxEvaluateChannelExpression(fx_info,BluePixelChannel,0,0,
+            &alpha,exception);
           pixel.blue=(MagickRealType) QuantumRange*alpha;
           if (image->colorspace == CMYKColorspace)
             {
-              status|=FxEvaluateChannelExpression(fx_info,BlackChannel,0,0,
+              status|=FxEvaluateChannelExpression(fx_info,BlackPixelChannel,0,0,
                 &alpha,exception);
               pixel.black=(MagickRealType) QuantumRange*alpha;
             }
-          status|=FxEvaluateChannelExpression(fx_info,OpacityChannel,0,0,&alpha,
-            exception);
+          status|=FxEvaluateChannelExpression(fx_info,AlphaPixelChannel,0,0,
+            &alpha,exception);
           pixel.alpha=(MagickRealType) QuantumRange*(1.0-alpha);
           fx_info=DestroyFxInfo(fx_info);
           if (status != MagickFalse)
@@ -2128,8 +2126,8 @@ MagickExport const char *GetImageProperty(const Image *image,
 %
 %  The format of the GetMagickProperty method is:
 %
-%      const char *GetMagickProperty(const ImageInfo *image_info,
-%        Image *image,const char *key)
+%      const char *GetMagickProperty(const ImageInfo *image_info,Image *image,
+%        const char *key)
 %
 %  A description of each parameter follows:
 %
@@ -2261,8 +2259,7 @@ MagickExport const char *GetMagickProperty(const ImageInfo *image_info,
             kurtosis,
             skewness;
 
-          (void) GetImageChannelKurtosis(image,image_info->channel,&kurtosis,
-            &skewness,&image->exception);
+          (void) GetImageKurtosis(image,&kurtosis,&skewness,&image->exception);
           (void) FormatLocaleString(value,MaxTextExtent,"%.*g",
             GetMagickPrecision(),kurtosis);
           break;
@@ -2282,8 +2279,7 @@ MagickExport const char *GetMagickProperty(const ImageInfo *image_info,
             maximum,
             minimum;
 
-          (void) GetImageChannelRange(image,image_info->channel,&minimum,
-            &maximum,&image->exception);
+          (void) GetImageRange(image,&minimum,&maximum,&image->exception);
           (void) FormatLocaleString(value,MaxTextExtent,"%.*g",
             GetMagickPrecision(),maximum);
           break;
@@ -2294,8 +2290,8 @@ MagickExport const char *GetMagickProperty(const ImageInfo *image_info,
             mean,
             standard_deviation;
 
-          (void) GetImageChannelMean(image,image_info->channel,&mean,
-            &standard_deviation,&image->exception);
+          (void) GetImageMean(image,&mean,&standard_deviation,
+             &image->exception);
           (void) FormatLocaleString(value,MaxTextExtent,"%.*g",
             GetMagickPrecision(),mean);
           break;
@@ -2306,8 +2302,7 @@ MagickExport const char *GetMagickProperty(const ImageInfo *image_info,
             maximum,
             minimum;
 
-          (void) GetImageChannelRange(image,image_info->channel,&minimum,
-            &maximum,&image->exception);
+          (void) GetImageRange(image,&minimum,&maximum,&image->exception);
           (void) FormatLocaleString(value,MaxTextExtent,"%.*g",
             GetMagickPrecision(),minimum);
           break;
@@ -2347,7 +2342,7 @@ MagickExport const char *GetMagickProperty(const ImageInfo *image_info,
       if (LocaleNCompare("page",property,4) == 0)
         {
           (void) FormatLocaleString(value,MaxTextExtent,"%.20g",(double)
-              GetImageIndexInList(image)+1);
+            GetImageIndexInList(image)+1);
           break;
         }
       break;
@@ -2384,21 +2379,19 @@ MagickExport const char *GetMagickProperty(const ImageInfo *image_info,
             kurtosis,
             skewness;
 
-          (void) GetImageChannelKurtosis(image,image_info->channel,&kurtosis,
-            &skewness,&image->exception);
+          (void) GetImageKurtosis(image,&kurtosis,&skewness,&image->exception);
           (void) FormatLocaleString(value,MaxTextExtent,"%.*g",
             GetMagickPrecision(),skewness);
           break;
         }
-      if ((LocaleNCompare("standard-deviation",property,18) == 0) ||
-          (LocaleNCompare("standard_deviation",property,18) == 0))
+      if (LocaleNCompare("standard-deviation",property,18) == 0)
         {
           double
             mean,
             standard_deviation;
 
-          (void) GetImageChannelMean(image,image_info->channel,&mean,
-            &standard_deviation,&image->exception);
+          (void) GetImageMean(image,&mean,&standard_deviation,
+            &image->exception);
           (void) FormatLocaleString(value,MaxTextExtent,"%.*g",
             GetMagickPrecision(),standard_deviation);
           break;
@@ -2789,7 +2782,7 @@ MagickExport char *InterpretImageProperties(const ImageInfo *image_info,
           Number of images in the list.
         */
         q+=FormatLocaleString(q,extent,"%.20g",(double)
-             GetImageListLength(image));
+          GetImageListLength(image));
         break;
       }
       case 'o':
@@ -3313,7 +3306,8 @@ MagickExport MagickBooleanType SetImageProperty(Image *image,
             value);
           if (colorspace < 0)
             break;
-          (void) SetImageColorspace(image,(ColorspaceType) colorspace);
+          (void) SetImageColorspace(image,(ColorspaceType) colorspace,
+            exception);
           break;
         }
       if (LocaleCompare(property,"compose") == 0)