cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1 | /* |
cristy | 16af1cb | 2009-12-11 21:38:29 +0000 | [diff] [blame] | 2 | Copyright 1999-2010 ImageMagick Studio LLC, a non-profit organization |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 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, |
| 50 | AspectValue = 0x2000, |
| 51 | LessValue = 0x4000, |
| 52 | GreaterValue = 0x8000, |
| 53 | MinimumValue = 0x10000, |
| 54 | AreaValue = 0x20000, |
| 55 | DecimalValue = 0x40000, |
| 56 | #undef AllValues |
| 57 | AllValues = 0x7fffffff |
| 58 | } GeometryFlags; |
| 59 | |
| 60 | #if defined(ForgetGravity) |
| 61 | #undef ForgetGravity |
| 62 | #undef NorthWestGravity |
| 63 | #undef NorthGravity |
| 64 | #undef NorthEastGravity |
| 65 | #undef WestGravity |
| 66 | #undef CenterGravity |
| 67 | #undef EastGravity |
| 68 | #undef SouthWestGravity |
| 69 | #undef SouthGravity |
| 70 | #undef SouthEastGravity |
| 71 | #undef StaticGravity |
| 72 | #endif |
| 73 | |
| 74 | typedef enum |
| 75 | { |
| 76 | UndefinedGravity, |
| 77 | ForgetGravity = 0, |
| 78 | NorthWestGravity = 1, |
| 79 | NorthGravity = 2, |
| 80 | NorthEastGravity = 3, |
| 81 | WestGravity = 4, |
| 82 | CenterGravity = 5, |
| 83 | EastGravity = 6, |
| 84 | SouthWestGravity = 7, |
| 85 | SouthGravity = 8, |
| 86 | SouthEastGravity = 9, |
| 87 | StaticGravity = 10 |
| 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 _RectangleInfo |
| 112 | { |
| 113 | unsigned long |
| 114 | width, |
| 115 | height; |
| 116 | |
| 117 | long |
| 118 | x, |
| 119 | y; |
| 120 | } RectangleInfo; |
| 121 | |
| 122 | extern MagickExport char |
| 123 | *GetPageGeometry(const char *); |
| 124 | |
| 125 | extern MagickExport MagickBooleanType |
| 126 | IsGeometry(const char *), |
| 127 | IsSceneGeometry(const char *,const MagickBooleanType); |
| 128 | |
| 129 | extern MagickExport MagickStatusType |
| 130 | GetGeometry(const char *,long *,long *,unsigned long *,unsigned long *), |
| 131 | ParseAbsoluteGeometry(const char *,RectangleInfo *), |
| 132 | ParseAffineGeometry(const char *,AffineMatrix *,ExceptionInfo *), |
| 133 | ParseGeometry(const char *,GeometryInfo *), |
| 134 | ParseGravityGeometry(const Image *,const char *,RectangleInfo *, |
| 135 | ExceptionInfo *), |
| 136 | ParseMetaGeometry(const char *,long *,long *,unsigned long *,unsigned long *), |
| 137 | ParsePageGeometry(const Image *,const char *,RectangleInfo *,ExceptionInfo *), |
| 138 | ParseRegionGeometry(const Image *,const char *,RectangleInfo *, |
| 139 | ExceptionInfo *); |
| 140 | |
| 141 | extern MagickExport void |
| 142 | GravityAdjustGeometry(const unsigned long,const unsigned long, |
| 143 | const GravityType,RectangleInfo *), |
| 144 | SetGeometry(const Image *,RectangleInfo *), |
| 145 | SetGeometryInfo(GeometryInfo *); |
| 146 | |
| 147 | #if defined(__cplusplus) || defined(c_plusplus) |
| 148 | } |
| 149 | #endif |
| 150 | |
| 151 | #endif |