]> granicus.if.org Git - imagemagick/blob - magick/morphology.h
Added convolve:scale expert option to 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,    /* Boolean 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   ConvolveMorphology,          /* Weighted Sum of pixels - Convolve */
51   DilateMorphology,            /* Weighted Value Maximum */
52   ErodeMorphology,             /* Weighted Value Minimum */
53   CloseMorphology,             /* Erode then Dilate */
54   OpenMorphology,              /* Dilate then Erode */
55   DilateIntensityMorphology,   /* Pixel Pick using GreyScale Dialate */
56   ErodeIntensityMorphology,    /* Pixel Pick using GreyScale Erode */
57   CloseIntensityMorphology,    /* Pixel Pick using GreyScale Close */
58   OpenIntensityMorphology,     /* Pixel Pick using GreyScale Open */
59   DistanceMorphology           /* Add to Value, take Minimum */
60 } MorphologyMethod;
61
62 typedef struct
63 {
64   KernelInfoType
65     type;
66
67   unsigned long
68     width,
69     height,
70     offset_x,
71     offset_y;
72
73   double
74     *values;
75
76   double
77     value_min,
78     value_max,
79     range_neg,
80     range_pos;
81
82   unsigned long
83     signature;
84 } KernelInfo;
85
86 extern MagickExport KernelInfo
87   *AcquireKernelInfo(const char *),
88   *AcquireKernelBuiltIn(const KernelInfoType, const GeometryInfo *),
89   *DestroyKernelInfo(KernelInfo *);
90
91 extern MagickExport Image
92   *MorphologyImage(const Image *,MorphologyMethod,const long,KernelInfo *,
93     ExceptionInfo *),
94   *MorphologyImageChannel(const Image *,const ChannelType,MorphologyMethod,
95     const long,KernelInfo *,ExceptionInfo *);
96
97 #if defined(__cplusplus) || defined(c_plusplus)
98 }
99 #endif
100
101 #endif