]> granicus.if.org Git - imagemagick/blob - MagickCore/geometry.h
(no commit message)
[imagemagick] / MagickCore / geometry.h
1 /*
2   Copyright 1999-2012 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 image geometry methods.
17 */
18 #ifndef _MAGICKCORE_GEOMETRY_H
19 #define _MAGICKCORE_GEOMETRY_H
20
21 #if defined(__cplusplus) || defined(c_plusplus)
22 extern "C" {
23 #endif
24
25 typedef enum
26 {
27 #undef NoValue
28   NoValue = 0x0000,
29 #undef XValue
30   XValue = 0x0001,
31   XiValue = 0x0001,
32 #undef YValue
33   YValue = 0x0002,
34   PsiValue = 0x0002,
35 #undef WidthValue
36   WidthValue = 0x0004,
37   RhoValue = 0x0004,
38 #undef HeightValue
39   HeightValue = 0x0008,
40   SigmaValue = 0x0008,
41   ChiValue = 0x0010,
42   XiNegative = 0x0020,
43 #undef XNegative
44   XNegative = 0x0020,
45   PsiNegative = 0x0040,
46 #undef YNegative
47   YNegative = 0x0040,
48   ChiNegative = 0x0080,
49   PercentValue = 0x1000,   /* '%'  percentage of something */
50   AspectValue = 0x2000,    /* '!'  resize no-aspect - special use flag */
51   NormalizeValue = 0x2000, /* '!'  ScaleKernelValue() in morphology.c */
52   LessValue = 0x4000,      /* '<'  resize smaller - special use flag */
53   GreaterValue = 0x8000,   /* '>'  resize larger - spacial use flag */
54   MinimumValue = 0x10000,  /* '^'  special handling needed */
55   CorrelateNormalizeValue = 0x10000, /* '^' see ScaleKernelValue() */
56   AreaValue = 0x20000,     /* '@'  resize to area - special use flag */
57   DecimalValue = 0x40000,  /* '.'  floating point numbers found */
58 #undef AllValues
59   AllValues = 0x7fffffff
60 } GeometryFlags;
61
62 #if defined(ForgetGravity)
63 #undef ForgetGravity
64 #undef NorthWestGravity
65 #undef NorthGravity
66 #undef NorthEastGravity
67 #undef WestGravity
68 #undef CenterGravity
69 #undef EastGravity
70 #undef SouthWestGravity
71 #undef SouthGravity
72 #undef SouthEastGravity
73 #endif
74
75 typedef enum
76 {
77   UndefinedGravity,
78   ForgetGravity = 0,
79   NorthWestGravity = 1,
80   NorthGravity = 2,
81   NorthEastGravity = 3,
82   WestGravity = 4,
83   CenterGravity = 5,
84   EastGravity = 6,
85   SouthWestGravity = 7,
86   SouthGravity = 8,
87   SouthEastGravity = 9,
88 } GravityType;
89
90 typedef struct _AffineMatrix
91 {
92   double
93     sx,
94     rx,
95     ry,
96     sy,
97     tx,
98     ty;
99 } AffineMatrix;
100
101 typedef struct _GeometryInfo
102 {
103   double
104     rho,
105     sigma,
106     xi,
107     psi,
108     chi;
109 } GeometryInfo;
110
111 typedef struct _OffsetInfo
112 {
113   ssize_t
114     x,
115     y;
116 } OffsetInfo;
117
118 typedef struct _PointInfo
119 {
120   double
121     x,
122     y;
123 } PointInfo;
124
125 typedef struct _RectangleInfo
126 {
127   size_t
128     width,
129     height;
130
131   ssize_t
132     x,
133     y;
134 } RectangleInfo;
135
136 extern MagickExport char
137   *GetPageGeometry(const char *);
138
139 extern MagickExport MagickBooleanType
140   IsGeometry(const char *),
141   IsSceneGeometry(const char *,const MagickBooleanType);
142
143 extern MagickExport MagickStatusType
144   GetGeometry(const char *,ssize_t *,ssize_t *,size_t *,size_t *),
145   ParseAbsoluteGeometry(const char *,RectangleInfo *),
146   ParseAffineGeometry(const char *,AffineMatrix *,ExceptionInfo *),
147   ParseGeometry(const char *,GeometryInfo *),
148   ParseGravityGeometry(const Image *,const char *,RectangleInfo *,
149     ExceptionInfo *),
150   ParseMetaGeometry(const char *,ssize_t *,ssize_t *,size_t *,size_t *),
151   ParsePageGeometry(const Image *,const char *,RectangleInfo *,ExceptionInfo *),
152   ParseRegionGeometry(const Image *,const char *,RectangleInfo *,
153     ExceptionInfo *);
154
155 extern MagickExport void
156   GravityAdjustGeometry(const size_t,const size_t,
157     const GravityType,RectangleInfo *),
158   SetGeometry(const Image *,RectangleInfo *),
159   SetGeometryInfo(GeometryInfo *);
160
161 #if defined(__cplusplus) || defined(c_plusplus)
162 }
163 #endif
164
165 #endif