]> granicus.if.org Git - imagemagick/blob - MagickCore/statistic.h
(no commit message)
[imagemagick] / MagickCore / statistic.h
1 /*
2   Copyright 1999-2014 ImageMagick Studio LLC, a non-profit organization
3   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
16   MagickCore statistical methods.
17 */
18 #ifndef _MAGICKCORE_STATISTIC_H
19 #define _MAGICKCORE_STATISTIC_H
20
21 #if defined(__cplusplus) || defined(c_plusplus)
22 extern "C" {
23 #endif
24
25 typedef struct _ChannelStatistics
26 {
27   size_t
28     depth;
29
30   double
31     area,
32     minima,
33     maxima,
34     sum,
35     sum_squared,
36     sum_cubed,
37     sum_fourth_power,
38     mean,
39     variance,
40     standard_deviation,
41     kurtosis,
42     skewness;
43 } ChannelStatistics;
44
45 typedef struct _ChannelMoments
46 {
47   double
48     I[32];
49
50   PointInfo
51     centroid,
52     ellipse_axis;
53
54   double
55     ellipse_angle,
56     ellipse_eccentricity,
57     ellipse_intensity;
58 } ChannelMoments;
59
60 typedef struct _ChannelPerceptualHash
61 {
62   double
63     P[32],
64     Q[32];
65 } ChannelPerceptualHash;
66
67 typedef enum
68 {
69   UndefinedEvaluateOperator,
70   AbsEvaluateOperator,
71   AddEvaluateOperator,
72   AddModulusEvaluateOperator,
73   AndEvaluateOperator,
74   CosineEvaluateOperator,
75   DivideEvaluateOperator,
76   ExponentialEvaluateOperator,
77   GaussianNoiseEvaluateOperator,
78   ImpulseNoiseEvaluateOperator,
79   LaplacianNoiseEvaluateOperator,
80   LeftShiftEvaluateOperator,
81   LogEvaluateOperator,
82   MaxEvaluateOperator,
83   MeanEvaluateOperator,
84   MedianEvaluateOperator,
85   MinEvaluateOperator,
86   MultiplicativeNoiseEvaluateOperator,
87   MultiplyEvaluateOperator,
88   OrEvaluateOperator,
89   PoissonNoiseEvaluateOperator,
90   PowEvaluateOperator,
91   RightShiftEvaluateOperator,
92   SetEvaluateOperator,
93   SineEvaluateOperator,
94   SubtractEvaluateOperator,
95   SumEvaluateOperator,
96   ThresholdBlackEvaluateOperator,
97   ThresholdEvaluateOperator,
98   ThresholdWhiteEvaluateOperator,
99   UniformNoiseEvaluateOperator,
100   XorEvaluateOperator
101 } MagickEvaluateOperator;
102
103 typedef enum
104 {
105   UndefinedFunction,
106   PolynomialFunction,
107   SinusoidFunction,
108   ArcsinFunction,
109   ArctanFunction
110 } MagickFunction;
111
112 typedef enum
113 {
114   UndefinedStatistic,
115   GradientStatistic,
116   MaximumStatistic,
117   MeanStatistic,
118   MedianStatistic,
119   MinimumStatistic,
120   ModeStatistic,
121   NonpeakStatistic,
122   StandardDeviationStatistic
123 } StatisticType;
124
125 extern MagickExport ChannelStatistics
126   *GetImageStatistics(const Image *,ExceptionInfo *);
127
128 extern MagickExport ChannelMoments
129   *GetImageMoments(const Image *,ExceptionInfo *);
130
131 extern MagickExport ChannelPerceptualHash
132   *GetImagePerceptualHash(const Image *,ExceptionInfo *);
133
134 extern MagickExport Image
135   *EvaluateImages(const Image *,const MagickEvaluateOperator,ExceptionInfo *),
136   *PolynomialImage(const Image *,const size_t,const double *,ExceptionInfo *),
137   *StatisticImage(const Image *,const StatisticType,const size_t,const size_t,
138     ExceptionInfo *);
139
140 extern MagickExport MagickBooleanType
141   EvaluateImage(Image *,const MagickEvaluateOperator,const double,
142     ExceptionInfo *),
143   FunctionImage(Image *,const MagickFunction,const size_t,const double *,
144     ExceptionInfo *),
145   GetImageExtrema(const Image *,size_t *,size_t *,ExceptionInfo *),
146   GetImageMean(const Image *,double *,double *,ExceptionInfo *),
147   GetImageKurtosis(const Image *,double *,double *,ExceptionInfo *),
148   GetImageRange(const Image *,double *,double *,ExceptionInfo *);
149
150 #if defined(__cplusplus) || defined(c_plusplus)
151 }
152 #endif
153
154 #endif