Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-15 09:43:32

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 } ChannelStatistics;
0050 
0051 typedef struct _ChannelMoments
0052 {
0053   double
0054     invariant[MaximumNumberOfImageMoments+1];
0055 
0056   PointInfo
0057     centroid,
0058     ellipse_axis;
0059 
0060   double
0061     ellipse_angle,
0062     ellipse_eccentricity,
0063     ellipse_intensity;
0064 } ChannelMoments;
0065 
0066 typedef struct _ChannelPerceptualHash
0067 {
0068   double
0069     srgb_hu_phash[MaximumNumberOfImageMoments+1],
0070     hclp_hu_phash[MaximumNumberOfImageMoments+1];
0071 
0072   size_t
0073     number_colorspaces;
0074 
0075   ColorspaceType
0076     colorspace[MaximumNumberOfPerceptualColorspaces+1];
0077 
0078   double
0079     phash[MaximumNumberOfPerceptualColorspaces+1][MaximumNumberOfImageMoments+1];
0080 
0081   size_t
0082     number_channels;
0083 } ChannelPerceptualHash;
0084 
0085 typedef enum
0086 {
0087   UndefinedEvaluateOperator,
0088   AbsEvaluateOperator,
0089   AddEvaluateOperator,
0090   AddModulusEvaluateOperator,
0091   AndEvaluateOperator,
0092   CosineEvaluateOperator,
0093   DivideEvaluateOperator,
0094   ExponentialEvaluateOperator,
0095   GaussianNoiseEvaluateOperator,
0096   ImpulseNoiseEvaluateOperator,
0097   LaplacianNoiseEvaluateOperator,
0098   LeftShiftEvaluateOperator,
0099   LogEvaluateOperator,
0100   MaxEvaluateOperator,
0101   MeanEvaluateOperator,
0102   MedianEvaluateOperator,
0103   MinEvaluateOperator,
0104   MultiplicativeNoiseEvaluateOperator,
0105   MultiplyEvaluateOperator,
0106   OrEvaluateOperator,
0107   PoissonNoiseEvaluateOperator,
0108   PowEvaluateOperator,
0109   RightShiftEvaluateOperator,
0110   RootMeanSquareEvaluateOperator,
0111   SetEvaluateOperator,
0112   SineEvaluateOperator,
0113   SubtractEvaluateOperator,
0114   SumEvaluateOperator,
0115   ThresholdBlackEvaluateOperator,
0116   ThresholdEvaluateOperator,
0117   ThresholdWhiteEvaluateOperator,
0118   UniformNoiseEvaluateOperator,
0119   XorEvaluateOperator,
0120   InverseLogEvaluateOperator
0121 } MagickEvaluateOperator;
0122 
0123 typedef enum
0124 {
0125   UndefinedFunction,
0126   ArcsinFunction,
0127   ArctanFunction,
0128   PolynomialFunction,
0129   SinusoidFunction
0130 } MagickFunction;
0131 
0132 typedef enum
0133 {
0134   UndefinedStatistic,
0135   GradientStatistic,
0136   MaximumStatistic,
0137   MeanStatistic,
0138   MedianStatistic,
0139   MinimumStatistic,
0140   ModeStatistic,
0141   NonpeakStatistic,
0142   RootMeanSquareStatistic,
0143   StandardDeviationStatistic,
0144   ContrastStatistic
0145 } StatisticType;
0146 
0147 extern MagickExport ChannelStatistics
0148   *GetImageStatistics(const Image *,ExceptionInfo *);
0149 
0150 extern MagickExport ChannelMoments
0151   *GetImageMoments(const Image *,ExceptionInfo *);
0152 
0153 extern MagickExport ChannelPerceptualHash
0154   *GetImagePerceptualHash(const Image *,ExceptionInfo *);
0155 
0156 extern MagickExport Image
0157   *EvaluateImages(const Image *,const MagickEvaluateOperator,ExceptionInfo *),
0158   *PolynomialImage(const Image *,const size_t,const double *,ExceptionInfo *),
0159   *StatisticImage(const Image *,const StatisticType,const size_t,const size_t,
0160     ExceptionInfo *);
0161 
0162 extern MagickExport MagickBooleanType
0163   EvaluateImage(Image *,const MagickEvaluateOperator,const double,
0164     ExceptionInfo *),
0165   FunctionImage(Image *,const MagickFunction,const size_t,const double *,
0166     ExceptionInfo *),
0167   GetImageEntropy(const Image *,double *,ExceptionInfo *),
0168   GetImageExtrema(const Image *,size_t *,size_t *,ExceptionInfo *),
0169   GetImageMean(const Image *,double *,double *,ExceptionInfo *),
0170   GetImageMedian(const Image *,double *,ExceptionInfo *),
0171   GetImageKurtosis(const Image *,double *,double *,ExceptionInfo *),
0172   GetImageRange(const Image *,double *,double *,ExceptionInfo *);
0173 
0174 #if defined(__cplusplus) || defined(c_plusplus)
0175 }
0176 #endif
0177 
0178 #endif