blob: 1a39b65abd7b2c9f3770ee01f4569c18dae81ef7 [file] [log] [blame]
cristy3ed852e2009-09-05 21:47:34 +00001/*
cristy1454be72011-12-19 01:52:48 +00002 Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization
cristy3ed852e2009-09-05 21:47:34 +00003 dedicated to making software imaging solutions freely available.
4
5 You may not use this file except in compliance with the License.
6 obtain a copy of the License at
7
8 http://www.imagemagick.org/script/license.php
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15
cristy3e2860c2010-01-24 01:36:30 +000016 MagickCore statistical methods.
cristy3ed852e2009-09-05 21:47:34 +000017*/
18#ifndef _MAGICKCORE_STATISTIC_H
19#define _MAGICKCORE_STATISTIC_H
20
21#if defined(__cplusplus) || defined(c_plusplus)
22extern "C" {
23#endif
24
25typedef struct _ChannelStatistics
26{
cristybb503372010-05-27 20:51:26 +000027 size_t
cristy3ed852e2009-09-05 21:47:34 +000028 depth;
29
30 double
cristy5048d302012-08-07 01:05:16 +000031 area,
cristy3ed852e2009-09-05 21:47:34 +000032 minima,
33 maxima,
cristyfd9dcd42010-08-08 18:07:02 +000034 sum,
35 sum_squared,
cristya8178ed2010-08-10 17:31:59 +000036 sum_cubed,
37 sum_fourth_power,
cristycf584452010-08-08 02:26:04 +000038 mean,
cristyfd9dcd42010-08-08 18:07:02 +000039 variance,
cristycf584452010-08-08 02:26:04 +000040 standard_deviation,
cristy3ed852e2009-09-05 21:47:34 +000041 kurtosis,
42 skewness;
43} ChannelStatistics;
44
cristy351842f2010-03-07 15:27:38 +000045typedef enum
46{
47 UndefinedEvaluateOperator,
cristy95f562a2012-01-01 20:49:11 +000048 AbsEvaluateOperator,
cristy351842f2010-03-07 15:27:38 +000049 AddEvaluateOperator,
cristy95f562a2012-01-01 20:49:11 +000050 AddModulusEvaluateOperator,
cristy351842f2010-03-07 15:27:38 +000051 AndEvaluateOperator,
cristy95f562a2012-01-01 20:49:11 +000052 CosineEvaluateOperator,
cristy351842f2010-03-07 15:27:38 +000053 DivideEvaluateOperator,
cristy95f562a2012-01-01 20:49:11 +000054 ExponentialEvaluateOperator,
cristy351842f2010-03-07 15:27:38 +000055 GaussianNoiseEvaluateOperator,
56 ImpulseNoiseEvaluateOperator,
57 LaplacianNoiseEvaluateOperator,
cristy95f562a2012-01-01 20:49:11 +000058 LeftShiftEvaluateOperator,
59 LogEvaluateOperator,
60 MaxEvaluateOperator,
cristy33aaed22010-08-11 18:10:50 +000061 MeanEvaluateOperator,
cristy95f562a2012-01-01 20:49:11 +000062 MedianEvaluateOperator,
63 MinEvaluateOperator,
64 MultiplicativeNoiseEvaluateOperator,
65 MultiplyEvaluateOperator,
66 OrEvaluateOperator,
67 PoissonNoiseEvaluateOperator,
68 PowEvaluateOperator,
69 RightShiftEvaluateOperator,
70 SetEvaluateOperator,
71 SineEvaluateOperator,
72 SubtractEvaluateOperator,
cristy12a3f8e2012-01-31 01:53:19 +000073 SumEvaluateOperator,
cristy95f562a2012-01-01 20:49:11 +000074 ThresholdBlackEvaluateOperator,
75 ThresholdEvaluateOperator,
76 ThresholdWhiteEvaluateOperator,
77 UniformNoiseEvaluateOperator,
78 XorEvaluateOperator
cristy351842f2010-03-07 15:27:38 +000079} MagickEvaluateOperator;
80
81typedef enum
82{
83 UndefinedFunction,
84 PolynomialFunction,
85 SinusoidFunction,
86 ArcsinFunction,
87 ArctanFunction
88} MagickFunction;
89
cristy99bd5232011-12-07 14:38:20 +000090typedef enum
91{
92 UndefinedStatistic,
93 GradientStatistic,
94 MaximumStatistic,
95 MeanStatistic,
96 MedianStatistic,
97 MinimumStatistic,
98 ModeStatistic,
99 NonpeakStatistic,
100 StandardDeviationStatistic
101} StatisticType;
102
cristy3ed852e2009-09-05 21:47:34 +0000103extern MagickExport ChannelStatistics
cristyd42d9952011-07-08 14:21:50 +0000104 *GetImageStatistics(const Image *,ExceptionInfo *);
cristy3ed852e2009-09-05 21:47:34 +0000105
cristy316d5172009-09-17 19:31:25 +0000106extern MagickExport Image
cristy99bd5232011-12-07 14:38:20 +0000107 *EvaluateImages(const Image *,const MagickEvaluateOperator,ExceptionInfo *),
108 *StatisticImage(const Image *,const StatisticType,const size_t,const size_t,
109 ExceptionInfo *);
cristy316d5172009-09-17 19:31:25 +0000110
cristy3ed852e2009-09-05 21:47:34 +0000111extern MagickExport MagickBooleanType
cristy351842f2010-03-07 15:27:38 +0000112 EvaluateImage(Image *,const MagickEvaluateOperator,const double,
113 ExceptionInfo *),
cristybb503372010-05-27 20:51:26 +0000114 FunctionImage(Image *,const MagickFunction,const size_t,const double *,
cristy351842f2010-03-07 15:27:38 +0000115 ExceptionInfo *),
cristy5ed838e2010-05-31 00:05:35 +0000116 GetImageExtrema(const Image *,size_t *,size_t *,ExceptionInfo *),
cristy3ed852e2009-09-05 21:47:34 +0000117 GetImageMean(const Image *,double *,double *,ExceptionInfo *),
cristyd42d9952011-07-08 14:21:50 +0000118 GetImageKurtosis(const Image *,double *,double *,ExceptionInfo *),
119 GetImageRange(const Image *,double *,double *,ExceptionInfo *);
cristy3ed852e2009-09-05 21:47:34 +0000120
121#if defined(__cplusplus) || defined(c_plusplus)
122}
123#endif
124
125#endif