]> granicus.if.org Git - imagemagick/blob - MagickCore/option.h
(no commit message)
[imagemagick] / MagickCore / option.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 option methods.
17 */
18 #ifndef _MAGICKCORE_OPTION_H
19 #define _MAGICKCORE_OPTION_H
20
21 #if defined(__cplusplus) || defined(c_plusplus)
22 extern "C" {
23 #endif
24
25 typedef enum
26 {
27   MagickUndefinedOptions = -1,
28   MagickAlignOptions = 0,
29   MagickAlphaOptions,
30   MagickBooleanOptions,
31   MagickChannelOptions,
32   MagickClassOptions,
33   MagickClipPathOptions,
34   MagickCoderOptions,
35   MagickColorOptions,
36   MagickColorspaceOptions,
37   MagickCommandOptions,
38   MagickComposeOptions,
39   MagickCompressOptions,
40   MagickConfigureOptions,
41   MagickDataTypeOptions,
42   MagickDebugOptions,
43   MagickDecorateOptions,
44   MagickDelegateOptions,
45   MagickDirectionOptions,
46   MagickDisposeOptions,
47   MagickDistortOptions,
48   MagickDitherOptions,
49   MagickEndianOptions,
50   MagickEvaluateOptions,
51   MagickFillRuleOptions,
52   MagickFilterOptions,
53   MagickFontOptions,
54   MagickFontsOptions,
55   MagickFormatOptions,
56   MagickFunctionOptions,
57   MagickGravityOptions,
58   MagickIntentOptions,
59   MagickInterlaceOptions,
60   MagickInterpolateOptions,
61   MagickKernelOptions,
62   MagickLayerOptions,
63   MagickLineCapOptions,
64   MagickLineJoinOptions,
65   MagickListOptions,
66   MagickLocaleOptions,
67   MagickLogEventOptions,
68   MagickLogOptions,
69   MagickMagicOptions,
70   MagickMethodOptions,
71   MagickMetricOptions,
72   MagickMimeOptions,
73   MagickModeOptions,
74   MagickModuleOptions,
75   MagickMorphologyOptions,
76   MagickNoiseOptions,
77   MagickOrientationOptions,
78   MagickPixelChannelOptions,
79   MagickPixelTraitOptions,
80   MagickPolicyOptions,
81   MagickPolicyDomainOptions,
82   MagickPolicyRightsOptions,
83   MagickPreviewOptions,
84   MagickPrimitiveOptions,
85   MagickQuantumFormatOptions,
86   MagickResolutionOptions,
87   MagickResourceOptions,
88   MagickSparseColorOptions,
89   MagickStatisticOptions,
90   MagickStorageOptions,
91   MagickStretchOptions,
92   MagickStyleOptions,
93   MagickThresholdOptions,
94   MagickTypeOptions,
95   MagickValidateOptions,
96   MagickVirtualPixelOptions
97 } CommandOption;
98
99 typedef enum
100 {
101   UndefinedValidate,
102   NoValidate = 0x00000,
103   CompareValidate = 0x00001,
104   CompositeValidate = 0x00002,
105   ConvertValidate = 0x00004,
106   FormatsInMemoryValidate = 0x00008,
107   FormatsOnDiskValidate = 0x00010,
108   IdentifyValidate = 0x00020,
109   ImportExportValidate = 0x00040,
110   MontageValidate = 0x00080,
111   StreamValidate = 0x00100,
112   AllValidate = 0x7fffffff
113 } ValidateType;
114
115 typedef struct _OptionInfo
116 {
117   const char
118     *mnemonic;
119
120   ssize_t
121     type,
122     flags;
123
124   MagickBooleanType
125     stealth;
126 } OptionInfo;
127
128 /*
129   Flags to describe classes of image processing options.
130   These are used to determine how a option should be processed, and
131   allow use to avoid attempting to process each option in every way posible.
132 */
133 typedef enum
134 {
135   UndefinedOptionFlag       = 0x0000,  /* option flag is not in use */
136
137   ImageInfoOptionFlag       = 0x0001,  /* Setting stored in ImageInfo */
138   DrawInfoOptionFlag        = 0x0002,  /* Setting stored in DrawInfo */
139   QuantizeInfoOptionFlag    = 0x0004,  /* Setting stored in QuantizeInfo */
140   GlobalOptionFlag          = 0x0008,  /* Global Setting or Control */
141   SettingOptionFlags        = 0x000F,  /* mask for all setting options */
142
143   SimpleOperatorOptionFlag  = 0x0010,  /* Simple Image processing operator */
144   ListOperatorOptionFlag    = 0x0020,  /* Multi-Image processing operator */
145   SpecialOptionFlag         = 0x0040,  /* Special handled Option */
146   GenesisOptionFlag         = 0x0080,  /* MagickCommandGenesis() Only Option */
147
148   ImageRequiredFlags        = 0x0030,  /* Flags also means Images Required */
149
150   NonMagickOptionFlag       = 0x1000,  /* Option not used by Magick Command */
151   FireOptionFlag            = 0x2000,  /* Convert operation seq firing point */
152   DeprecateOptionFlag       = 0x4000,  /* Deprecate option (no code) */
153   ReplacedOptionFlag        = 0x8000   /* Replaced Option (still works) */
154
155 } CommandOptionFlags;
156
157
158 extern MagickExport char
159   **GetCommandOptions(const CommandOption),
160   *GetNextImageOption(const ImageInfo *),
161   *RemoveImageOption(ImageInfo *,const char *);
162
163 extern MagickExport const char
164   *CommandOptionToMnemonic(const CommandOption,const ssize_t),
165   *GetImageOption(const ImageInfo *,const char *);
166
167 extern MagickExport MagickBooleanType
168   CloneImageOptions(ImageInfo *,const ImageInfo *),
169   DefineImageOption(ImageInfo *,const char *),
170   DeleteImageOption(ImageInfo *,const char *),
171   IsCommandOption(const char *),
172   ListCommandOptions(FILE *,const CommandOption,ExceptionInfo *),
173   SetImageOption(ImageInfo *,const char *,const char *);
174
175 extern MagickExport ssize_t
176   GetCommandOptionFlags(const CommandOption,const MagickBooleanType,
177     const char *),
178   ParseChannelOption(const char *),
179   ParsePixelChannelOption(const char *),
180   ParseCommandOption(const CommandOption,const MagickBooleanType,const char *);
181
182 extern MagickExport void
183   DestroyImageOptions(ImageInfo *),
184   ResetImageOptions(const ImageInfo *),
185   ResetImageOptionIterator(const ImageInfo *);
186
187 extern MagickExport const OptionInfo
188   *GetCommandOptionInfo(const char *value);
189
190 #if defined(__cplusplus) || defined(c_plusplus)
191 }
192 #endif
193
194 #endif