]> granicus.if.org Git - imagemagick/blob - magick/morphology.h
Added subtractive morphology
[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 /* Basic Morphology methods */
51   ConvolveMorphology,          /* Weighted Sum of pixels - Convolve */
52   ErodeMorphology,             /* Weighted Value Minimum */
53   DilateMorphology,            /* Weighted Value Maximum */
54   ErodeIntensityMorphology,    /* Pixel Pick using GreyScale Erode */
55   DilateIntensityMorphology,   /* Pixel Pick using GreyScale Dialate */
56   DistanceMorphology,          /* Add to Value, take Minimum */
57 /* Compound Morphology methods */
58   OpenMorphology,              /* Dilate then Erode */
59   CloseMorphology,             /* Erode then Dilate */
60   OpenIntensityMorphology,     /* Pixel Pick using GreyScale Open */
61   CloseIntensityMorphology,    /* Pixel Pick using GreyScale Close */
62   EdgeInMorphology,            /* Dilate difference from orig */
63   EdgeOutMorphology,           /* Erode difference from orig */
64   EdgeMorphology,              /* Dilate difference with Erode */
65   TopHatMorphology,            /* Close difference from Original */
66   BottomHatMorphology          /* Open difference from Original */
67 } MorphologyMethod;
68
69 typedef struct
70 {
71   KernelInfoType
72     type;
73
74   unsigned long
75     width,
76     height;
77
78   long
79     x,
80     y;
81
82   double
83     *values,
84     minimum,
85     maximum,
86     negative_range,
87     positive_range;
88
89   unsigned long
90     signature;
91 } KernelInfo;
92
93 extern MagickExport KernelInfo
94   *AcquireKernelInfo(const char *),
95   *AcquireKernelBuiltIn(const KernelInfoType, const GeometryInfo *),
96   *DestroyKernelInfo(KernelInfo *);
97
98 extern MagickExport void
99   ShowKernelInfo(KernelInfo *);
100
101 extern MagickExport Image
102   *MorphologyImage(const Image *,MorphologyMethod,const long,KernelInfo *,
103     ExceptionInfo *),
104   *MorphologyImageChannel(const Image *,const ChannelType,MorphologyMethod,
105     const long,KernelInfo *,ExceptionInfo *);
106
107 #if defined(__cplusplus) || defined(c_plusplus)
108 }
109 #endif
110
111 #endif