]> granicus.if.org Git - imagemagick/blob - magick/morphology.h
(no commit message)
[imagemagick] / magick / morphology.h
1 /*
2   Copyright 1999-2010 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 morphology methods.
17 */
18 #ifndef _MAGICKCORE_MORPHOLOGY_H
19 #define _MAGICKCORE_MORPHOLOGY_H
20
21 #if defined(__cplusplus) || defined(c_plusplus)
22 extern "C" {
23 #endif
24
25 #include <magick/geometry.h>
26
27 typedef enum
28 {
29   UndefinedKernel,    /* also the 'no-op' kernel */
30   GaussianKernel,     /* Convolution Kernels */
31   BlurKernel,
32   CometKernel,
33   LaplacianKernel,
34   LOGKernel,
35   DOGKernel,
36   RectangleKernel,    /* Shape Kernels */
37   SquareKernel,
38   DiamondKernel,
39   DiskKernel,
40   PlusKernel,
41   ChebyshevKernel,    /* Distance Measuring Kernels */
42   ManhattenKernel,
43   EuclideanKernel,
44   UserDefinedKernel   /* user specified kernel values */
45 } KernelInfoType;
46
47 typedef enum
48 {
49   UndefinedMorphology,
50 /* Convolve / Correlate weighted sums */
51   ConvolveMorphology,          /* Weighted Sum with reflected kernel */
52   CorrelateMorphology,         /* Weighted Sum using a sliding window */
53 /* Low-level Morphology methods */
54   ErodeMorphology,             /* Minimum Value in Neighbourhood */
55   DilateMorphology,            /* Maximum Value in Neighbourhood */
56   ErodeIntensityMorphology,    /* Pixel Pick using GreyScale Erode */
57   DilateIntensityMorphology,   /* Pixel Pick using GreyScale Dialate */
58   DistanceMorphology,          /* Add Kernel Value, take Minimum */
59 /* Second-level Morphology methods */
60   OpenMorphology,              /* Dilate then Erode */
61   CloseMorphology,             /* Erode then Dilate */
62   OpenIntensityMorphology,     /* Pixel Pick using GreyScale Open */
63   CloseIntensityMorphology,    /* Pixel Pick using GreyScale Close */
64 /* Third-level Morphology methods */
65   EdgeInMorphology,            /* Dilate difference from Original */
66   EdgeOutMorphology,           /* Erode difference from Original */
67   EdgeMorphology,              /* Dilate difference with Erode */
68   TopHatMorphology,            /* Close difference from Original */
69   BottomHatMorphology          /* Open difference from Original */
70 } MorphologyMethod;
71
72 typedef struct
73 {
74   KernelInfoType
75     type;
76
77   unsigned long
78     width,
79     height;
80
81   long
82     x,
83     y;
84
85   double
86     *values,
87     minimum,
88     maximum,
89     negative_range,
90     positive_range;
91
92   unsigned long
93     signature;
94 } KernelInfo;
95
96 extern MagickExport KernelInfo
97   *AcquireKernelInfo(const char *),
98   *AcquireKernelBuiltIn(const KernelInfoType,const GeometryInfo *),
99   *DestroyKernelInfo(KernelInfo *);
100
101 extern MagickExport void
102   ShowKernelInfo(KernelInfo *);
103
104 extern MagickExport Image
105   *MorphologyImage(const Image *,const MorphologyMethod,const long,
106     const KernelInfo *,ExceptionInfo *),
107   *MorphologyImageChannel(const Image *,const ChannelType,
108      const MorphologyMethod,const long,const KernelInfo *,ExceptionInfo *);
109
110 #if defined(__cplusplus) || defined(c_plusplus)
111 }
112 #endif
113
114 #endif