MagickCore  7.0.3
geometry.h
Go to the documentation of this file.
1 /*
2  Copyright 1999-2019 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. You may
6  obtain a copy of the License at
7 
8  https://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  SeparatorValue = 0x80000, /* 'x' separator found */
59  AspectRatioValue = 0x100000, /* '~' special handling needed */
60 #undef AllValues
61  AllValues = 0x7fffffff
63 
64 #if defined(ForgetGravity)
65 #undef ForgetGravity
66 #undef NorthWestGravity
67 #undef NorthGravity
68 #undef NorthEastGravity
69 #undef WestGravity
70 #undef CenterGravity
71 #undef EastGravity
72 #undef SouthWestGravity
73 #undef SouthGravity
74 #undef SouthEastGravity
75 #endif
76 
77 typedef enum
78 {
90 } GravityType;
91 
92 typedef struct _AffineMatrix
93 {
94  double
95  sx,
96  rx,
97  ry,
98  sy,
99  tx,
100  ty;
101 } AffineMatrix;
102 
103 typedef struct _GeometryInfo
104 {
105  double
107  sigma,
108  xi,
109  psi,
110  chi;
111 } GeometryInfo;
112 
113 typedef struct _OffsetInfo
114 {
115  ssize_t
116  x,
117  y;
118 } OffsetInfo;
119 
120 typedef struct _PointInfo
121 {
122  double
123  x,
124  y;
125 } PointInfo;
126 
127 typedef struct _RectangleInfo
128 {
129  size_t
131  height;
132 
133  ssize_t
134  x,
135  y;
136 } RectangleInfo;
137 
138 extern MagickExport char
139  *GetPageGeometry(const char *);
140 
142  IsGeometry(const char *),
143  IsSceneGeometry(const char *,const MagickBooleanType);
144 
146  GetGeometry(const char *,ssize_t *,ssize_t *,size_t *,size_t *),
147  ParseAbsoluteGeometry(const char *,RectangleInfo *),
149  ParseGeometry(const char *,GeometryInfo *),
150  ParseGravityGeometry(const Image *,const char *,RectangleInfo *,
151  ExceptionInfo *),
152  ParseMetaGeometry(const char *,ssize_t *,ssize_t *,size_t *,size_t *),
153  ParsePageGeometry(const Image *,const char *,RectangleInfo *,ExceptionInfo *),
154  ParseRegionGeometry(const Image *,const char *,RectangleInfo *,
155  ExceptionInfo *);
156 
157 extern MagickExport void
158  GravityAdjustGeometry(const size_t,const size_t,const GravityType,
159  RectangleInfo *),
160  SetGeometry(const Image *,RectangleInfo *),
162 
163 #if defined(__cplusplus) || defined(c_plusplus)
164 }
165 #endif
166 
167 #endif
double psi
Definition: geometry.h:106
double rx
Definition: geometry.h:95
ssize_t y
Definition: geometry.h:116
double ty
Definition: geometry.h:95
MagickExport MagickStatusType ParseAffineGeometry(const char *geometry, AffineMatrix *affine_matrix, ExceptionInfo *exception)
Definition: geometry.c:744
double rho
Definition: geometry.h:106
MagickExport MagickStatusType ParseAbsoluteGeometry(const char *geometry, RectangleInfo *region_info)
Definition: geometry.c:703
MagickExport void SetGeometryInfo(GeometryInfo *geometry_info)
Definition: geometry.c:1720
MagickExport MagickStatusType ParseMetaGeometry(const char *geometry, ssize_t *x, ssize_t *y, size_t *width, size_t *height)
Definition: geometry.c:1368
MagickExport char * GetPageGeometry(const char *page_geometry)
Definition: geometry.c:362
struct _RectangleInfo RectangleInfo
double sigma
Definition: geometry.h:106
size_t width
Definition: geometry.h:130
Definition: image.h:151
double tx
Definition: geometry.h:95
double x
Definition: geometry.h:123
MagickExport MagickBooleanType IsGeometry(const char *geometry)
Definition: geometry.c:610
MagickBooleanType
Definition: magick-type.h:158
unsigned int MagickStatusType
Definition: magick-type.h:121
MagickExport MagickStatusType ParsePageGeometry(const Image *image, const char *geometry, RectangleInfo *region_info, ExceptionInfo *exception)
Definition: geometry.c:1578
double y
Definition: geometry.h:123
double ry
Definition: geometry.h:95
double sx
Definition: geometry.h:95
GravityType
Definition: geometry.h:77
ssize_t x
Definition: geometry.h:134
size_t height
Definition: geometry.h:130
GeometryFlags
Definition: geometry.h:25
double sy
Definition: geometry.h:95
struct _PointInfo PointInfo
double chi
Definition: geometry.h:106
MagickExport MagickStatusType GetGeometry(const char *geometry, ssize_t *x, ssize_t *y, size_t *width, size_t *height)
Definition: geometry.c:97
double xi
Definition: geometry.h:106
MagickExport MagickStatusType ParseGravityGeometry(const Image *image, const char *geometry, RectangleInfo *region_info, ExceptionInfo *exception)
Definition: geometry.c:1232
struct _AffineMatrix AffineMatrix
MagickExport MagickStatusType ParseGeometry(const char *geometry, GeometryInfo *geometry_info)
Definition: geometry.c:853
MagickExport void SetGeometry(const Image *image, RectangleInfo *geometry)
Definition: geometry.c:1686
ssize_t x
Definition: geometry.h:116
MagickExport void GravityAdjustGeometry(const size_t width, const size_t height, const GravityType gravity, RectangleInfo *region)
Definition: geometry.c:531
struct _OffsetInfo OffsetInfo
#define MagickExport
ssize_t y
Definition: geometry.h:134
MagickExport MagickBooleanType IsSceneGeometry(const char *geometry, const MagickBooleanType pedantic)
Definition: geometry.c:651
MagickExport MagickStatusType ParseRegionGeometry(const Image *image, const char *geometry, RectangleInfo *region_info, ExceptionInfo *exception)
Definition: geometry.c:1647
struct _GeometryInfo GeometryInfo