From: cristy Date: Sun, 11 Nov 2012 19:29:38 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~4732 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f56e6ad6da167beca48fb23194201c25cd3dfb8e;p=imagemagick --- diff --git a/MagickCore/option.c b/MagickCore/option.c index 5775b31cf..0552365d7 100644 --- a/MagickCore/option.c +++ b/MagickCore/option.c @@ -535,6 +535,8 @@ static const OptionInfo { "-pointsize", 1L, ImageInfoOptionFlag | DrawInfoOptionFlag, MagickFalse }, { "+polaroid", 0L, SimpleOperatorFlag, MagickFalse }, { "-polaroid", 1L, SimpleOperatorFlag, MagickFalse }, + { "+poly", 1L, DeprecateOptionFlag | FireOptionFlag, MagickTrue }, + { "-poly", 1L, ListOperatorFlag | FireOptionFlag, MagickFalse }, { "+posterize", 1L, DeprecateOptionFlag, MagickTrue }, { "-posterize", 1L, SimpleOperatorFlag, MagickFalse }, { "+precision", 0L, ImageInfoOptionFlag, MagickFalse }, diff --git a/MagickCore/statistic.c b/MagickCore/statistic.c index dba1c57c2..a5c37571e 100644 --- a/MagickCore/statistic.c +++ b/MagickCore/statistic.c @@ -1752,6 +1752,69 @@ MagickExport ChannelStatistics *GetImageStatistics(const Image *image, % % % % % % +% P o l y n o m i a l I m a g e % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% PolynomialImage() returns a new image where each pixel is the sum of the +% pixels in the image sequence after applying its corresponding terms +% (coefficients and degree pairs) and a constant. +% +% The format of the PolynomialImage method is: +% +% Image *PolynomialImage(const Image *image,const size_t number_terms, +% const double *terms,ExceptionInfo *exception) +% +% A description of each parameter follows: +% +% o image: the image. +% +% o number_terms: the number of terms in the list. The actual list length +% is 2 x number_terms + 1 (the constant). +% +% o terms: the list of polynomial coefficients and degree pairs and a +% constant. +% +% o exception: return any errors or warnings in this structure. +% +*/ + +MagickExport Image *PolynomialImage(const Image *image, + const size_t number_terms,const double *terms,ExceptionInfo *exception) +{ + Image + *polynomial_image; + + MagickBooleanType + status; + + assert(image != (Image *) NULL); + assert(image->signature == MagickSignature); + if (image->debug != MagickFalse) + (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); + assert(terms != (double *) NULL); + assert(exception != (ExceptionInfo *) NULL); + assert(exception->signature == MagickSignature); + polynomial_image=CloneImage(image,image->columns,image->rows,MagickTrue, + exception); + if (polynomial_image == (Image *) NULL) + return((Image *) NULL); + status=SetImageStorageClass(polynomial_image,DirectClass,exception); + if (status == MagickFalse) + { + polynomial_image=DestroyImage(polynomial_image); + return((Image *) NULL); + } + return(polynomial_image); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % % S t a t i s t i c I m a g e % % % % % diff --git a/MagickCore/statistic.h b/MagickCore/statistic.h index 1a39b65ab..2dd70b655 100644 --- a/MagickCore/statistic.h +++ b/MagickCore/statistic.h @@ -105,6 +105,7 @@ extern MagickExport ChannelStatistics extern MagickExport Image *EvaluateImages(const Image *,const MagickEvaluateOperator,ExceptionInfo *), + *PolynomialImage(const Image *,const size_t,const double *,ExceptionInfo *), *StatisticImage(const Image *,const StatisticType,const size_t,const size_t, ExceptionInfo *);