Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 09:02:11

0001 /*
0002   Copyright @ 1999 ImageMagick Studio LLC, a non-profit organization
0003   dedicated to making software imaging solutions freely available.
0004   
0005   You may not use this file except in compliance with the License.  You may
0006   obtain a copy of the License at
0007   
0008     https://imagemagick.org/script/license.php
0009   
0010   Unless required by applicable law or agreed to in writing, software
0011   distributed under the License is distributed on an "AS IS" BASIS,
0012   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0013   See the License for the specific language governing permissions and
0014   limitations under the License.
0015 
0016   MagickCore statistical methods.
0017 */
0018 #ifndef MAGICKCORE_STATISTIC_H
0019 #define MAGICKCORE_STATISTIC_H
0020 
0021 #if defined(__cplusplus) || defined(c_plusplus)
0022 extern "C" {
0023 #endif
0024 
0025 #define MaximumNumberOfImageMoments  8
0026 #define MaximumNumberOfPerceptualColorspaces  6
0027 #define MaximumNumberOfPerceptualHashes  7
0028 
0029 typedef struct _ChannelStatistics
0030 {
0031   size_t
0032     depth;
0033 
0034   double
0035     area,
0036     minima,
0037     maxima,
0038     sum,
0039     sum_squared,
0040     sum_cubed,
0041     sum_fourth_power,
0042     mean,
0043     variance,
0044     standard_deviation,
0045     kurtosis,
0046     skewness,
0047     entropy,
0048     median;
0049 
0050   long double
0051     sumLD,
0052     M1,
0053     M2,
0054     M3,
0055     M4;
0056 } ChannelStatistics;
0057 
0058 typedef struct _ChannelMoments
0059 {
0060   double
0061     invariant[MaximumNumberOfImageMoments+1];
0062 
0063   PointInfo
0064     centroid,
0065     ellipse_axis;
0066 
0067   double
0068     ellipse_angle,
0069     ellipse_eccentricity,
0070     ellipse_intensity;
0071 } ChannelMoments;
0072 
0073 typedef struct _ChannelPerceptualHash
0074 {
0075   double
0076     srgb_hu_phash[MaximumNumberOfImageMoments+1],
0077     hclp_hu_phash[MaximumNumberOfImageMoments+1];
0078 
0079   size_t
0080     number_colorspaces;
0081 
0082   ColorspaceType
0083     colorspace[MaximumNumberOfPerceptualColorspaces+1];
0084 
0085   double
0086     phash[MaximumNumberOfPerceptualColorspaces+1][MaximumNumberOfImageMoments+1];
0087 
0088   size_t
0089     number_channels;
0090 } ChannelPerceptualHash;
0091 
0092 typedef enum
0093 {
0094   UndefinedEvaluateOperator,
0095   AbsEvaluateOperator,
0096   AddEvaluateOperator,
0097   AddModulusEvaluateOperator,
0098   AndEvaluateOperator,
0099   CosineEvaluateOperator,
0100   DivideEvaluateOperator,
0101   ExponentialEvaluateOperator,
0102   GaussianNoiseEvaluateOperator,
0103   ImpulseNoiseEvaluateOperator,
0104   LaplacianNoiseEvaluateOperator,
0105   LeftShiftEvaluateOperator,
0106   LogEvaluateOperator,
0107   MaxEvaluateOperator,
0108   MeanEvaluateOperator,
0109   MedianEvaluateOperator,
0110   MinEvaluateOperator,
0111   MultiplicativeNoiseEvaluateOperator,
0112   MultiplyEvaluateOperator,
0113   OrEvaluateOperator,
0114   PoissonNoiseEvaluateOperator,
0115   PowEvaluateOperator,
0116   RightShiftEvaluateOperator,
0117   RootMeanSquareEvaluateOperator,
0118   SetEvaluateOperator,
0119   SineEvaluateOperator,
0120   SubtractEvaluateOperator,
0121   SumEvaluateOperator,
0122   ThresholdBlackEvaluateOperator,
0123   ThresholdEvaluateOperator,
0124   ThresholdWhiteEvaluateOperator,
0125   UniformNoiseEvaluateOperator,
0126   XorEvaluateOperator,
0127   InverseLogEvaluateOperator
0128 } MagickEvaluateOperator;
0129 
0130 typedef enum
0131 {
0132   UndefinedFunction,
0133   ArcsinFunction,
0134   ArctanFunction,
0135   PolynomialFunction,
0136   SinusoidFunction
0137 } MagickFunction;
0138 
0139 typedef enum
0140 {
0141   UndefinedStatistic,
0142   GradientStatistic,
0143   MaximumStatistic,
0144   MeanStatistic,
0145   MedianStatistic,
0146   MinimumStatistic,
0147   ModeStatistic,
0148   NonpeakStatistic,
0149   RootMeanSquareStatistic,
0150   StandardDeviationStatistic,
0151   ContrastStatistic
0152 } StatisticType;
0153 
0154 extern MagickExport ChannelStatistics
0155   *GetImageStatistics(const Image *,ExceptionInfo *);
0156 
0157 extern MagickExport ChannelMoments
0158   *GetImageMoments(const Image *,ExceptionInfo *);
0159 
0160 extern MagickExport ChannelPerceptualHash
0161   *GetImagePerceptualHash(const Image *,ExceptionInfo *);
0162 
0163 extern MagickExport Image
0164   *EvaluateImages(const Image *,const MagickEvaluateOperator,ExceptionInfo *),
0165   *PolynomialImage(const Image *,const size_t,const double *,ExceptionInfo *),
0166   *StatisticImage(const Image *,const StatisticType,const size_t,const size_t,
0167     ExceptionInfo *);
0168 
0169 extern MagickExport MagickBooleanType
0170   EvaluateImage(Image *,const MagickEvaluateOperator,const double,
0171     ExceptionInfo *),
0172   FunctionImage(Image *,const MagickFunction,const size_t,const double *,
0173     ExceptionInfo *),
0174   GetImageEntropy(const Image *,double *,ExceptionInfo *),
0175   GetImageExtrema(const Image *,size_t *,size_t *,ExceptionInfo *),
0176   GetImageMean(const Image *,double *,double *,ExceptionInfo *),
0177   GetImageMedian(const Image *,double *,ExceptionInfo *),
0178   GetImageKurtosis(const Image *,double *,double *,ExceptionInfo *),
0179   GetImageRange(const Image *,double *,double *,ExceptionInfo *);
0180 
0181 #if defined(__cplusplus) || defined(c_plusplus)
0182 }
0183 #endif
0184 
0185 #endif