Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:01:22

0001 /*
0002   Copyright @ 2010 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 morphology methods.
0017 */
0018 #ifndef MAGICKCORE_MORPHOLOGY_H
0019 #define MAGICKCORE_MORPHOLOGY_H
0020 
0021 #include "MagickCore/geometry.h"
0022 
0023 #if defined(__cplusplus) || defined(c_plusplus)
0024 extern "C" {
0025 #endif
0026 
0027 typedef enum
0028 {
0029   UndefinedKernel,    /* equivalent to UnityKernel */
0030   UnityKernel,        /* The no-op or 'original image' kernel */
0031   GaussianKernel,     /* Convolution Kernels, Gaussian Based */
0032   DoGKernel,
0033   LoGKernel,
0034   BlurKernel,
0035   CometKernel,
0036   BinomialKernel,
0037   LaplacianKernel,    /* Convolution Kernels, by Name */
0038   SobelKernel,
0039   FreiChenKernel,
0040   RobertsKernel,
0041   PrewittKernel,
0042   CompassKernel,
0043   KirschKernel,
0044   DiamondKernel,      /* Shape Kernels */
0045   SquareKernel,
0046   RectangleKernel,
0047   OctagonKernel,
0048   DiskKernel,
0049   PlusKernel,
0050   CrossKernel,
0051   RingKernel,
0052   PeaksKernel,         /* Hit And Miss Kernels */
0053   EdgesKernel,
0054   CornersKernel,
0055   DiagonalsKernel,
0056   LineEndsKernel,
0057   LineJunctionsKernel,
0058   RidgesKernel,
0059   ConvexHullKernel,
0060   ThinSEKernel,
0061   SkeletonKernel,
0062   ChebyshevKernel,    /* Distance Measuring Kernels */
0063   ManhattanKernel,
0064   OctagonalKernel,
0065   EuclideanKernel,
0066   UserDefinedKernel   /* User Specified Kernel Array */
0067 } KernelInfoType;
0068 
0069 typedef enum
0070 {
0071   UndefinedMorphology,
0072 /* Convolve / Correlate weighted sums */
0073   ConvolveMorphology,           /* Weighted Sum with reflected kernel */
0074   CorrelateMorphology,          /* Weighted Sum using a sliding window */
0075 /* Low-level Morphology methods */
0076   ErodeMorphology,              /* Minimum Value in Neighbourhood */
0077   DilateMorphology,             /* Maximum Value in Neighbourhood */
0078   ErodeIntensityMorphology,     /* Pixel Pick using GreyScale Erode */
0079   DilateIntensityMorphology,    /* Pixel Pick using GreyScale Dilate */
0080   IterativeDistanceMorphology,  /* Add Kernel Value, take Minimum */
0081 /* Second-level Morphology methods */
0082   OpenMorphology,               /* Dilate then Erode */
0083   CloseMorphology,              /* Erode then Dilate */
0084   OpenIntensityMorphology,      /* Pixel Pick using GreyScale Open */
0085   CloseIntensityMorphology,     /* Pixel Pick using GreyScale Close */
0086   SmoothMorphology,             /* Open then Close */
0087 /* Difference Morphology methods */
0088   EdgeInMorphology,             /* Dilate difference from Original */
0089   EdgeOutMorphology,            /* Erode difference from Original */
0090   EdgeMorphology,               /* Dilate difference with Erode */
0091   TopHatMorphology,             /* Close difference from Original */
0092   BottomHatMorphology,          /* Open difference from Original */
0093 /* Recursive Morphology methods */
0094   HitAndMissMorphology,         /* Foreground/Background pattern matching */
0095   ThinningMorphology,           /* Remove matching pixels from image */
0096   ThickenMorphology,            /* Add matching pixels from image */
0097 /* Directly Applied Morphology methods */
0098   DistanceMorphology,           /* Add Kernel Value, take Minimum */
0099   VoronoiMorphology             /* Distance matte channel copy nearest color */
0100 } MorphologyMethod;
0101 
0102 typedef struct _KernelInfo
0103 {
0104   KernelInfoType
0105     type;
0106 
0107   size_t
0108     width,
0109     height;
0110 
0111   ssize_t
0112     x,
0113     y;
0114 
0115   MagickRealType
0116     *values;
0117 
0118   double
0119     minimum,
0120     maximum,
0121     negative_range,
0122     positive_range,
0123     angle;
0124 
0125   struct _KernelInfo
0126     *next;
0127 
0128   size_t
0129     signature;
0130 } KernelInfo;
0131 
0132 extern MagickExport KernelInfo
0133   *AcquireKernelInfo(const char *,ExceptionInfo *),
0134   *AcquireKernelBuiltIn(const KernelInfoType,const GeometryInfo *,
0135     ExceptionInfo *),
0136   *CloneKernelInfo(const KernelInfo *),
0137   *DestroyKernelInfo(KernelInfo *);
0138 
0139 extern MagickExport Image
0140   *MorphologyImage(const Image *,const MorphologyMethod,const ssize_t,
0141     const KernelInfo *,ExceptionInfo *);
0142 
0143 extern MagickExport void
0144   ScaleGeometryKernelInfo(KernelInfo *,const char *),
0145   ScaleKernelInfo(KernelInfo *,const double,const GeometryFlags),
0146   UnityAddKernelInfo(KernelInfo *,const double);
0147 
0148 #if defined(__cplusplus) || defined(c_plusplus)
0149 }
0150 #endif
0151 
0152 #endif