From: cristy Date: Tue, 18 Oct 2011 00:05:15 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~6794 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d3090f92b8f346df0a8191d5aa3f9d14be5a32d5;p=imagemagick --- diff --git a/MagickCore/color.c b/MagickCore/color.c index 7402e5108..9760f8ec0 100644 --- a/MagickCore/color.c +++ b/MagickCore/color.c @@ -1327,7 +1327,7 @@ MagickExport char **GetColorList(const char *pattern, */ static void ConcatentateHexColorComponent(const PixelInfo *pixel, - const ChannelType channel,char *tuple) + const PixelChannel channel,char *tuple) { char component[MaxTextExtent]; @@ -1338,27 +1338,27 @@ static void ConcatentateHexColorComponent(const PixelInfo *pixel, color=0.0; switch (channel) { - case RedChannel: + case RedPixelChannel: { color=pixel->red; break; } - case GreenChannel: + case GreenPixelChannel: { color=pixel->green; break; } - case BlueChannel: + case BluePixelChannel: { color=pixel->blue; break; } - case AlphaChannel: + case AlphaPixelChannel: { color=pixel->alpha; break; } - case BlackChannel: + case BlackPixelChannel: { color=pixel->black; break; @@ -1410,13 +1410,13 @@ MagickExport void GetColorTuple(const PixelInfo *pixel, Convert pixel to hex color. */ (void) ConcatenateMagickString(tuple,"#",MaxTextExtent); - ConcatentateHexColorComponent(pixel,RedChannel,tuple); - ConcatentateHexColorComponent(pixel,GreenChannel,tuple); - ConcatentateHexColorComponent(pixel,BlueChannel,tuple); + ConcatentateHexColorComponent(pixel,RedPixelChannel,tuple); + ConcatentateHexColorComponent(pixel,GreenPixelChannel,tuple); + ConcatentateHexColorComponent(pixel,BluePixelChannel,tuple); if (pixel->colorspace == CMYKColorspace) - ConcatentateHexColorComponent(pixel,BlackChannel,tuple); + ConcatentateHexColorComponent(pixel,BlackPixelChannel,tuple); if ((pixel->matte != MagickFalse) && (pixel->alpha != OpaqueAlpha)) - ConcatentateHexColorComponent(pixel,AlphaChannel,tuple); + ConcatentateHexColorComponent(pixel,AlphaPixelChannel,tuple); return; } /* diff --git a/MagickCore/feature.c b/MagickCore/feature.c index f0b12578a..905fedc01 100644 --- a/MagickCore/feature.c +++ b/MagickCore/feature.c @@ -109,7 +109,7 @@ % access the red channel contrast, for example, like this: % % channel_features=GetImageFeatures(image,1,exception); -% contrast=channel_features[RedChannel].contrast[0]; +% contrast=channel_features[RedPixelChannel].contrast[0]; % % Use MagickRelinquishMemory() to free the features buffer. % @@ -610,21 +610,21 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image, /* Angular second moment: measure of homogeneity of the image. */ - channel_features[RedChannel].angular_second_moment[i]+= + channel_features[RedPixelChannel].angular_second_moment[i]+= cooccurrence[x][y].direction[i].red* cooccurrence[x][y].direction[i].red; - channel_features[GreenChannel].angular_second_moment[i]+= + channel_features[GreenPixelChannel].angular_second_moment[i]+= cooccurrence[x][y].direction[i].green* cooccurrence[x][y].direction[i].green; - channel_features[BlueChannel].angular_second_moment[i]+= + channel_features[BluePixelChannel].angular_second_moment[i]+= cooccurrence[x][y].direction[i].blue* cooccurrence[x][y].direction[i].blue; if (image->colorspace == CMYKColorspace) - channel_features[BlackChannel].angular_second_moment[i]+= + channel_features[BlackPixelChannel].angular_second_moment[i]+= cooccurrence[x][y].direction[i].black* cooccurrence[x][y].direction[i].black; if (image->matte != MagickFalse) - channel_features[OpacityChannel].angular_second_moment[i]+= + channel_features[AlphaPixelChannel].angular_second_moment[i]+= cooccurrence[x][y].direction[i].alpha* cooccurrence[x][y].direction[i].alpha; /* @@ -651,17 +651,17 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image, /* Inverse Difference Moment. */ - channel_features[RedChannel].inverse_difference_moment[i]+= + channel_features[RedPixelChannel].inverse_difference_moment[i]+= cooccurrence[x][y].direction[i].red/((y-x)*(y-x)+1); - channel_features[GreenChannel].inverse_difference_moment[i]+= + channel_features[GreenPixelChannel].inverse_difference_moment[i]+= cooccurrence[x][y].direction[i].green/((y-x)*(y-x)+1); - channel_features[BlueChannel].inverse_difference_moment[i]+= + channel_features[BluePixelChannel].inverse_difference_moment[i]+= cooccurrence[x][y].direction[i].blue/((y-x)*(y-x)+1); if (image->colorspace == CMYKColorspace) - channel_features[BlackChannel].inverse_difference_moment[i]+= + channel_features[BlackPixelChannel].inverse_difference_moment[i]+= cooccurrence[x][y].direction[i].black/((y-x)*(y-x)+1); if (image->matte != MagickFalse) - channel_features[OpacityChannel].inverse_difference_moment[i]+= + channel_features[AlphaPixelChannel].inverse_difference_moment[i]+= cooccurrence[x][y].direction[i].alpha/((y-x)*(y-x)+1); /* Sum average. @@ -681,21 +681,21 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image, /* Entropy. */ - channel_features[RedChannel].entropy[i]-= + channel_features[RedPixelChannel].entropy[i]-= cooccurrence[x][y].direction[i].red* log10(cooccurrence[x][y].direction[i].red+MagickEpsilon); - channel_features[GreenChannel].entropy[i]-= + channel_features[GreenPixelChannel].entropy[i]-= cooccurrence[x][y].direction[i].green* log10(cooccurrence[x][y].direction[i].green+MagickEpsilon); - channel_features[BlueChannel].entropy[i]-= + channel_features[BluePixelChannel].entropy[i]-= cooccurrence[x][y].direction[i].blue* log10(cooccurrence[x][y].direction[i].blue+MagickEpsilon); if (image->colorspace == CMYKColorspace) - channel_features[BlackChannel].entropy[i]-= + channel_features[BlackPixelChannel].entropy[i]-= cooccurrence[x][y].direction[i].black* log10(cooccurrence[x][y].direction[i].black+MagickEpsilon); if (image->matte != MagickFalse) - channel_features[OpacityChannel].entropy[i]-= + channel_features[AlphaPixelChannel].entropy[i]-= cooccurrence[x][y].direction[i].alpha* log10(cooccurrence[x][y].direction[i].alpha+MagickEpsilon); /* @@ -740,33 +740,33 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image, /* Correlation: measure of linear-dependencies in the image. */ - channel_features[RedChannel].correlation[i]= + channel_features[RedPixelChannel].correlation[i]= (correlation.direction[i].red-mean.direction[i].red* mean.direction[i].red)/(sqrt(sum_squares.direction[i].red- (mean.direction[i].red*mean.direction[i].red))*sqrt( sum_squares.direction[i].red-(mean.direction[i].red* mean.direction[i].red))); - channel_features[GreenChannel].correlation[i]= + channel_features[GreenPixelChannel].correlation[i]= (correlation.direction[i].green-mean.direction[i].green* mean.direction[i].green)/(sqrt(sum_squares.direction[i].green- (mean.direction[i].green*mean.direction[i].green))*sqrt( sum_squares.direction[i].green-(mean.direction[i].green* mean.direction[i].green))); - channel_features[BlueChannel].correlation[i]= + channel_features[BluePixelChannel].correlation[i]= (correlation.direction[i].blue-mean.direction[i].blue* mean.direction[i].blue)/(sqrt(sum_squares.direction[i].blue- (mean.direction[i].blue*mean.direction[i].blue))*sqrt( sum_squares.direction[i].blue-(mean.direction[i].blue* mean.direction[i].blue))); if (image->colorspace == CMYKColorspace) - channel_features[BlackChannel].correlation[i]= + channel_features[BlackPixelChannel].correlation[i]= (correlation.direction[i].black-mean.direction[i].black* mean.direction[i].black)/(sqrt(sum_squares.direction[i].black- (mean.direction[i].black*mean.direction[i].black))*sqrt( sum_squares.direction[i].black-(mean.direction[i].black* mean.direction[i].black))); if (image->matte != MagickFalse) - channel_features[OpacityChannel].correlation[i]= + channel_features[AlphaPixelChannel].correlation[i]= (correlation.direction[i].alpha-mean.direction[i].alpha* mean.direction[i].alpha)/(sqrt(sum_squares.direction[i].alpha- (mean.direction[i].alpha*mean.direction[i].alpha))*sqrt( @@ -789,62 +789,62 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image, /* Sum average. */ - channel_features[RedChannel].sum_average[i]+= + channel_features[RedPixelChannel].sum_average[i]+= x*density_xy[x].direction[i].red; - channel_features[GreenChannel].sum_average[i]+= + channel_features[GreenPixelChannel].sum_average[i]+= x*density_xy[x].direction[i].green; - channel_features[BlueChannel].sum_average[i]+= + channel_features[BluePixelChannel].sum_average[i]+= x*density_xy[x].direction[i].blue; if (image->colorspace == CMYKColorspace) - channel_features[BlackChannel].sum_average[i]+= + channel_features[BlackPixelChannel].sum_average[i]+= x*density_xy[x].direction[i].black; if (image->matte != MagickFalse) - channel_features[OpacityChannel].sum_average[i]+= + channel_features[AlphaPixelChannel].sum_average[i]+= x*density_xy[x].direction[i].alpha; /* Sum entropy. */ - channel_features[RedChannel].sum_entropy[i]-= + channel_features[RedPixelChannel].sum_entropy[i]-= density_xy[x].direction[i].red* log10(density_xy[x].direction[i].red+MagickEpsilon); - channel_features[GreenChannel].sum_entropy[i]-= + channel_features[GreenPixelChannel].sum_entropy[i]-= density_xy[x].direction[i].green* log10(density_xy[x].direction[i].green+MagickEpsilon); - channel_features[BlueChannel].sum_entropy[i]-= + channel_features[BluePixelChannel].sum_entropy[i]-= density_xy[x].direction[i].blue* log10(density_xy[x].direction[i].blue+MagickEpsilon); if (image->colorspace == CMYKColorspace) - channel_features[BlackChannel].sum_entropy[i]-= + channel_features[BlackPixelChannel].sum_entropy[i]-= density_xy[x].direction[i].black* log10(density_xy[x].direction[i].black+MagickEpsilon); if (image->matte != MagickFalse) - channel_features[OpacityChannel].sum_entropy[i]-= + channel_features[AlphaPixelChannel].sum_entropy[i]-= density_xy[x].direction[i].alpha* log10(density_xy[x].direction[i].alpha+MagickEpsilon); /* Sum variance. */ - channel_features[RedChannel].sum_variance[i]+= - (x-channel_features[RedChannel].sum_entropy[i])* - (x-channel_features[RedChannel].sum_entropy[i])* + channel_features[RedPixelChannel].sum_variance[i]+= + (x-channel_features[RedPixelChannel].sum_entropy[i])* + (x-channel_features[RedPixelChannel].sum_entropy[i])* density_xy[x].direction[i].red; - channel_features[GreenChannel].sum_variance[i]+= - (x-channel_features[GreenChannel].sum_entropy[i])* - (x-channel_features[GreenChannel].sum_entropy[i])* + channel_features[GreenPixelChannel].sum_variance[i]+= + (x-channel_features[GreenPixelChannel].sum_entropy[i])* + (x-channel_features[GreenPixelChannel].sum_entropy[i])* density_xy[x].direction[i].green; - channel_features[BlueChannel].sum_variance[i]+= - (x-channel_features[BlueChannel].sum_entropy[i])* - (x-channel_features[BlueChannel].sum_entropy[i])* + channel_features[BluePixelChannel].sum_variance[i]+= + (x-channel_features[BluePixelChannel].sum_entropy[i])* + (x-channel_features[BluePixelChannel].sum_entropy[i])* density_xy[x].direction[i].blue; if (image->colorspace == CMYKColorspace) - channel_features[BlackChannel].sum_variance[i]+= - (x-channel_features[BlackChannel].sum_entropy[i])* - (x-channel_features[BlackChannel].sum_entropy[i])* + channel_features[BlackPixelChannel].sum_variance[i]+= + (x-channel_features[BlackPixelChannel].sum_entropy[i])* + (x-channel_features[BlackPixelChannel].sum_entropy[i])* density_xy[x].direction[i].black; if (image->matte != MagickFalse) - channel_features[OpacityChannel].sum_variance[i]+= - (x-channel_features[OpacityChannel].sum_entropy[i])* - (x-channel_features[OpacityChannel].sum_entropy[i])* + channel_features[AlphaPixelChannel].sum_variance[i]+= + (x-channel_features[AlphaPixelChannel].sum_entropy[i])* + (x-channel_features[AlphaPixelChannel].sum_entropy[i])* density_xy[x].direction[i].alpha; } } @@ -953,17 +953,17 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image, MagickEpsilon)); } } - channel_features[RedChannel].variance_sum_of_squares[i]= + channel_features[RedPixelChannel].variance_sum_of_squares[i]= variance.direction[i].red; - channel_features[GreenChannel].variance_sum_of_squares[i]= + channel_features[GreenPixelChannel].variance_sum_of_squares[i]= variance.direction[i].green; - channel_features[BlueChannel].variance_sum_of_squares[i]= + channel_features[BluePixelChannel].variance_sum_of_squares[i]= variance.direction[i].blue; if (image->colorspace == CMYKColorspace) - channel_features[RedChannel].variance_sum_of_squares[i]= + channel_features[BlackPixelChannel].variance_sum_of_squares[i]= variance.direction[i].black; if (image->matte != MagickFalse) - channel_features[RedChannel].variance_sum_of_squares[i]= + channel_features[AlphaPixelChannel].variance_sum_of_squares[i]= variance.direction[i].alpha; } /* @@ -1006,21 +1006,21 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image, /* Difference entropy. */ - channel_features[RedChannel].difference_entropy[i]-= + channel_features[RedPixelChannel].difference_entropy[i]-= density_xy[x].direction[i].red* log10(density_xy[x].direction[i].red+MagickEpsilon); - channel_features[GreenChannel].difference_entropy[i]-= + channel_features[GreenPixelChannel].difference_entropy[i]-= density_xy[x].direction[i].green* log10(density_xy[x].direction[i].green+MagickEpsilon); - channel_features[BlueChannel].difference_entropy[i]-= + channel_features[BluePixelChannel].difference_entropy[i]-= density_xy[x].direction[i].blue* log10(density_xy[x].direction[i].blue+MagickEpsilon); if (image->colorspace == CMYKColorspace) - channel_features[BlackChannel].difference_entropy[i]-= + channel_features[BlackPixelChannel].difference_entropy[i]-= density_xy[x].direction[i].black* log10(density_xy[x].direction[i].black+MagickEpsilon); if (image->matte != MagickFalse) - channel_features[OpacityChannel].difference_entropy[i]-= + channel_features[AlphaPixelChannel].difference_entropy[i]-= density_xy[x].direction[i].alpha* log10(density_xy[x].direction[i].alpha+MagickEpsilon); /* @@ -1054,68 +1054,68 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image, /* Difference variance. */ - channel_features[RedChannel].difference_variance[i]= + channel_features[RedPixelChannel].difference_variance[i]= (((double) number_grays*number_grays*sum_squares.direction[i].red)- (variance.direction[i].red*variance.direction[i].red))/ ((double) number_grays*number_grays*number_grays*number_grays); - channel_features[GreenChannel].difference_variance[i]= + channel_features[GreenPixelChannel].difference_variance[i]= (((double) number_grays*number_grays*sum_squares.direction[i].green)- (variance.direction[i].green*variance.direction[i].green))/ ((double) number_grays*number_grays*number_grays*number_grays); - channel_features[BlueChannel].difference_variance[i]= + channel_features[BluePixelChannel].difference_variance[i]= (((double) number_grays*number_grays*sum_squares.direction[i].blue)- (variance.direction[i].blue*variance.direction[i].blue))/ ((double) number_grays*number_grays*number_grays*number_grays); if (image->colorspace == CMYKColorspace) - channel_features[BlackChannel].difference_variance[i]= + channel_features[BlackPixelChannel].difference_variance[i]= (((double) number_grays*number_grays*sum_squares.direction[i].black)- (variance.direction[i].black*variance.direction[i].black))/ ((double) number_grays*number_grays*number_grays*number_grays); if (image->matte != MagickFalse) - channel_features[OpacityChannel].difference_variance[i]= + channel_features[AlphaPixelChannel].difference_variance[i]= (((double) number_grays*number_grays*sum_squares.direction[i].alpha)- (variance.direction[i].alpha*variance.direction[i].alpha))/ ((double) number_grays*number_grays*number_grays*number_grays); /* Information Measures of Correlation. */ - channel_features[RedChannel].measure_of_correlation_1[i]= + channel_features[RedPixelChannel].measure_of_correlation_1[i]= (entropy_xy.direction[i].red-entropy_xy1.direction[i].red)/ (entropy_x.direction[i].red > entropy_y.direction[i].red ? entropy_x.direction[i].red : entropy_y.direction[i].red); - channel_features[GreenChannel].measure_of_correlation_1[i]= + channel_features[GreenPixelChannel].measure_of_correlation_1[i]= (entropy_xy.direction[i].green-entropy_xy1.direction[i].green)/ (entropy_x.direction[i].green > entropy_y.direction[i].green ? entropy_x.direction[i].green : entropy_y.direction[i].green); - channel_features[BlueChannel].measure_of_correlation_1[i]= + channel_features[BluePixelChannel].measure_of_correlation_1[i]= (entropy_xy.direction[i].blue-entropy_xy1.direction[i].blue)/ (entropy_x.direction[i].blue > entropy_y.direction[i].blue ? entropy_x.direction[i].blue : entropy_y.direction[i].blue); if (image->colorspace == CMYKColorspace) - channel_features[BlackChannel].measure_of_correlation_1[i]= + channel_features[BlackPixelChannel].measure_of_correlation_1[i]= (entropy_xy.direction[i].black-entropy_xy1.direction[i].black)/ (entropy_x.direction[i].black > entropy_y.direction[i].black ? entropy_x.direction[i].black : entropy_y.direction[i].black); if (image->matte != MagickFalse) - channel_features[OpacityChannel].measure_of_correlation_1[i]= + channel_features[AlphaPixelChannel].measure_of_correlation_1[i]= (entropy_xy.direction[i].alpha-entropy_xy1.direction[i].alpha)/ (entropy_x.direction[i].alpha > entropy_y.direction[i].alpha ? entropy_x.direction[i].alpha : entropy_y.direction[i].alpha); - channel_features[RedChannel].measure_of_correlation_2[i]= + channel_features[RedPixelChannel].measure_of_correlation_2[i]= (sqrt(fabs(1.0-exp(-2.0*(entropy_xy2.direction[i].red- entropy_xy.direction[i].red))))); - channel_features[GreenChannel].measure_of_correlation_2[i]= + channel_features[GreenPixelChannel].measure_of_correlation_2[i]= (sqrt(fabs(1.0-exp(-2.0*(entropy_xy2.direction[i].green- entropy_xy.direction[i].green))))); - channel_features[BlueChannel].measure_of_correlation_2[i]= + channel_features[BluePixelChannel].measure_of_correlation_2[i]= (sqrt(fabs(1.0-exp(-2.0*(entropy_xy2.direction[i].blue- entropy_xy.direction[i].blue))))); if (image->colorspace == CMYKColorspace) - channel_features[BlackChannel].measure_of_correlation_2[i]= + channel_features[BlackPixelChannel].measure_of_correlation_2[i]= (sqrt(fabs(1.0-exp(-2.0*(entropy_xy2.direction[i].black- entropy_xy.direction[i].black))))); if (image->matte != MagickFalse) - channel_features[OpacityChannel].measure_of_correlation_2[i]= + channel_features[AlphaPixelChannel].measure_of_correlation_2[i]= (sqrt(fabs(1.0-exp(-2.0*(entropy_xy2.direction[i].alpha- entropy_xy.direction[i].alpha))))); } @@ -1181,31 +1181,34 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image, density_y[x].direction[i].alpha; } } - channel_features[RedChannel].contrast[i]+=z*z*pixel.direction[i].red; - channel_features[GreenChannel].contrast[i]+=z*z*pixel.direction[i].green; - channel_features[BlueChannel].contrast[i]+=z*z*pixel.direction[i].blue; + channel_features[RedPixelChannel].contrast[i]+=z*z* + pixel.direction[i].red; + channel_features[GreenPixelChannel].contrast[i]+=z*z* + pixel.direction[i].green; + channel_features[BluePixelChannel].contrast[i]+=z*z* + pixel.direction[i].blue; if (image->colorspace == CMYKColorspace) - channel_features[BlackChannel].contrast[i]+=z*z* + channel_features[BlackPixelChannel].contrast[i]+=z*z* pixel.direction[i].black; if (image->matte != MagickFalse) - channel_features[OpacityChannel].contrast[i]+=z*z* + channel_features[AlphaPixelChannel].contrast[i]+=z*z* pixel.direction[i].alpha; } /* Maximum Correlation Coefficient. Future: return second largest eigenvalue of Q. */ - channel_features[RedChannel].maximum_correlation_coefficient[i]= + channel_features[RedPixelChannel].maximum_correlation_coefficient[i]= sqrt((double) -1.0); - channel_features[GreenChannel].maximum_correlation_coefficient[i]= + channel_features[GreenPixelChannel].maximum_correlation_coefficient[i]= sqrt((double) -1.0); - channel_features[BlueChannel].maximum_correlation_coefficient[i]= + channel_features[BluePixelChannel].maximum_correlation_coefficient[i]= sqrt((double) -1.0); if (image->colorspace == CMYKColorspace) - channel_features[BlackChannel].maximum_correlation_coefficient[i]= + channel_features[BlackPixelChannel].maximum_correlation_coefficient[i]= sqrt((double) -1.0); if (image->matte != MagickFalse) - channel_features[OpacityChannel].maximum_correlation_coefficient[i]= + channel_features[AlphaPixelChannel].maximum_correlation_coefficient[i]= sqrt((double) -1.0); } /* diff --git a/MagickCore/fourier.c b/MagickCore/fourier.c index 36f04ce5e..c0f114b1a 100644 --- a/MagickCore/fourier.c +++ b/MagickCore/fourier.c @@ -80,7 +80,7 @@ */ typedef struct _FourierInfo { - ChannelType + PixelChannel channel; MagickBooleanType @@ -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); @@ -356,43 +350,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); @@ -459,37 +447,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); @@ -554,7 +537,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 @@ -686,10 +669,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 +686,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 +700,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 +714,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 +728,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; } @@ -880,37 +863,32 @@ 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); @@ -928,37 +906,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); @@ -1092,37 +1065,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 +1105,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 @@ -1262,10 +1230,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 +1247,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 +1261,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 +1275,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 +1289,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; } diff --git a/MagickCore/magick-config.h b/MagickCore/magick-config.h index 54e2e2ac5..4de7f9ad5 100644 --- a/MagickCore/magick-config.h +++ b/MagickCore/magick-config.h @@ -12,7 +12,9 @@ /* #undef AUTOTRACE_DELEGATE */ /* Define if coders and filters are to be built as modules. */ -/* #undef BUILD_MODULES */ +#ifndef MAGICKCORE_BUILD_MODULES +#define MAGICKCORE_BUILD_MODULES 1 +#endif /* Define if you have the bzip2 library */ #ifndef MAGICKCORE_BZLIB_DELEGATE @@ -75,7 +77,9 @@ #endif /* Define if you have FFTW library */ -/* #undef FFTW_DELEGATE */ +#ifndef MAGICKCORE_FFTW_DELEGATE +#define MAGICKCORE_FFTW_DELEGATE 1 +#endif /* Location of filter modules */ #ifndef MAGICKCORE_FILTER_PATH @@ -217,7 +221,9 @@ #endif /* Define to 1 if you have the header file. */ -/* #undef HAVE_CL_CL_H */ +#ifndef MAGICKCORE_HAVE_CL_CL_H +#define MAGICKCORE_HAVE_CL_CL_H 1 +#endif /* Define to 1 if you have the header file. */ #ifndef MAGICKCORE_HAVE_COMPLEX_H @@ -435,15 +441,15 @@ #endif /* Define if you have the header file. */ -#ifndef MAGICKCORE_HAVE_LCMS2_H -#define MAGICKCORE_HAVE_LCMS2_H 1 -#endif +/* #undef HAVE_LCMS2_H */ /* Define if you have the header file. */ /* #undef HAVE_LCMS2_LCMS2_H */ /* Define if you have the header file. */ -/* #undef HAVE_LCMS_H */ +#ifndef MAGICKCORE_HAVE_LCMS_H +#define MAGICKCORE_HAVE_LCMS_H 1 +#endif /* Define if you have the header file. */ /* #undef HAVE_LCMS_LCMS_H */ @@ -1166,7 +1172,9 @@ #endif /* Define if you have JBIG library */ -/* #undef JBIG_DELEGATE */ +#ifndef MAGICKCORE_JBIG_DELEGATE +#define MAGICKCORE_JBIG_DELEGATE 1 +#endif /* Define if you have JPEG version 2 "Jasper" library */ #ifndef MAGICKCORE_JP2_DELEGATE @@ -1195,7 +1203,9 @@ #endif /* Define if you have LQR library */ -/* #undef LQR_DELEGATE */ +#ifndef MAGICKCORE_LQR_DELEGATE +#define MAGICKCORE_LQR_DELEGATE 1 +#endif /* Define if using libltdl to support dynamically loadable modules */ #ifndef MAGICKCORE_LTDL_DELEGATE @@ -1207,7 +1217,7 @@ /* 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/atlas:/usr/lib/llvm:/usr/lib64/llvm:/usr/lib64/mysql:/usr/lib64/qt-3.3/lib:/usr/lib64/tcl8.5/tclx8.4:/usr/lib64/tcl8.5:/usr/lib64/tracker-0.12:/usr/lib/wine/:/usr/lib64/wine/:/usr/lib64/xulrunner-2" +#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:/opt/intel/lib/intel64:/usr/lib64/llvm:/usr/local/lib:/usr/lib64/mysql:/usr/lib64/nvidia:/usr/lib64/qt-3.3/lib:/usr/lib64/tracker-0.12:/usr/lib64/xulrunner-2" #endif /* The archive extension */ @@ -1258,7 +1268,9 @@ /* #undef NO_MINUS_C_MINUS_O */ /* Define if you have OPENEXR library */ -/* #undef OPENEXR_DELEGATE */ +#ifndef MAGICKCORE_OPENEXR_DELEGATE +#define MAGICKCORE_OPENEXR_DELEGATE 1 +#endif /* Name of package */ #ifndef MAGICKCORE_PACKAGE @@ -1318,7 +1330,9 @@ #endif /* Define if you have RSVG library */ -/* #undef RSVG_DELEGATE */ +#ifndef MAGICKCORE_RSVG_DELEGATE +#define MAGICKCORE_RSVG_DELEGATE 1 +#endif /* Define to the type of arg 1 for `select'. */ #ifndef MAGICKCORE_SELECT_TYPE_ARG1 @@ -1465,7 +1479,9 @@ #endif /* Define if you have WEBP library */ -/* #undef WEBP_DELEGATE */ +#ifndef MAGICKCORE_WEBP_DELEGATE +#define MAGICKCORE_WEBP_DELEGATE 1 +#endif /* Define to use the Windows GDI32 library */ /* #undef WINGDI32_DELEGATE */ @@ -1474,7 +1490,9 @@ /* #undef WITH_DMALLOC */ /* Define if you have WMF library */ -/* #undef WMF_DELEGATE */ +#ifndef MAGICKCORE_WMF_DELEGATE +#define MAGICKCORE_WMF_DELEGATE 1 +#endif /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ diff --git a/MagickCore/version.h b/MagickCore/version.h index 6e1d28104..577d9a2cd 100644 --- a/MagickCore/version.h +++ b/MagickCore/version.h @@ -27,14 +27,14 @@ extern "C" { */ #define MagickPackageName "ImageMagick" #define MagickCopyright "Copyright (C) 1999-2011 ImageMagick Studio LLC" -#define MagickSVNRevision "5659" +#define MagickSVNRevision "exported" #define MagickLibVersion 0x700 #define MagickLibVersionText "7.0.0" #define MagickLibVersionNumber 7,0,0 #define MagickLibAddendum "-0" #define MagickLibInterface 7 #define MagickLibMinInterface 7 -#define MagickReleaseDate "2011-10-15" +#define MagickReleaseDate "2011-10-17" #define MagickChangeDate "20110801" #define MagickAuthoritativeURL "http://www.imagemagick.org" #if defined(MAGICKCORE_OPENMP_SUPPORT) diff --git a/MagickWand/compare.c b/MagickWand/compare.c index aef830125..e285cbc53 100644 --- a/MagickWand/compare.c +++ b/MagickWand/compare.c @@ -1071,55 +1071,55 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info, default: { (void) FormatLocaleFile(stderr," red: %g (%g)\n", - QuantumRange*channel_distortion[RedChannel], - channel_distortion[RedChannel]); + QuantumRange*channel_distortion[RedPixelChannel], + channel_distortion[RedPixelChannel]); (void) FormatLocaleFile(stderr," green: %g (%g)\n", - QuantumRange*channel_distortion[GreenChannel], - channel_distortion[GreenChannel]); + QuantumRange*channel_distortion[GreenPixelChannel], + channel_distortion[GreenPixelChannel]); (void) FormatLocaleFile(stderr," blue: %g (%g)\n", - QuantumRange*channel_distortion[BlueChannel], - channel_distortion[BlueChannel]); + QuantumRange*channel_distortion[BluePixelChannel], + channel_distortion[BluePixelChannel]); if (image->matte != MagickFalse) (void) FormatLocaleFile(stderr," alpha: %g (%g)\n", - QuantumRange*channel_distortion[AlphaChannel], - channel_distortion[AlphaChannel]); + QuantumRange*channel_distortion[AlphaPixelChannel], + channel_distortion[AlphaPixelChannel]); break; } case CMYKColorspace: { (void) FormatLocaleFile(stderr," cyan: %g (%g)\n", - QuantumRange*channel_distortion[CyanChannel], - channel_distortion[CyanChannel]); + QuantumRange*channel_distortion[CyanPixelChannel], + channel_distortion[CyanPixelChannel]); (void) FormatLocaleFile(stderr," magenta: %g (%g)\n", - QuantumRange*channel_distortion[MagentaChannel], - channel_distortion[MagentaChannel]); + QuantumRange*channel_distortion[MagentaPixelChannel], + channel_distortion[MagentaPixelChannel]); (void) FormatLocaleFile(stderr," yellow: %g (%g)\n", - QuantumRange*channel_distortion[YellowChannel], - channel_distortion[YellowChannel]); + QuantumRange*channel_distortion[YellowPixelChannel], + channel_distortion[YellowPixelChannel]); (void) FormatLocaleFile(stderr," black: %g (%g)\n", - QuantumRange*channel_distortion[BlackChannel], - channel_distortion[BlackChannel]); + QuantumRange*channel_distortion[BlackPixelChannel], + channel_distortion[BlackPixelChannel]); if (image->matte != MagickFalse) (void) FormatLocaleFile(stderr," alpha: %g (%g)\n", - QuantumRange*channel_distortion[AlphaChannel], - channel_distortion[AlphaChannel]); + QuantumRange*channel_distortion[AlphaPixelChannel], + channel_distortion[AlphaPixelChannel]); break; } case GRAYColorspace: { (void) FormatLocaleFile(stderr," gray: %g (%g)\n", - QuantumRange*channel_distortion[GrayChannel], - channel_distortion[GrayChannel]); + QuantumRange*channel_distortion[GrayPixelChannel], + channel_distortion[GrayPixelChannel]); if (image->matte != MagickFalse) (void) FormatLocaleFile(stderr," alpha: %g (%g)\n", - QuantumRange*channel_distortion[AlphaChannel], - channel_distortion[AlphaChannel]); + QuantumRange*channel_distortion[AlphaPixelChannel], + channel_distortion[AlphaPixelChannel]); break; } } (void) FormatLocaleFile(stderr," all: %g (%g)\n", - QuantumRange*channel_distortion[CompositeChannels], - channel_distortion[CompositeChannels]); + QuantumRange*channel_distortion[MaxPixelChannels], + channel_distortion[MaxPixelChannels]); break; } case AbsoluteErrorMetric: @@ -1132,49 +1132,49 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info, default: { (void) FormatLocaleFile(stderr," red: %g\n", - channel_distortion[RedChannel]); + channel_distortion[RedPixelChannel]); (void) FormatLocaleFile(stderr," green: %g\n", - channel_distortion[GreenChannel]); + channel_distortion[GreenPixelChannel]); (void) FormatLocaleFile(stderr," blue: %g\n", - channel_distortion[BlueChannel]); + channel_distortion[BluePixelChannel]); if (image->matte != MagickFalse) (void) FormatLocaleFile(stderr," alpha: %g\n", - channel_distortion[AlphaChannel]); + channel_distortion[AlphaPixelChannel]); break; } case CMYKColorspace: { (void) FormatLocaleFile(stderr," cyan: %g\n", - channel_distortion[CyanChannel]); + channel_distortion[CyanPixelChannel]); (void) FormatLocaleFile(stderr," magenta: %g\n", - channel_distortion[MagentaChannel]); + channel_distortion[MagentaPixelChannel]); (void) FormatLocaleFile(stderr," yellow: %g\n", - channel_distortion[YellowChannel]); + channel_distortion[YellowPixelChannel]); (void) FormatLocaleFile(stderr," black: %g\n", - channel_distortion[BlackChannel]); + channel_distortion[BlackPixelChannel]); if (image->matte != MagickFalse) (void) FormatLocaleFile(stderr," alpha: %g\n", - channel_distortion[AlphaChannel]); + channel_distortion[AlphaPixelChannel]); break; } case GRAYColorspace: { (void) FormatLocaleFile(stderr," gray: %g\n", - channel_distortion[GrayChannel]); + channel_distortion[GrayPixelChannel]); if (image->matte != MagickFalse) (void) FormatLocaleFile(stderr," alpha: %g\n", - channel_distortion[AlphaChannel]); + channel_distortion[AlphaPixelChannel]); break; } } (void) FormatLocaleFile(stderr," all: %g\n", - channel_distortion[CompositeChannels]); + channel_distortion[MaxPixelChannels]); break; } case MeanErrorPerPixelMetric: { (void) FormatLocaleFile(stderr," %g (%g, %g)\n", - channel_distortion[CompositeChannels], + channel_distortion[MaxPixelChannels], image->error.normalized_mean_error, image->error.normalized_maximum_error); break; diff --git a/MagickWand/magick-image.c b/MagickWand/magick-image.c index 3b3cb0024..2f0dbf78f 100644 --- a/MagickWand/magick-image.c +++ b/MagickWand/magick-image.c @@ -3768,7 +3768,7 @@ WandExport MagickBooleanType MagickGetImageBorderColor(MagickWand *wand, % example, like this: % % channel_features=MagickGetImageFeatures(wand,1); -% contrast=channel_features[RedChannel].contrast[0]; +% contrast=channel_features[RedPixelChannel].contrast[0]; % % Use MagickRelinquishMemory() to free the statistics buffer. % @@ -3950,7 +3950,7 @@ WandExport MagickBooleanType MagickGetImageRange(MagickWand *wand, % You can access the red channel mean, for example, like this: % % channel_statistics=MagickGetImageStatistics(wand); -% red_mean=channel_statistics[RedChannel].mean; +% red_mean=channel_statistics[RedPixelChannel].mean; % % Use MagickRelinquishMemory() to free the statistics buffer. % @@ -6050,7 +6050,8 @@ WandExport MagickBooleanType MagickLabelImage(MagickWand *wand, % % o wand: the magick wand. % -% o channel: Identify which channel to level: RedChannel, GreenChannel, +% o channel: Identify which channel to level: RedPixelChannel, +% GreenPixelChannel, etc. % % o black_point: the black point. %