]> granicus.if.org Git - imagemagick/blob - magick/morphology.h
minor morpholofy updates
[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 typedef enum
26 {
27   UndefinedKernel,    /* also the 'no-op' kernel */
28   GaussianKernel,     /* Convolution Kernels */
29   BlurKernel,
30   CometKernel,
31   LaplacianKernel,
32   LOGKernel,
33   DOGKernel,
34   RectangleKernel,    /* Boolean Kernels */
35   SquareKernel,
36   DiamondKernel,
37   DiskKernel,
38   PlusKernel,
39   ChebyshevKernel,    /* Distance Measuring Kernels */
40   ManhattenKernel,
41   EuclideanKernel,
42   UserDefinedKernel   /* user specified kernel values */
43 } MagickKernelType;
44
45 typedef enum
46 {
47   UndefinedMorphology,
48   ConvolveMorphology,          /* Weighted Sum of pixels - Convolve */
49   DialateMorphology,           /* Weighted Value Maximum */
50   ErodeMorphology,             /* Weighted Value Minimum */
51   CloseMorphology,             /* Erode then Dialate */
52   OpenMorphology,              /* Dialate then Erode */
53   DialateIntensityMorphology,  /* Pixel Pick using GreyScale Dialate */
54   ErodeIntensityMorphology,    /* Pixel Pick using GreyScale Erode */
55   CloseIntensityMorphology,    /* Pixel Pick using GreyScale Close */
56   OpenIntensityMorphology,     /* Pixel Pick using GreyScale Open */
57   DistanceMorphology           /* Add to Value, take Minimum */
58 } MorphologyMethod;
59
60 typedef struct
61 {
62   MagickKernelType
63     type;
64
65   unsigned long
66     width,
67     height,
68     offset_x,
69     offset_y;
70
71   double *
72     values;
73
74   double
75     value_min,
76     value_max,
77     range_neg,
78     range_pos;
79
80   MagickBooleanType
81     normalized;
82
83 } MagickKernel;
84
85 extern MagickKernel
86   *AcquireKernelFromString(const char *),
87   *AcquireKernelBuiltIn(const MagickKernelType, const GeometryInfo *),
88   *DestroyKernel(MagickKernel *);
89
90 extern void
91   KernelNormalize(MagickKernel *),
92   KernelPrint(MagickKernel *),
93   KernelRotate(MagickKernel *, double);
94
95 extern Image
96   *MorphologyImage(const Image *, MorphologyMethod, const long,
97              const ChannelType, MagickKernel *, ExceptionInfo *);
98
99
100 #if defined(__cplusplus) || defined(c_plusplus)
101 }
102 #endif
103
104 #endif