From: cristy Date: Sun, 23 Oct 2011 01:01:01 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~6760 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5f95f4f77efc46ff53593d750491c8f60698c983;p=imagemagick --- diff --git a/MagickCore/cache.c b/MagickCore/cache.c index 8da3c3c36..f5b23fcfa 100644 --- a/MagickCore/cache.c +++ b/MagickCore/cache.c @@ -3143,7 +3143,7 @@ MagickPrivate const Quantum *GetVirtualPixelsFromNexus(const Image *image, Quantum *pixels, - virtual_pixel[MaxPixelChannels]; + virtual_pixel[CompositePixelChannel]; RectangleInfo region; diff --git a/MagickCore/compare.c b/MagickCore/compare.c index 0e21c7672..4b5bd0fa1 100644 --- a/MagickCore/compare.c +++ b/MagickCore/compare.c @@ -379,7 +379,7 @@ static MagickBooleanType GetAbsoluteDistortion(const Image *image, if (difference != MagickFalse) { channel_distortion[i]++; - channel_distortion[MaxPixelChannels]++; + channel_distortion[CompositePixelChannel]++; } p+=GetPixelChannels(image); q+=GetPixelChannels(reconstruct_image); @@ -491,7 +491,7 @@ static MagickBooleanType GetFuzzDistortion(const Image *image, reconstruct_image,channel,q)); distance*=distance; channel_distortion[i]+=distance; - channel_distortion[MaxPixelChannels]+=distance; + channel_distortion[CompositePixelChannel]+=distance; } p+=GetPixelChannels(image); q+=GetPixelChannels(reconstruct_image); @@ -506,8 +506,8 @@ static MagickBooleanType GetFuzzDistortion(const Image *image, image_view=DestroyCacheView(image_view); for (i=0; i <= MaxPixelChannels; i++) distortion[i]/=((double) image->columns*image->rows); - distortion[MaxPixelChannels]/=(double) GetImageChannels(image); - distortion[MaxPixelChannels]=sqrt(distortion[MaxPixelChannels]); + distortion[CompositePixelChannel]/=(double) GetImageChannels(image); + distortion[CompositePixelChannel]=sqrt(distortion[CompositePixelChannel]); return(status); } @@ -585,7 +585,7 @@ static MagickBooleanType GetMeanAbsoluteDistortion(const Image *image, distance=QuantumScale*fabs(p[i]-(MagickRealType) GetPixelChannel( reconstruct_image,channel,q)); channel_distortion[i]+=distance; - channel_distortion[MaxPixelChannels]+=distance; + channel_distortion[CompositePixelChannel]+=distance; } p+=GetPixelChannels(image); q+=GetPixelChannels(reconstruct_image); @@ -600,7 +600,7 @@ static MagickBooleanType GetMeanAbsoluteDistortion(const Image *image, image_view=DestroyCacheView(image_view); for (i=0; i <= MaxPixelChannels; i++) distortion[i]/=((double) image->columns*image->rows); - distortion[MaxPixelChannels]/=(double) GetImageChannels(image); + distortion[CompositePixelChannel]/=(double) GetImageChannels(image); return(status); } @@ -677,7 +677,7 @@ static MagickBooleanType GetMeanErrorPerPixel(Image *image, distance=fabs((double) (alpha*p[i]-beta*GetPixelChannel( reconstruct_image,channel,q))); distortion[i]+=distance; - distortion[MaxPixelChannels]+=distance; + distortion[CompositePixelChannel]+=distance; mean_error+=distance*distance; if (distance > maximum_error) maximum_error=distance; @@ -689,7 +689,7 @@ static MagickBooleanType GetMeanErrorPerPixel(Image *image, } reconstruct_view=DestroyCacheView(reconstruct_view); image_view=DestroyCacheView(image_view); - image->error.mean_error_per_pixel=distortion[MaxPixelChannels]/area; + image->error.mean_error_per_pixel=distortion[CompositePixelChannel]/area; image->error.normalized_mean_error=QuantumScale*QuantumScale*mean_error/area; image->error.normalized_maximum_error=QuantumScale*maximum_error; return(status); @@ -770,7 +770,7 @@ static MagickBooleanType GetMeanSquaredDistortion(const Image *image, reconstruct_image,channel,q)); distance*=distance; channel_distortion[i]+=distance; - channel_distortion[MaxPixelChannels]+=distance; + channel_distortion[CompositePixelChannel]+=distance; } p+=GetPixelChannels(image); q+=GetPixelChannels(reconstruct_image); @@ -785,7 +785,7 @@ static MagickBooleanType GetMeanSquaredDistortion(const Image *image, image_view=DestroyCacheView(image_view); for (i=0; i <= MaxPixelChannels; i++) distortion[i]/=((double) image->columns*image->rows); - distortion[MaxPixelChannels]/=GetImageChannels(image); + distortion[CompositePixelChannel]/=GetImageChannels(image); return(status); } @@ -894,7 +894,7 @@ static MagickBooleanType GetNormalizedCrossCorrelationDistortion( /* Divide by the standard deviation. */ - distortion[MaxPixelChannels]=0.0; + distortion[CompositePixelChannel]=0.0; for (i=0; i < MaxPixelChannels; i++) { MagickRealType @@ -908,9 +908,9 @@ static MagickBooleanType GetNormalizedCrossCorrelationDistortion( reconstruct_statistics[channel].standard_deviation; gamma=1.0/(fabs((double) gamma) <= MagickEpsilon ? 1.0 : gamma); distortion[i]=QuantumRange*gamma*distortion[i]; - distortion[MaxPixelChannels]+=distortion[i]*distortion[i]; + distortion[CompositePixelChannel]+=distortion[i]*distortion[i]; } - distortion[MaxPixelChannels]=sqrt(distortion[MaxPixelChannels]/ + distortion[CompositePixelChannel]=sqrt(distortion[CompositePixelChannel]/ GetImageChannels(image)); /* Free resources. @@ -994,8 +994,8 @@ static MagickBooleanType GetPeakAbsoluteDistortion(const Image *image, reconstruct_image,channel,q)); if (distance > channel_distortion[i]) channel_distortion[i]=distance; - if (distance > channel_distortion[MaxPixelChannels]) - channel_distortion[MaxPixelChannels]=distance; + if (distance > channel_distortion[CompositePixelChannel]) + channel_distortion[CompositePixelChannel]=distance; } p+=GetPixelChannels(image); q+=GetPixelChannels(image); @@ -1136,7 +1136,7 @@ MagickExport MagickBooleanType GetImageDistortion(Image *image, break; } } - *distortion=channel_distortion[MaxPixelChannels]; + *distortion=channel_distortion[CompositePixelChannel]; channel_distortion=(double *) RelinquishMagickMemory(channel_distortion); return(status); } diff --git a/MagickCore/composite.c b/MagickCore/composite.c index a2e4ab2df..038ea55cf 100644 --- a/MagickCore/composite.c +++ b/MagickCore/composite.c @@ -342,7 +342,7 @@ static inline void CompositeDarken(const Image *image,const PixelInfo *p, Darken is equivalent to a 'Minimum' method OR a greyscale version of a binary 'Or' OR the 'Intersection' of pixel sets. */ - if (image->sync == MagickFalse) + if (image->channel_mask != DefaultChannels) { /* Handle channels as separate grayscale channels. @@ -382,7 +382,7 @@ static inline void CompositeDarkenIntensity(const Image *image, If 'Sync' flag select whole pixel based on alpha weighted intensity. Otherwise use intensity only, but restrict copy according to channel. */ - if (image->sync == MagickFalse) + if (image->channel_mask != DefaultChannels) { MagickBooleanType from_p; @@ -427,7 +427,7 @@ static inline void CompositeDifference(const Image *image,const PixelInfo *p, Sa=QuantumScale*p->alpha; /* simplify and speed up equations */ Da=QuantumScale*q->alpha; - if (image->sync == MagickFalse) + if (image->channel_mask != DefaultChannels) { /* Handle channels as separate grayscale channels. @@ -485,7 +485,7 @@ static inline void CompositeDivide(const Image *image,const PixelInfo *p, Sa=QuantumScale*p->alpha; /* simplify and speed up equations */ Da=QuantumScale*q->alpha; - if (image->sync == MagickFalse) + if (image->channel_mask != DefaultChannels) { /* Handle channels as separate grayscale channels. @@ -537,7 +537,7 @@ static inline void CompositeExclusion(const Image *image,const PixelInfo *p, Sa=QuantumScale*p->alpha; /* simplify and speed up equations */ Da=QuantumScale*q->alpha; - if (image->sync == MagickFalse) + if (image->channel_mask != DefaultChannels) { /* Handle channels as separate grayscale channels. @@ -691,7 +691,7 @@ static inline void CompositeLighten(const Image *image,const PixelInfo *p, Lighten is also equvalent to a 'Maximum' method OR a greyscale version of a binary 'And' OR the 'Union' of pixel sets. */ - if (image->sync == MagickFalse) + if (image->channel_mask != DefaultChannels) { /* Handle channels as separate grayscale channels @@ -731,7 +731,7 @@ static inline void CompositeLightenIntensity(const Image *image, If 'Sync' flag select whole pixel based on alpha weighted intensity. Otherwise use Intenisty only, but restrict copy according to channel. */ - if (image->sync == MagickFalse) + if (image->channel_mask != DefaultChannels) { MagickBooleanType from_p; @@ -891,7 +891,7 @@ static inline void CompositeMathematics(const Image *image,const PixelInfo *p, Sa=QuantumScale*p->alpha; /* ??? - AT */ Da=QuantumScale*q->alpha; - if (image->sync == MagickFalse) + if (image->channel_mask != DefaultChannels) { /* Handle channels as separate grayscale channels. @@ -945,7 +945,7 @@ static inline void CompositePlus(const Image *image,const PixelInfo *p, The CompositePixelInfoPlus() function is defined in "composite-private.h" so it can also be used for Image Blending. */ - if (image->sync == MagickFalse) + if (image->channel_mask != DefaultChannels) { /* Handle channels as separate grayscale channels. @@ -988,7 +988,7 @@ static inline void CompositeMinus(const Image *image,const PixelInfo *p, Sa=QuantumScale*p->alpha; /* simplify and speed up equations */ Da=QuantumScale*q->alpha; - if (image->sync == MagickFalse) + if (image->channel_mask != DefaultChannels) { /* Handle channels as separate grayscale channels. @@ -1036,7 +1036,7 @@ static inline void CompositeModulusAdd(const Image *image,const PixelInfo *p, gamma, Sa; - if (image->sync == MagickFalse) + if (image->channel_mask != DefaultChannels) { /* Handle channels as separate grayscale channels. @@ -1086,7 +1086,7 @@ static inline void CompositeModulusSubtract(const Image *image, gamma, Sa; - if (image->sync == MagickFalse) + if (image->channel_mask != DefaultChannels) { /* Handle channels as separate grayscale channels, @@ -1132,7 +1132,7 @@ static inline void CompositeMultiply(const Image *image,const PixelInfo *p, Sa=QuantumScale*p->alpha; /* simplify and speed up equations */ Da=QuantumScale*q->alpha; - if (image->sync == MagickFalse) + if (image->channel_mask != DefaultChannels) { /* Handle channels as separate grayscale channels. @@ -1290,7 +1290,7 @@ static inline void CompositeScreen(const Image *image,const PixelInfo *p, Sa=QuantumScale*p->alpha; /* simplify and speed up equations */ Da=QuantumScale*q->alpha; - if (image->sync == MagickFalse) + if (image->channel_mask != DefaultChannels) { /* Handle channels as separate grayscale channels. diff --git a/MagickCore/display.c b/MagickCore/display.c index e89f51e4d..e519246f7 100644 --- a/MagickCore/display.c +++ b/MagickCore/display.c @@ -3758,7 +3758,7 @@ static MagickBooleanType XColorEditImage(Display *display, target; Quantum - virtual_pixel[MaxPixelChannels]; + virtual_pixel[CompositePixelChannel]; /* Update color information using replace algorithm. @@ -10120,7 +10120,7 @@ static MagickBooleanType XMatteEditImage(Display *display, target; Quantum - virtual_pixel[MaxPixelChannels]; + virtual_pixel[CompositePixelChannel]; /* Update matte information using replace algorithm. @@ -13245,7 +13245,7 @@ static Image *XTileImage(Display *display,XResourceInfo *resource_info, pixel; Quantum - virtual_pixel[MaxPixelChannels]; + virtual_pixel[CompositePixelChannel]; register int j; diff --git a/MagickCore/draw.c b/MagickCore/draw.c index b3ed8197e..b749b17af 100644 --- a/MagickCore/draw.c +++ b/MagickCore/draw.c @@ -4194,7 +4194,7 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, target; Quantum - virtual_pixel[MaxPixelChannels]; + virtual_pixel[CompositePixelChannel]; (void) GetOneCacheViewVirtualPixel(image_view,x,y,virtual_pixel, exception); @@ -4317,7 +4317,7 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, target; Quantum - virtual_pixel[MaxPixelChannels]; + virtual_pixel[CompositePixelChannel]; (void) GetOneCacheViewVirtualPixel(image_view,x,y,virtual_pixel, exception); diff --git a/MagickCore/enhance.c b/MagickCore/enhance.c index 07db5ff35..1877b24cf 100644 --- a/MagickCore/enhance.c +++ b/MagickCore/enhance.c @@ -116,7 +116,7 @@ MagickExport MagickBooleanType AutoGammaImage(Image *image, i; log_mean=log(0.5); - if (image->sync != MagickFalse) + if (image->channel_mask == DefaultChannels) { /* Apply gamma correction equally across all given channels. @@ -1483,11 +1483,11 @@ MagickExport MagickBooleanType EqualizeImage(Image *image, progress; MagickRealType - black[MaxPixelChannels], + black[CompositePixelChannel], *equalize_map, *histogram, *map, - white[MaxPixelChannels]; + white[CompositePixelChannel]; register ssize_t i; diff --git a/MagickCore/fx.c b/MagickCore/fx.c index 3cf788051..2ee6b5178 100644 --- a/MagickCore/fx.c +++ b/MagickCore/fx.c @@ -4684,7 +4684,7 @@ MagickExport Image *SteganoImage(const Image *image,const Image *watermark, for (x=0; (x < (ssize_t) watermark->columns) && (j < (ssize_t) depth); x++) { Quantum - virtual_pixel[MaxPixelChannels]; + virtual_pixel[CompositePixelChannel]; (void) GetOneCacheViewVirtualPixel(watermark_view,x,y,virtual_pixel, exception); diff --git a/MagickCore/histogram.c b/MagickCore/histogram.c index 9078fc3c8..af17ac290 100644 --- a/MagickCore/histogram.c +++ b/MagickCore/histogram.c @@ -994,7 +994,7 @@ MagickExport MagickBooleanType MinMaxStretchImage(Image *image, status; status=MagickTrue; - if (image->sync != MagickFalse) + if (image->channel_mask == DefaultChannels) { /* Auto-level all channels equally. diff --git a/MagickCore/image.c b/MagickCore/image.c index 4f56f5970..c31f1a363 100644 --- a/MagickCore/image.c +++ b/MagickCore/image.c @@ -826,7 +826,6 @@ MagickExport Image *CloneImage(const Image *image,const size_t columns, clone_image->magick_columns=image->magick_columns; clone_image->magick_rows=image->magick_rows; clone_image->type=image->type; - clone_image->sync=image->sync; clone_image->channel_mask=image->channel_mask; clone_image->channel_map=ClonePixelChannelMap(image->channel_map); (void) CopyMagickString(clone_image->magick_filename,image->magick_filename, diff --git a/MagickCore/image.h b/MagickCore/image.h index 008555401..6e6ecaee5 100644 --- a/MagickCore/image.h +++ b/MagickCore/image.h @@ -285,9 +285,6 @@ struct _Image number_meta_channels, metacontent_extent; - MagickBooleanType - sync; - ChannelType channel_mask; diff --git a/MagickCore/morphology.c b/MagickCore/morphology.c index 6eeb38904..139e3bfd2 100644 --- a/MagickCore/morphology.c +++ b/MagickCore/morphology.c @@ -2656,7 +2656,7 @@ static ssize_t MorphologyPrimitive(const Image *image,Image *morphology_image, */ k = &kernel->values[ kernel->height-1 ]; k_pixels = p; - if ( (image->sync == MagickFalse) || (image->matte == MagickFalse) ) + if ( (image->channel_mask != DefaultChannels) || (image->matte == MagickFalse) ) { /* No 'Sync' involved. ** Convolution is simple greyscale channel operation */ @@ -2880,7 +2880,7 @@ static ssize_t MorphologyPrimitive(const Image *image,Image *morphology_image, */ k = &kernel->values[ kernel->width*kernel->height-1 ]; k_pixels = p; - if ( (image->sync == MagickFalse) || + if ( (image->channel_mask != DefaultChannels) || (image->matte == MagickFalse) ) { /* No 'Sync' involved. ** Convolution is simple greyscale channel operation @@ -4091,7 +4091,6 @@ MagickPrivate Image *MorphologyApply(const Image *image, (void) FormatLocaleFile(stderr, "\n%s: Difference with original image",CommandOptionToMnemonic( MagickMorphologyOptions, method) ); - curr_image->sync=MagickFalse; (void) CompositeImage(curr_image,DifferenceCompositeOp,image,0,0, exception); break; @@ -4100,7 +4099,6 @@ MagickPrivate Image *MorphologyApply(const Image *image, (void) FormatLocaleFile(stderr, "\n%s: Difference of Dilate and Erode",CommandOptionToMnemonic( MagickMorphologyOptions, method) ); - curr_image->sync=MagickFalse; (void) CompositeImage(curr_image,DifferenceCompositeOp,save_image,0, 0,exception); save_image = DestroyImage(save_image); /* finished with save image */ @@ -4138,7 +4136,6 @@ MagickPrivate Image *MorphologyApply(const Image *image, if ( verbose == MagickTrue ) (void) FormatLocaleFile(stderr, " (compose \"%s\")", CommandOptionToMnemonic(MagickComposeOptions, rslt_compose) ); - rslt_image->sync=MagickFalse; (void) CompositeImage(rslt_image, rslt_compose, curr_image, 0, 0, exception); curr_image = DestroyImage(curr_image); diff --git a/MagickCore/pixel.c b/MagickCore/pixel.c index 904256422..c6b42f7f7 100644 --- a/MagickCore/pixel.c +++ b/MagickCore/pixel.c @@ -3573,7 +3573,6 @@ MagickExport void InitializePixelChannelMap(Image *image) SetPixelChannelMapChannel(image,(PixelChannel) i,(PixelChannel) i); SetPixelChannelMapTraits(image,(PixelChannel) i,UndefinedPixelTrait); } - image->sync=MagickTrue; image->number_channels=4; if (0 && image->colorspace == GRAYColorspace) image->number_channels=2; @@ -5102,8 +5101,8 @@ MagickExport MagickBooleanType IsFuzzyEquivalencePixel(const Image *image, distance, scale; - fuzz=MagickMax(image->fuzz,(MagickRealType) MagickSQ1_2)* - MagickMax(image->fuzz,(MagickRealType) MagickSQ1_2); + fuzz=MagickMax(image->fuzz,(MagickRealType) MagickSQ1_2)*MagickMax( + image->fuzz,(MagickRealType) MagickSQ1_2); scale=1.0; distance=0.0; if (image->matte != MagickFalse) @@ -5173,13 +5172,13 @@ MagickExport MagickBooleanType IsFuzzyEquivalencePixel(const Image *image, % colors is less than the specified distance in a linear three (or four) % dimensional color space. % -% This implements the equivalent of... -% fuzz < sqrt( color_distance^2 * u.a*v.a + alpha_distance^2 ) +% This implements the equivalent of: +% fuzz < sqrt(color_distance^2 * u.a*v.a + alpha_distance^2) % % Which produces a multi-dimensional cone for that colorspace along the % transparency vector. % -% For example for an RGB +% For example for an RGB: % color_distance^2 = ( (u.r-v.r)^2 + (u.g-v.g)^2 + (u.b-v.b)^2 ) / 3 % % See http://www.imagemagick.org/Usage/bugs/fuzz_distance/ @@ -5216,14 +5215,14 @@ MagickExport MagickBooleanType IsFuzzyEquivalencePixelInfo(const PixelInfo *p, if ((p->fuzz == 0.0) && (q->fuzz == 0.0)) return(IsPixelInfoEquivalent(p,q)); if (p->fuzz == 0.0) - fuzz=MagickMax(q->fuzz,(MagickRealType) MagickSQ1_2)* - MagickMax(q->fuzz,(MagickRealType) MagickSQ1_2); + fuzz=MagickMax(q->fuzz,(MagickRealType) MagickSQ1_2)*MagickMax(q->fuzz, + (MagickRealType) MagickSQ1_2); else if (q->fuzz == 0.0) - fuzz=MagickMax(p->fuzz,(MagickRealType) MagickSQ1_2)* - MagickMax(p->fuzz,(MagickRealType) MagickSQ1_2); + fuzz=MagickMax(p->fuzz,(MagickRealType) MagickSQ1_2)*MagickMax(p->fuzz, + (MagickRealType) MagickSQ1_2); else - fuzz=MagickMax(p->fuzz,(MagickRealType) MagickSQ1_2)* - MagickMax(q->fuzz,(MagickRealType) MagickSQ1_2); + fuzz=MagickMax(p->fuzz,(MagickRealType) MagickSQ1_2)*MagickMax(q->fuzz, + (MagickRealType) MagickSQ1_2); scale=1.0; distance=0.0; if ((p->matte != MagickFalse) || (q->matte != MagickFalse)) @@ -5238,7 +5237,7 @@ MagickExport MagickBooleanType IsFuzzyEquivalencePixelInfo(const PixelInfo *p, return(MagickFalse); /* Generate a alpha scaling factor to generate a 4D cone on colorspace. - Note that if one color is transparent, distance has no color component. + If one color is transparent, distance has no color component. */ if (p->matte != MagickFalse) scale=(QuantumScale*p->alpha); @@ -5268,10 +5267,10 @@ MagickExport MagickBooleanType IsFuzzyEquivalencePixelInfo(const PixelInfo *p, if ((p->colorspace == HSLColorspace) || (p->colorspace == HSBColorspace) || (p->colorspace == HWBColorspace)) { - /* This calculates a arc distance for hue - Really if should be a vector angle of 'S'/'W' length - with 'L'/'B' forming appropriate cones. - In other words this is a hack - Anthony + /* + This calculates a arc distance for hue-- it should be a vector angle + of 'S'/'W' length with 'L'/'B' forming appropriate cones. In other + words this is a hack - Anthony. */ if (fabs((double) pixel) > (QuantumRange/2)) pixel-=QuantumRange; @@ -5324,7 +5323,6 @@ MagickExport void SetPixelChannelMap(Image *image, register ssize_t i; - image->sync=channel_mask == DefaultChannels ? MagickTrue : MagickFalse; for (i=0; i < (ssize_t) GetPixelChannels(image); i++) SetPixelChannelMapTraits(image,(PixelChannel) i, GetChannelBit(channel_mask,i) != 0 ? UpdatePixelTrait : CopyPixelTrait); @@ -5345,8 +5343,8 @@ MagickExport void SetPixelChannelMap(Image *image, % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% SetPixelChannelMask() sets the pixel channel mask from the specified -% channel mask. +% SetPixelChannelMask() sets the pixel channel mask from the specified channel +% mask. % % The format of the SetPixelChannelMask method is: % diff --git a/MagickCore/pixel.h b/MagickCore/pixel.h index c852801e0..5258c5844 100644 --- a/MagickCore/pixel.h +++ b/MagickCore/pixel.h @@ -58,6 +58,7 @@ typedef enum IndexPixelChannel = 4, MaskPixelChannel = 5, IntensityPixelChannel = MaxPixelChannels, + CompositePixelChannel = MaxPixelChannels, SyncPixelChannel = MaxPixelChannels+1 } PixelChannel; diff --git a/MagickCore/profile.c b/MagickCore/profile.c index 0226af768..f63f5f09d 100644 --- a/MagickCore/profile.c +++ b/MagickCore/profile.c @@ -5777,6 +5777,7 @@ MagickExport MagickBooleanType ProfileImage(Image *image,const char *name, cmsSetLogErrorHandler(CMSExceptionHandler); cms_exception.image=image; cms_exception.exception=exception; + (void) cms_exception; source_profile=cmsOpenProfileFromMemTHR(&cms_exception, GetStringInfoDatum(profile),(cmsUInt32Number) GetStringInfoLength(profile)); diff --git a/MagickCore/resize.c b/MagickCore/resize.c index 7919da6e2..34bd01679 100644 --- a/MagickCore/resize.c +++ b/MagickCore/resize.c @@ -2806,7 +2806,7 @@ MagickExport Image *ScaleImage(const Image *image,const size_t columns, MagickRealType alpha, gamma, - pixel[MaxPixelChannels], + pixel[CompositePixelChannel], *scale_scanline, *scanline, *x_vector, diff --git a/MagickCore/statistic.c b/MagickCore/statistic.c index 716637854..26d9a3d42 100644 --- a/MagickCore/statistic.c +++ b/MagickCore/statistic.c @@ -131,7 +131,7 @@ typedef struct _PixelChannels { MagickRealType - channel[MaxPixelChannels]; + channel[CompositePixelChannel]; } PixelChannels; static PixelChannels **DestroyPixelThreadSet(PixelChannels **pixels) @@ -1163,8 +1163,8 @@ MagickExport MagickBooleanType GetImageMean(const Image *image,double *mean, if (channel_statistics == (ChannelStatistics *) NULL) return(MagickFalse); area=0; - channel_statistics[MaxPixelChannels].mean=0.0; - channel_statistics[MaxPixelChannels].standard_deviation=0.0; + channel_statistics[CompositePixelChannel].mean=0.0; + channel_statistics[CompositePixelChannel].standard_deviation=0.0; for (i=0; i < (ssize_t) GetPixelChannels(image); i++) { PixelTrait @@ -1175,17 +1175,17 @@ MagickExport MagickBooleanType GetImageMean(const Image *image,double *mean, continue; if ((traits & UpdatePixelTrait) == 0) continue; - channel_statistics[MaxPixelChannels].mean+=channel_statistics[i].mean; - channel_statistics[MaxPixelChannels].standard_deviation+= + channel_statistics[CompositePixelChannel].mean+=channel_statistics[i].mean; + channel_statistics[CompositePixelChannel].standard_deviation+= channel_statistics[i].variance-channel_statistics[i].mean* channel_statistics[i].mean; area++; } - channel_statistics[MaxPixelChannels].mean/=area; - channel_statistics[MaxPixelChannels].standard_deviation= - sqrt(channel_statistics[MaxPixelChannels].standard_deviation/area); - *mean=channel_statistics[MaxPixelChannels].mean; - *standard_deviation=channel_statistics[MaxPixelChannels].standard_deviation; + channel_statistics[CompositePixelChannel].mean/=area; + channel_statistics[CompositePixelChannel].standard_deviation= + sqrt(channel_statistics[CompositePixelChannel].standard_deviation/area); + *mean=channel_statistics[CompositePixelChannel].mean; + *standard_deviation=channel_statistics[CompositePixelChannel].standard_deviation; channel_statistics=(ChannelStatistics *) RelinquishMagickMemory( channel_statistics); return(MagickTrue); @@ -1584,41 +1584,41 @@ MagickExport ChannelStatistics *GetImageStatistics(const Image *image, } for (i=0; i < (ssize_t) MaxPixelChannels; i++) { - channel_statistics[MaxPixelChannels].depth=(size_t) MagickMax((double) - channel_statistics[MaxPixelChannels].depth,(double) + channel_statistics[CompositePixelChannel].depth=(size_t) MagickMax((double) + channel_statistics[CompositePixelChannel].depth,(double) channel_statistics[i].depth); - channel_statistics[MaxPixelChannels].minima=MagickMin( - channel_statistics[MaxPixelChannels].minima, + channel_statistics[CompositePixelChannel].minima=MagickMin( + channel_statistics[CompositePixelChannel].minima, channel_statistics[i].minima); - channel_statistics[MaxPixelChannels].maxima=MagickMax( - channel_statistics[MaxPixelChannels].maxima, + channel_statistics[CompositePixelChannel].maxima=MagickMax( + channel_statistics[CompositePixelChannel].maxima, channel_statistics[i].maxima); - channel_statistics[MaxPixelChannels].sum+=channel_statistics[i].sum; - channel_statistics[MaxPixelChannels].sum_squared+= + channel_statistics[CompositePixelChannel].sum+=channel_statistics[i].sum; + channel_statistics[CompositePixelChannel].sum_squared+= channel_statistics[i].sum_squared; - channel_statistics[MaxPixelChannels].sum_cubed+= + channel_statistics[CompositePixelChannel].sum_cubed+= channel_statistics[i].sum_cubed; - channel_statistics[MaxPixelChannels].sum_fourth_power+= + channel_statistics[CompositePixelChannel].sum_fourth_power+= channel_statistics[i].sum_fourth_power; - channel_statistics[MaxPixelChannels].mean+=channel_statistics[i].mean; - channel_statistics[MaxPixelChannels].variance+= + channel_statistics[CompositePixelChannel].mean+=channel_statistics[i].mean; + channel_statistics[CompositePixelChannel].variance+= channel_statistics[i].variance-channel_statistics[i].mean* channel_statistics[i].mean; - channel_statistics[MaxPixelChannels].standard_deviation+= + channel_statistics[CompositePixelChannel].standard_deviation+= channel_statistics[i].variance-channel_statistics[i].mean* channel_statistics[i].mean; } channels=GetImageChannels(image); - channel_statistics[MaxPixelChannels].sum/=channels; - channel_statistics[MaxPixelChannels].sum_squared/=channels; - channel_statistics[MaxPixelChannels].sum_cubed/=channels; - channel_statistics[MaxPixelChannels].sum_fourth_power/=channels; - channel_statistics[MaxPixelChannels].mean/=channels; - channel_statistics[MaxPixelChannels].variance/=channels; - channel_statistics[MaxPixelChannels].standard_deviation= - sqrt(channel_statistics[MaxPixelChannels].standard_deviation/channels); - channel_statistics[MaxPixelChannels].kurtosis/=channels; - channel_statistics[MaxPixelChannels].skewness/=channels; + channel_statistics[CompositePixelChannel].sum/=channels; + channel_statistics[CompositePixelChannel].sum_squared/=channels; + channel_statistics[CompositePixelChannel].sum_cubed/=channels; + channel_statistics[CompositePixelChannel].sum_fourth_power/=channels; + channel_statistics[CompositePixelChannel].mean/=channels; + channel_statistics[CompositePixelChannel].variance/=channels; + channel_statistics[CompositePixelChannel].standard_deviation= + sqrt(channel_statistics[CompositePixelChannel].standard_deviation/channels); + channel_statistics[CompositePixelChannel].kurtosis/=channels; + channel_statistics[CompositePixelChannel].skewness/=channels; for (i=0; i <= (ssize_t) MaxPixelChannels; i++) { if (channel_statistics[i].standard_deviation == 0.0) diff --git a/MagickCore/threshold.c b/MagickCore/threshold.c index bc0ab9657..e42e3abad 100644 --- a/MagickCore/threshold.c +++ b/MagickCore/threshold.c @@ -1224,7 +1224,7 @@ MagickExport MagickBooleanType OrderedPosterizeImage(Image *image, progress; MagickRealType - levels[MaxPixelChannels]; + levels[CompositePixelChannel]; register ssize_t i; diff --git a/MagickCore/xwindow.c b/MagickCore/xwindow.c index 98145abec..6fa824d31 100644 --- a/MagickCore/xwindow.c +++ b/MagickCore/xwindow.c @@ -484,7 +484,7 @@ MagickPrivate MagickBooleanType XAnnotateImage(Display *display, annotate_pixmap; Quantum - virtual_pixel[MaxPixelChannels]; + virtual_pixel[CompositePixelChannel]; unsigned int depth, @@ -2327,7 +2327,7 @@ MagickPrivate MagickBooleanType XDrawImage(Display *display, matte; Quantum - virtual_pixel[MaxPixelChannels]; + virtual_pixel[CompositePixelChannel]; Pixmap draw_pixmap;