]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sun, 11 Nov 2012 19:29:38 +0000 (19:29 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sun, 11 Nov 2012 19:29:38 +0000 (19:29 +0000)
MagickCore/option.c
MagickCore/statistic.c
MagickCore/statistic.h

index 5775b31cff6b56a9c8b0b53bfbc524ed94e973a3..0552365d71823122361c76cb113c7e9c9b524e88 100644 (file)
@@ -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 },
index dba1c57c243210464bcbbf37dbbb553d8c601a0b..a5c37571e92a741cf6845639dc7a46871e6194ad 100644 (file)
@@ -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);
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
 %     S t a t i s t i c I m a g e                                             %
 %                                                                             %
 %                                                                             %
index 1a39b65abd7b2c9f3770ee01f4569c18dae81ef7..2dd70b6552f3991e7882d0e80668f0b003b80740 100644 (file)
@@ -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 *);