|
MagickCore
6.7.5
|
00001 /* 00002 Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization 00003 dedicated to making software imaging solutions freely available. 00004 00005 You may not use this file except in compliance with the License. 00006 obtain a copy of the License at 00007 00008 http://www.imagemagick.org/script/license.php 00009 00010 Unless required by applicable law or agreed to in writing, software 00011 distributed under the License is distributed on an "AS IS" BASIS, 00012 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 See the License for the specific language governing permissions and 00014 limitations under the License. 00015 00016 MagickCore image geometry methods. 00017 */ 00018 #ifndef _MAGICKCORE_GEOMETRY_H 00019 #define _MAGICKCORE_GEOMETRY_H 00020 00021 #if defined(__cplusplus) || defined(c_plusplus) 00022 extern "C" { 00023 #endif 00024 00025 typedef enum 00026 { 00027 #undef NoValue 00028 NoValue = 0x0000, 00029 #undef XValue 00030 XValue = 0x0001, 00031 XiValue = 0x0001, 00032 #undef YValue 00033 YValue = 0x0002, 00034 PsiValue = 0x0002, 00035 #undef WidthValue 00036 WidthValue = 0x0004, 00037 RhoValue = 0x0004, 00038 #undef HeightValue 00039 HeightValue = 0x0008, 00040 SigmaValue = 0x0008, 00041 ChiValue = 0x0010, 00042 XiNegative = 0x0020, 00043 #undef XNegative 00044 XNegative = 0x0020, 00045 PsiNegative = 0x0040, 00046 #undef YNegative 00047 YNegative = 0x0040, 00048 ChiNegative = 0x0080, 00049 PercentValue = 0x1000, /* '%' percentage of something */ 00050 AspectValue = 0x2000, /* '!' resize no-aspect - special use flag */ 00051 NormalizeValue = 0x2000, /* '!' ScaleKernelValue() in morphology.c */ 00052 LessValue = 0x4000, /* '<' resize smaller - special use flag */ 00053 GreaterValue = 0x8000, /* '>' resize larger - spacial use flag */ 00054 MinimumValue = 0x10000, /* '^' special handling needed */ 00055 CorrelateNormalizeValue = 0x10000, /* '^' see ScaleKernelValue() */ 00056 AreaValue = 0x20000, /* '@' resize to area - special use flag */ 00057 DecimalValue = 0x40000, /* '.' floating point numbers found */ 00058 #undef AllValues 00059 AllValues = 0x7fffffff 00060 } GeometryFlags; 00061 00062 #if defined(ForgetGravity) 00063 #undef ForgetGravity 00064 #undef NorthWestGravity 00065 #undef NorthGravity 00066 #undef NorthEastGravity 00067 #undef WestGravity 00068 #undef CenterGravity 00069 #undef EastGravity 00070 #undef SouthWestGravity 00071 #undef SouthGravity 00072 #undef SouthEastGravity 00073 #undef StaticGravity 00074 #endif 00075 00076 typedef enum 00077 { 00078 UndefinedGravity, 00079 ForgetGravity = 0, 00080 NorthWestGravity = 1, 00081 NorthGravity = 2, 00082 NorthEastGravity = 3, 00083 WestGravity = 4, 00084 CenterGravity = 5, 00085 EastGravity = 6, 00086 SouthWestGravity = 7, 00087 SouthGravity = 8, 00088 SouthEastGravity = 9, 00089 StaticGravity = 10 00090 } GravityType; 00091 00092 typedef struct _AffineMatrix 00093 { 00094 double 00095 sx, 00096 rx, 00097 ry, 00098 sy, 00099 tx, 00100 ty; 00101 } AffineMatrix; 00102 00103 typedef struct _GeometryInfo 00104 { 00105 double 00106 rho, 00107 sigma, 00108 xi, 00109 psi, 00110 chi; 00111 } GeometryInfo; 00112 00113 typedef struct _OffsetInfo 00114 { 00115 ssize_t 00116 x, 00117 y; 00118 } OffsetInfo; 00119 00120 typedef struct _PointInfo 00121 { 00122 double 00123 x, 00124 y; 00125 } PointInfo; 00126 00127 typedef struct _RectangleInfo 00128 { 00129 size_t 00130 width, 00131 height; 00132 00133 ssize_t 00134 x, 00135 y; 00136 } RectangleInfo; 00137 00138 extern MagickExport char 00139 *GetPageGeometry(const char *); 00140 00141 extern MagickExport MagickBooleanType 00142 IsGeometry(const char *), 00143 IsSceneGeometry(const char *,const MagickBooleanType); 00144 00145 extern MagickExport MagickStatusType 00146 GetGeometry(const char *,ssize_t *,ssize_t *,size_t *,size_t *), 00147 ParseAbsoluteGeometry(const char *,RectangleInfo *), 00148 ParseAffineGeometry(const char *,AffineMatrix *,ExceptionInfo *), 00149 ParseGeometry(const char *,GeometryInfo *), 00150 ParseGravityGeometry(const Image *,const char *,RectangleInfo *, 00151 ExceptionInfo *), 00152 ParseMetaGeometry(const char *,ssize_t *,ssize_t *,size_t *,size_t *), 00153 ParsePageGeometry(const Image *,const char *,RectangleInfo *,ExceptionInfo *), 00154 ParseRegionGeometry(const Image *,const char *,RectangleInfo *, 00155 ExceptionInfo *); 00156 00157 extern MagickExport void 00158 GravityAdjustGeometry(const size_t,const size_t, 00159 const GravityType,RectangleInfo *), 00160 SetGeometry(const Image *,RectangleInfo *), 00161 SetGeometryInfo(GeometryInfo *); 00162 00163 #if defined(__cplusplus) || defined(c_plusplus) 00164 } 00165 #endif 00166 00167 #endif