Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:01:20

0001 /*
0002   Copyright @ 2003 ImageMagick Studio LLC, a non-profit organization
0003   dedicated to making software imaging solutions freely available.
0004 
0005   You may not use this file except in compliance with the License.  You may
0006   obtain a copy of the License at
0007 
0008     https://imagemagick.org/script/license.php
0009 
0010   Unless required by applicable law or agreed to in writing, software
0011   distributed under the License is distributed on an "AS IS" BASIS,
0012   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0013   See the License for the specific language governing permissions and
0014   limitations under the License.
0015 
0016   MagickCore image geometry methods.
0017 */
0018 #ifndef MAGICKCORE_GEOMETRY_H
0019 #define MAGICKCORE_GEOMETRY_H
0020 
0021 #if defined(__cplusplus) || defined(c_plusplus)
0022 extern "C" {
0023 #endif
0024 
0025 typedef enum
0026 {
0027 #undef NoValue
0028   NoValue = 0x0000,
0029 #undef XValue
0030   XValue = 0x0001,
0031   XiValue = 0x0001,
0032 #undef YValue
0033   YValue = 0x0002,
0034   PsiValue = 0x0002,
0035 #undef WidthValue
0036   WidthValue = 0x0004,
0037   RhoValue = 0x0004,
0038 #undef HeightValue
0039   HeightValue = 0x0008,
0040   SigmaValue = 0x0008,
0041   ChiValue = 0x0010,
0042   XiNegative = 0x0020,
0043 #undef XNegative
0044   XNegative = 0x0020,
0045   PsiNegative = 0x0040,
0046 #undef YNegative
0047   YNegative = 0x0040,
0048   ChiNegative = 0x0080,
0049   PercentValue = 0x1000,       /* '%'  percentage of something */
0050   AspectValue = 0x2000,        /* '!'  resize no-aspect - special use flag */
0051   NormalizeValue = 0x2000,     /* '!'  ScaleKernelValue() in morphology.c */
0052   LessValue = 0x4000,          /* '<'  resize smaller - special use flag */
0053   GreaterValue = 0x8000,       /* '>'  resize larger - spacial use flag */
0054   MinimumValue = 0x10000,      /* '^'  special handling needed */
0055   CorrelateNormalizeValue = 0x10000, /* '^' see ScaleKernelValue() */
0056   AreaValue = 0x20000,         /* '@'  resize to area - special use flag */
0057   DecimalValue = 0x40000,      /* '.'  floating point numbers found */
0058   SeparatorValue = 0x80000,    /* 'x'  separator found */
0059   AspectRatioValue = 0x100000, /* '~'  special handling needed */
0060   AlphaValue = 0x200000,       /* '/'  alpha */
0061   MaximumValue = 0x400000,     /* '#'  special handling needed */
0062 #undef AllValues
0063   AllValues = 0x7fffffff
0064 } GeometryFlags;
0065 
0066 #if defined(ForgetGravity)
0067 #undef ForgetGravity
0068 #undef NorthWestGravity
0069 #undef NorthGravity
0070 #undef NorthEastGravity
0071 #undef WestGravity
0072 #undef CenterGravity
0073 #undef EastGravity
0074 #undef SouthWestGravity
0075 #undef SouthGravity
0076 #undef SouthEastGravity
0077 #endif
0078 
0079 typedef enum
0080 {
0081   UndefinedGravity,
0082   ForgetGravity = 0,
0083   NorthWestGravity = 1,
0084   NorthGravity = 2,
0085   NorthEastGravity = 3,
0086   WestGravity = 4,
0087   CenterGravity = 5,
0088   EastGravity = 6,
0089   SouthWestGravity = 7,
0090   SouthGravity = 8,
0091   SouthEastGravity = 9
0092 } GravityType;
0093 
0094 typedef struct _AffineMatrix
0095 {
0096   double
0097     sx,
0098     rx,
0099     ry,
0100     sy,
0101     tx,
0102     ty;
0103 } AffineMatrix;
0104 
0105 typedef struct _GeometryInfo
0106 {
0107   double
0108     rho,
0109     sigma,
0110     xi,
0111     psi,
0112     chi;
0113 } GeometryInfo;
0114 
0115 typedef struct _OffsetInfo
0116 {
0117   ssize_t
0118     x,
0119     y;
0120 } OffsetInfo;
0121 
0122 typedef struct _PointInfo
0123 {
0124   double
0125     x,
0126     y;
0127 } PointInfo;
0128 
0129 typedef struct _RectangleInfo
0130 {
0131   size_t
0132     width,
0133     height;
0134 
0135   ssize_t
0136     x,
0137     y;
0138 } RectangleInfo;
0139 
0140 extern MagickExport char
0141   *GetPageGeometry(const char *);
0142 
0143 extern MagickExport MagickBooleanType
0144   IsGeometry(const char *),
0145   IsSceneGeometry(const char *,const MagickBooleanType);
0146 
0147 extern MagickExport MagickStatusType
0148   GetGeometry(const char *,ssize_t *,ssize_t *,size_t *,size_t *),
0149   ParseAbsoluteGeometry(const char *,RectangleInfo *),
0150   ParseAffineGeometry(const char *,AffineMatrix *,ExceptionInfo *),
0151   ParseGeometry(const char *,GeometryInfo *),
0152   ParseGravityGeometry(const Image *,const char *,RectangleInfo *,
0153     ExceptionInfo *),
0154   ParseMetaGeometry(const char *,ssize_t *,ssize_t *,size_t *,size_t *),
0155   ParsePageGeometry(const Image *,const char *,RectangleInfo *,ExceptionInfo *),
0156   ParseRegionGeometry(const Image *,const char *,RectangleInfo *,
0157     ExceptionInfo *);
0158 
0159 extern MagickExport void
0160   GravityAdjustGeometry(const size_t,const size_t,const GravityType,
0161     RectangleInfo *),
0162   SetGeometry(const Image *,RectangleInfo *),
0163   SetGeometryInfo(GeometryInfo *);
0164 
0165 #if defined(__cplusplus) || defined(c_plusplus)
0166 }
0167 #endif
0168 
0169 #endif