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