morphology.h

Go to the documentation of this file.
00001 /*
00002   Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
00003   dedicated to making software imaging solutions freely available.
00004   
00005   You may not use this file except in compliance with the License.  You may
00006   obtain a copy of the License at
00007   
00008     https://imagemagick.org/script/license.php
00009   
00010   Unless required by applicable law or agreed to in writing, software
00011   distributed under the License is distributed on an "AS IS" BASIS,
00012   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013   See the License for the specific language governing permissions and
00014   limitations under the License.
00015 
00016   MagickCore morphology methods.
00017 */
00018 #ifndef MAGICKCORE_MORPHOLOGY_H
00019 #define MAGICKCORE_MORPHOLOGY_H
00020 
00021 #include "magick/geometry.h"
00022 
00023 #if defined(__cplusplus) || defined(c_plusplus)
00024 extern "C" {
00025 #endif
00026 
00027 typedef enum
00028 {
00029   UndefinedKernel,    /* equivalent to UnityKernel */
00030   UnityKernel,        /* The no-op or 'original image' kernel */
00031   GaussianKernel,     /* Convolution Kernels, Gaussian Based */
00032   DoGKernel,
00033   LoGKernel,
00034   BlurKernel,
00035   CometKernel,
00036   LaplacianKernel,    /* Convolution Kernels, by Name */
00037   SobelKernel,
00038   FreiChenKernel,
00039   RobertsKernel,
00040   PrewittKernel,
00041   CompassKernel,
00042   KirschKernel,
00043   DiamondKernel,      /* Shape Kernels */
00044   SquareKernel,
00045   RectangleKernel,
00046   OctagonKernel,
00047   DiskKernel,
00048   PlusKernel,
00049   CrossKernel,
00050   RingKernel,
00051   PeaksKernel,         /* Hit And Miss Kernels */
00052   EdgesKernel,
00053   CornersKernel,
00054   DiagonalsKernel,
00055   LineEndsKernel,
00056   LineJunctionsKernel,
00057   RidgesKernel,
00058   ConvexHullKernel,
00059   ThinSEKernel,
00060   SkeletonKernel,
00061   ChebyshevKernel,    /* Distance Measuring Kernels */
00062   ManhattanKernel,
00063   OctagonalKernel,
00064   EuclideanKernel,
00065   UserDefinedKernel,   /* User Specified Kernel Array */
00066   BinomialKernel
00067 } KernelInfoType;
00068 
00069 typedef enum
00070 {
00071   UndefinedMorphology,
00072 /* Convolve / Correlate weighted sums */
00073   ConvolveMorphology,           /* Weighted Sum with reflected kernel */
00074   CorrelateMorphology,          /* Weighted Sum using a sliding window */
00075 /* Low-level Morphology methods */
00076   ErodeMorphology,              /* Minimum Value in Neighbourhood */
00077   DilateMorphology,             /* Maximum Value in Neighbourhood */
00078   ErodeIntensityMorphology,     /* Pixel Pick using GreyScale Erode */
00079   DilateIntensityMorphology,    /* Pixel Pick using GreyScale Dialate */
00080   DistanceMorphology,           /* Add Kernel Value, take Minimum */
00081 /* Second-level Morphology methods */
00082   OpenMorphology,               /* Dilate then Erode */
00083   CloseMorphology,              /* Erode then Dilate */
00084   OpenIntensityMorphology,      /* Pixel Pick using GreyScale Open */
00085   CloseIntensityMorphology,     /* Pixel Pick using GreyScale Close */
00086   SmoothMorphology,             /* Open then Close */
00087 /* Difference Morphology methods */
00088   EdgeInMorphology,             /* Dilate difference from Original */
00089   EdgeOutMorphology,            /* Erode difference from Original */
00090   EdgeMorphology,               /* Dilate difference with Erode */
00091   TopHatMorphology,             /* Close difference from Original */
00092   BottomHatMorphology,          /* Open difference from Original */
00093 /* Recursive Morphology methods */
00094   HitAndMissMorphology,         /* Foreground/Background pattern matching */
00095   ThinningMorphology,           /* Remove matching pixels from image */
00096   ThickenMorphology,            /* Add matching pixels from image */
00097 /* Experimental Morphology methods */
00098   VoronoiMorphology,            /* distance matte channel copy nearest color */
00099   IterativeDistanceMorphology   /* Add Kernel Value, take Minimum */
00100 } MorphologyMethod;
00101 
00102 typedef struct KernelInfo
00103 {
00104   KernelInfoType
00105     type;
00106 
00107   size_t
00108     width,
00109     height;
00110 
00111   ssize_t
00112     x,
00113     y;
00114 
00115   double
00116     *values,
00117     minimum,
00118     maximum,
00119     negative_range,
00120     positive_range,
00121     angle;
00122 
00123   struct KernelInfo
00124     *next;
00125 
00126   size_t
00127     signature;
00128 } KernelInfo;
00129 
00130 extern MagickExport KernelInfo
00131   *AcquireKernelInfo(const char *),
00132   *AcquireKernelBuiltIn(const KernelInfoType,const GeometryInfo *),
00133   *CloneKernelInfo(const KernelInfo *),
00134   *DestroyKernelInfo(KernelInfo *);
00135 
00136 extern MagickExport Image
00137   *MorphologyImage(const Image *,const MorphologyMethod,const ssize_t,
00138     const KernelInfo *,ExceptionInfo *),
00139   *MorphologyImageChannel(const Image *,const ChannelType,
00140     const MorphologyMethod,const ssize_t,const KernelInfo *,ExceptionInfo *);
00141 
00142 extern MagickExport void
00143   ScaleGeometryKernelInfo(KernelInfo *,const char *),
00144   ScaleKernelInfo(KernelInfo *,const double,const GeometryFlags),
00145   ShowKernelInfo(const KernelInfo *),
00146   UnityAddKernelInfo(KernelInfo *,const double);
00147 
00148 #if defined(__cplusplus) || defined(c_plusplus)
00149 }
00150 #endif
00151 
00152 #endif

Generated on 6 Jan 2020 for MagickCore by  doxygen 1.6.1