From d42d995b9cb2a16e13221e665554417a5b7ec7fb Mon Sep 17 00:00:00 2001 From: cristy Date: Fri, 8 Jul 2011 14:21:50 +0000 Subject: [PATCH] --- Magick++/lib/Image.cpp | 85 +++++++------ Magick++/lib/Magick++/Image.h | 2 +- Magick++/lib/Magick++/Include.h | 9 +- MagickCore/compare.c | 8 +- MagickCore/display.c | 14 ++- MagickCore/draw.c | 8 +- MagickCore/enhance.c | 32 ++--- MagickCore/fx.c | 16 +-- MagickCore/histogram.c | 57 ++++----- MagickCore/identify.c | 2 +- MagickCore/magick-config.h | 22 ++-- MagickCore/methods.h | 16 +-- MagickCore/paint.c | 31 ++--- MagickCore/paint.h | 7 +- MagickCore/pixel.h | 4 +- MagickCore/property.c | 23 ++-- MagickCore/statistic.c | 161 ++++++------------------ MagickCore/statistic.h | 18 +-- MagickCore/version.h | 2 +- MagickWand/magick-image.c | 208 +++++++------------------------- MagickWand/magick-image.h | 20 +-- MagickWand/mogrify.c | 18 +-- MagickWand/wandtest.c | 4 +- PerlMagick/Magick.xs | 25 ++-- coders/histogram.c | 4 - coders/msl.c | 20 +-- coders/xtrn.c | 3 +- 27 files changed, 274 insertions(+), 545 deletions(-) diff --git a/Magick++/lib/Image.cpp b/Magick++/lib/Image.cpp index f160085bd..260ccc8c6 100644 --- a/Magick++/lib/Image.cpp +++ b/Magick++/lib/Image.cpp @@ -975,7 +975,6 @@ void Magick::Image::floodFillOpacity( const ssize_t x_, target.blue=pixel.blue; target.alpha=alpha_; FloodfillPaintImage ( image(), - DefaultChannels, options()->drawInfo(), // const DrawInfo *draw_info &target, static_cast(x_), static_cast(y_), @@ -1006,7 +1005,6 @@ void Magick::Image::floodFillTexture( const ssize_t x_, target.blue=GetPixelBlue(constImage(),p); if (p) FloodfillPaintImage ( image(), // Image *image - DefaultChannels, options()->drawInfo(), // const DrawInfo *draw_info &target, // const MagickPacket target static_cast(x_), // const ssize_t x_offset @@ -1041,7 +1039,6 @@ void Magick::Image::floodFillTexture( const ssize_t x_, target.green=static_cast(borderColor_).green; target.blue=static_cast(borderColor_).blue; FloodfillPaintImage ( image(), - DefaultChannels, options()->drawInfo(), &target, static_cast(x_), @@ -1281,8 +1278,10 @@ void Magick::Image::matteFloodfill ( const Color &target_ , target.green=static_cast(target_).green; target.blue=static_cast(target_).blue; target.alpha=alpha_; - FloodfillPaintImage ( image(), OpacityChannel, options()->drawInfo(), &target, - x_, y_, method_ == FloodfillMethod ? MagickFalse : MagickTrue); + PushPixelComponentMap( image(), AlphaChannel ); + FloodfillPaintImage ( image(), options()->drawInfo(), &target, x_, y_, + method_ == FloodfillMethod ? MagickFalse : MagickTrue); + PopPixelComponentMap( image() ); throwImageException(); } @@ -1483,7 +1482,9 @@ void Magick::Image::quantumOperator ( const ChannelType channel_, { ExceptionInfo exceptionInfo; GetExceptionInfo( &exceptionInfo ); - EvaluateImageChannel( image(), channel_, operator_, rvalue_, &exceptionInfo); + PushPixelComponentMap( image(), channel_ ); + EvaluateImage( image(), operator_, rvalue_, &exceptionInfo); + PopPixelComponentMap( image() ); throwException( exceptionInfo ); (void) DestroyExceptionInfo( &exceptionInfo ); } @@ -1504,8 +1505,9 @@ void Magick::Image::quantumOperator ( const ssize_t x_,const ssize_t y_, geometry.y = y_; MagickCore::Image *crop_image = CropImage( image(), &geometry, &exceptionInfo ); - EvaluateImageChannel( crop_image, channel_, operator_, rvalue_, - &exceptionInfo ); + PushPixelComponentMap( image(), channel_); + EvaluateImage( crop_image, operator_, rvalue_, &exceptionInfo ); + PopPixelComponentMap( image() ); (void) CompositeImage( image(), image()->matte != MagickFalse ? OverCompositeOp : CopyCompositeOp, crop_image, geometry.x, geometry.y ); crop_image = DestroyImageList(crop_image); @@ -3551,7 +3553,7 @@ void Magick::Image::splice( const Geometry &geometry_ ) // Obtain image statistics. Statistics are normalized to the range of // 0.0 to 1.0 and are output to the specified ImageStatistics // structure. -void Magick::Image::statistics ( ImageStatistics *statistics ) const +void Magick::Image::statistics ( ImageStatistics *statistics ) { double maximum, @@ -3559,40 +3561,47 @@ void Magick::Image::statistics ( ImageStatistics *statistics ) const ExceptionInfo exceptionInfo; GetExceptionInfo( &exceptionInfo ); - (void) GetImageChannelRange(constImage(),RedChannel,&minimum,&maximum, - &exceptionInfo); + + PushPixelComponentMap( image(), RedChannel); + (void) GetImageRange( image(),&minimum,&maximum,&exceptionInfo); statistics->red.minimum=minimum; - statistics->red.maximum=maximum; - (void) GetImageChannelMean(constImage(),RedChannel, - &statistics->red.mean,&statistics->red.standard_deviation,&exceptionInfo); - (void) GetImageChannelKurtosis(constImage(),RedChannel, - &statistics->red.kurtosis,&statistics->red.skewness,&exceptionInfo); - (void) GetImageChannelRange(constImage(),GreenChannel,&minimum,&maximum, - &exceptionInfo); + statistics->red.maximum=maximum; + (void) GetImageMean( image(),&statistics->red.mean, + &statistics->red.standard_deviation,&exceptionInfo); + (void) GetImageKurtosis( image(),&statistics->red.kurtosis, + &statistics->red.skewness,&exceptionInfo); + PopPixelComponentMap( image() ); + + PushPixelComponentMap( image(), GreenChannel); + (void) GetImageRange( image(),&minimum,&maximum,&exceptionInfo); statistics->green.minimum=minimum; - statistics->green.maximum=maximum; - (void) GetImageChannelMean(constImage(),GreenChannel, - &statistics->green.mean,&statistics->green.standard_deviation, - &exceptionInfo); - (void) GetImageChannelKurtosis(constImage(),GreenChannel, - &statistics->green.kurtosis,&statistics->green.skewness,&exceptionInfo); - (void) GetImageChannelRange(constImage(),BlueChannel,&minimum,&maximum, - &exceptionInfo); + statistics->green.maximum=maximum; + (void) GetImageMean( image(),&statistics->green.mean, + &statistics->green.standard_deviation,&exceptionInfo); + (void) GetImageKurtosis( image(),&statistics->green.kurtosis, + &statistics->green.skewness,&exceptionInfo); + PopPixelComponentMap( image() ); + + PushPixelComponentMap( image(), GreenChannel); + (void) GetImageRange( image(),&minimum,&maximum,&exceptionInfo); statistics->blue.minimum=minimum; - statistics->blue.maximum=maximum; - (void) GetImageChannelMean(constImage(),BlueChannel, - &statistics->blue.mean,&statistics->blue.standard_deviation,&exceptionInfo); - (void) GetImageChannelKurtosis(constImage(),BlueChannel, - &statistics->blue.kurtosis,&statistics->blue.skewness,&exceptionInfo); - (void) GetImageChannelRange(constImage(),OpacityChannel,&minimum,&maximum, - &exceptionInfo); + statistics->blue.maximum=maximum; + (void) GetImageMean( image(),&statistics->blue.mean, + &statistics->blue.standard_deviation,&exceptionInfo); + (void) GetImageKurtosis( image(),&statistics->blue.kurtosis, + &statistics->blue.skewness,&exceptionInfo); + PopPixelComponentMap( image() ); + + PushPixelComponentMap( image(), AlphaChannel); + (void) GetImageRange( image(),&minimum,&maximum,&exceptionInfo); statistics->alpha.minimum=minimum; statistics->alpha.maximum=maximum; - (void) GetImageChannelMean(constImage(),OpacityChannel, - &statistics->alpha.mean,&statistics->alpha.standard_deviation, - &exceptionInfo); - (void) GetImageChannelKurtosis(constImage(),OpacityChannel, - &statistics->alpha.kurtosis,&statistics->alpha.skewness,&exceptionInfo); + (void) GetImageMean( image(),&statistics->alpha.mean, + &statistics->alpha.standard_deviation,&exceptionInfo); + (void) GetImageKurtosis( image(),&statistics->alpha.kurtosis, + &statistics->alpha.skewness,&exceptionInfo); + PopPixelComponentMap( image() ); + throwException( exceptionInfo ); (void) DestroyExceptionInfo( &exceptionInfo ); } diff --git a/Magick++/lib/Magick++/Image.h b/Magick++/lib/Magick++/Image.h index 15f1dae10..221b38bab 100644 --- a/Magick++/lib/Magick++/Image.h +++ b/Magick++/lib/Magick++/Image.h @@ -1007,7 +1007,7 @@ typedef struct _ImageStatistics ImageChannelStatistics alpha; } ImageStatistics; - void statistics ( ImageStatistics *statistics ) const; + void statistics ( ImageStatistics *statistics ) ; // Stroke width for drawing vector objects (default one) // This method is now deprecated. Please use strokeWidth instead. diff --git a/Magick++/lib/Magick++/Include.h b/Magick++/lib/Magick++/Include.h index cf2c75258..1356db2bd 100644 --- a/Magick++/lib/Magick++/Include.h +++ b/Magick++/lib/Magick++/Include.h @@ -136,6 +136,7 @@ namespace Magick // Channel types using MagickCore::ChannelType; using MagickCore::UndefinedChannel; + using MagickCore::AlphaChannel; using MagickCore::RedChannel; using MagickCore::CyanChannel; using MagickCore::GreenChannel; @@ -690,7 +691,7 @@ namespace Magick using MagickCore::EnhanceImage; using MagickCore::EqualizeImage; using MagickCore::EvaluateImage; - using MagickCore::EvaluateImageChannel; + using MagickCore::EvaluateImage; using MagickCore::ExceptionInfo; using MagickCore::ExceptionType; using MagickCore::ExportImagePixels; @@ -723,9 +724,9 @@ namespace Magick using MagickCore::GetGeometry; using MagickCore::GetImageBoundingBox; using MagickCore::GetImageDepth; - using MagickCore::GetImageChannelMean; - using MagickCore::GetImageChannelKurtosis; - using MagickCore::GetImageChannelRange; + using MagickCore::GetImageMean; + using MagickCore::GetImageKurtosis; + using MagickCore::GetImageRange; using MagickCore::GetImageClipMask; using MagickCore::GetImageDepth; using MagickCore::GetImageInfo; diff --git a/MagickCore/compare.c b/MagickCore/compare.c index 5f29d5e6c..dc266f479 100644 --- a/MagickCore/compare.c +++ b/MagickCore/compare.c @@ -906,8 +906,8 @@ static MagickBooleanType GetNormalizedCrossCorrelationDistortion( /* Normalize to account for variation due to lighting and exposure condition. */ - image_statistics=GetImageChannelStatistics(image,exception); - reconstruct_statistics=GetImageChannelStatistics(reconstruct_image,exception); + image_statistics=GetImageStatistics(image,exception); + reconstruct_statistics=GetImageStatistics(reconstruct_image,exception); status=MagickTrue; progress=0; for (i=0; i <= (ssize_t) CompositeChannels; i++) @@ -1646,7 +1646,7 @@ static double GetNCCDistortion(const Image *image, /* Normalize to account for variation due to lighting and exposure condition. */ - image_statistics=GetImageChannelStatistics(image,exception); + image_statistics=GetImageStatistics(image,exception); status=MagickTrue; distortion=0.0; area=1.0/((MagickRealType) image->columns*image->rows); @@ -1797,7 +1797,7 @@ MagickExport Image *SimilarityImage(Image *image,const Image *reference, */ status=MagickTrue; progress=0; - reference_statistics=GetImageChannelStatistics(reference,exception); + reference_statistics=GetImageStatistics(reference,exception); similarity_view=AcquireCacheView(similarity_image); #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(dynamic,4) shared(progress,status) diff --git a/MagickCore/display.c b/MagickCore/display.c index fb195450d..4ba34eb49 100644 --- a/MagickCore/display.c +++ b/MagickCore/display.c @@ -3801,9 +3801,9 @@ static MagickBooleanType XColorEditImage(Display *display, (DrawInfo *) NULL); (void) QueryColorDatabase(resource_info->pen_colors[pen_id], &draw_info->fill,exception); - (void) FloodfillPaintImage(*image,DefaultChannels,draw_info,&target, - (ssize_t) x_offset,(ssize_t) y_offset, - method == FloodfillMethod ? MagickFalse : MagickTrue); + (void) FloodfillPaintImage(*image,draw_info,&target,(ssize_t) + x_offset,(ssize_t) y_offset,method == FloodfillMethod ? + MagickFalse : MagickTrue); draw_info=DestroyDrawInfo(draw_info); break; } @@ -10077,9 +10077,11 @@ static MagickBooleanType XMatteEditImage(Display *display, (DrawInfo *) NULL); draw_info->fill.alpha=ClampToQuantum(InterpretLocaleValue(matte, (char **) NULL)); - (void) FloodfillPaintImage(*image,OpacityChannel,draw_info,&target, - (ssize_t) x_offset,(ssize_t) y_offset, - method == FloodfillMethod ? MagickFalse : MagickTrue); + PushPixelComponentMap(*image,AlphaChannel); + (void) FloodfillPaintImage(*image,draw_info,&target,(ssize_t) + x_offset,(ssize_t) y_offset,method == FloodfillMethod ? + MagickFalse : MagickTrue); + PopPixelComponentMap(*image); draw_info=DestroyDrawInfo(draw_info); break; } diff --git a/MagickCore/draw.c b/MagickCore/draw.c index fe1c2b9a8..2f73d0e11 100644 --- a/MagickCore/draw.c +++ b/MagickCore/draw.c @@ -4243,8 +4243,8 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, target.green=(MagickRealType) draw_info->border_color.green; target.blue=(MagickRealType) draw_info->border_color.blue; } - (void) FloodfillPaintImage(image,DefaultChannels,draw_info,&target,x, - y,primitive_info->method == FloodfillMethod ? MagickFalse : + (void) FloodfillPaintImage(image,draw_info,&target,x,y, + primitive_info->method == FloodfillMethod ? MagickFalse : MagickTrue); break; } @@ -4359,9 +4359,11 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, target.green=(MagickRealType) draw_info->border_color.green; target.blue=(MagickRealType) draw_info->border_color.blue; } - (void) FloodfillPaintImage(image,OpacityChannel,draw_info,&target,x,y, + PushPixelComponentMap(image,AlphaChannel); + (void) FloodfillPaintImage(image,draw_info,&target,x,y, primitive_info->method == FloodfillMethod ? MagickFalse : MagickTrue); + PopPixelComponentMap(image); break; } case ResetMethod: diff --git a/MagickCore/enhance.c b/MagickCore/enhance.c index 14265bb05..2b43895ab 100644 --- a/MagickCore/enhance.c +++ b/MagickCore/enhance.c @@ -113,8 +113,7 @@ MagickExport MagickBooleanType AutoGammaImage(Image *image) /* Apply gamma correction equally accross all given channels */ - (void) GetImageChannelMean(image,DefaultChannels,&mean,&sans, - &image->exception); + (void) GetImageMean(image,&mean,&sans,&image->exception); gamma=log(mean*QuantumScale)/log_mean; return(LevelImage(image,0.0,(double) QuantumRange,gamma)); } @@ -124,48 +123,43 @@ MagickExport MagickBooleanType AutoGammaImage(Image *image) status=MagickTrue; if ((GetPixelRedTraits(image) & ActivePixelTrait) != 0) { - (void) GetImageChannelMean(image,RedChannel,&mean,&sans, - &image->exception); - gamma=log(mean*QuantumScale)/log_mean; PushPixelComponentMap(image,RedChannel); + (void) GetImageMean(image,&mean,&sans,&image->exception); + gamma=log(mean*QuantumScale)/log_mean; status=status && LevelImage(image,0.0,(double) QuantumRange,gamma); PopPixelComponentMap(image); } if ((GetPixelGreenTraits(image) & ActivePixelTrait) != 0) { - (void) GetImageChannelMean(image,GreenChannel,&mean,&sans, - &image->exception); - gamma=log(mean*QuantumScale)/log_mean; PushPixelComponentMap(image,GreenChannel); + (void) GetImageMean(image,&mean,&sans,&image->exception); + gamma=log(mean*QuantumScale)/log_mean; status=status && LevelImage(image,0.0,(double) QuantumRange,gamma); PopPixelComponentMap(image); } if ((GetPixelBlueTraits(image) & ActivePixelTrait) != 0) { - (void) GetImageChannelMean(image,BlueChannel,&mean,&sans, - &image->exception); - gamma=log(mean*QuantumScale)/log_mean; PushPixelComponentMap(image,BlueChannel); + (void) GetImageMean(image,&mean,&sans,&image->exception); + gamma=log(mean*QuantumScale)/log_mean; status=status && LevelImage(image,0.0,(double) QuantumRange,gamma); PopPixelComponentMap(image); } if (((GetPixelBlackTraits(image) & ActivePixelTrait) != 0) && (image->colorspace == CMYKColorspace)) { - (void) GetImageChannelMean(image,BlackChannel,&mean,&sans, - &image->exception); - gamma=log(mean*QuantumScale)/log_mean; PushPixelComponentMap(image,BlackChannel); + (void) GetImageMean(image,&mean,&sans,&image->exception); + gamma=log(mean*QuantumScale)/log_mean; status=status && LevelImage(image,0.0,(double) QuantumRange,gamma); PopPixelComponentMap(image); } if (((GetPixelAlphaTraits(image) & ActivePixelTrait) != 0) && (image->matte == MagickTrue)) { - (void) GetImageChannelMean(image,OpacityChannel,&mean,&sans, - &image->exception); - gamma=log(mean*QuantumScale)/log_mean; PushPixelComponentMap(image,AlphaChannel); + (void) GetImageMean(image,&mean,&sans,&image->exception); + gamma=log(mean*QuantumScale)/log_mean; status=status && LevelImage(image,0.0,(double) QuantumRange,gamma); PopPixelComponentMap(image); } @@ -257,8 +251,8 @@ MagickExport MagickBooleanType BrightnessContrastImage(Image *image, intercept=brightness/100.0+((100-brightness)/200.0)*(1.0-slope); coefficients[0]=slope; coefficients[1]=intercept; - status=FunctionImageChannel(image,DefaultChannels,PolynomialFunction,2, - coefficients,&image->exception); + status=FunctionImage(image,PolynomialFunction,2,coefficients, + &image->exception); return(status); } diff --git a/MagickCore/fx.c b/MagickCore/fx.c index 11e874225..98e53d4fe 100644 --- a/MagickCore/fx.c +++ b/MagickCore/fx.c @@ -1179,8 +1179,7 @@ static MagickRealType FxChannelStatistics(FxInfo *fx_info,const Image *image, kurtosis, skewness; - (void) GetImageChannelKurtosis(image,channel,&kurtosis,&skewness, - exception); + (void) GetImageKurtosis(image,&kurtosis,&skewness,exception); (void) FormatLocaleString(statistic,MaxTextExtent,"%g",kurtosis); } if (LocaleNCompare(symbol,"maxima",6) == 0) @@ -1189,7 +1188,7 @@ static MagickRealType FxChannelStatistics(FxInfo *fx_info,const Image *image, maxima, minima; - (void) GetImageChannelRange(image,channel,&minima,&maxima,exception); + (void) GetImageRange(image,&minima,&maxima,exception); (void) FormatLocaleString(statistic,MaxTextExtent,"%g",maxima); } if (LocaleNCompare(symbol,"mean",4) == 0) @@ -1198,8 +1197,7 @@ static MagickRealType FxChannelStatistics(FxInfo *fx_info,const Image *image, mean, standard_deviation; - (void) GetImageChannelMean(image,channel,&mean,&standard_deviation, - exception); + (void) GetImageMean(image,&mean,&standard_deviation,exception); (void) FormatLocaleString(statistic,MaxTextExtent,"%g",mean); } if (LocaleNCompare(symbol,"minima",6) == 0) @@ -1208,7 +1206,7 @@ static MagickRealType FxChannelStatistics(FxInfo *fx_info,const Image *image, maxima, minima; - (void) GetImageChannelRange(image,channel,&minima,&maxima,exception); + (void) GetImageRange(image,&minima,&maxima,exception); (void) FormatLocaleString(statistic,MaxTextExtent,"%g",minima); } if (LocaleNCompare(symbol,"skewness",8) == 0) @@ -1217,8 +1215,7 @@ static MagickRealType FxChannelStatistics(FxInfo *fx_info,const Image *image, kurtosis, skewness; - (void) GetImageChannelKurtosis(image,channel,&kurtosis,&skewness, - exception); + (void) GetImageKurtosis(image,&kurtosis,&skewness,exception); (void) FormatLocaleString(statistic,MaxTextExtent,"%g",skewness); } if (LocaleNCompare(symbol,"standard_deviation",18) == 0) @@ -1227,8 +1224,7 @@ static MagickRealType FxChannelStatistics(FxInfo *fx_info,const Image *image, mean, standard_deviation; - (void) GetImageChannelMean(image,channel,&mean,&standard_deviation, - exception); + (void) GetImageMean(image,&mean,&standard_deviation,exception); (void) FormatLocaleString(statistic,MaxTextExtent,"%g", standard_deviation); } diff --git a/MagickCore/histogram.c b/MagickCore/histogram.c index 12dd013d0..4d259b1be 100644 --- a/MagickCore/histogram.c +++ b/MagickCore/histogram.c @@ -991,8 +991,7 @@ MagickExport MagickBooleanType MinMaxStretchImage(Image *image, /* Auto-level all channels equally. */ - (void) GetImageChannelRange(image,DefaultChannels,&min,&max, - &image->exception); + (void) GetImageRange(image,&min,&max,&image->exception); min+=black; max-=white; if (fabs(min-max) >= MagickEpsilon) @@ -1004,69 +1003,55 @@ MagickExport MagickBooleanType MinMaxStretchImage(Image *image, */ if ((GetPixelRedTraits(image) & ActivePixelTrait) != 0) { - (void) GetImageChannelRange(image,RedChannel,&min,&max,&image->exception); + PushPixelComponentMap(image,RedChannel); + (void) GetImageRange(image,&min,&max,&image->exception); min+=black; max-=white; if (fabs(min-max) >= MagickEpsilon) - { - PushPixelComponentMap(image,RedChannel); - status&=LevelImage(image,min,max,1.0); - PopPixelComponentMap(image); - } + status&=LevelImage(image,min,max,1.0); + PopPixelComponentMap(image); } if ((GetPixelGreenTraits(image) & ActivePixelTrait) != 0) { - (void) GetImageChannelRange(image,GreenChannel,&min,&max, - &image->exception); + PushPixelComponentMap(image,GreenChannel); + (void) GetImageRange(image,&min,&max,&image->exception); min+=black; max-=white; if (fabs(min-max) >= MagickEpsilon) - { - PushPixelComponentMap(image,GreenChannel); - status&=LevelImage(image,min,max,1.0); - PopPixelComponentMap(image); - } + status&=LevelImage(image,min,max,1.0); + PopPixelComponentMap(image); } if ((GetPixelBlueTraits(image) & ActivePixelTrait) != 0) { - (void) GetImageChannelRange(image,BlueChannel,&min,&max, - &image->exception); + PushPixelComponentMap(image,BlueChannel); + (void) GetImageRange(image,&min,&max,&image->exception); min+=black; max-=white; if (fabs(min-max) >= MagickEpsilon) - { - PushPixelComponentMap(image,BlueChannel); - status&=LevelImage(image,min,max,1.0); - PopPixelComponentMap(image); - } + status&=LevelImage(image,min,max,1.0); + PopPixelComponentMap(image); } if (((GetPixelBlackTraits(image) & ActivePixelTrait) != 0) && (image->colorspace == CMYKColorspace)) { - (void) GetImageChannelRange(image,BlackChannel,&min,&max, - &image->exception); + PushPixelComponentMap(image,BlackChannel); + (void) GetImageRange(image,&min,&max,&image->exception); min+=black; max-=white; if (fabs(min-max) >= MagickEpsilon) - { - PushPixelComponentMap(image,BlackChannel); - status&=LevelImage(image,min,max,1.0); - PopPixelComponentMap(image); - } + status&=LevelImage(image,min,max,1.0); + PopPixelComponentMap(image); } if (((GetPixelAlphaTraits(image) & ActivePixelTrait) != 0) && (image->matte == MagickTrue)) { - (void) GetImageChannelRange(image,OpacityChannel,&min,&max, - &image->exception); + PushPixelComponentMap(image,AlphaChannel); + (void) GetImageRange(image,&min,&max,&image->exception); min+=black; max-=white; if (fabs(min-max) >= MagickEpsilon) - { - PushPixelComponentMap(image,AlphaChannel); - status&=LevelImage(image,min,max,1.0); - PopPixelComponentMap(image); - } + status&=LevelImage(image,min,max,1.0); + PopPixelComponentMap(image); } return(status != 0 ? MagickTrue : MagickFalse); } diff --git a/MagickCore/identify.c b/MagickCore/identify.c index be8ffe65f..6ff5a5e68 100644 --- a/MagickCore/identify.c +++ b/MagickCore/identify.c @@ -425,7 +425,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file, size_t depth; - channel_statistics=GetImageChannelStatistics(image,&image->exception); + channel_statistics=GetImageStatistics(image,&image->exception); artifact=GetImageArtifact(image,"identify:features"); if (artifact != (const char *) NULL) { diff --git a/MagickCore/magick-config.h b/MagickCore/magick-config.h index 9002a55f6..53e983a1c 100644 --- a/MagickCore/magick-config.h +++ b/MagickCore/magick-config.h @@ -421,15 +421,15 @@ #endif /* Define if you have the header file. */ -/* #undef HAVE_LCMS2_H */ +#ifndef MAGICKCORE_HAVE_LCMS2_H +#define MAGICKCORE_HAVE_LCMS2_H 1 +#endif /* Define if you have the header file. */ /* #undef HAVE_LCMS2_LCMS2_H */ /* Define if you have the header file. */ -#ifndef MAGICKCORE_HAVE_LCMS_H -#define MAGICKCORE_HAVE_LCMS_H 1 -#endif +/* #undef HAVE_LCMS_H */ /* Define if you have the header file. */ /* #undef HAVE_LCMS_LCMS_H */ @@ -1152,9 +1152,7 @@ #endif /* Define if you have JBIG library */ -#ifndef MAGICKCORE_JBIG_DELEGATE -#define MAGICKCORE_JBIG_DELEGATE 1 -#endif +/* #undef JBIG_DELEGATE */ /* Define if you have JPEG version 2 "Jasper" library */ #ifndef MAGICKCORE_JP2_DELEGATE @@ -1183,9 +1181,7 @@ #endif /* Define if you have LQR library */ -#ifndef MAGICKCORE_LQR_DELEGATE -#define MAGICKCORE_LQR_DELEGATE 1 -#endif +/* #undef LQR_DELEGATE */ /* Define if using libltdl to support dynamically loadable modules */ #ifndef MAGICKCORE_LTDL_DELEGATE @@ -1197,7 +1193,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/R/lib:/usr/lib64/atlas:/opt/modules/pkg/intel/f77/10.0.025/lib:/usr/local/lib:/usr/lib64/mysql:/usr/lib64/qt-3.3/lib:/usr/lib64/xulrunner-2" +#define MAGICKCORE_LT_DLSEARCH_PATH "/lib64:/usr/lib64:/lib:/usr/lib:/usr/lib64/R/lib:/usr/lib64/alliance/lib:/usr/lib64/atlas:/opt/modules/pkg/intel/f77/10.0.025/lib:/usr/lib64/kicad:/usr/lib64/llvm:/usr/local/lib:/usr/lib64/mpich2/lib/:/usr/lib64/mysql:/usr/lib64/octave/3.4.0:/usr/lib64/openmotif:/usr/lib64/qt-3.3/lib:/usr/lib64/tcl8.5/tclx8.4:/usr/lib/wine/:/usr/lib64/wine/:/usr/lib64/xulrunner-2" #endif /* The archive extension */ @@ -1444,9 +1440,7 @@ /* Define if you have WEBP library */ -#ifndef MAGICKCORE_WEBP_DELEGATE -#define MAGICKCORE_WEBP_DELEGATE 1 -#endif +/* #undef WEBP_DELEGATE */ /* Define to use the Windows GDI32 library */ /* #undef WINGDI32_DELEGATE */ diff --git a/MagickCore/methods.h b/MagickCore/methods.h index b0ec36e43..03de5dc28 100644 --- a/MagickCore/methods.h +++ b/MagickCore/methods.h @@ -309,7 +309,7 @@ extern "C" { #define EqualizeImage PrependMagickMethod(EqualizeImage) #define EqualizeImage PrependMagickMethod(EqualizeImage) #define EscapeString PrependMagickMethod(EscapeString) -#define EvaluateImageChannel PrependMagickMethod(EvaluateImageChannel) +#define EvaluateImage PrependMagickMethod(EvaluateImage) #define EvaluateImage PrependMagickMethod(EvaluateImage) #define ExcerptImage PrependMagickMethod(ExcerptImage) #define ExpandAffine PrependMagickMethod(ExpandAffine) @@ -343,7 +343,7 @@ extern "C" { #define FormatString PrependMagickMethod(FormatString) #define ForwardFourierTransformImage PrependMagickMethod(ForwardFourierTransformImage) #define FrameImage PrependMagickMethod(FrameImage) -#define FunctionImageChannel PrependMagickMethod(FunctionImageChannel) +#define FunctionImage PrependMagickMethod(FunctionImage) #define FunctionImage PrependMagickMethod(FunctionImage) #define FuzzyColorCompare PrependMagickMethod(FuzzyColorCompare) #define FuzzyColorMatch PrependMagickMethod(FuzzyColorMatch) @@ -423,11 +423,11 @@ extern "C" { #define GetImageDepth PrependMagickMethod(GetImageDepth) #define GetImageDistortion PrependMagickMethod(GetImageDistortion) #define GetImageDistortions PrependMagickMethod(GetImageDistortions) -#define GetImageChannelExtrema PrependMagickMethod(GetImageChannelExtrema) -#define GetImageChannelKurtosis PrependMagickMethod(GetImageChannelKurtosis) -#define GetImageChannelMean PrependMagickMethod(GetImageChannelMean) -#define GetImageChannelRange PrependMagickMethod(GetImageChannelRange) -#define GetImageChannelStatistics PrependMagickMethod(GetImageChannelStatistics) +#define GetImageExtrema PrependMagickMethod(GetImageExtrema) +#define GetImageKurtosis PrependMagickMethod(GetImageKurtosis) +#define GetImageMean PrependMagickMethod(GetImageMean) +#define GetImageRange PrependMagickMethod(GetImageRange) +#define GetImageStatistics PrependMagickMethod(GetImageStatistics) #define GetImageClipMask PrependMagickMethod(GetImageClipMask) #define GetImageClippingPathAttribute PrependMagickMethod(GetImageClippingPathAttribute) #define GetImageDecoder PrependMagickMethod(GetImageDecoder) @@ -778,7 +778,7 @@ extern "C" { #define NormalizeImage PrependMagickMethod(NormalizeImage) #define OilPaintImage PrependMagickMethod(OilPaintImage) #define OpaqueImage PrependMagickMethod(OpaqueImage) -#define OpaquePaintImageChannel PrependMagickMethod(OpaquePaintImageChannel) +#define OpaquePaintImage PrependMagickMethod(OpaquePaintImage) #define OpaquePaintImage PrependMagickMethod(OpaquePaintImage) #define OpenBlob PrependMagickMethod(OpenBlob) #define OpenCacheView PrependMagickMethod(OpenCacheView) diff --git a/MagickCore/paint.c b/MagickCore/paint.c index bac4cda9a..dd4c468d3 100644 --- a/MagickCore/paint.c +++ b/MagickCore/paint.c @@ -83,16 +83,14 @@ % The format of the FloodfillPaintImage method is: % % MagickBooleanType FloodfillPaintImage(Image *image, -% const ChannelType channel,const DrawInfo *draw_info, -% const PixelInfo target,const ssize_t x_offset, -% const ssize_t y_offset,const MagickBooleanType invert) +% const DrawInfo *draw_info,const PixelInfo target, +% const ssize_t x_offset,const ssize_t y_offset, +% const MagickBooleanType invert) % % A description of each parameter follows: % % o image: the image. % -% o channel: the channel(s). -% % o draw_info: the draw info. % % o target: the RGB value of the target color. @@ -103,9 +101,8 @@ % */ MagickExport MagickBooleanType FloodfillPaintImage(Image *image, - const ChannelType channel,const DrawInfo *draw_info, - const PixelInfo *target,const ssize_t x_offset,const ssize_t y_offset, - const MagickBooleanType invert) + const DrawInfo *draw_info,const PixelInfo *target,const ssize_t x_offset, + const ssize_t y_offset,const MagickBooleanType invert) { #define MaxStacksize (1UL << 15) #define PushSegmentStack(up,left,right,delta) \ @@ -727,16 +724,11 @@ MagickExport Image *OilPaintImage(const Image *image,const double radius, % MagickBooleanType OpaquePaintImage(Image *image, % const PixelPacket *target,const PixelPacket *fill, % const MagickBooleanType invert) -% MagickBooleanType OpaquePaintImageChannel(Image *image, -% const ChannelType channel,const PixelPacket *target, -% const PixelPacket *fill,const MagickBooleanType invert) % % A description of each parameter follows: % % o image: the image. % -% o channel: the channel(s). -% % o target: the RGB value of the target color. % % o fill: the replacement color. @@ -744,17 +736,8 @@ MagickExport Image *OilPaintImage(const Image *image,const double radius, % o invert: paint any pixel that does not match the target color. % */ - MagickExport MagickBooleanType OpaquePaintImage(Image *image, - const PixelInfo *target,const PixelInfo *fill, - const MagickBooleanType invert) -{ - return(OpaquePaintImageChannel(image,CompositeChannels,target,fill,invert)); -} - -MagickExport MagickBooleanType OpaquePaintImageChannel(Image *image, - const ChannelType channel,const PixelInfo *target, - const PixelInfo *fill,const MagickBooleanType invert) + const PixelInfo *target,const PixelInfo *fill,const MagickBooleanType invert) { #define OpaquePaintImageTag "Opaque/Image" @@ -842,7 +825,7 @@ MagickExport MagickBooleanType OpaquePaintImageChannel(Image *image, proceed; #if defined(MAGICKCORE_OPENMP_SUPPORT) - #pragma omp critical (MagickCore_OpaquePaintImageChannel) + #pragma omp critical (MagickCore_OpaquePaintImage) #endif proceed=SetImageProgress(image,OpaquePaintImageTag,progress++, image->rows); diff --git a/MagickCore/paint.h b/MagickCore/paint.h index 24709b966..9b080c448 100644 --- a/MagickCore/paint.h +++ b/MagickCore/paint.h @@ -29,15 +29,12 @@ extern MagickExport Image *OilPaintImage(const Image *,const double,ExceptionInfo *); extern MagickExport MagickBooleanType - FloodfillPaintImage(Image *,const ChannelType,const DrawInfo *, - const PixelInfo *,const ssize_t,const ssize_t, - const MagickBooleanType), + FloodfillPaintImage(Image *,const DrawInfo *,const PixelInfo *,const ssize_t, + const ssize_t,const MagickBooleanType), GradientImage(Image *,const GradientType,const SpreadMethod, const PixelPacket *,const PixelPacket *), OpaquePaintImage(Image *,const PixelInfo *,const PixelInfo *, const MagickBooleanType), - OpaquePaintImageChannel(Image *,const ChannelType,const PixelInfo *, - const PixelInfo *,const MagickBooleanType), TransparentPaintImage(Image *,const PixelInfo *, const Quantum,const MagickBooleanType), TransparentPaintImageChroma(Image *,const PixelInfo *, diff --git a/MagickCore/pixel.h b/MagickCore/pixel.h index bb10bf1a9..35bc8d786 100644 --- a/MagickCore/pixel.h +++ b/MagickCore/pixel.h @@ -25,8 +25,8 @@ extern "C" { #include #include -#define MaxPixelComponents 16 -#define MaxPixelComponentMaps 16 +#define MaxPixelComponents 32 +#define MaxPixelComponentMaps 8 typedef enum { diff --git a/MagickCore/property.c b/MagickCore/property.c index 0c85008ed..35c44894e 100644 --- a/MagickCore/property.c +++ b/MagickCore/property.c @@ -2261,8 +2261,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 +2281,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 +2292,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 +2304,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; @@ -2384,21 +2381,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; diff --git a/MagickCore/statistic.c b/MagickCore/statistic.c index a84c8e9de..f26b3e87c 100644 --- a/MagickCore/statistic.c +++ b/MagickCore/statistic.c @@ -106,7 +106,7 @@ % an image, to increase or decrease contrast in an image, or to produce the % "negative" of an image. % -% The format of the EvaluateImageChannel method is: +% The format of the EvaluateImage method is: % % MagickBooleanType EvaluateImage(Image *image, % const MagickEvaluateOperator op,const double value, @@ -114,16 +114,11 @@ % MagickBooleanType EvaluateImages(Image *images, % const MagickEvaluateOperator op,const double value, % ExceptionInfo *exception) -% MagickBooleanType EvaluateImageChannel(Image *image, -% const ChannelType channel,const MagickEvaluateOperator op, -% const double value,ExceptionInfo *exception) % % A description of each parameter follows: % % o image: the image. % -% o channel: the channel. -% % o op: A channel op. % % o value: A value value. @@ -403,16 +398,6 @@ static MagickRealType ApplyEvaluateOperator(RandomInfo *random_info, return(result); } -MagickExport MagickBooleanType EvaluateImage(Image *image, - const MagickEvaluateOperator op,const double value,ExceptionInfo *exception) -{ - MagickBooleanType - status; - - status=EvaluateImageChannel(image,CompositeChannels,op,value,exception); - return(status); -} - MagickExport Image *EvaluateImages(const Image *images, const MagickEvaluateOperator op,ExceptionInfo *exception) { @@ -717,9 +702,8 @@ MagickExport Image *EvaluateImages(const Image *images, return(evaluate_image); } -MagickExport MagickBooleanType EvaluateImageChannel(Image *image, - const ChannelType channel,const MagickEvaluateOperator op,const double value, - ExceptionInfo *exception) +MagickExport MagickBooleanType EvaluateImage(Image *image, + const MagickEvaluateOperator op,const double value,ExceptionInfo *exception) { CacheView *image_view; @@ -807,7 +791,7 @@ MagickExport MagickBooleanType EvaluateImageChannel(Image *image, proceed; #if defined(MAGICKCORE_OPENMP_SUPPORT) - #pragma omp critical (MagickCore_EvaluateImageChannel) + #pragma omp critical (MagickCore_EvaluateImage) #endif proceed=SetImageProgress(image,EvaluateImageTag,progress++,image->rows); if (proceed == MagickFalse) @@ -835,22 +819,16 @@ MagickExport MagickBooleanType EvaluateImageChannel(Image *image, % an image, to increase or decrease contrast in an image, or to produce the % "negative" of an image. % -% The format of the FunctionImageChannel method is: +% The format of the FunctionImage method is: % % MagickBooleanType FunctionImage(Image *image, % const MagickFunction function,const ssize_t number_parameters, % const double *parameters,ExceptionInfo *exception) -% MagickBooleanType FunctionImageChannel(Image *image, -% const ChannelType channel,const MagickFunction function, -% const ssize_t number_parameters,const double *argument, -% ExceptionInfo *exception) % % A description of each parameter follows: % % o image: the image. % -% o channel: the channel. -% % o function: A channel function. % % o parameters: one or more parameters. @@ -944,19 +922,6 @@ static Quantum ApplyFunction(Quantum pixel,const MagickFunction function, MagickExport MagickBooleanType FunctionImage(Image *image, const MagickFunction function,const size_t number_parameters, const double *parameters,ExceptionInfo *exception) -{ - MagickBooleanType - status; - - status=FunctionImageChannel(image,CompositeChannels,function,number_parameters, - parameters,exception); - return(status); -} - -MagickExport MagickBooleanType FunctionImageChannel(Image *image, - const ChannelType channel,const MagickFunction function, - const size_t number_parameters,const double *parameters, - ExceptionInfo *exception) { #define FunctionImageTag "Function/Image " @@ -1039,7 +1004,7 @@ MagickExport MagickBooleanType FunctionImageChannel(Image *image, proceed; #if defined(MAGICKCORE_OPENMP_SUPPORT) - #pragma omp critical (MagickCore_FunctionImageChannel) + #pragma omp critical (MagickCore_FunctionImage) #endif proceed=SetImageProgress(image,FunctionImageTag,progress++,image->rows); if (proceed == MagickFalse) @@ -1055,26 +1020,23 @@ MagickExport MagickBooleanType FunctionImageChannel(Image *image, % % % % % % -+ G e t I m a g e C h a n n e l E x t r e m a % +% G e t I m a g e E x t r e m a % % % % % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% GetImageChannelExtrema() returns the extrema of one or more image channels. +% GetImageExtrema() returns the extrema of one or more image channels. % -% The format of the GetImageChannelExtrema method is: +% The format of the GetImageExtrema method is: % -% MagickBooleanType GetImageChannelExtrema(const Image *image, -% const ChannelType channel,size_t *minima,size_t *maxima, -% ExceptionInfo *exception) +% MagickBooleanType GetImageExtrema(const Image *image,size_t *minima, +% size_t *maxima,ExceptionInfo *exception) % % A description of each parameter follows: % % o image: the image. % -% o channel: the channel. -% % o minima: the minimum value in the channel. % % o maxima: the maximum value in the channel. @@ -1082,16 +1044,8 @@ MagickExport MagickBooleanType FunctionImageChannel(Image *image, % o exception: return any errors or warnings in this structure. % */ - MagickExport MagickBooleanType GetImageExtrema(const Image *image, size_t *minima,size_t *maxima,ExceptionInfo *exception) -{ - return(GetImageChannelExtrema(image,CompositeChannels,minima,maxima,exception)); -} - -MagickExport MagickBooleanType GetImageChannelExtrema(const Image *image, - const ChannelType channel,size_t *minima,size_t *maxima, - ExceptionInfo *exception) { double max, @@ -1104,7 +1058,7 @@ MagickExport MagickBooleanType GetImageChannelExtrema(const Image *image, assert(image->signature == MagickSignature); if (image->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); - status=GetImageChannelRange(image,channel,&min,&max,exception); + status=GetImageRange(image,&min,&max,exception); *minima=(size_t) ceil(min-0.5); *maxima=(size_t) floor(max+0.5); return(status); @@ -1115,27 +1069,24 @@ MagickExport MagickBooleanType GetImageChannelExtrema(const Image *image, % % % % % % -% G e t I m a g e C h a n n e l M e a n % +% G e t I m a g e M e a n % % % % % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% GetImageChannelMean() returns the mean and standard deviation of one or more +% GetImageMean() returns the mean and standard deviation of one or more % image channels. % -% The format of the GetImageChannelMean method is: +% The format of the GetImageMean method is: % -% MagickBooleanType GetImageChannelMean(const Image *image, -% const ChannelType channel,double *mean,double *standard_deviation, -% ExceptionInfo *exception) +% MagickBooleanType GetImageMean(const Image *image,double *mean, +% double *standard_deviation,ExceptionInfo *exception) % % A description of each parameter follows: % % o image: the image. % -% o channel: the channel. -% % o mean: the average value in the channel. % % o standard_deviation: the standard deviation of the channel. @@ -1143,21 +1094,8 @@ MagickExport MagickBooleanType GetImageChannelExtrema(const Image *image, % o exception: return any errors or warnings in this structure. % */ - MagickExport MagickBooleanType GetImageMean(const Image *image,double *mean, double *standard_deviation,ExceptionInfo *exception) -{ - MagickBooleanType - status; - - status=GetImageChannelMean(image,CompositeChannels,mean,standard_deviation, - exception); - return(status); -} - -MagickExport MagickBooleanType GetImageChannelMean(const Image *image, - const ChannelType channel,double *mean,double *standard_deviation, - ExceptionInfo *exception) { ChannelStatistics *channel_statistics; @@ -1169,7 +1107,7 @@ MagickExport MagickBooleanType GetImageChannelMean(const Image *image, assert(image->signature == MagickSignature); if (image->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); - channel_statistics=GetImageChannelStatistics(image,exception); + channel_statistics=GetImageStatistics(image,exception); if (channel_statistics == (ChannelStatistics *) NULL) return(MagickFalse); channels=0; @@ -1242,27 +1180,24 @@ MagickExport MagickBooleanType GetImageChannelMean(const Image *image, % % % % % % -% G e t I m a g e C h a n n e l K u r t o s i s % +% G e t I m a g e K u r t o s i s % % % % % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% GetImageChannelKurtosis() returns the kurtosis and skewness of one or more +% GetImageKurtosis() returns the kurtosis and skewness of one or more % image channels. % -% The format of the GetImageChannelKurtosis method is: +% The format of the GetImageKurtosis method is: % -% MagickBooleanType GetImageChannelKurtosis(const Image *image, -% const ChannelType channel,double *kurtosis,double *skewness, -% ExceptionInfo *exception) +% MagickBooleanType GetImageKurtosis(const Image *image,double *kurtosis, +% double *skewness,ExceptionInfo *exception) % % A description of each parameter follows: % % o image: the image. % -% o channel: the channel. -% % o kurtosis: the kurtosis of the channel. % % o skewness: the skewness of the channel. @@ -1270,21 +1205,8 @@ MagickExport MagickBooleanType GetImageChannelMean(const Image *image, % o exception: return any errors or warnings in this structure. % */ - MagickExport MagickBooleanType GetImageKurtosis(const Image *image, double *kurtosis,double *skewness,ExceptionInfo *exception) -{ - MagickBooleanType - status; - - status=GetImageChannelKurtosis(image,CompositeChannels,kurtosis,skewness, - exception); - return(status); -} - -MagickExport MagickBooleanType GetImageChannelKurtosis(const Image *image, - const ChannelType channel,double *kurtosis,double *skewness, - ExceptionInfo *exception) { double area, @@ -1408,26 +1330,23 @@ MagickExport MagickBooleanType GetImageChannelKurtosis(const Image *image, % % % % % % -% G e t I m a g e C h a n n e l R a n g e % +% G e t I m a g e R a n g e % % % % % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% GetImageChannelRange() returns the range of one or more image channels. +% GetImageRange() returns the range of one or more image channels. % -% The format of the GetImageChannelRange method is: +% The format of the GetImageRange method is: % -% MagickBooleanType GetImageChannelRange(const Image *image, -% const ChannelType channel,double *minima,double *maxima, -% ExceptionInfo *exception) +% MagickBooleanType GetImageRange(const Image *image,double *minima, +% double *maxima,ExceptionInfo *exception) % % A description of each parameter follows: % % o image: the image. % -% o channel: the channel. -% % o minima: the minimum value in the channel. % % o maxima: the maximum value in the channel. @@ -1435,16 +1354,8 @@ MagickExport MagickBooleanType GetImageChannelKurtosis(const Image *image, % o exception: return any errors or warnings in this structure. % */ - -MagickExport MagickBooleanType GetImageRange(const Image *image, - double *minima,double *maxima,ExceptionInfo *exception) -{ - return(GetImageChannelRange(image,CompositeChannels,minima,maxima,exception)); -} - -MagickExport MagickBooleanType GetImageChannelRange(const Image *image, - const ChannelType channel,double *minima,double *maxima, - ExceptionInfo *exception) +MagickExport MagickBooleanType GetImageRange(const Image *image,double *minima, + double *maxima,ExceptionInfo *exception) { PixelInfo pixel; @@ -1520,25 +1431,25 @@ MagickExport MagickBooleanType GetImageChannelRange(const Image *image, % % % % % % -% G e t I m a g e C h a n n e l S t a t i s t i c s % +% G e t I m a g e S t a t i s t i c s % % % % % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% GetImageChannelStatistics() returns statistics for each channel in the +% GetImageStatistics() returns statistics for each channel in the % image. The statistics include the channel depth, its minima, maxima, mean, % standard deviation, kurtosis and skewness. You can access the red channel % mean, for example, like this: % -% channel_statistics=GetImageChannelStatistics(image,exception); +% channel_statistics=GetImageStatistics(image,exception); % red_mean=channel_statistics[RedChannel].mean; % % Use MagickRelinquishMemory() to free the statistics buffer. % -% The format of the GetImageChannelStatistics method is: +% The format of the GetImageStatistics method is: % -% ChannelStatistics *GetImageChannelStatistics(const Image *image, +% ChannelStatistics *GetImageStatistics(const Image *image, % ExceptionInfo *exception) % % A description of each parameter follows: @@ -1548,7 +1459,7 @@ MagickExport MagickBooleanType GetImageChannelRange(const Image *image, % o exception: return any errors or warnings in this structure. % */ -MagickExport ChannelStatistics *GetImageChannelStatistics(const Image *image, +MagickExport ChannelStatistics *GetImageStatistics(const Image *image, ExceptionInfo *exception) { ChannelStatistics diff --git a/MagickCore/statistic.h b/MagickCore/statistic.h index 1ce8e5007..efcacaae7 100644 --- a/MagickCore/statistic.h +++ b/MagickCore/statistic.h @@ -86,7 +86,7 @@ typedef enum } MagickFunction; extern MagickExport ChannelStatistics - *GetImageChannelStatistics(const Image *,ExceptionInfo *); + *GetImageStatistics(const Image *,ExceptionInfo *); extern MagickExport Image *EvaluateImages(const Image *,const MagickEvaluateOperator,ExceptionInfo *); @@ -94,24 +94,12 @@ extern MagickExport Image extern MagickExport MagickBooleanType EvaluateImage(Image *,const MagickEvaluateOperator,const double, ExceptionInfo *), - EvaluateImageChannel(Image *,const ChannelType,const MagickEvaluateOperator, - const double,ExceptionInfo *), FunctionImage(Image *,const MagickFunction,const size_t,const double *, ExceptionInfo *), - FunctionImageChannel(Image *,const ChannelType,const MagickFunction, - const size_t,const double *,ExceptionInfo *), - GetImageChannelExtrema(const Image *,const ChannelType,size_t *,size_t *, - ExceptionInfo *), - GetImageChannelMean(const Image *,const ChannelType,double *,double *, - ExceptionInfo *), - GetImageChannelKurtosis(const Image *,const ChannelType,double *,double *, - ExceptionInfo *), - GetImageChannelRange(const Image *,const ChannelType,double *,double *, - ExceptionInfo *), GetImageExtrema(const Image *,size_t *,size_t *,ExceptionInfo *), - GetImageRange(const Image *,double *,double *,ExceptionInfo *), GetImageMean(const Image *,double *,double *,ExceptionInfo *), - GetImageKurtosis(const Image *,double *,double *,ExceptionInfo *); + GetImageKurtosis(const Image *,double *,double *,ExceptionInfo *), + GetImageRange(const Image *,double *,double *,ExceptionInfo *); #if defined(__cplusplus) || defined(c_plusplus) } diff --git a/MagickCore/version.h b/MagickCore/version.h index 50b9a5540..497eef330 100644 --- a/MagickCore/version.h +++ b/MagickCore/version.h @@ -34,7 +34,7 @@ extern "C" { #define MagickLibAddendum "-0" #define MagickLibInterface 5 #define MagickLibMinInterface 5 -#define MagickReleaseDate "2011-07-07" +#define MagickReleaseDate "2011-07-08" #define MagickChangeDate "20110701" #define MagickAuthoritativeURL "http://www.imagemagick.org" #if defined(MAGICKCORE_OPENMP_SUPPORT) diff --git a/MagickWand/magick-image.c b/MagickWand/magick-image.c index 75417ef5c..09449d90c 100644 --- a/MagickWand/magick-image.c +++ b/MagickWand/magick-image.c @@ -2846,40 +2846,17 @@ WandExport MagickBooleanType MagickEqualizeImage(MagickWand *wand) % const MagickEvaluateOperator operator,const double value) % MagickBooleanType MagickEvaluateImages(MagickWand *wand, % const MagickEvaluateOperator operator) -% MagickBooleanType MagickEvaluateImageChannel(MagickWand *wand, -% const ChannelType channel,const MagickEvaluateOperator op, -% const double value) % % A description of each parameter follows: % % o wand: the magick wand. % -% o channel: the channel(s). -% % o op: A channel operator. % % o value: A value value. % */ -WandExport MagickBooleanType MagickEvaluateImage(MagickWand *wand, - const MagickEvaluateOperator op,const double value) -{ - MagickBooleanType - status; - - assert(wand != (MagickWand *) NULL); - assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) - (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); - if (wand->images == (Image *) NULL) - ThrowWandException(WandError,"ContainsNoImages",wand->name); - status=EvaluateImage(wand->images,op,value,&wand->images->exception); - if (status == MagickFalse) - InheritException(wand->exception,&wand->images->exception); - return(status); -} - WandExport MagickWand *MagickEvaluateImages(MagickWand *wand, const MagickEvaluateOperator op) { @@ -2898,8 +2875,8 @@ WandExport MagickWand *MagickEvaluateImages(MagickWand *wand, return(CloneMagickWandFromImages(wand,evaluate_image)); } -WandExport MagickBooleanType MagickEvaluateImageChannel(MagickWand *wand, - const ChannelType channel,const MagickEvaluateOperator op,const double value) +WandExport MagickBooleanType MagickEvaluateImage(MagickWand *wand, + const MagickEvaluateOperator op,const double value) { MagickBooleanType status; @@ -2910,8 +2887,7 @@ WandExport MagickBooleanType MagickEvaluateImageChannel(MagickWand *wand, (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); - status=EvaluateImageChannel(wand->images,channel,op,value, - &wand->images->exception); + status=EvaluateImage(wand->images,op,value,&wand->images->exception); return(status); } @@ -3169,16 +3145,13 @@ WandExport MagickBooleanType MagickFlipImage(MagickWand *wand) % The format of the MagickFloodfillPaintImage method is: % % MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand, -% const ChannelType channel,const PixelWand *fill,const double fuzz, -% const PixelWand *bordercolor,const ssize_t x,const ssize_t y, -% const MagickBooleanType invert) +% const PixelWand *fill,const double fuzz,const PixelWand *bordercolor, +% const ssize_t x,const ssize_t y,const MagickBooleanType invert) % % A description of each parameter follows: % % o wand: the magick wand. % -% o channel: the channel(s). -% % o fill: the floodfill color pixel wand. % % o fuzz: By default target must match a particular pixel color @@ -3196,9 +3169,8 @@ WandExport MagickBooleanType MagickFlipImage(MagickWand *wand) % */ WandExport MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand, - const ChannelType channel,const PixelWand *fill,const double fuzz, - const PixelWand *bordercolor,const ssize_t x,const ssize_t y, - const MagickBooleanType invert) + const PixelWand *fill,const double fuzz,const PixelWand *bordercolor, + const ssize_t x,const ssize_t y,const MagickBooleanType invert) { DrawInfo *draw_info; @@ -3222,8 +3194,7 @@ WandExport MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand, if (bordercolor != (PixelWand *) NULL) PixelGetMagickColor(bordercolor,&target); wand->images->fuzz=fuzz; - status=FloodfillPaintImage(wand->images,channel,draw_info,&target,x,y, - invert); + status=FloodfillPaintImage(wand->images,draw_info,&target,x,y,invert); if (status == MagickFalse) InheritException(wand->exception,&wand->images->exception); draw_info=DestroyDrawInfo(draw_info); @@ -3409,16 +3380,11 @@ WandExport MagickBooleanType MagickFrameImage(MagickWand *wand, % MagickBooleanType MagickFunctionImage(MagickWand *wand, % const MagickFunction function,const size_t number_arguments, % const double *arguments) -% MagickBooleanType MagickFunctionImageChannel(MagickWand *wand, -% const ChannelType channel,const MagickFunction function, -% const size_t number_arguments,const double *arguments) % % A description of each parameter follows: % % o wand: the magick wand. % -% o channel: the channel(s). -% % o function: the image function. % % o number_arguments: the number of function arguments. @@ -3426,7 +3392,6 @@ WandExport MagickBooleanType MagickFrameImage(MagickWand *wand, % o arguments: the function arguments. % */ - WandExport MagickBooleanType MagickFunctionImage(MagickWand *wand, const MagickFunction function,const size_t number_arguments, const double *arguments) @@ -3442,26 +3407,6 @@ WandExport MagickBooleanType MagickFunctionImage(MagickWand *wand, ThrowWandException(WandError,"ContainsNoImages",wand->name); status=FunctionImage(wand->images,function,number_arguments,arguments, &wand->images->exception); - if (status == MagickFalse) - InheritException(wand->exception,&wand->images->exception); - return(status); -} - -WandExport MagickBooleanType MagickFunctionImageChannel(MagickWand *wand, - const ChannelType channel,const MagickFunction function, - const size_t number_arguments,const double *arguments) -{ - MagickBooleanType - status; - - assert(wand != (MagickWand *) NULL); - assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) - (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); - if (wand->images == (Image *) NULL) - ThrowWandException(WandError,"ContainsNoImages",wand->name); - status=FunctionImageChannel(wand->images,channel,function,number_arguments, - arguments,&wand->images->exception); return(status); } @@ -3963,7 +3908,7 @@ WandExport MagickBooleanType MagickGetImageBorderColor(MagickWand *wand, % % % % % % -% M a g i c k G e t I m a g e C h a n n e l F e a t u r e s % +% M a g i c k G e t I m a g e F e a t u r e s % % % % % % % @@ -4017,33 +3962,31 @@ WandExport ChannelFeatures *MagickGetImageFeatures(MagickWand *wand, % % % % % % -% M a g i c k G e t I m a g e C h a n n e l K u r t o s i s % +% M a g i c k G e t I m a g e K u r t o s i s % % % % % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% MagickGetImageChannelKurtosis() gets the kurtosis and skewness of one or +% MagickGetImageKurtosis() gets the kurtosis and skewness of one or % more image channels. % -% The format of the MagickGetImageChannelKurtosis method is: +% The format of the MagickGetImageKurtosis method is: % -% MagickBooleanType MagickGetImageChannelKurtosis(MagickWand *wand, -% const ChannelType channel,double *kurtosis,double *skewness) +% MagickBooleanType MagickGetImageKurtosis(MagickWand *wand, +% double *kurtosis,double *skewness) % % A description of each parameter follows: % % o wand: the magick wand. % -% o channel: the image channel(s). -% % o kurtosis: The kurtosis for the specified channel(s). % % o skewness: The skewness for the specified channel(s). % */ -WandExport MagickBooleanType MagickGetImageChannelKurtosis(MagickWand *wand, - const ChannelType channel,double *kurtosis,double *skewness) +WandExport MagickBooleanType MagickGetImageKurtosis(MagickWand *wand, + double *kurtosis,double *skewness) { MagickBooleanType status; @@ -4054,8 +3997,7 @@ WandExport MagickBooleanType MagickGetImageChannelKurtosis(MagickWand *wand, (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); - status=GetImageChannelKurtosis(wand->images,channel,kurtosis,skewness, - wand->exception); + status=GetImageKurtosis(wand->images,kurtosis,skewness,wand->exception); return(status); } @@ -4064,19 +4006,19 @@ WandExport MagickBooleanType MagickGetImageChannelKurtosis(MagickWand *wand, % % % % % % -% M a g i c k G e t I m a g e C h a n n e l M e a n % +% M a g i c k G e t I m a g e M e a n % % % % % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% MagickGetImageChannelMean() gets the mean and standard deviation of one or -% more image channels. +% MagickGetImageMean() gets the mean and standard deviation of one or more +% image channels. % -% The format of the MagickGetImageChannelMean method is: +% The format of the MagickGetImageMean method is: % -% MagickBooleanType MagickGetImageChannelMean(MagickWand *wand, -% const ChannelType channel,double *mean,double *standard_deviation) +% MagickBooleanType MagickGetImageMean(MagickWand *wand,double *mean, +% double *standard_deviation) % % A description of each parameter follows: % @@ -4089,8 +4031,8 @@ WandExport MagickBooleanType MagickGetImageChannelKurtosis(MagickWand *wand, % o standard_deviation: The standard deviation for the specified channel(s). % */ -WandExport MagickBooleanType MagickGetImageChannelMean(MagickWand *wand, - const ChannelType channel,double *mean,double *standard_deviation) +WandExport MagickBooleanType MagickGetImageMean(MagickWand *wand,double *mean, + double *standard_deviation) { MagickBooleanType status; @@ -4101,8 +4043,7 @@ WandExport MagickBooleanType MagickGetImageChannelMean(MagickWand *wand, (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); - status=GetImageChannelMean(wand->images,channel,mean,standard_deviation, - wand->exception); + status=GetImageMean(wand->images,mean,standard_deviation,wand->exception); return(status); } @@ -4111,32 +4052,30 @@ WandExport MagickBooleanType MagickGetImageChannelMean(MagickWand *wand, % % % % % % -% M a g i c k G e t I m a g e C h a n n e l R a n g e % +% M a g i c k G e t I m a g e R a n g e % % % % % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% MagickGetImageChannelRange() gets the range for one or more image channels. +% MagickGetImageRange() gets the range for one or more image channels. % -% The format of the MagickGetImageChannelRange method is: +% The format of the MagickGetImageRange method is: % -% MagickBooleanType MagickGetImageChannelRange(MagickWand *wand, -% const ChannelType channel,double *minima,double *maxima) +% MagickBooleanType MagickGetImageRange(MagickWand *wand,double *minima, +% double *maxima) % % A description of each parameter follows: % % o wand: the magick wand. % -% o channel: the image channel(s). -% % o minima: The minimum pixel value for the specified channel(s). % % o maxima: The maximum pixel value for the specified channel(s). % */ -WandExport MagickBooleanType MagickGetImageChannelRange(MagickWand *wand, - const ChannelType channel,double *minima,double *maxima) +WandExport MagickBooleanType MagickGetImageRange(MagickWand *wand, + double *minima,double *maxima) { MagickBooleanType status; @@ -4147,8 +4086,7 @@ WandExport MagickBooleanType MagickGetImageChannelRange(MagickWand *wand, (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); - status=GetImageChannelRange(wand->images,channel,minima,maxima, - wand->exception); + status=GetImageRange(wand->images,minima,maxima,wand->exception); return(status); } @@ -4157,32 +4095,32 @@ WandExport MagickBooleanType MagickGetImageChannelRange(MagickWand *wand, % % % % % % -% M a g i c k G e t I m a g e C h a n n e l S t a t i s t i c s % +% M a g i c k G e t I m a g e S t a t i s t i c s % % % % % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% MagickGetImageChannelStatistics() returns statistics for each channel in the +% MagickGetImageStatistics() returns statistics for each channel in the % image. The statistics include the channel depth, its minima and % maxima, the mean, the standard deviation, the kurtosis and the skewness. % You can access the red channel mean, for example, like this: % -% channel_statistics=MagickGetImageChannelStatistics(wand); +% channel_statistics=MagickGetImageStatistics(wand); % red_mean=channel_statistics[RedChannel].mean; % % Use MagickRelinquishMemory() to free the statistics buffer. % -% The format of the MagickGetImageChannelStatistics method is: +% The format of the MagickGetImageStatistics method is: % -% ChannelStatistics *MagickGetImageChannelStatistics(MagickWand *wand) +% ChannelStatistics *MagickGetImageStatistics(MagickWand *wand) % % A description of each parameter follows: % % o wand: the magick wand. % */ -WandExport ChannelStatistics *MagickGetImageChannelStatistics(MagickWand *wand) +WandExport ChannelStatistics *MagickGetImageStatistics(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); @@ -4194,7 +4132,7 @@ WandExport ChannelStatistics *MagickGetImageChannelStatistics(MagickWand *wand) "ContainsNoImages","`%s'",wand->name); return((ChannelStatistics *) NULL); } - return(GetImageChannelStatistics(wand->images,wand->exception)); + return(GetImageStatistics(wand->images,wand->exception)); } /* @@ -5286,49 +5224,6 @@ WandExport MagickBooleanType MagickGetImagePixelColor(MagickWand *wand, % % % % % % -+ M a g i c k G e t I m a g e R a n g e % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% MagickGetImageRange() gets the pixel range for the image. -% -% The format of the MagickGetImageRange method is: -% -% MagickBooleanType MagickGetImageRange(MagickWand *wand,double *minima, -% double *maxima) -% -% A description of each parameter follows: -% -% o wand: the magick wand. -% -% o minima: The minimum pixel value for the specified channel(s). -% -% o maxima: The maximum pixel value for the specified channel(s). -% -*/ -WandExport MagickBooleanType MagickGetImageRange(MagickWand *wand, - double *minima,double *maxima) -{ - MagickBooleanType - status; - - assert(wand != (MagickWand *) NULL); - assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) - (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); - if (wand->images == (Image *) NULL) - ThrowWandException(WandError,"ContainsNoImages",wand->name); - status=GetImageRange(wand->images,minima,maxima,wand->exception); - return(status); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % % M a g i c k G e t I m a g e R e d P r i m a r y % % % % % @@ -7200,16 +7095,11 @@ WandExport MagickBooleanType MagickOilPaintImage(MagickWand *wand, % MagickBooleanType MagickOpaquePaintImage(MagickWand *wand, % const PixelWand *target,const PixelWand *fill,const double fuzz, % const MagickBooleanType invert) -% MagickBooleanType MagickOpaquePaintImageChannel(MagickWand *wand, -% const ChannelType channel,const PixelWand *target, -% const PixelWand *fill,const double fuzz,const MagickBooleanType invert) % % A description of each parameter follows: % % o wand: the magick wand. % -% o channel: the channel(s). -% % o target: Change this target color to the fill color within the image. % % o fill: the fill pixel wand. @@ -7224,7 +7114,6 @@ WandExport MagickBooleanType MagickOilPaintImage(MagickWand *wand, % o invert: paint any pixel that does not match the target color. % */ - WandExport MagickBooleanType MagickOpaquePaintImage(MagickWand *wand, const PixelWand *target,const PixelWand *fill,const double fuzz, const MagickBooleanType invert) @@ -7232,18 +7121,6 @@ WandExport MagickBooleanType MagickOpaquePaintImage(MagickWand *wand, MagickBooleanType status; - status=MagickOpaquePaintImageChannel(wand,DefaultChannels,target,fill,fuzz, - invert); - return(status); -} - -WandExport MagickBooleanType MagickOpaquePaintImageChannel(MagickWand *wand, - const ChannelType channel,const PixelWand *target,const PixelWand *fill, - const double fuzz,const MagickBooleanType invert) -{ - MagickBooleanType - status; - PixelInfo fill_pixel, target_pixel; @@ -7257,8 +7134,7 @@ WandExport MagickBooleanType MagickOpaquePaintImageChannel(MagickWand *wand, PixelGetMagickColor(target,&target_pixel); PixelGetMagickColor(fill,&fill_pixel); wand->images->fuzz=fuzz; - status=OpaquePaintImageChannel(wand->images,channel,&target_pixel, - &fill_pixel,invert); + status=OpaquePaintImage(wand->images,&target_pixel,&fill_pixel,invert); if (status == MagickFalse) InheritException(wand->exception,&wand->images->exception); return(status); diff --git a/MagickWand/magick-image.h b/MagickWand/magick-image.h index fbaaba99d..58ad3400e 100644 --- a/MagickWand/magick-image.h +++ b/MagickWand/magick-image.h @@ -27,7 +27,7 @@ extern WandExport ChannelFeatures *MagickGetImageFeatures(MagickWand *,const size_t); extern WandExport ChannelStatistics - *MagickGetImageChannelStatistics(MagickWand *); + *MagickGetImageStatistics(MagickWand *); extern WandExport char *MagickGetImageFilename(MagickWand *), @@ -134,8 +134,6 @@ extern WandExport MagickBooleanType MagickEnhanceImage(MagickWand *), MagickEqualizeImage(MagickWand *), MagickEvaluateImage(MagickWand *,const MagickEvaluateOperator,const double), - MagickEvaluateImageChannel(MagickWand *,const ChannelType, - const MagickEvaluateOperator,const double), MagickExportImagePixels(MagickWand *,const ssize_t,const ssize_t, const size_t,const size_t,const char *,const StorageType,void *), MagickExtentImage(MagickWand *,const size_t,const size_t,const ssize_t, @@ -143,17 +141,14 @@ extern WandExport MagickBooleanType MagickFilterImage(MagickWand *,const KernelInfo *), MagickFilterImageChannel(MagickWand *,const ChannelType,const KernelInfo *), MagickFlipImage(MagickWand *), - MagickFloodfillPaintImage(MagickWand *,const ChannelType,const PixelWand *, - const double,const PixelWand *,const ssize_t,const ssize_t, - const MagickBooleanType), + MagickFloodfillPaintImage(MagickWand *,const PixelWand *,const double, + const PixelWand *,const ssize_t,const ssize_t,const MagickBooleanType), MagickFlopImage(MagickWand *), MagickForwardFourierTransformImage(MagickWand *,const MagickBooleanType), MagickFrameImage(MagickWand *,const PixelWand *,const size_t,const size_t, const ssize_t,const ssize_t), MagickFunctionImage(MagickWand *,const MagickFunction,const size_t, const double *), - MagickFunctionImageChannel(MagickWand *,const ChannelType, - const MagickFunction,const size_t,const double *), MagickGammaImage(MagickWand *,const double), MagickGaussianBlurImage(MagickWand *,const double,const double), MagickGaussianBlurImageChannel(MagickWand *,const ChannelType,const double, @@ -162,10 +157,9 @@ extern WandExport MagickBooleanType MagickGetImageBackgroundColor(MagickWand *,PixelWand *), MagickGetImageBluePrimary(MagickWand *,double *,double *), MagickGetImageBorderColor(MagickWand *,PixelWand *), - MagickGetImageChannelKurtosis(MagickWand *,const ChannelType,double *, - double *), - MagickGetImageChannelMean(MagickWand *,const ChannelType,double *,double *), - MagickGetImageChannelRange(MagickWand *,const ChannelType,double *,double *), + MagickGetImageKurtosis(MagickWand *,double *,double *), + MagickGetImageMean(MagickWand *,double *,double *), + MagickGetImageRange(MagickWand *,double *,double *), MagickGetImageColormapColor(MagickWand *,const size_t,PixelWand *), MagickGetImageDistortion(MagickWand *,const MagickWand *,const MetricType, double *), @@ -212,8 +206,6 @@ extern WandExport MagickBooleanType MagickOilPaintImage(MagickWand *,const double), MagickOpaquePaintImage(MagickWand *,const PixelWand *,const PixelWand *, const double,const MagickBooleanType), - MagickOpaquePaintImageChannel(MagickWand *,const ChannelType, - const PixelWand *,const PixelWand *,const double,const MagickBooleanType), MagickOrderedPosterizeImage(MagickWand *,const char *), MagickTransparentPaintImage(MagickWand *,const PixelWand *, const double,const double,const MagickBooleanType invert), diff --git a/MagickWand/mogrify.c b/MagickWand/mogrify.c index 3a43ed280..ae5533dd5 100644 --- a/MagickWand/mogrify.c +++ b/MagickWand/mogrify.c @@ -1496,10 +1496,10 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc, op; (void) SyncImageSettings(mogrify_info,*image); - op=(MagickEvaluateOperator) ParseCommandOption(MagickEvaluateOptions, - MagickFalse,argv[i+1]); + op=(MagickEvaluateOperator) ParseCommandOption( + MagickEvaluateOptions,MagickFalse,argv[i+1]); constant=SiPrefixToDouble(argv[i+2],QuantumRange); - (void) EvaluateImageChannel(*image,channel,op,constant,exception); + (void) EvaluateImage(*image,op,constant,exception); break; } if (LocaleCompare("extent",option+1) == 0) @@ -1584,8 +1584,8 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc, (void) SyncImageSettings(mogrify_info,*image); (void) ParsePageGeometry(*image,argv[i+1],&geometry,exception); (void) QueryMagickColor(argv[i+2],&target,exception); - (void) FloodfillPaintImage(*image,channel,draw_info,&target, - geometry.x,geometry.y,*option == '-' ? MagickFalse : MagickTrue); + (void) FloodfillPaintImage(*image,draw_info,&target,geometry.x, + geometry.y,*option == '-' ? MagickFalse : MagickTrue); InheritException(exception,&(*image)->exception); break; } @@ -1692,8 +1692,8 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc, parameters[x]=InterpretLocaleValue(token,(char **) NULL); } arguments=DestroyString(arguments); - (void) FunctionImageChannel(*image,channel,function, - number_parameters,parameters,exception); + (void) FunctionImage(*image,function,number_parameters,parameters, + exception); parameters=(double *) RelinquishMagickMemory(parameters); break; } @@ -2191,8 +2191,8 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc, (void) SyncImageSettings(mogrify_info,*image); (void) QueryMagickColor(argv[i+1],&target,exception); - (void) OpaquePaintImageChannel(*image,channel,&target,&fill, - *option == '-' ? MagickFalse : MagickTrue); + (void) OpaquePaintImage(*image,&target,&fill,*option == '-' ? + MagickFalse : MagickTrue); break; } if (LocaleCompare("ordered-dither",option+1) == 0) diff --git a/MagickWand/wandtest.c b/MagickWand/wandtest.c index 090c2668b..877e22b87 100644 --- a/MagickWand/wandtest.c +++ b/MagickWand/wandtest.c @@ -508,8 +508,8 @@ int main(int argc,char **argv) border=NewPixelWand(); (void) PixelSetColor(background,"green"); (void) PixelSetColor(border,"black"); - status=MagickFloodfillPaintImage(magick_wand,CompositeChannels,background, - 0.01*QuantumRange,border,0,0,MagickFalse); + status=MagickFloodfillPaintImage(magick_wand,background,0.01*QuantumRange, + border,0,0,MagickFalse); if (status == MagickFalse) ThrowAPIException(magick_wand); background=DestroyPixelWand(background); diff --git a/PerlMagick/Magick.xs b/PerlMagick/Magick.xs index bb40e9152..b43487183 100644 --- a/PerlMagick/Magick.xs +++ b/PerlMagick/Magick.xs @@ -8157,8 +8157,8 @@ Mogrify(ref,...) QuantumRange); if (attribute_flag[6] != 0) invert=(MagickBooleanType) argument_list[6].integer_reference; - (void) FloodfillPaintImage(image,DefaultChannels,draw_info,&target, - geometry.x,geometry.y,invert); + (void) FloodfillPaintImage(image,draw_info,&target,geometry.x, + geometry.y,invert); draw_info=DestroyDrawInfo(draw_info); break; } @@ -8716,8 +8716,8 @@ Mogrify(ref,...) if (attribute_flag[6] != 0) invert=(MagickBooleanType) argument_list[6].integer_reference; PushPixelComponentMap(image,AlphaChannel); - (void) FloodfillPaintImage(image,AlphaChannel,draw_info,&target, - geometry.x,geometry.y,invert); + (void) FloodfillPaintImage(image,draw_info,&target,geometry.x, + geometry.y,invert); PopPixelComponentMap(image); StandardPixelComponentMap(image); draw_info=DestroyDrawInfo(draw_info); @@ -8811,8 +8811,9 @@ Mogrify(ref,...) invert=MagickFalse; if (attribute_flag[4] != 0) invert=(MagickBooleanType) argument_list[4].integer_reference; - (void) OpaquePaintImageChannel(image,channel,&target,&fill_color, - invert); + PushPixelComponentMap(image,channel); + (void) OpaquePaintImage(image,&target,&fill_color,invert); + PopPixelComponentMap(image); break; } case 48: /* Quantize */ @@ -8949,8 +8950,10 @@ Mogrify(ref,...) op=(MagickEvaluateOperator) argument_list[1].integer_reference; if (attribute_flag[2] != MagickFalse) channel=(ChannelType) argument_list[2].integer_reference; - (void) EvaluateImageChannel(image,channel,op, - argument_list[0].real_reference,exception); + PushPixelComponentMap(image,channel); + (void) EvaluateImage(image,op,argument_list[0].real_reference, + exception); + PopPixelComponentMap(image); break; } case 56: /* Transparent */ @@ -10106,8 +10109,10 @@ Mogrify(ref,...) invert=MagickFalse; if (attribute_flag[7] != 0) invert=(MagickBooleanType) argument_list[7].integer_reference; - (void) FloodfillPaintImage(image,channel,draw_info,&target,geometry.x, + PushPixelComponentMap(image,channel); + (void) FloodfillPaintImage(image,draw_info,&target,geometry.x, geometry.y,invert); + PopPixelComponentMap(image); draw_info=DestroyDrawInfo(draw_info); break; } @@ -13651,7 +13656,7 @@ Statistics(ref,...) count=0; for ( ; image; image=image->next) { - channel_statistics=GetImageChannelStatistics(image,&image->exception); + channel_statistics=GetImageStatistics(image,&image->exception); if (channel_statistics == (ChannelStatistics *) NULL) continue; count++; diff --git a/coders/histogram.c b/coders/histogram.c index 7e0f11bf6..3ff651c35 100644 --- a/coders/histogram.c +++ b/coders/histogram.c @@ -180,9 +180,6 @@ static MagickBooleanType WriteHISTOGRAMImage(const ImageInfo *image_info, { #define HistogramDensity "256x200" - ChannelType - channel; - char filename[MaxTextExtent]; @@ -262,7 +259,6 @@ static MagickBooleanType WriteHISTOGRAMImage(const ImageInfo *image_info, /* Initialize histogram count arrays. */ - channel=image_info->channel; (void) ResetMagickMemory(histogram,0,length*sizeof(*histogram)); for (y=0; y < (ssize_t) image->rows; y++) { diff --git a/coders/msl.c b/coders/msl.c index 78f38a0a5..c10a29b31 100644 --- a/coders/msl.c +++ b/coders/msl.c @@ -1714,9 +1714,9 @@ static void MSLStartElement(void *context,const xmlChar *tag, } } } - (void) FloodfillPaintImage(msl_info->image[n],DefaultChannels, - draw_info,&target,geometry.x,geometry.y, - paint_method == FloodfillMethod ? MagickFalse : MagickTrue); + (void) FloodfillPaintImage(msl_info->image[n],draw_info,&target, + geometry.x,geometry.y,paint_method == FloodfillMethod ? + MagickFalse : MagickTrue); draw_info=DestroyDrawInfo(draw_info); break; } @@ -3735,9 +3735,11 @@ static void MSLStartElement(void *context,const xmlChar *tag, draw_info=CloneDrawInfo(msl_info->image_info[n], msl_info->draw_info[n]); draw_info->fill.alpha=ClampToQuantum(opacity); - (void) FloodfillPaintImage(msl_info->image[n],OpacityChannel, - draw_info,&target,geometry.x,geometry.y, - paint_method == FloodfillMethod ? MagickFalse : MagickTrue); + PushPixelComponentMap(msl_info->image[n],AlphaChannel); + (void) FloodfillPaintImage(msl_info->image[n],draw_info,&target, + geometry.x,geometry.y,paint_method == FloodfillMethod ? + MagickFalse : MagickTrue); + PopPixelComponentMap(msl_info->image[n]); draw_info=DestroyDrawInfo(draw_info); break; } @@ -4224,8 +4226,10 @@ static void MSLStartElement(void *context,const xmlChar *tag, } } } - (void) OpaquePaintImageChannel(msl_info->image[n],channel, - &target,&fill_color,MagickFalse); + PushPixelComponentMap(msl_info->image[n],channel); + (void) OpaquePaintImage(msl_info->image[n],&target,&fill_color, + MagickFalse); + PopPixelComponentMap(msl_info->image[n]); break; } ThrowMSLException(OptionError,"UnrecognizedElement",(const char *) tag); diff --git a/coders/xtrn.c b/coders/xtrn.c index 262ccc767..30f2f938c 100644 --- a/coders/xtrn.c +++ b/coders/xtrn.c @@ -422,8 +422,7 @@ ModuleExport void UnregisterXTRNImage(void) % % The format of the WriteXTRNImage method is: % -% MagickBooleanType WriteXTRNImage(const ImageInfo *image_info, -% Image *image) +% MagickBooleanType WriteXTRNImage(const ImageInfo *image_info,Image *image) % % A description of each parameter follows. % -- 2.40.0