blob: 83ed5f8e57321037245148ac0dfa36283ccca2b8 [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,
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,
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
115typedef struct _OptionInfo
116{
117 const char
118 *mnemonic;
119
cristybb503372010-05-27 20:51:26 +0000120 ssize_t
cristy042ee782011-04-22 18:48:30 +0000121 type,
122 flags;
cristy3ed852e2009-09-05 21:47:34 +0000123
124 MagickBooleanType
125 stealth;
126} OptionInfo;
127
cristy042ee782011-04-22 18:48:30 +0000128/*
129 Flags to describe classes of image processing options.
130*/
anthonyce2716b2011-04-22 09:51:34 +0000131typedef enum
132{
anthonyb0d52702011-05-02 03:34:24 +0000133 UndefinedOptionFlag = 0x0000,
134 FireOptionFlag = 0x0001, /* Option sequence firing point */
135 ImageInfoOptionFlag = 0x0002, /* Sets ImageInfo, no image needed */
136 DrawInfoOptionFlag = 0x0004, /* Sets DrawInfo, no image needed */
cristya79a3482011-05-03 17:14:22 +0000137 QuantizeInfoOptionFlag = 0x0008, /* Sets QuantizeInfo, no image needed */
anthonyde1a57f2011-05-02 09:45:30 +0000138 GlobalOptionFlag = 0x0010, /* Sets Global Option, no image needed */
anthonyb0d52702011-05-02 03:34:24 +0000139 SimpleOperatorOptionFlag = 0x0100, /* Simple Image processing operator */
anthonyaf2746d2012-01-16 00:16:10 +0000140 ListOperatorOptionFlag = 0x0200, /* Multi-Image processing operator */
anthonyb0d52702011-05-02 03:34:24 +0000141 SpecialOperatorOptionFlag = 0x0400, /* Specially handled Operator Option */
anthony9a6469e2011-05-04 11:07:31 +0000142 GenesisOptionFlag = 0x0400, /* Genesis Command Wrapper Option */
anthony247a86d2011-05-03 13:18:18 +0000143 NonConvertOptionFlag = 0x4000, /* Option not used by Convert */
anthonyaf2746d2012-01-16 00:16:10 +0000144 DeprecateOptionFlag = 0x8000, /* Deprecate option, give warning */
145
anthony72feaa62012-01-17 06:46:23 +0000146 SettingInfoOption = 0x001F /* mask for all setting options */
anthonyce2716b2011-04-22 09:51:34 +0000147} CommandOptionFlags;
148
cristy3ed852e2009-09-05 21:47:34 +0000149extern MagickExport char
cristy042ee782011-04-22 18:48:30 +0000150 **GetCommandOptions(const CommandOption),
cristy3ed852e2009-09-05 21:47:34 +0000151 *GetNextImageOption(const ImageInfo *),
152 *RemoveImageOption(ImageInfo *,const char *);
153
154extern MagickExport const char
cristy042ee782011-04-22 18:48:30 +0000155 *CommandOptionToMnemonic(const CommandOption,const ssize_t),
156 *GetImageOption(const ImageInfo *,const char *);
cristy3ed852e2009-09-05 21:47:34 +0000157
cristy3ed852e2009-09-05 21:47:34 +0000158extern MagickExport MagickBooleanType
159 CloneImageOptions(ImageInfo *,const ImageInfo *),
160 DefineImageOption(ImageInfo *,const char *),
161 DeleteImageOption(ImageInfo *,const char *),
cristy042ee782011-04-22 18:48:30 +0000162 IsCommandOption(const char *),
163 ListCommandOptions(FILE *,const CommandOption,ExceptionInfo *),
cristy3ed852e2009-09-05 21:47:34 +0000164 SetImageOption(ImageInfo *,const char *,const char *);
165
cristy5ed838e2010-05-31 00:05:35 +0000166extern MagickExport ssize_t
cristy042ee782011-04-22 18:48:30 +0000167 GetCommandOptionFlags(const CommandOption,const MagickBooleanType,
168 const char *),
cristy5ed838e2010-05-31 00:05:35 +0000169 ParseChannelOption(const char *),
cristy042ee782011-04-22 18:48:30 +0000170 ParseCommandOption(const CommandOption,const MagickBooleanType,const char *);
cristy5ed838e2010-05-31 00:05:35 +0000171
cristy3ed852e2009-09-05 21:47:34 +0000172extern MagickExport void
173 DestroyImageOptions(ImageInfo *),
174 ResetImageOptions(const ImageInfo *),
175 ResetImageOptionIterator(const ImageInfo *);
176
177#if defined(__cplusplus) || defined(c_plusplus)
178}
179#endif
180
181#endif