blob: 41693bd63f25360bf0e30a8da9253fb17802cf46 [file] [log] [blame]
cristy3ed852e2009-09-05 21:47:34 +00001/*
cristy1454be72011-12-19 01:52:48 +00002 Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization
cristy3ed852e2009-09-05 21:47:34 +00003 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)
22extern "C" {
23#endif
24
25typedef enum
26{
27 MagickUndefinedOptions = -1,
28 MagickAlignOptions = 0,
cristy288a3532012-08-28 00:19:44 +000029 MagickAlphaChannelOptions,
cristy3ed852e2009-09-05 21:47:34 +000030 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,
cristyc9b12952010-03-28 01:12:28 +000045 MagickDirectionOptions,
cristy3ed852e2009-09-05 21:47:34 +000046 MagickDisposeOptions,
47 MagickDistortOptions,
48 MagickDitherOptions,
49 MagickEndianOptions,
50 MagickEvaluateOptions,
51 MagickFillRuleOptions,
52 MagickFilterOptions,
53 MagickFontOptions,
54 MagickFontsOptions,
55 MagickFormatOptions,
56 MagickFunctionOptions,
57 MagickGravityOptions,
cristy3ed852e2009-09-05 21:47:34 +000058 MagickIntentOptions,
59 MagickInterlaceOptions,
60 MagickInterpolateOptions,
anthony29188a82010-01-22 10:12:34 +000061 MagickKernelOptions,
cristy3ed852e2009-09-05 21:47:34 +000062 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,
anthony29188a82010-01-22 10:12:34 +000075 MagickMorphologyOptions,
cristy3ed852e2009-09-05 21:47:34 +000076 MagickNoiseOptions,
77 MagickOrientationOptions,
cristy6dcb9b82011-10-23 23:21:25 +000078 MagickPixelChannelOptions,
79 MagickPixelTraitOptions,
cristy3ed852e2009-09-05 21:47:34 +000080 MagickPolicyOptions,
81 MagickPolicyDomainOptions,
82 MagickPolicyRightsOptions,
83 MagickPreviewOptions,
84 MagickPrimitiveOptions,
85 MagickQuantumFormatOptions,
86 MagickResolutionOptions,
87 MagickResourceOptions,
88 MagickSparseColorOptions,
cristy0834d642011-03-18 18:26:08 +000089 MagickStatisticOptions,
cristy3ed852e2009-09-05 21:47:34 +000090 MagickStorageOptions,
91 MagickStretchOptions,
92 MagickStyleOptions,
93 MagickThresholdOptions,
94 MagickTypeOptions,
95 MagickValidateOptions,
anthony29188a82010-01-22 10:12:34 +000096 MagickVirtualPixelOptions
cristy042ee782011-04-22 18:48:30 +000097} CommandOption;
cristy3ed852e2009-09-05 21:47:34 +000098
99typedef 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
cristy042ee782011-04-22 18:48:30 +0000115/*
116 Flags to describe classes of image processing options.
anthonyfd706f92012-01-19 04:22:02 +0000117 These are used to determine how a option should be processed, and
118 allow use to avoid attempting to process each option in every way posible.
cristy042ee782011-04-22 18:48:30 +0000119*/
anthonyce2716b2011-04-22 09:51:34 +0000120typedef enum
121{
anthonyfd706f92012-01-19 04:22:02 +0000122 UndefinedOptionFlag = 0x0000, /* option flag is not in use */
123
anthony3ae42932012-04-16 13:59:49 +0000124 ImageInfoOptionFlag = 0x0001, /* Setting stored in ImageInfo */
125 DrawInfoOptionFlag = 0x0002, /* Setting stored in DrawInfo */
126 QuantizeInfoOptionFlag = 0x0004, /* Setting stored in QuantizeInfo */
anthony22de2722012-04-19 14:43:00 +0000127 GlobalOptionFlag = 0x0008, /* Global Setting or Control */
anthony964d28e2012-05-17 23:39:46 +0000128 SettingOptionFlags = 0x000F, /* mask any setting option */
anthonyfd706f92012-01-19 04:22:02 +0000129
anthony464f1c42012-04-22 08:51:01 +0000130 NoImageOperatorFlag = 0x0010, /* Images not required operator */
131 SimpleOperatorFlag = 0x0020, /* Simple Image processing operator */
132 ListOperatorFlag = 0x0040, /* Multi-Image processing operator */
anthonybcdb0202012-04-12 11:54:26 +0000133 GenesisOptionFlag = 0x0080, /* MagickCommandGenesis() Only Option */
anthonyfd706f92012-01-19 04:22:02 +0000134
anthony464f1c42012-04-22 08:51:01 +0000135 SpecialOptionFlag = 0x0100, /* Operator with Special Requirements */
136 /* EG: for specific CLI commands */
anthony8226e722012-04-05 14:25:46 +0000137
anthony964d28e2012-05-17 23:39:46 +0000138 AlwaysInterpretArgsFlag = 0x0400, /* Always Interpret escapes in Args */
anthony4837ac22012-05-18 23:39:48 +0000139 /* CF: "convert" compatibility mode */
anthony964d28e2012-05-17 23:39:46 +0000140 NeverInterpretArgsFlag = 0x0800, /* Never Interpret escapes in Args */
anthony4837ac22012-05-18 23:39:48 +0000141 /* Typical because it's a filename */
anthony964d28e2012-05-17 23:39:46 +0000142
anthony668f43a2012-02-20 14:55:32 +0000143 NonMagickOptionFlag = 0x1000, /* Option not used by Magick Command */
anthony975a8d72012-04-12 13:54:36 +0000144 FireOptionFlag = 0x2000, /* Convert operation seq firing point */
145 DeprecateOptionFlag = 0x4000, /* Deprecate option (no code) */
anthony4837ac22012-05-18 23:39:48 +0000146 ReplacedOptionFlag = 0x8800 /* Replaced Option (but still works) */
anthonyaf2746d2012-01-16 00:16:10 +0000147
anthonyce2716b2011-04-22 09:51:34 +0000148} CommandOptionFlags;
149
anthony464f1c42012-04-22 08:51:01 +0000150typedef struct _OptionInfo
151{
152 const char
153 *mnemonic;
154
155 ssize_t
156 type,
157 flags;
158
159 MagickBooleanType
160 stealth;
161} OptionInfo;
162
anthonyfd706f92012-01-19 04:22:02 +0000163
cristy3ed852e2009-09-05 21:47:34 +0000164extern MagickExport char
cristy042ee782011-04-22 18:48:30 +0000165 **GetCommandOptions(const CommandOption),
cristy3ed852e2009-09-05 21:47:34 +0000166 *GetNextImageOption(const ImageInfo *),
167 *RemoveImageOption(ImageInfo *,const char *);
168
169extern MagickExport const char
cristy042ee782011-04-22 18:48:30 +0000170 *CommandOptionToMnemonic(const CommandOption,const ssize_t),
171 *GetImageOption(const ImageInfo *,const char *);
cristy3ed852e2009-09-05 21:47:34 +0000172
cristy3ed852e2009-09-05 21:47:34 +0000173extern MagickExport MagickBooleanType
174 CloneImageOptions(ImageInfo *,const ImageInfo *),
175 DefineImageOption(ImageInfo *,const char *),
176 DeleteImageOption(ImageInfo *,const char *),
cristy042ee782011-04-22 18:48:30 +0000177 IsCommandOption(const char *),
178 ListCommandOptions(FILE *,const CommandOption,ExceptionInfo *),
cristy3ed852e2009-09-05 21:47:34 +0000179 SetImageOption(ImageInfo *,const char *,const char *);
180
cristy5ed838e2010-05-31 00:05:35 +0000181extern MagickExport ssize_t
cristy042ee782011-04-22 18:48:30 +0000182 GetCommandOptionFlags(const CommandOption,const MagickBooleanType,
183 const char *),
cristy5ed838e2010-05-31 00:05:35 +0000184 ParseChannelOption(const char *),
cristy953c4bd2012-02-24 01:04:04 +0000185 ParsePixelChannelOption(const char *),
cristy042ee782011-04-22 18:48:30 +0000186 ParseCommandOption(const CommandOption,const MagickBooleanType,const char *);
cristy5ed838e2010-05-31 00:05:35 +0000187
cristy3ed852e2009-09-05 21:47:34 +0000188extern MagickExport void
189 DestroyImageOptions(ImageInfo *),
190 ResetImageOptions(const ImageInfo *),
191 ResetImageOptionIterator(const ImageInfo *);
192
anthony32d85bf2012-02-15 14:54:59 +0000193extern MagickExport const OptionInfo
194 *GetCommandOptionInfo(const char *value);
195
cristy3ed852e2009-09-05 21:47:34 +0000196#if defined(__cplusplus) || defined(c_plusplus)
197}
198#endif
199
200#endif