1 /*
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %                                                                             %
4 %                                                                             %
5 %                                                                             %
6 %                   OOO   PPPP   TTTTT  IIIII   OOO   N   N                   %
7 %                  O   O  P   P    T      I    O   O  NN  N                   %
8 %                  O   O  PPPP     T      I    O   O  N N N                   %
9 %                  O   O  P        T      I    O   O  N  NN                   %
10 %                   OOO   P        T    IIIII   OOO   N   N                   %
11 %                                                                             %
12 %                                                                             %
13 %                         MagickCore Option Methods                           %
14 %                                                                             %
15 %                              Software Design                                %
16 %                                   Cristy                                    %
17 %                                 March 2000                                  %
18 %                                                                             %
19 %                                                                             %
20 %  Copyright 1999-2016 ImageMagick Studio LLC, a non-profit organization      %
21 %  dedicated to making software imaging solutions freely available.           %
22 %                                                                             %
23 %  You may not use this file except in compliance with the License.  You may  %
24 %  obtain a copy of the License at                                            %
25 %                                                                             %
26 %    http://www.imagemagick.org/script/license.php                            %
27 %                                                                             %
28 %  Unless required by applicable law or agreed to in writing, software        %
29 %  distributed under the License is distributed on an "AS IS" BASIS,          %
30 %  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   %
31 %  See the License for the specific language governing permissions and        %
32 %  limitations under the License.                                             %
33 %                                                                             %
34 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
35 %
36 %
37 %
38 */
39 
40 /*
41   Include declarations.
42 */
43 #include "MagickCore/studio.h"
44 #include "MagickCore/artifact.h"
45 #include "MagickCore/cache.h"
46 #include "MagickCore/color.h"
47 #include "MagickCore/compare.h"
48 #include "MagickCore/constitute.h"
49 #include "MagickCore/distort.h"
50 #include "MagickCore/draw.h"
51 #include "MagickCore/effect.h"
52 #include "MagickCore/exception.h"
53 #include "MagickCore/exception-private.h"
54 #include "MagickCore/fourier.h"
55 #include "MagickCore/fx.h"
56 #include "MagickCore/gem.h"
57 #include "MagickCore/geometry.h"
58 #include "MagickCore/image.h"
59 #include "MagickCore/image-private.h"
60 #include "MagickCore/layer.h"
61 #include "MagickCore/mime-private.h"
62 #include "MagickCore/memory_.h"
63 #include "MagickCore/monitor.h"
64 #include "MagickCore/montage.h"
65 #include "MagickCore/morphology.h"
66 #include "MagickCore/option.h"
67 #include "MagickCore/option-private.h"
68 #include "MagickCore/pixel.h"
69 #include "MagickCore/policy.h"
70 #include "MagickCore/property.h"
71 #include "MagickCore/quantize.h"
72 #include "MagickCore/quantum.h"
73 #include "MagickCore/resample.h"
74 #include "MagickCore/resource_.h"
75 #include "MagickCore/splay-tree.h"
76 #include "MagickCore/statistic.h"
77 #include "MagickCore/string_.h"
78 #include "MagickCore/token.h"
79 #include "MagickCore/utility.h"
80 
81 /*
82   ImageMagick options.
83 */
84 static const OptionInfo
85   AlignOptions[] =
86   {
87     { "Undefined", UndefinedAlign, UndefinedOptionFlag, MagickTrue },
88     { "Center", CenterAlign, UndefinedOptionFlag, MagickFalse },
89     { "End", RightAlign, UndefinedOptionFlag, MagickFalse },
90     { "Left", LeftAlign, UndefinedOptionFlag, MagickFalse },
91     { "Middle", CenterAlign, UndefinedOptionFlag, MagickFalse },
92     { "Right", RightAlign, UndefinedOptionFlag, MagickFalse },
93     { "Start", LeftAlign, UndefinedOptionFlag, MagickFalse },
94     { (char *) NULL, UndefinedAlign, UndefinedOptionFlag, MagickFalse }
95   },
96   AlphaChannelOptions[] =
97   {
98     { "Undefined", UndefinedAlphaChannel, UndefinedOptionFlag, MagickTrue },
99     { "Activate", ActivateAlphaChannel, UndefinedOptionFlag, MagickFalse },
100     { "Associate", AssociateAlphaChannel, UndefinedOptionFlag, MagickFalse },
101     { "Background", BackgroundAlphaChannel, UndefinedOptionFlag, MagickFalse },
102     { "Copy", CopyAlphaChannel, UndefinedOptionFlag, MagickFalse },
103     { "Deactivate", DeactivateAlphaChannel, UndefinedOptionFlag, MagickFalse },
104     { "Discrete", DiscreteAlphaChannel, UndefinedOptionFlag, MagickFalse },
105     { "Disassociate", DisassociateAlphaChannel, UndefinedOptionFlag, MagickFalse },
106     { "Extract", ExtractAlphaChannel, UndefinedOptionFlag, MagickFalse },
107     { "Off", OffAlphaChannel, UndefinedOptionFlag, MagickFalse },
108     { "On", OnAlphaChannel, UndefinedOptionFlag, MagickFalse },
109     { "Opaque", OpaqueAlphaChannel, UndefinedOptionFlag, MagickFalse },
110     { "Remove", RemoveAlphaChannel, UndefinedOptionFlag, MagickFalse },
111     { "Set", SetAlphaChannel, UndefinedOptionFlag, MagickFalse },
112     { "Shape", ShapeAlphaChannel, UndefinedOptionFlag, MagickFalse },
113     { "Reset", SetAlphaChannel, DeprecateOptionFlag, MagickTrue },
114     { "Transparent", TransparentAlphaChannel, UndefinedOptionFlag, MagickFalse },
115     { (char *) NULL, UndefinedAlphaChannel, UndefinedOptionFlag, MagickFalse }
116   },
117   BooleanOptions[] =
118   {
119     { "False", MagickFalse, UndefinedOptionFlag, MagickFalse },
120     { "True", MagickTrue, UndefinedOptionFlag, MagickFalse },
121     { "0", MagickFalse, UndefinedOptionFlag, MagickFalse },
122     { "1", MagickTrue, UndefinedOptionFlag, MagickFalse },
123     { (char *) NULL, MagickFalse, UndefinedOptionFlag, MagickFalse }
124   },
125   CacheOptions[] =
126   {
127     { "Disk", DiskCache, UndefinedOptionFlag, MagickFalse },
128     { "Distributed", DistributedCache, UndefinedOptionFlag, MagickFalse },
129     { "Map", MapCache, UndefinedOptionFlag, MagickFalse },
130     { "Memory", MemoryCache, UndefinedOptionFlag, MagickFalse },
131     { "Ping", PingCache, UndefinedOptionFlag, MagickFalse },
132     { (char *) NULL, MagickFalse, UndefinedOptionFlag, MagickFalse }
133   },
134   ChannelOptions[] =
135   {
136     { "Undefined", UndefinedChannel, UndefinedOptionFlag, MagickTrue },
137     /* special */
138     { "All", CompositeChannels, UndefinedOptionFlag, MagickFalse },
139     { "Sync", SyncChannels, UndefinedOptionFlag, MagickFalse },
140     { "Default", DefaultChannels, UndefinedOptionFlag, MagickFalse },
141     /* individual channel */
142     { "A", AlphaChannel, UndefinedOptionFlag, MagickFalse },
143     { "Alpha", AlphaChannel, UndefinedOptionFlag, MagickFalse },
144     { "Black", BlackChannel, UndefinedOptionFlag, MagickFalse },
145     { "B", BlueChannel, UndefinedOptionFlag, MagickFalse },
146     { "Blue", BlueChannel, UndefinedOptionFlag, MagickFalse },
147     { "C", CyanChannel, UndefinedOptionFlag, MagickFalse },
148     { "Cyan", CyanChannel, UndefinedOptionFlag, MagickFalse },
149     { "Gray", GrayChannel, UndefinedOptionFlag, MagickFalse },
150     { "G", GreenChannel, UndefinedOptionFlag, MagickFalse },
151     { "Green", GreenChannel, UndefinedOptionFlag, MagickFalse },
152     { "H", RedChannel, UndefinedOptionFlag, MagickFalse },
153     { "Hue", RedChannel, UndefinedOptionFlag, MagickFalse },
154     { "K", BlackChannel, UndefinedOptionFlag, MagickFalse },
155     { "L", BlueChannel, UndefinedOptionFlag, MagickFalse },
156     { "Lightness", BlueChannel, UndefinedOptionFlag, MagickFalse },
157     { "Luminance", BlueChannel, UndefinedOptionFlag, MagickFalse },
158     { "Luminosity", BlueChannel, DeprecateOptionFlag, MagickTrue },
159     { "M", MagentaChannel, UndefinedOptionFlag, MagickFalse },
160     { "Magenta", MagentaChannel, UndefinedOptionFlag, MagickFalse },
161     { "Matte", AlphaChannel, DeprecateOptionFlag, MagickTrue },/*depreciate*/
162     { "Opacity", AlphaChannel, DeprecateOptionFlag, MagickTrue },/*depreciate*/
163     { "R", RedChannel, UndefinedOptionFlag, MagickFalse },
164     { "Red", RedChannel, UndefinedOptionFlag, MagickFalse },
165     { "S", GreenChannel, UndefinedOptionFlag, MagickFalse },
166     { "Saturation", GreenChannel, UndefinedOptionFlag, MagickFalse },
167     { "Y", YellowChannel, UndefinedOptionFlag, MagickFalse },
168     { "Yellow", YellowChannel, UndefinedOptionFlag, MagickFalse },
169     { (char *) NULL, UndefinedChannel, UndefinedOptionFlag, MagickFalse }
170   },
171   ClassOptions[] =
172   {
173     { "Undefined", UndefinedClass, UndefinedOptionFlag, MagickTrue },
174     { "DirectClass", DirectClass, UndefinedOptionFlag, MagickFalse },
175     { "PseudoClass", PseudoClass, UndefinedOptionFlag, MagickFalse },
176     { (char *) NULL, UndefinedClass, UndefinedOptionFlag, MagickFalse }
177   },
178   ClipPathOptions[] =
179   {
180     { "Undefined", UndefinedPathUnits, UndefinedOptionFlag, MagickTrue },
181     { "ObjectBoundingBox", ObjectBoundingBox, UndefinedOptionFlag, MagickFalse },
182     { "UserSpace", UserSpace, UndefinedOptionFlag, MagickFalse },
183     { "UserSpaceOnUse", UserSpaceOnUse, UndefinedOptionFlag, MagickFalse },
184     { (char *) NULL, UndefinedPathUnits, UndefinedOptionFlag, MagickFalse }
185   },
186   ColorspaceOptions[] =
187   {
188     { "Undefined", UndefinedColorspace, UndefinedOptionFlag, MagickTrue },
189     { "CIELab", LabColorspace, UndefinedOptionFlag, MagickFalse },
190     { "CMY", CMYColorspace, UndefinedOptionFlag, MagickFalse },
191     { "CMYK", CMYKColorspace, UndefinedOptionFlag, MagickFalse },
192     { "Gray", GRAYColorspace, UndefinedOptionFlag, MagickFalse },
193     { "HCL", HCLColorspace, UndefinedOptionFlag, MagickFalse },
194     { "HCLp", HCLpColorspace, UndefinedOptionFlag, MagickFalse },
195     { "HSB", HSBColorspace, UndefinedOptionFlag, MagickFalse },
196     { "HSI", HSIColorspace, UndefinedOptionFlag, MagickFalse },
197     { "HSL", HSLColorspace, UndefinedOptionFlag, MagickFalse },
198     { "HSV", HSVColorspace, UndefinedOptionFlag, MagickFalse },
199     { "HWB", HWBColorspace, UndefinedOptionFlag, MagickFalse },
200     { "Lab", LabColorspace, UndefinedOptionFlag, MagickFalse },
201     { "LCH", LCHColorspace, UndefinedOptionFlag, MagickFalse },
202     { "LCHab", LCHabColorspace, UndefinedOptionFlag, MagickFalse },
203     { "LCHuv", LCHuvColorspace, UndefinedOptionFlag, MagickFalse },
204     { "LMS", LMSColorspace, UndefinedOptionFlag, MagickFalse },
205     { "Log", LogColorspace, UndefinedOptionFlag, MagickFalse },
206     { "Luv", LuvColorspace, UndefinedOptionFlag, MagickFalse },
207     { "OHTA", OHTAColorspace, UndefinedOptionFlag, MagickFalse },
208     { "Rec601YCbCr", Rec601YCbCrColorspace, UndefinedOptionFlag, MagickFalse },
209     { "Rec709YCbCr", Rec709YCbCrColorspace, UndefinedOptionFlag, MagickFalse },
210     { "RGB", RGBColorspace, UndefinedOptionFlag, MagickFalse },
211     { "scRGB", scRGBColorspace, UndefinedOptionFlag, MagickFalse },
212     { "sRGB", sRGBColorspace, UndefinedOptionFlag, MagickFalse },
213     { "Transparent", TransparentColorspace, UndefinedOptionFlag, MagickFalse },
214     { "xyY", xyYColorspace, UndefinedOptionFlag, MagickFalse },
215     { "XYZ", XYZColorspace, UndefinedOptionFlag, MagickFalse },
216     { "YCbCr", YCbCrColorspace, UndefinedOptionFlag, MagickFalse },
217     { "YDbDr", YDbDrColorspace, UndefinedOptionFlag, MagickFalse },
218     { "YCC", YCCColorspace, UndefinedOptionFlag, MagickFalse },
219     { "YIQ", YIQColorspace, UndefinedOptionFlag, MagickFalse },
220     { "YPbPr", YPbPrColorspace, UndefinedOptionFlag, MagickFalse },
221     { "YUV", YUVColorspace, UndefinedOptionFlag, MagickFalse },
222     { (char *) NULL, UndefinedColorspace, UndefinedOptionFlag, MagickFalse }
223   },
224   ComplexOptions[] =
225   {
226     { "Undefined", UndefinedComplexOperator, UndefinedOptionFlag, MagickTrue },
227     { "Add", AddComplexOperator, UndefinedOptionFlag, MagickFalse },
228     { "Conjugate", ConjugateComplexOperator, UndefinedOptionFlag, MagickFalse },
229     { "Divide", DivideComplexOperator, UndefinedOptionFlag, MagickFalse },
230     { "MagnitudePhase", MagnitudePhaseComplexOperator, UndefinedOptionFlag, MagickFalse },
231     { "Multiply", MultiplyComplexOperator, UndefinedOptionFlag, MagickFalse },
232     { "RealImaginary", RealImaginaryComplexOperator, UndefinedOptionFlag, MagickFalse },
233     { "Subtract", SubtractComplexOperator, UndefinedOptionFlag, MagickFalse },
234     { (char *) NULL, UndefinedComplexOperator, UndefinedOptionFlag, MagickFalse }
235   },
236   CommandOptions[] =
237   {
238     /*
239       Must be ordered lexigraphically.
240     */
241     { "+alpha", 1L, DeprecateOptionFlag, MagickTrue },
242     { "-alpha", 1L, SimpleOperatorFlag, MagickFalse },
243     { "+background", 0L, ImageInfoOptionFlag, MagickFalse },
244     { "-background", 1L, ImageInfoOptionFlag, MagickFalse },
245     { "+format", 0L, ImageInfoOptionFlag, MagickFalse },
246     { "-format", 1L, ImageInfoOptionFlag | NeverInterpretArgsFlag, MagickFalse },
247     { "-quiet", 0L, GlobalOptionFlag | FireOptionFlag, MagickFalse },
248     { "+quiet", 0L, GlobalOptionFlag | FireOptionFlag, MagickFalse },
249     { "-regard-warnings", 0L, ImageInfoOptionFlag, MagickFalse },
250     { "+regard-warnings", 0L, ImageInfoOptionFlag, MagickFalse },
251     { "+repage", 0L, SimpleOperatorFlag, MagickFalse },
252     { "-repage", 1L, SimpleOperatorFlag, MagickFalse },
253     { "+size", 0L, ImageInfoOptionFlag, MagickFalse },
254     { "-size", 1L, ImageInfoOptionFlag, MagickFalse },
255     { "+virtual-pixel", 0L, ImageInfoOptionFlag, MagickFalse },
256     { "-virtual-pixel", 1L, ImageInfoOptionFlag, MagickFalse },
257     { "+blur", 0L, DeprecateOptionFlag, MagickTrue },
258     { "-blur", 1L, SimpleOperatorFlag, MagickFalse },
259     { "+resize", 1L, DeprecateOptionFlag, MagickTrue },
260     { "-resize", 1L, SimpleOperatorFlag, MagickFalse },
261     { "(", 0L, NoImageOperatorFlag, MagickTrue },
262     { ")", 0L, NoImageOperatorFlag, MagickTrue },
263     { "{", 0L, NoImageOperatorFlag, MagickTrue },
264     { "}", 0L, NoImageOperatorFlag, MagickTrue },
265     { "--", 1L, NoImageOperatorFlag, MagickTrue },
266     { "+adaptive-blur", 1L, DeprecateOptionFlag, MagickTrue },
267     { "-adaptive-blur", 1L, SimpleOperatorFlag, MagickFalse },
268     { "+adaptive-resize", 1L, DeprecateOptionFlag, MagickTrue },
269     { "-adaptive-resize", 1L, SimpleOperatorFlag, MagickFalse },
270     { "+adaptive-sharpen", 1L, DeprecateOptionFlag, MagickTrue },
271     { "-adaptive-sharpen", 1L, SimpleOperatorFlag, MagickFalse },
272     { "-adjoin", 0L, ImageInfoOptionFlag, MagickFalse },
273     { "+adjoin", 0L, ImageInfoOptionFlag, MagickFalse },
274     { "+affine", 0L, ReplacedOptionFlag | DrawInfoOptionFlag, MagickTrue },
275     { "-affine", 1L, ReplacedOptionFlag | DrawInfoOptionFlag, MagickTrue },
276     { "+affinity", 0L, DeprecateOptionFlag, MagickTrue },
277     { "-affinity", 1L, DeprecateOptionFlag | FireOptionFlag, MagickTrue },
278     { "+alpha-color", 0L, ImageInfoOptionFlag, MagickFalse },
279     { "-alpha-color", 1L, ImageInfoOptionFlag, MagickFalse },
280     { "+annotate", 0L, DeprecateOptionFlag, MagickTrue },
281     { "-annotate", 2L, SimpleOperatorFlag | AlwaysInterpretArgsFlag, MagickFalse },
282     { "-antialias", 0L, ImageInfoOptionFlag | DrawInfoOptionFlag, MagickFalse },
283     { "+antialias", 0L, ImageInfoOptionFlag | DrawInfoOptionFlag, MagickFalse },
284     { "-append", 0L, ListOperatorFlag | FireOptionFlag, MagickFalse },
285     { "+append", 0L, ListOperatorFlag | FireOptionFlag, MagickFalse },
286     { "+attenuate", 0L, ImageInfoOptionFlag, MagickFalse },
287     { "-attenuate", 1L, ImageInfoOptionFlag, MagickFalse },
288     { "+authenticate", 0L, ImageInfoOptionFlag, MagickFalse },
289     { "-authenticate", 1L, ImageInfoOptionFlag, MagickFalse },
290     { "+auto-gamma", 0L, DeprecateOptionFlag, MagickTrue },
291     { "-auto-gamma", 0L, SimpleOperatorFlag, MagickFalse },
292     { "+auto-level", 0L, DeprecateOptionFlag, MagickTrue },
293     { "-auto-level", 0L, SimpleOperatorFlag, MagickFalse },
294     { "+auto-orient", 0L, DeprecateOptionFlag, MagickTrue },
295     { "-auto-orient", 0L, SimpleOperatorFlag, MagickFalse },
296     { "+average", 0L, DeprecateOptionFlag, MagickTrue },
297     { "-average", 0L, ReplacedOptionFlag | ListOperatorFlag | FireOptionFlag, MagickTrue },
298     { "+backdrop", 0L, NonMagickOptionFlag | NeverInterpretArgsFlag, MagickFalse },
299     { "-backdrop", 1L, NonMagickOptionFlag | NeverInterpretArgsFlag, MagickFalse },
300     { "+bench", 1L, DeprecateOptionFlag, MagickTrue },
301     { "-bench", 1L, GenesisOptionFlag, MagickFalse },
302     { "+bias", 0L, ImageInfoOptionFlag, MagickFalse },
303     { "-bias", 1L, ImageInfoOptionFlag, MagickFalse },
304     { "-black-point-compensation", 0L, ImageInfoOptionFlag, MagickFalse },
305     { "+black-point-compensation", 0L, ImageInfoOptionFlag, MagickFalse },
306     { "+black-threshold", 0L, DeprecateOptionFlag, MagickTrue },
307     { "-black-threshold", 1L, SimpleOperatorFlag, MagickFalse },
308     { "+blend", 0L, NonMagickOptionFlag, MagickFalse },
309     { "-blend", 1L, NonMagickOptionFlag, MagickFalse },
310     { "+blue-primary", 0L, ImageInfoOptionFlag, MagickFalse },
311     { "-blue-primary", 1L, ImageInfoOptionFlag, MagickFalse },
312     { "-blue-shift", 1L, SimpleOperatorFlag, MagickFalse },
313     { "+blue-shift", 1L, SimpleOperatorFlag, MagickFalse },
314     { "+border", 1L, DeprecateOptionFlag, MagickTrue },
315     { "-border", 1L, SimpleOperatorFlag, MagickFalse },
316     { "+bordercolor", 0L, ImageInfoOptionFlag | DrawInfoOptionFlag, MagickFalse },
317     { "-bordercolor", 1L, ImageInfoOptionFlag | DrawInfoOptionFlag, MagickFalse },
318     { "+borderwidth", 0L, NonMagickOptionFlag, MagickFalse },
319     { "-borderwidth", 1L, NonMagickOptionFlag, MagickFalse },
320     { "+box", 0L, ReplacedOptionFlag | ImageInfoOptionFlag | DrawInfoOptionFlag, MagickTrue },
321     { "-box", 1L, ReplacedOptionFlag | ImageInfoOptionFlag | DrawInfoOptionFlag, MagickTrue },
322     { "+brightness-contrast", 0L, DeprecateOptionFlag, MagickTrue },
323     { "-brightness-contrast", 1L, SimpleOperatorFlag, MagickFalse },
324     { "+cache", 0L, GlobalOptionFlag, MagickFalse },
325     { "-cache", 1L, GlobalOptionFlag, MagickFalse },
326     { "+canny", 1L, DeprecateOptionFlag, MagickTrue },
327     { "-canny", 1L, SimpleOperatorFlag, MagickTrue },
328     { "+caption", 0L, ImageInfoOptionFlag | NeverInterpretArgsFlag, MagickFalse },
329     { "-caption", 1L, ImageInfoOptionFlag | NeverInterpretArgsFlag, MagickFalse },
330     { "+cdl", 1L, DeprecateOptionFlag, MagickTrue },
331     { "-cdl", 1L, SimpleOperatorFlag | NeverInterpretArgsFlag, MagickFalse },
332     { "+channel", 0L, SimpleOperatorFlag, MagickFalse },
333     { "-channel", 1L, SimpleOperatorFlag, MagickFalse },
334     { "-channel-fx", 1L, ListOperatorFlag | FireOptionFlag, MagickFalse },
335     { "+charcoal", 1L, DeprecateOptionFlag, MagickTrue },
336     { "-charcoal", 1L, SimpleOperatorFlag, MagickFalse },
337     { "+chop", 1L, DeprecateOptionFlag, MagickTrue },
338     { "-chop", 1L, SimpleOperatorFlag, MagickFalse },
339     { "+clamp", 0L, DeprecateOptionFlag, MagickTrue },
340     { "-clamp", 0L, SimpleOperatorFlag, MagickFalse },
341     { "-clip", 0L, SimpleOperatorFlag, MagickFalse },
342     { "+clip", 0L, SimpleOperatorFlag, MagickFalse },
343     { "+clip-mask", 0L, SimpleOperatorFlag | NeverInterpretArgsFlag, MagickFalse },
344     { "-clip-mask", 1L, SimpleOperatorFlag | NeverInterpretArgsFlag, MagickFalse },
345     { "-clip-path", 1L, SimpleOperatorFlag, MagickFalse },
346     { "+clip-path", 1L, SimpleOperatorFlag, MagickFalse },
347     { "+clone", 0L, NoImageOperatorFlag, MagickFalse },
348     { "-clone", 1L, NoImageOperatorFlag, MagickFalse },
349     { "+clut", 0L, DeprecateOptionFlag | FireOptionFlag, MagickTrue },
350     { "-clut", 0L, ListOperatorFlag | FireOptionFlag, MagickFalse },
351     { "+coalesce", 0L, DeprecateOptionFlag | FireOptionFlag, MagickTrue },
352     { "-coalesce", 0L, ListOperatorFlag | FireOptionFlag, MagickFalse },
353     { "+colorize", 1L, DeprecateOptionFlag, MagickTrue },
354     { "-colorize", 1L, SimpleOperatorFlag, MagickFalse },
355     { "+colormap", 0L, NonMagickOptionFlag, MagickFalse },
356     { "-colormap", 1L, NonMagickOptionFlag, MagickFalse },
357     { "+color-matrix", 1L, DeprecateOptionFlag, MagickTrue },
358     { "-color-matrix", 1L, SimpleOperatorFlag, MagickFalse },
359     { "+colors", 1L, DeprecateOptionFlag, MagickTrue },
360     { "-colors", 1L, SimpleOperatorFlag, MagickFalse },
361     { "+colorspace", 0L, ImageInfoOptionFlag | SimpleOperatorFlag, MagickFalse },
362     { "-colorspace", 1L, ImageInfoOptionFlag | SimpleOperatorFlag, MagickFalse },
363     { "-combine", 0L, ListOperatorFlag | FireOptionFlag, MagickFalse },
364     { "+combine", 1L, ListOperatorFlag | FireOptionFlag, MagickFalse },
365     { "+comment", 0L, ImageInfoOptionFlag | NeverInterpretArgsFlag, MagickFalse },
366     { "-comment", 1L, ImageInfoOptionFlag | NeverInterpretArgsFlag, MagickFalse },
367     { "+compare", 0L, DeprecateOptionFlag | FireOptionFlag, MagickTrue },
368     { "-compare", 0L, ListOperatorFlag | FireOptionFlag, MagickFalse },
369     { "+complex", 1L, DeprecateOptionFlag | FireOptionFlag, MagickTrue },
370     { "-complex", 1L, ListOperatorFlag | FireOptionFlag, MagickFalse },
371     { "+compose", 0L, ImageInfoOptionFlag, MagickFalse },
372     { "-compose", 1L, ImageInfoOptionFlag, MagickFalse },
373     { "+composite", 0L, DeprecateOptionFlag | FireOptionFlag, MagickTrue },
374     { "-composite", 0L, ListOperatorFlag | FireOptionFlag, MagickFalse },
375     { "+compress", 0L, ImageInfoOptionFlag, MagickFalse },
376     { "-compress", 1L, ImageInfoOptionFlag, MagickFalse },
377     { "+concurrent", 0L, DeprecateOptionFlag, MagickTrue },
378     { "-concurrent", 0L, GenesisOptionFlag, MagickFalse },
379     { "+connected-components", 1L, DeprecateOptionFlag, MagickTrue },
380     { "-connected-components", 1L, SimpleOperatorFlag, MagickFalse },
381     { "-contrast", 0L, ReplacedOptionFlag | SimpleOperatorFlag, MagickTrue },
382     { "+contrast", 0L, ReplacedOptionFlag | SimpleOperatorFlag, MagickTrue },
383     { "+contrast-stretch", 1L, DeprecateOptionFlag, MagickTrue },
384     { "-contrast-stretch", 1L, SimpleOperatorFlag, MagickFalse },
385     { "+convolve", 1L, DeprecateOptionFlag, MagickTrue },
386     { "-convolve", 1L, SimpleOperatorFlag, MagickFalse },
387     { "+copy", 2L, DeprecateOptionFlag | FireOptionFlag, MagickTrue },
388     { "-copy", 2L, ListOperatorFlag | FireOptionFlag, MagickFalse },
389     { "+crop", 1L, DeprecateOptionFlag | FireOptionFlag, MagickTrue },
390     { "-crop", 1L, SimpleOperatorFlag | FireOptionFlag, MagickFalse },
391     { "+cycle", 1L, DeprecateOptionFlag, MagickTrue },
392     { "-cycle", 1L, SimpleOperatorFlag, MagickFalse },
393     { "+debug", 0L, GlobalOptionFlag | FireOptionFlag, MagickFalse },
394     { "-debug", 1L, GlobalOptionFlag | FireOptionFlag, MagickFalse },
395     { "+decipher", 1L, DeprecateOptionFlag, MagickTrue },
396     { "-decipher", 1L, SimpleOperatorFlag | NeverInterpretArgsFlag, MagickFalse },
397     { "+deconstruct", 0L, DeprecateOptionFlag, MagickTrue },
398     { "-deconstruct", 0L, ReplacedOptionFlag | ListOperatorFlag | FireOptionFlag, MagickTrue },
399     { "-define", 1L, ImageInfoOptionFlag | NeverInterpretArgsFlag | FireOptionFlag, MagickFalse },
400     { "+define", 1L, ImageInfoOptionFlag | NeverInterpretArgsFlag | FireOptionFlag, MagickFalse },
401     { "+delay", 0L, ImageInfoOptionFlag, MagickFalse },
402     { "-delay", 1L, ImageInfoOptionFlag, MagickFalse },
403     { "+delete", 0L, ListOperatorFlag | FireOptionFlag, MagickFalse },
404     { "-delete", 1L, ListOperatorFlag | FireOptionFlag, MagickFalse },
405     { "+density", 0L, ImageInfoOptionFlag | DrawInfoOptionFlag, MagickFalse },
406     { "-density", 1L, ImageInfoOptionFlag | DrawInfoOptionFlag, MagickFalse },
407     { "+depth", 0L, ImageInfoOptionFlag | SimpleOperatorFlag, MagickFalse },
408     { "-depth", 1L, ImageInfoOptionFlag | SimpleOperatorFlag, MagickFalse },
409     { "+descend", 0L, NonMagickOptionFlag, MagickFalse },
410     { "-descend", 1L, NonMagickOptionFlag, MagickFalse },
411     { "+deskew", 0L, SimpleOperatorFlag, MagickFalse },
412     { "-deskew", 1L, SimpleOperatorFlag, MagickFalse },
413     { "+despeckle", 0L, DeprecateOptionFlag, MagickTrue },
414     { "-despeckle", 0L, SimpleOperatorFlag, MagickFalse },
415     { "+direction", 0L, ImageInfoOptionFlag | DrawInfoOptionFlag, MagickFalse },
416     { "-direction", 1L, ImageInfoOptionFlag | DrawInfoOptionFlag, MagickFalse },
417     { "+displace", 0L, NonMagickOptionFlag, MagickFalse },
418     { "-displace", 1L, NonMagickOptionFlag, MagickFalse },
419     { "-display", 1L, ImageInfoOptionFlag | DrawInfoOptionFlag, MagickFalse },
420     { "+display", 1L, ImageInfoOptionFlag | DrawInfoOptionFlag, MagickFalse },
421     { "+dispose", 0L, ImageInfoOptionFlag, MagickFalse },
422     { "-dispose", 1L, ImageInfoOptionFlag, MagickFalse },
423     { "+dissimilarity-threshold", 0L, NonMagickOptionFlag | ImageInfoOptionFlag, MagickFalse },
424     { "-dissimilarity-threshold", 1L, NonMagickOptionFlag | ImageInfoOptionFlag, MagickFalse },
425     { "+dissolve", 0L, NonMagickOptionFlag, MagickFalse },
426     { "-dissolve", 1L, NonMagickOptionFlag, MagickFalse },
427     { "-distort", 2L, SimpleOperatorFlag | AlwaysInterpretArgsFlag, MagickFalse },
428     { "+distort", 2L, SimpleOperatorFlag | AlwaysInterpretArgsFlag, MagickFalse },
429     { "+dither", 0L, ImageInfoOptionFlag | QuantizeInfoOptionFlag, MagickFalse },
430     { "-dither", 1L, ImageInfoOptionFlag | QuantizeInfoOptionFlag, MagickFalse },
431     { "+draw", 0L, DeprecateOptionFlag, MagickTrue },
432     { "-draw", 1L, SimpleOperatorFlag, MagickFalse },
433     { "+duplicate", 0L, ListOperatorFlag | FireOptionFlag, MagickFalse },
434     { "-duplicate", 1L, ListOperatorFlag | FireOptionFlag, MagickFalse },
435     { "-duration", 1L, GenesisOptionFlag, MagickFalse },
436     { "+duration", 1L, GenesisOptionFlag, MagickFalse },
437     { "+edge", 1L, DeprecateOptionFlag, MagickTrue },
438     { "-edge", 1L, SimpleOperatorFlag, MagickFalse },
439     { "+emboss", 1L, DeprecateOptionFlag, MagickTrue },
440     { "-emboss", 1L, SimpleOperatorFlag, MagickFalse },
441     { "+encipher", 1L, DeprecateOptionFlag, MagickTrue },
442     { "-encipher", 1L, SimpleOperatorFlag | NeverInterpretArgsFlag, MagickFalse },
443     { "+encoding", 0L, ImageInfoOptionFlag | DrawInfoOptionFlag, MagickFalse },
444     { "-encoding", 1L, ImageInfoOptionFlag | DrawInfoOptionFlag, MagickFalse },
445     { "+endian", 0L, ImageInfoOptionFlag, MagickFalse },
446     { "-endian", 1L, ImageInfoOptionFlag, MagickFalse },
447     { "+enhance", 0L, DeprecateOptionFlag, MagickTrue },
448     { "-enhance", 0L, SimpleOperatorFlag, MagickFalse },
449     { "+equalize", 0L, DeprecateOptionFlag, MagickTrue },
450     { "-equalize", 0L, SimpleOperatorFlag, MagickFalse },
451     { "+evaluate", 2L, DeprecateOptionFlag, MagickTrue },
452     { "-evaluate", 2L, SimpleOperatorFlag, MagickFalse },
453     { "+evaluate-sequence", 1L, DeprecateOptionFlag | FireOptionFlag, MagickTrue },
454     { "-evaluate-sequence", 1L, ListOperatorFlag | FireOptionFlag, MagickFalse },
455     { "-exit", 0L, SpecialOptionFlag, MagickFalse },
456     { "+extent", 1L, DeprecateOptionFlag, MagickTrue },
457     { "-extent", 1L, SimpleOperatorFlag, MagickFalse },
458     { "+extract", 0L, ImageInfoOptionFlag, MagickFalse },
459     { "-extract", 1L, ImageInfoOptionFlag, MagickFalse },
460     { "+family", 0L, DeprecateOptionFlag, MagickTrue },
461     { "-family", 1L, DrawInfoOptionFlag, MagickFalse },
462     { "+features", 0L, SimpleOperatorFlag | FireOptionFlag, MagickFalse },
463     { "-features", 1L, SimpleOperatorFlag | FireOptionFlag, MagickFalse },
464     { "-fft", 0L, ListOperatorFlag | FireOptionFlag, MagickFalse },
465     { "+fft", 0L, ListOperatorFlag | FireOptionFlag, MagickFalse },
466     { "+fill", 0L, ImageInfoOptionFlag | DrawInfoOptionFlag, MagickFalse },
467     { "-fill", 1L, ImageInfoOptionFlag | DrawInfoOptionFlag, MagickFalse },
468     { "+filter", 0L, ImageInfoOptionFlag, MagickFalse },
469     { "-filter", 1L, ImageInfoOptionFlag, MagickFalse },
470     { "+flatten", 0L, DeprecateOptionFlag, MagickTrue },
471     { "-flatten", 0L, ListOperatorFlag | FireOptionFlag, MagickFalse },
472     { "+flip", 0L, DeprecateOptionFlag, MagickTrue },
473     { "-flip", 0L, SimpleOperatorFlag, MagickFalse },
474     { "-floodfill", 2L, SimpleOperatorFlag, MagickFalse },
475     { "+floodfill", 2L, SimpleOperatorFlag, MagickFalse },
476     { "+flop", 0L, DeprecateOptionFlag, MagickTrue },
477     { "-flop", 0L, SimpleOperatorFlag, MagickFalse },
478     { "+font", 0L, ImageInfoOptionFlag | DrawInfoOptionFlag, MagickFalse },
479     { "-font", 1L, ImageInfoOptionFlag | DrawInfoOptionFlag, MagickFalse },
480     { "+foreground", 0L, NonMagickOptionFlag, MagickFalse },
481     { "-foreground", 1L, NonMagickOptionFlag, MagickFalse },
482     { "+frame", 1L, DeprecateOptionFlag, MagickTrue },
483     { "-frame", 1L, SimpleOperatorFlag, MagickFalse },
484     { "+function", 2L, DeprecateOptionFlag, MagickTrue },
485     { "-function", 2L,SimpleOperatorFlag | AlwaysInterpretArgsFlag, MagickFalse },
486     { "+fuzz", 0L, ImageInfoOptionFlag, MagickFalse },
487     { "-fuzz", 1L, ImageInfoOptionFlag, MagickFalse },
488     { "+fx", 1L, DeprecateOptionFlag | FireOptionFlag | NeverInterpretArgsFlag, MagickTrue },
489     { "-fx", 1L, ListOperatorFlag | FireOptionFlag | NeverInterpretArgsFlag, MagickFalse },
490     { "-gamma", 1L, SimpleOperatorFlag, MagickFalse },
491     { "+gamma", 1L, SimpleOperatorFlag, MagickFalse },
492     { "+gaussian", 1L, DeprecateOptionFlag, MagickTrue },
493     { "-gaussian", 1L, ReplacedOptionFlag | SimpleOperatorFlag, MagickTrue },
494     { "+gaussian-blur", 1L, DeprecateOptionFlag, MagickTrue },
495     { "-gaussian-blur", 1L, SimpleOperatorFlag, MagickFalse },
496     { "+geometry", 0L, SimpleOperatorFlag, MagickFalse },
497     { "-geometry", 1L, SimpleOperatorFlag, MagickFalse },
498     { "+gravity", 0L, ImageInfoOptionFlag | DrawInfoOptionFlag, MagickFalse },
499     { "-gravity", 1L, ImageInfoOptionFlag | DrawInfoOptionFlag, MagickFalse },
500     { "+grayscale", 1L, SimpleOperatorFlag, MagickTrue },
501     { "-grayscale", 1L, SimpleOperatorFlag, MagickFalse },
502     { "+green-primary", 0L, ImageInfoOptionFlag, MagickFalse },
503     { "-green-primary", 1L, ImageInfoOptionFlag, MagickFalse },
504     { "+hald-clut", 0L, DeprecateOptionFlag | FireOptionFlag, MagickTrue },
505     { "-hald-clut", 0L, ListOperatorFlag | FireOptionFlag, MagickFalse },
506     { "+highlight-color", 0L, NonMagickOptionFlag | ImageInfoOptionFlag, MagickFalse },
507     { "-highlight-color", 1L, NonMagickOptionFlag | ImageInfoOptionFlag, MagickFalse },
508     { "+hough-lines", 1L, DeprecateOptionFlag, MagickTrue },
509     { "-hough-lines", 1L, SimpleOperatorFlag, MagickTrue },
510     { "+iconGeometry", 0L, NonMagickOptionFlag, MagickFalse },
511     { "-iconGeometry", 1L, NonMagickOptionFlag, MagickFalse },
512     { "-iconic", 0L, NonMagickOptionFlag, MagickFalse },
513     { "+iconic", 0L, NonMagickOptionFlag, MagickFalse },
514     { "+identify", 0L, DeprecateOptionFlag | FireOptionFlag, MagickTrue },
515     { "-identify", 0L, SimpleOperatorFlag | FireOptionFlag, MagickFalse },
516     { "-ift", 0L, ListOperatorFlag | FireOptionFlag, MagickFalse },
517     { "+ift", 0L, ListOperatorFlag | FireOptionFlag, MagickFalse },
518     { "-immutable", 0L, NonMagickOptionFlag, MagickFalse },
519     { "+immutable", 0L, NonMagickOptionFlag, MagickFalse },
520     { "+implode", 0L, DeprecateOptionFlag, MagickTrue },
521     { "-implode", 1L, SimpleOperatorFlag, MagickFalse },
522     { "+insert", 0L, ListOperatorFlag | FireOptionFlag, MagickFalse },
523     { "-insert", 1L, ListOperatorFlag | FireOptionFlag, MagickFalse },
524     { "+intensity", 0L, ImageInfoOptionFlag, MagickFalse },
525     { "-intensity", 1L, ImageInfoOptionFlag, MagickFalse },
526     { "+intent", 0L, ImageInfoOptionFlag, MagickFalse },
527     { "-intent", 1L, ImageInfoOptionFlag, MagickFalse },
528     { "+interlace", 0L, ImageInfoOptionFlag, MagickFalse },
529     { "-interlace", 1L, ImageInfoOptionFlag, MagickFalse },
530     { "+interline-spacing", 0L, ImageInfoOptionFlag | DrawInfoOptionFlag, MagickFalse },
531     { "-interline-spacing", 1L, ImageInfoOptionFlag | DrawInfoOptionFlag, MagickFalse },
532     { "+interpolate", 0L, ImageInfoOptionFlag, MagickFalse },
533     { "-interpolate", 1L, ImageInfoOptionFlag, MagickFalse },
534     { "+interpolative-resize", 1L, DeprecateOptionFlag, MagickTrue },
535     { "-interpolative-resize", 1L, SimpleOperatorFlag, MagickFalse },
536     { "+interword-spacing", 0L, ImageInfoOptionFlag | DrawInfoOptionFlag, MagickFalse },
537     { "-interword-spacing", 1L, ImageInfoOptionFlag | DrawInfoOptionFlag, MagickFalse },
538     { "+kerning", 0L, ImageInfoOptionFlag | DrawInfoOptionFlag, MagickFalse },
539     { "-kerning", 1L, ImageInfoOptionFlag | DrawInfoOptionFlag, MagickFalse },
540     { "+kuwahara", 0L, DeprecateOptionFlag, MagickTrue },
541     { "-kuwahara", 1L, SimpleOperatorFlag, MagickFalse },
542     { "+label", 0L, ImageInfoOptionFlag | NeverInterpretArgsFlag, MagickFalse },
543     { "-label", 1L, ImageInfoOptionFlag | NeverInterpretArgsFlag, MagickFalse },
544     { "+lat", 1L, DeprecateOptionFlag, MagickTrue },
545     { "-lat", 1L, SimpleOperatorFlag, MagickFalse },
546     { "+layers", 1L, DeprecateOptionFlag | FireOptionFlag, MagickTrue },
547     { "-layers", 1L, ListOperatorFlag | FireOptionFlag, MagickFalse },
548     { "-level", 1L, SimpleOperatorFlag, MagickFalse },
549     { "+level", 1L, SimpleOperatorFlag, MagickFalse },
550     { "-level-colors", 1L, SimpleOperatorFlag, MagickFalse },
551     { "+level-colors", 1L, SimpleOperatorFlag, MagickFalse },
552     { "+limit", 0L, DeprecateOptionFlag, MagickTrue },
553     { "-limit", 2L, GlobalOptionFlag | FireOptionFlag, MagickFalse },
554     { "+linear-stretch", 1L, DeprecateOptionFlag, MagickTrue },
555     { "-linear-stretch", 1L, SimpleOperatorFlag, MagickFalse },
556     { "+liquid-rescale", 1L, DeprecateOptionFlag, MagickTrue },
557     { "-liquid-rescale", 1L, SimpleOperatorFlag, MagickFalse },
558     { "+list", 0L, DeprecateOptionFlag, MagickTrue },
559     { "-list", 1L, NoImageOperatorFlag, MagickFalse },
560     { "+local-contrast", 0L, DeprecateOptionFlag, MagickTrue },
561     { "-local-contrast", 1L, SimpleOperatorFlag, MagickFalse },
562     { "+log", 0L, DeprecateOptionFlag, MagickFalse },
563     { "-log", 1L, GlobalOptionFlag, MagickFalse },
564     { "+loop", 0L, ImageInfoOptionFlag, MagickFalse },
565     { "-loop", 1L, ImageInfoOptionFlag, MagickFalse },
566     { "+lowlight-color", 0L, NonMagickOptionFlag | ImageInfoOptionFlag, MagickFalse },
567     { "-lowlight-color", 1L, NonMagickOptionFlag | ImageInfoOptionFlag, MagickFalse },
568     { "+magnify", 0L, DeprecateOptionFlag, MagickTrue },
569     { "-magnify", 0L, SimpleOperatorFlag, MagickFalse },
570     { "+map", 0L, ReplacedOptionFlag | ListOperatorFlag | FireOptionFlag, MagickTrue },
571     { "-map", 1L, ReplacedOptionFlag | SimpleOperatorFlag, MagickTrue },
572     { "+mask", 0L, DeprecateOptionFlag | NeverInterpretArgsFlag, MagickFalse },
573     { "-mask", 1L, DeprecateOptionFlag | NeverInterpretArgsFlag, MagickFalse },
574     { "-matte", 0L, ReplacedOptionFlag | SimpleOperatorFlag, MagickTrue },
575     { "+matte", 0L, ReplacedOptionFlag | SimpleOperatorFlag, MagickTrue },
576     { "-maximum", 0L, DeprecateOptionFlag | FireOptionFlag, MagickTrue },
577     { "+maximum", 0L, DeprecateOptionFlag | FireOptionFlag, MagickTrue },
578     { "+mean-shift", 1L, DeprecateOptionFlag, MagickTrue },
579     { "-mean-shift", 1L, SimpleOperatorFlag, MagickTrue },
580     { "+median", 1L, DeprecateOptionFlag, MagickTrue },
581     { "-median", 1L, ReplacedOptionFlag | SimpleOperatorFlag | FireOptionFlag, MagickTrue },
582     { "+metric", 0L, DeprecateOptionFlag | FireOptionFlag, MagickFalse },
583     { "-metric", 1L, ListOperatorFlag | FireOptionFlag, MagickFalse },
584     { "-minimum", 0L, DeprecateOptionFlag | FireOptionFlag, MagickTrue },
585     { "+minimum", 0L, DeprecateOptionFlag | FireOptionFlag, MagickTrue },
586     { "+mode", 1L, NonMagickOptionFlag, MagickFalse },
587     { "-mode", 1L, ReplacedOptionFlag | SimpleOperatorFlag, MagickTrue },
588     { "+modulate", 1L, DeprecateOptionFlag, MagickTrue },
589     { "-modulate", 1L, SimpleOperatorFlag, MagickFalse },
590     { "-moments", 0L, SimpleOperatorFlag | FireOptionFlag, MagickFalse },
591     { "+moments", 0L, SimpleOperatorFlag | FireOptionFlag, MagickFalse },
592     { "-monitor", 0L, ImageInfoOptionFlag | SimpleOperatorFlag, MagickFalse },
593     { "+monitor", 0L, ImageInfoOptionFlag | SimpleOperatorFlag, MagickFalse },
594     { "+monochrome", 0L, ImageInfoOptionFlag, MagickFalse },
595     { "-monochrome", 0L, ImageInfoOptionFlag | SimpleOperatorFlag, MagickFalse },
596     { "+morph", 1L, DeprecateOptionFlag | FireOptionFlag, MagickTrue },
597     { "-morph", 1L, ListOperatorFlag | FireOptionFlag, MagickFalse },
598     { "+morphology", 2L, DeprecateOptionFlag, MagickTrue },
599     { "-morphology", 2L, SimpleOperatorFlag, MagickFalse },
600     { "+mosaic", 0L, DeprecateOptionFlag, MagickTrue },
601     { "-mosaic", 0L, ListOperatorFlag | FireOptionFlag, MagickFalse },
602     { "+motion-blur", 1L, DeprecateOptionFlag, MagickTrue },
603     { "-motion-blur", 1L, SimpleOperatorFlag, MagickFalse },
604     { "+name", 0L, NonMagickOptionFlag, MagickFalse },
605     { "-name", 1L, NonMagickOptionFlag, MagickFalse },
606     { "+negate", 0L, SimpleOperatorFlag, MagickFalse },
607     { "-negate", 0L, SimpleOperatorFlag, MagickFalse },
608     { "-noise", 1L, ReplacedOptionFlag | SimpleOperatorFlag, MagickFalse },
609     { "+noise", 1L, SimpleOperatorFlag, MagickFalse },
610     { "-noop", 0L, NoImageOperatorFlag, MagickFalse },
611     { "+normalize", 0L, DeprecateOptionFlag, MagickTrue },
612     { "-normalize", 0L, SimpleOperatorFlag, MagickFalse },
613     { "-opaque", 1L, SimpleOperatorFlag, MagickFalse },
614     { "+opaque", 1L, SimpleOperatorFlag, MagickFalse },
615     { "+ordered-dither", 0L, DeprecateOptionFlag, MagickTrue },
616     { "-ordered-dither", 1L, SimpleOperatorFlag, MagickFalse },
617     { "+orient", 0L, ImageInfoOptionFlag, MagickFalse },
618     { "-orient", 1L, ImageInfoOptionFlag, MagickFalse },
619     { "+page", 0L, ImageInfoOptionFlag, MagickFalse },
620     { "-page", 1L, ImageInfoOptionFlag, MagickFalse },
621     { "+paint", 0L, DeprecateOptionFlag, MagickTrue },
622     { "-paint", 1L, SimpleOperatorFlag, MagickFalse },
623     { "+path", 0L, NonMagickOptionFlag, MagickFalse },
624     { "-path", 1L, NonMagickOptionFlag, MagickFalse },
625     { "+pause", 0L, NonMagickOptionFlag, MagickFalse },
626     { "-pause", 1L, NonMagickOptionFlag, MagickFalse },
627     { "-ping", 0L, ImageInfoOptionFlag, MagickFalse },
628     { "+ping", 0L, ImageInfoOptionFlag, MagickFalse },
629     { "+pointsize", 0L, ImageInfoOptionFlag | DrawInfoOptionFlag, MagickFalse },
630     { "-pointsize", 1L, ImageInfoOptionFlag | DrawInfoOptionFlag, MagickFalse },
631     { "+polaroid", 0L, SimpleOperatorFlag, MagickFalse },
632     { "-polaroid", 1L, SimpleOperatorFlag, MagickFalse },
633     { "+poly", 1L, DeprecateOptionFlag | FireOptionFlag, MagickTrue },
634     { "-poly", 1L, ListOperatorFlag | FireOptionFlag, MagickFalse },
635     { "+posterize", 1L, DeprecateOptionFlag, MagickTrue },
636     { "-posterize", 1L, SimpleOperatorFlag, MagickFalse },
637     { "+precision", 0L, ImageInfoOptionFlag, MagickFalse },
638     { "-precision", 1L, ImageInfoOptionFlag, MagickFalse },
639     { "+preview", 0L, DeprecateOptionFlag, MagickTrue },
640     { "-preview", 1L, GlobalOptionFlag, MagickFalse },
641     { "+print", 1L, DeprecateOptionFlag | FireOptionFlag, MagickTrue },
642     { "-print", 1L, NoImageOperatorFlag | AlwaysInterpretArgsFlag | FireOptionFlag, MagickFalse },
643     { "+process", 1L, DeprecateOptionFlag | FireOptionFlag, MagickTrue },
644     { "-process", 1L, ListOperatorFlag | FireOptionFlag, MagickFalse },
645     { "+profile", 1L, SimpleOperatorFlag, MagickFalse },
646     { "-profile", 1L, SimpleOperatorFlag | NeverInterpretArgsFlag, MagickFalse },
647     { "+quality", 0L, ImageInfoOptionFlag, MagickFalse },
648     { "-quality", 1L, ImageInfoOptionFlag, MagickFalse },
649     { "+quantize", 0L, QuantizeInfoOptionFlag, MagickFalse },
650     { "-quantize", 1L, QuantizeInfoOptionFlag, MagickFalse },
651     { "-raise", 1L, SimpleOperatorFlag, MagickFalse },
652     { "+raise", 1L, SimpleOperatorFlag, MagickFalse },
653     { "+random-threshold", 1L, DeprecateOptionFlag, MagickTrue },
654     { "-random-threshold", 1L, SimpleOperatorFlag, MagickFalse },
655     { "-read", 1L, NoImageOperatorFlag | NeverInterpretArgsFlag, MagickFalse },
656     { "+read-mask", 0L, SimpleOperatorFlag | NeverInterpretArgsFlag, MagickFalse },
657     { "-read-mask", 1L, SimpleOperatorFlag | NeverInterpretArgsFlag, MagickFalse },
658     { "+recolor", 1L, DeprecateOptionFlag, MagickTrue },
659     { "-recolor", 1L, ReplacedOptionFlag | SimpleOperatorFlag, MagickTrue },
660     { "+red-primary", 0L, ImageInfoOptionFlag, MagickFalse },
661     { "-red-primary", 1L, ImageInfoOptionFlag, MagickFalse },
662     { "+region", 0L, NoImageOperatorFlag, MagickFalse },
663     { "-region", 1L, NoImageOperatorFlag, MagickFalse },
664     { "+remap", 0L, ListOperatorFlag | NeverInterpretArgsFlag | FireOptionFlag, MagickFalse },
665     { "-remap", 1L, SimpleOperatorFlag | NeverInterpretArgsFlag, MagickFalse },
666     { "+remote", 0L, NonMagickOptionFlag, MagickFalse },
667     { "-remote", 1L, NonMagickOptionFlag, MagickFalse },
668     { "-render", 0L, DrawInfoOptionFlag, MagickFalse },
669     { "+render", 0L, DrawInfoOptionFlag, MagickFalse },
670     { "+resample", 1L, DeprecateOptionFlag, MagickTrue },
671     { "-resample", 1L, SimpleOperatorFlag, MagickFalse },
672     { "-respect-parenthesis", 0L, ImageInfoOptionFlag, MagickFalse },
673     { "+respect-parenthesis", 0L, ImageInfoOptionFlag, MagickFalse },
674     { "+reverse", 0L, DeprecateOptionFlag | FireOptionFlag, MagickTrue },
675     { "-reverse", 0L, ListOperatorFlag | FireOptionFlag, MagickFalse },
676     { "+roll", 1L, DeprecateOptionFlag, MagickTrue },
677     { "-roll", 1L, SimpleOperatorFlag, MagickFalse },
678     { "+rotate", 1L, DeprecateOptionFlag, MagickTrue },
679     { "-rotate", 1L, SimpleOperatorFlag, MagickFalse },
680     { "-rotational-blur", 1L, SimpleOperatorFlag, MagickFalse },
681     { "+sample", 1L, DeprecateOptionFlag, MagickTrue },
682     { "-sample", 1L, SimpleOperatorFlag, MagickFalse },
683     { "+sampling-factor", 0L, ImageInfoOptionFlag, MagickFalse },
684     { "-sampling-factor", 1L, ImageInfoOptionFlag, MagickFalse },
685     { "-sans0", 0L, NoImageOperatorFlag | NeverInterpretArgsFlag, MagickTrue },
686     { "+sans0", 0L, NoImageOperatorFlag | NeverInterpretArgsFlag, MagickTrue }, /* equivelent to 'noop' */
687     { "+sans1", 1L, NoImageOperatorFlag | NeverInterpretArgsFlag, MagickTrue },
688     { "-sans1", 1L, NoImageOperatorFlag | NeverInterpretArgsFlag, MagickTrue }, /* equivelent to 'sans' */
689     { "-sans", 1L, NoImageOperatorFlag | NeverInterpretArgsFlag, MagickTrue },
690     { "+sans", 1L, NoImageOperatorFlag | NeverInterpretArgsFlag, MagickTrue },
691     { "-sans2", 2L, NoImageOperatorFlag | NeverInterpretArgsFlag, MagickTrue },
692     { "+sans2", 2L, NoImageOperatorFlag | NeverInterpretArgsFlag, MagickTrue },
693     { "+scale", 1L, DeprecateOptionFlag, MagickTrue },
694     { "-scale", 1L, SimpleOperatorFlag, MagickFalse },
695     { "+scene", 0L, ImageInfoOptionFlag, MagickFalse },
696     { "-scene", 1L, ImageInfoOptionFlag, MagickFalse },
697     { "+scenes", 0L, NonMagickOptionFlag, MagickFalse },
698     { "-scenes", 1L, NonMagickOptionFlag, MagickFalse },
699     { "+screen", 0L, NonMagickOptionFlag, MagickFalse },
700     { "-screen", 1L, NonMagickOptionFlag, MagickFalse },
701     { "-script", 1L, SpecialOptionFlag | NeverInterpretArgsFlag, MagickFalse },
702     { "+seed", 0L, GlobalOptionFlag, MagickFalse },
703     { "-seed", 1L, GlobalOptionFlag, MagickFalse },
704     { "+segment", 1L, DeprecateOptionFlag, MagickTrue },
705     { "-segment", 1L, SimpleOperatorFlag, MagickFalse },
706     { "+selective-blur", 1L, DeprecateOptionFlag, MagickTrue },
707     { "-selective-blur", 1L, SimpleOperatorFlag, MagickFalse },
708     { "+separate", 0L, DeprecateOptionFlag | FireOptionFlag, MagickTrue },
709     { "-separate", 0L, SimpleOperatorFlag | FireOptionFlag, MagickFalse },
710     { "+sepia-tone", 1L, DeprecateOptionFlag, MagickTrue },
711     { "-sepia-tone", 1L, SimpleOperatorFlag, MagickFalse },
712     { "+set", 1L, NoImageOperatorFlag, MagickFalse },
713     { "-set", 2L, NoImageOperatorFlag | NeverInterpretArgsFlag, MagickFalse },
714     { "+shade", 0L, DeprecateOptionFlag, MagickTrue },
715     { "-shade", 1L, SimpleOperatorFlag, MagickFalse },
716     { "+shadow", 1L, DeprecateOptionFlag, MagickTrue },
717     { "-shadow", 1L, SimpleOperatorFlag, MagickFalse },
718     { "+shared-memory", 0L, NonMagickOptionFlag, MagickFalse },
719     { "-shared-memory", 1L, NonMagickOptionFlag, MagickFalse },
720     { "+sharpen", 1L, DeprecateOptionFlag, MagickTrue },
721     { "-sharpen", 1L, SimpleOperatorFlag, MagickFalse },
722     { "+shave", 1L, DeprecateOptionFlag, MagickTrue },
723     { "-shave", 1L, SimpleOperatorFlag, MagickFalse },
724     { "+shear", 1L, DeprecateOptionFlag, MagickTrue },
725     { "-shear", 1L, SimpleOperatorFlag, MagickFalse },
726     { "-sigmoidal-contrast", 1L, SimpleOperatorFlag, MagickFalse },
727     { "+sigmoidal-contrast", 1L, SimpleOperatorFlag, MagickFalse },
728     { "+silent", 0L, NonMagickOptionFlag, MagickFalse },
729     { "-silent", 1L, NonMagickOptionFlag, MagickFalse },
730     { "+similarity-threshold", 0L, NonMagickOptionFlag | ImageInfoOptionFlag, MagickFalse },
731     { "-similarity-threshold", 1L, NonMagickOptionFlag | ImageInfoOptionFlag, MagickFalse },
732     { "+sketch", 1L, DeprecateOptionFlag, MagickTrue },
733     { "-sketch", 1L, SimpleOperatorFlag, MagickFalse },
734     { "-smush", 1L, ListOperatorFlag | FireOptionFlag, MagickFalse },
735     { "+smush", 1L, ListOperatorFlag | FireOptionFlag, MagickFalse },
736     { "+snaps", 0L, NonMagickOptionFlag, MagickFalse },
737     { "-snaps", 1L, NonMagickOptionFlag, MagickFalse },
738     { "+solarize", 1L, DeprecateOptionFlag, MagickTrue },
739     { "-solarize", 1L, SimpleOperatorFlag, MagickFalse },
740     { "+sparse-color", 1L, DeprecateOptionFlag, MagickTrue },
741     { "-sparse-color", 2L, SimpleOperatorFlag | AlwaysInterpretArgsFlag, MagickFalse },
742     { "+splice", 1L, DeprecateOptionFlag, MagickTrue },
743     { "-splice", 1L, SimpleOperatorFlag, MagickFalse },
744     { "+spread", 1L, DeprecateOptionFlag, MagickTrue },
745     { "-spread", 1L, SimpleOperatorFlag, MagickFalse },
746     { "+statistic", 2L, DeprecateOptionFlag, MagickTrue },
747     { "-statistic", 2L, SimpleOperatorFlag, MagickFalse },
748     { "+stegano", 0L, NonMagickOptionFlag, MagickFalse },
749     { "-stegano", 1L, NonMagickOptionFlag, MagickFalse },
750     { "+stereo", 0L, DeprecateOptionFlag, MagickTrue },
751     { "-stereo", 1L, NonMagickOptionFlag, MagickFalse },
752     { "+stretch", 1L, DeprecateOptionFlag, MagickTrue },
753     { "-stretch", 1L, SimpleOperatorFlag, MagickFalse },
754     { "+strip", 0L, DeprecateOptionFlag, MagickTrue },
755     { "-strip", 0L, SimpleOperatorFlag, MagickFalse },
756     { "+stroke", 0L, ImageInfoOptionFlag | DrawInfoOptionFlag, MagickFalse },
757     { "-stroke", 1L, ImageInfoOptionFlag | DrawInfoOptionFlag, MagickFalse },
758     { "-strokewidth", 1L, ImageInfoOptionFlag | DrawInfoOptionFlag, MagickFalse },
759     { "+strokewidth", 1L, ImageInfoOptionFlag, MagickFalse },
760     { "+style", 0L, DrawInfoOptionFlag, MagickFalse },
761     { "-style", 1L, DrawInfoOptionFlag, MagickFalse },
762     { "-subimage", 0L, ListOperatorFlag, MagickFalse },
763     { "-subimage-search", 0L, NonMagickOptionFlag | ImageInfoOptionFlag, MagickFalse },
764     { "+subimage-search", 0L, NonMagickOptionFlag | ImageInfoOptionFlag, MagickFalse },
765     { "+swap", 0L, ListOperatorFlag | FireOptionFlag, MagickFalse },
766     { "-swap", 1L, ListOperatorFlag | FireOptionFlag, MagickFalse },
767     { "+swirl", 1L, DeprecateOptionFlag, MagickTrue },
768     { "-swirl", 1L, SimpleOperatorFlag, MagickFalse },
769     { "-synchronize", 0L, ImageInfoOptionFlag, MagickFalse },
770     { "+synchronize", 0L, ImageInfoOptionFlag, MagickFalse },
771     { "-taint", 0L, ImageInfoOptionFlag, MagickFalse },
772     { "+taint", 0L, ImageInfoOptionFlag, MagickFalse },
773     { "+text-font", 0L, NonMagickOptionFlag, MagickFalse },
774     { "-text-font", 1L, NonMagickOptionFlag, MagickFalse },
775     { "+texture", 0L, ImageInfoOptionFlag, MagickFalse },
776     { "-texture", 1L, ImageInfoOptionFlag | NeverInterpretArgsFlag, MagickFalse },
777     { "+threshold", 0L, SimpleOperatorFlag, MagickFalse },
778     { "-threshold", 1L, SimpleOperatorFlag, MagickFalse },
779     { "+thumbnail", 1L, DeprecateOptionFlag, MagickTrue },
780     { "-thumbnail", 1L, SimpleOperatorFlag, MagickFalse },
781     { "+tile", 0L, DrawInfoOptionFlag | NeverInterpretArgsFlag, MagickFalse },
782     { "-tile", 1L, DrawInfoOptionFlag | NeverInterpretArgsFlag, MagickFalse },
783     { "+tile-offset", 0L, ImageInfoOptionFlag, MagickFalse },
784     { "-tile-offset", 1L, ImageInfoOptionFlag, MagickFalse },
785     { "-tint", 1L, SimpleOperatorFlag, MagickFalse },
786     { "+tint", 1L, SimpleOperatorFlag, MagickFalse },
787     { "+title", 0L, NonMagickOptionFlag, MagickFalse },
788     { "-title", 1L, NonMagickOptionFlag, MagickFalse },
789     { "+transform", 0L, DeprecateOptionFlag, MagickTrue },
790     { "-transform", 0L, ReplacedOptionFlag | SimpleOperatorFlag, MagickTrue },
791     { "-transparent", 1L, SimpleOperatorFlag, MagickFalse },
792     { "+transparent", 1L, SimpleOperatorFlag, MagickFalse },
793     { "+transparent-color", 0L, ImageInfoOptionFlag, MagickFalse },
794     { "-transparent-color", 1L, ImageInfoOptionFlag, MagickFalse },
795     { "+transpose", 0L, DeprecateOptionFlag, MagickTrue },
796     { "-transpose", 0L, SimpleOperatorFlag, MagickFalse },
797     { "+transverse", 0L, DeprecateOptionFlag, MagickTrue },
798     { "-transverse", 0L, SimpleOperatorFlag, MagickFalse },
799     { "+treedepth", 1L, DeprecateOptionFlag, MagickTrue },
800     { "-treedepth", 1L, QuantizeInfoOptionFlag, MagickFalse },
801     { "+trim", 0L, DeprecateOptionFlag, MagickTrue },
802     { "-trim", 0L, SimpleOperatorFlag, MagickFalse },
803     { "+type", 0L, ImageInfoOptionFlag | SimpleOperatorFlag, MagickFalse },
804     { "-type", 1L, ImageInfoOptionFlag | SimpleOperatorFlag, MagickFalse },
805     { "+undercolor", 0L, ImageInfoOptionFlag | DrawInfoOptionFlag, MagickFalse },
806     { "-undercolor", 1L, ImageInfoOptionFlag | DrawInfoOptionFlag, MagickFalse },
807     { "-unique", 0L, SimpleOperatorFlag, MagickFalse },
808     { "+unique", 0L, SimpleOperatorFlag, MagickFalse },
809     { "+unique-colors", 0L, DeprecateOptionFlag, MagickTrue },
810     { "-unique-colors", 0L, SimpleOperatorFlag, MagickFalse },
811     { "+units", 0L, ImageInfoOptionFlag, MagickFalse },
812     { "-units", 1L, ImageInfoOptionFlag, MagickFalse },
813     { "+unsharp", 1L, DeprecateOptionFlag, MagickTrue },
814     { "-unsharp", 1L, SimpleOperatorFlag, MagickFalse },
815     { "+update", 0L, NonMagickOptionFlag, MagickFalse },
816     { "-update", 1L, NonMagickOptionFlag, MagickFalse },
817     { "+use-pixmap", 0L, NonMagickOptionFlag, MagickFalse },
818     { "-use-pixmap", 1L, NonMagickOptionFlag, MagickFalse },
819     { "-verbose", 0L, ImageInfoOptionFlag, MagickFalse },
820     { "+verbose", 0L, ImageInfoOptionFlag, MagickFalse },
821     { "+version", 0L, DeprecateOptionFlag, MagickTrue },
822     { "-version", 0L, NoImageOperatorFlag, MagickFalse },
823     { "+view", 0L, ImageInfoOptionFlag, MagickFalse },
824     { "-view", 1L, ImageInfoOptionFlag, MagickFalse },
825     { "+vignette", 1L, DeprecateOptionFlag, MagickTrue },
826     { "-vignette", 1L, SimpleOperatorFlag, MagickFalse },
827     { "+visual", 0L, NonMagickOptionFlag, MagickFalse },
828     { "-visual", 1L, NonMagickOptionFlag, MagickFalse },
829     { "+watermark", 0L, NonMagickOptionFlag, MagickFalse },
830     { "-watermark", 1L, NonMagickOptionFlag, MagickFalse },
831     { "+wave", 1L, DeprecateOptionFlag, MagickTrue },
832     { "-wave", 1L, SimpleOperatorFlag, MagickFalse },
833     { "+wavelet-denoise", 0L, DeprecateOptionFlag, MagickTrue },
834     { "-wavelet-denoise", 1L, SimpleOperatorFlag, MagickFalse },
835     { "+weight", 1L, DeprecateOptionFlag, MagickTrue },
836     { "-weight", 1L, DrawInfoOptionFlag, MagickFalse },
837     { "+white-point", 0L, ImageInfoOptionFlag, MagickFalse },
838     { "-white-point", 1L, ImageInfoOptionFlag, MagickFalse },
839     { "+white-threshold", 1L, DeprecateOptionFlag, MagickTrue },
840     { "-white-threshold", 1L, SimpleOperatorFlag, MagickFalse },
841     { "+window", 0L, NonMagickOptionFlag, MagickFalse },
842     { "-window", 1L, NonMagickOptionFlag, MagickFalse },
843     { "+window-group", 0L, NonMagickOptionFlag, MagickFalse },
844     { "-window-group", 1L, NonMagickOptionFlag, MagickFalse },
845     { "-write", 1L, NoImageOperatorFlag | NeverInterpretArgsFlag | FireOptionFlag, MagickFalse },
846     { "+write", 1L, NoImageOperatorFlag | NeverInterpretArgsFlag | FireOptionFlag, MagickFalse },
847     { "+write-mask", 0L, SimpleOperatorFlag | NeverInterpretArgsFlag, MagickFalse },
848     { "-write-mask", 1L, SimpleOperatorFlag | NeverInterpretArgsFlag, MagickFalse },
849     { (char *) NULL, 0L, UndefinedOptionFlag, MagickFalse }
850   },
851   ComplianceOptions[] =
852   {
853     { "Undefined", UndefinedCompliance, UndefinedOptionFlag, MagickTrue },
854     { "CSS", CSSCompliance, UndefinedOptionFlag, MagickFalse },
855     { "No", NoCompliance, UndefinedOptionFlag, MagickFalse },
856     { "SVG", SVGCompliance, UndefinedOptionFlag, MagickFalse },
857     { "X11", X11Compliance, UndefinedOptionFlag, MagickFalse },
858     { "XPM", XPMCompliance, UndefinedOptionFlag, MagickFalse },
859     { (char *) NULL, UndefinedClass, UndefinedOptionFlag, MagickFalse }
860   },
861   ComposeOptions[] =
862   {
863     { "Undefined", UndefinedCompositeOp, UndefinedOptionFlag, MagickTrue },
864     { "Atop", AtopCompositeOp, UndefinedOptionFlag, MagickFalse },
865     { "Blend", BlendCompositeOp, UndefinedOptionFlag, MagickFalse },
866     { "Blur", BlurCompositeOp, UndefinedOptionFlag, MagickFalse },
867     { "Bumpmap", BumpmapCompositeOp, UndefinedOptionFlag, MagickFalse },
868     { "ChangeMask", ChangeMaskCompositeOp, UndefinedOptionFlag, MagickFalse },
869     { "Clear", ClearCompositeOp, UndefinedOptionFlag, MagickFalse },
870     { "ColorBurn", ColorBurnCompositeOp, UndefinedOptionFlag, MagickFalse },
871     { "ColorDodge", ColorDodgeCompositeOp, UndefinedOptionFlag, MagickFalse },
872     { "Colorize", ColorizeCompositeOp, UndefinedOptionFlag, MagickFalse },
873     { "CopyAlpha", CopyAlphaCompositeOp, UndefinedOptionFlag, MagickFalse },
874     { "CopyBlack", CopyBlackCompositeOp, UndefinedOptionFlag, MagickFalse },
875     { "CopyBlue", CopyBlueCompositeOp, UndefinedOptionFlag, MagickFalse },
876     { "CopyCyan", CopyCyanCompositeOp, UndefinedOptionFlag, MagickFalse },
877     { "CopyGreen", CopyGreenCompositeOp, UndefinedOptionFlag, MagickFalse },
878     { "Copy", CopyCompositeOp, UndefinedOptionFlag, MagickFalse },
879     { "CopyMagenta", CopyMagentaCompositeOp, UndefinedOptionFlag, MagickFalse },
880     { "CopyRed", CopyRedCompositeOp, UndefinedOptionFlag, MagickFalse },
881     { "CopyYellow", CopyYellowCompositeOp, UndefinedOptionFlag, MagickFalse },
882     { "Darken", DarkenCompositeOp, UndefinedOptionFlag, MagickFalse },
883     { "DarkenIntensity", DarkenIntensityCompositeOp, UndefinedOptionFlag, MagickFalse },
884     { "DivideDst", DivideDstCompositeOp, UndefinedOptionFlag, MagickFalse },
885     { "DivideSrc", DivideSrcCompositeOp, UndefinedOptionFlag, MagickFalse },
886     { "Dst", DstCompositeOp, UndefinedOptionFlag, MagickFalse },
887     { "Difference", DifferenceCompositeOp, UndefinedOptionFlag, MagickFalse },
888     { "Displace", DisplaceCompositeOp, UndefinedOptionFlag, MagickFalse },
889     { "Dissolve", DissolveCompositeOp, UndefinedOptionFlag, MagickFalse },
890     { "Distort", DistortCompositeOp, UndefinedOptionFlag, MagickFalse },
891     { "DstAtop", DstAtopCompositeOp, UndefinedOptionFlag, MagickFalse },
892     { "DstIn", DstInCompositeOp, UndefinedOptionFlag, MagickFalse },
893     { "DstOut", DstOutCompositeOp, UndefinedOptionFlag, MagickFalse },
894     { "DstOver", DstOverCompositeOp, UndefinedOptionFlag, MagickFalse },
895     { "Exclusion", ExclusionCompositeOp, UndefinedOptionFlag, MagickFalse },
896     { "HardLight", HardLightCompositeOp, UndefinedOptionFlag, MagickFalse },
897     { "HardMix", HardMixCompositeOp, UndefinedOptionFlag, MagickFalse },
898     { "Hue", HueCompositeOp, UndefinedOptionFlag, MagickFalse },
899     { "In", InCompositeOp, UndefinedOptionFlag, MagickFalse },
900     { "Intensity", IntensityCompositeOp, UndefinedOptionFlag, MagickFalse },
901     { "Lighten", LightenCompositeOp, UndefinedOptionFlag, MagickFalse },
902     { "LightenIntensity", LightenIntensityCompositeOp, UndefinedOptionFlag, MagickFalse },
903     { "LinearBurn", LinearBurnCompositeOp, UndefinedOptionFlag, MagickFalse },
904     { "LinearDodge", LinearDodgeCompositeOp, UndefinedOptionFlag, MagickFalse },
905     { "LinearLight", LinearLightCompositeOp, UndefinedOptionFlag, MagickFalse },
906     { "Luminize", LuminizeCompositeOp, UndefinedOptionFlag, MagickFalse },
907     { "Mathematics", MathematicsCompositeOp, UndefinedOptionFlag, MagickFalse },
908     { "MinusDst", MinusDstCompositeOp, UndefinedOptionFlag, MagickFalse },
909     { "MinusSrc", MinusSrcCompositeOp, UndefinedOptionFlag, MagickFalse },
910     { "Modulate", ModulateCompositeOp, UndefinedOptionFlag, MagickFalse },
911     { "ModulusAdd", ModulusAddCompositeOp, UndefinedOptionFlag, MagickFalse },
912     { "ModulusSubtract", ModulusSubtractCompositeOp, UndefinedOptionFlag, MagickFalse },
913     { "Multiply", MultiplyCompositeOp, UndefinedOptionFlag, MagickFalse },
914     { "None", NoCompositeOp, UndefinedOptionFlag, MagickFalse },
915     { "Out", OutCompositeOp, UndefinedOptionFlag, MagickFalse },
916     { "Overlay", OverlayCompositeOp, UndefinedOptionFlag, MagickFalse },
917     { "Over", OverCompositeOp, UndefinedOptionFlag, MagickFalse },
918     { "PegtopLight", PegtopLightCompositeOp, UndefinedOptionFlag, MagickFalse },
919     { "PinLight", PinLightCompositeOp, UndefinedOptionFlag, MagickFalse },
920     { "Plus", PlusCompositeOp, UndefinedOptionFlag, MagickFalse },
921     { "Replace", ReplaceCompositeOp, UndefinedOptionFlag, MagickFalse },
922     { "Saturate", SaturateCompositeOp, UndefinedOptionFlag, MagickFalse },
923     { "Screen", ScreenCompositeOp, UndefinedOptionFlag, MagickFalse },
924     { "SoftLight", SoftLightCompositeOp, UndefinedOptionFlag, MagickFalse },
925     { "Src", SrcCompositeOp, UndefinedOptionFlag, MagickFalse },
926     { "SrcAtop", SrcAtopCompositeOp, UndefinedOptionFlag, MagickFalse },
927     { "SrcIn", SrcInCompositeOp, UndefinedOptionFlag, MagickFalse },
928     { "SrcOut", SrcOutCompositeOp, UndefinedOptionFlag, MagickFalse },
929     { "SrcOver", SrcOverCompositeOp, UndefinedOptionFlag, MagickFalse },
930     { "VividLight", VividLightCompositeOp, UndefinedOptionFlag, MagickFalse },
931     { "Xor", XorCompositeOp, UndefinedOptionFlag, MagickFalse },
932     { "Divide", DivideDstCompositeOp, DeprecateOptionFlag, MagickTrue },
933     { "Minus", MinusDstCompositeOp, DeprecateOptionFlag, MagickTrue },
934     { "Subtract", ModulusSubtractCompositeOp, DeprecateOptionFlag, MagickTrue },
935     { "Add", ModulusAddCompositeOp, DeprecateOptionFlag, MagickTrue },
936     { "Threshold", ThresholdCompositeOp, DeprecateOptionFlag, MagickTrue },
937     { "CopyOpacity", CopyAlphaCompositeOp, UndefinedOptionFlag, MagickTrue },
938     { (char *) NULL, UndefinedCompositeOp, UndefinedOptionFlag, MagickFalse }
939   },
940   CompressOptions[] =
941   {
942     { "Undefined", UndefinedCompression, UndefinedOptionFlag, MagickTrue },
943     { "B44", B44Compression, UndefinedOptionFlag, MagickFalse },
944     { "B44A", B44ACompression, UndefinedOptionFlag, MagickFalse },
945     { "BZip", BZipCompression, UndefinedOptionFlag, MagickFalse },
946     { "DXT1", DXT1Compression, UndefinedOptionFlag, MagickFalse },
947     { "DXT3", DXT3Compression, UndefinedOptionFlag, MagickFalse },
948     { "DXT5", DXT5Compression, UndefinedOptionFlag, MagickFalse },
949     { "Fax", FaxCompression, UndefinedOptionFlag, MagickFalse },
950     { "Group4", Group4Compression, UndefinedOptionFlag, MagickFalse },
951     { "JBIG1", JBIG1Compression, UndefinedOptionFlag, MagickFalse },
952     { "JBIG2", JBIG2Compression, UndefinedOptionFlag, MagickFalse },
953     { "JPEG", JPEGCompression, UndefinedOptionFlag, MagickFalse },
954     { "JPEG2000", JPEG2000Compression, UndefinedOptionFlag, MagickFalse },
955     { "Lossless", LosslessJPEGCompression, UndefinedOptionFlag, MagickFalse },
956     { "LosslessJPEG", LosslessJPEGCompression, UndefinedOptionFlag, MagickFalse },
957     { "LZMA", LZMACompression, UndefinedOptionFlag, MagickFalse },
958     { "LZW", LZWCompression, UndefinedOptionFlag, MagickFalse },
959     { "None", NoCompression, UndefinedOptionFlag, MagickFalse },
960     { "Piz", PizCompression, UndefinedOptionFlag, MagickFalse },
961     { "Pxr24", Pxr24Compression, UndefinedOptionFlag, MagickFalse },
962     { "RLE", RLECompression, UndefinedOptionFlag, MagickFalse },
963     { "Zip", ZipCompression, UndefinedOptionFlag, MagickFalse },
964     { "RunlengthEncoded", RLECompression, UndefinedOptionFlag, MagickFalse },
965     { "ZipS", ZipSCompression, UndefinedOptionFlag, MagickFalse },
966     { (char *) NULL, UndefinedCompression, UndefinedOptionFlag, MagickFalse }
967   },
968   DataTypeOptions[] =
969   {
970     { "Undefined", UndefinedData, UndefinedOptionFlag, MagickTrue },
971     { "Byte", ByteData, UndefinedOptionFlag, MagickFalse },
972     { "Long", LongData, UndefinedOptionFlag, MagickFalse },
973     { "Short", ShortData, UndefinedOptionFlag, MagickFalse },
974     { "String", StringData, UndefinedOptionFlag, MagickFalse },
975     { (char *) NULL, UndefinedData, UndefinedOptionFlag, MagickFalse }
976   },
977   DecorateOptions[] =
978   {
979     { "Undefined", UndefinedDecoration, UndefinedOptionFlag, MagickTrue },
980     { "LineThrough", LineThroughDecoration, UndefinedOptionFlag, MagickFalse },
981     { "None", NoDecoration, UndefinedOptionFlag, MagickFalse },
982     { "Overline", OverlineDecoration, UndefinedOptionFlag, MagickFalse },
983     { "Underline", UnderlineDecoration, UndefinedOptionFlag, MagickFalse },
984     { (char *) NULL, UndefinedDecoration, UndefinedOptionFlag, MagickFalse }
985   },
986   DirectionOptions[] =
987   {
988     { "Undefined", UndefinedDirection, UndefinedOptionFlag, MagickTrue },
989     { "right-to-left", RightToLeftDirection, UndefinedOptionFlag, MagickFalse },
990     { "left-to-right", LeftToRightDirection, UndefinedOptionFlag, MagickFalse },
991     { (char *) NULL, UndefinedDirection, UndefinedOptionFlag, MagickFalse }
992   },
993   DisposeOptions[] =
994   {
995     { "Undefined", UndefinedDispose, UndefinedOptionFlag, MagickFalse },
996     { "Background", BackgroundDispose, UndefinedOptionFlag, MagickFalse },
997     { "None", NoneDispose, UndefinedOptionFlag, MagickFalse },
998     { "Previous", PreviousDispose, UndefinedOptionFlag, MagickFalse },
999     { "0", UndefinedDispose, UndefinedOptionFlag, MagickFalse },
1000     { "1", NoneDispose, UndefinedOptionFlag, MagickFalse },
1001     { "2", BackgroundDispose, UndefinedOptionFlag, MagickFalse },
1002     { "3", PreviousDispose, UndefinedOptionFlag, MagickFalse },
1003     { (char *) NULL, UndefinedDispose, UndefinedOptionFlag, MagickFalse }
1004   },
1005   DistortOptions[] =
1006   {
1007     { "Affine", AffineDistortion, UndefinedOptionFlag, MagickFalse },
1008     { "AffineProjection", AffineProjectionDistortion, UndefinedOptionFlag, MagickFalse },
1009     { "ScaleRotateTranslate", ScaleRotateTranslateDistortion, UndefinedOptionFlag, MagickFalse },
1010     { "SRT", ScaleRotateTranslateDistortion, UndefinedOptionFlag, MagickFalse },
1011     { "Perspective", PerspectiveDistortion, UndefinedOptionFlag, MagickFalse },
1012     { "PerspectiveProjection", PerspectiveProjectionDistortion, UndefinedOptionFlag, MagickFalse },
1013     { "Bilinear", BilinearForwardDistortion, UndefinedOptionFlag, MagickTrue },
1014     { "BilinearForward", BilinearForwardDistortion, UndefinedOptionFlag, MagickFalse },
1015     { "BilinearReverse", BilinearReverseDistortion, UndefinedOptionFlag, MagickFalse },
1016     { "Polynomial", PolynomialDistortion, UndefinedOptionFlag, MagickFalse },
1017     { "Arc", ArcDistortion, UndefinedOptionFlag, MagickFalse },
1018     { "Polar", PolarDistortion, UndefinedOptionFlag, MagickFalse },
1019     { "DePolar", DePolarDistortion, UndefinedOptionFlag, MagickFalse },
1020     { "Barrel", BarrelDistortion, UndefinedOptionFlag, MagickFalse },
1021     { "Cylinder2Plane", Cylinder2PlaneDistortion, UndefinedOptionFlag, MagickTrue },
1022     { "Plane2Cylinder", Plane2CylinderDistortion, UndefinedOptionFlag, MagickTrue },
1023     { "BarrelInverse", BarrelInverseDistortion, UndefinedOptionFlag, MagickFalse },
1024     { "Shepards", ShepardsDistortion, UndefinedOptionFlag, MagickFalse },
1025     { "Resize", ResizeDistortion, UndefinedOptionFlag, MagickFalse },
1026     { (char *) NULL, UndefinedDistortion, UndefinedOptionFlag, MagickFalse }
1027   },
1028   DitherOptions[] =
1029   {
1030     { "Undefined", UndefinedDitherMethod, UndefinedOptionFlag, MagickTrue },
1031     { "None", NoDitherMethod, UndefinedOptionFlag, MagickFalse },
1032     { "FloydSteinberg", FloydSteinbergDitherMethod, UndefinedOptionFlag, MagickFalse },
1033     { "Riemersma", RiemersmaDitherMethod, UndefinedOptionFlag, MagickFalse },
1034     { (char *) NULL, UndefinedEndian, UndefinedOptionFlag, MagickFalse }
1035   },
1036   EndianOptions[] =
1037   {
1038     { "Undefined", UndefinedEndian, UndefinedOptionFlag, MagickTrue },
1039     { "LSB", LSBEndian, UndefinedOptionFlag, MagickFalse },
1040     { "MSB", MSBEndian, UndefinedOptionFlag, MagickFalse },
1041     { (char *) NULL, UndefinedEndian, UndefinedOptionFlag, MagickFalse }
1042   },
1043   EvaluateOptions[] =
1044   {
1045     { "Undefined", UndefinedEvaluateOperator, UndefinedOptionFlag, MagickTrue },
1046     { "Abs", AbsEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1047     { "Add", AddEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1048     { "AddModulus", AddModulusEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1049     { "And", AndEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1050     { "Cos", CosineEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1051     { "Cosine", CosineEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1052     { "Divide", DivideEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1053     { "Exp", ExponentialEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1054     { "Exponential", ExponentialEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1055     { "GaussianNoise", GaussianNoiseEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1056     { "ImpulseNoise", ImpulseNoiseEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1057     { "LaplacianNoise", LaplacianNoiseEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1058     { "LeftShift", LeftShiftEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1059     { "Log", LogEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1060     { "Max", MaxEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1061     { "Mean", MeanEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1062     { "Median", MedianEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1063     { "Min", MinEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1064     { "MultiplicativeNoise", MultiplicativeNoiseEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1065     { "Multiply", MultiplyEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1066     { "Or", OrEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1067     { "PoissonNoise", PoissonNoiseEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1068     { "Pow", PowEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1069     { "RightShift", RightShiftEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1070     { "RMS", RootMeanSquareEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1071     { "RootMeanSquare", RootMeanSquareEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1072     { "Set", SetEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1073     { "Sin", SineEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1074     { "Sine", SineEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1075     { "Subtract", SubtractEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1076     { "Sum", SumEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1077     { "Threshold", ThresholdEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1078     { "ThresholdBlack", ThresholdBlackEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1079     { "ThresholdWhite", ThresholdWhiteEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1080     { "UniformNoise", UniformNoiseEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1081     { "Xor", XorEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1082     { (char *) NULL, UndefinedEvaluateOperator, UndefinedOptionFlag, MagickFalse }
1083   },
1084   FillRuleOptions[] =
1085   {
1086     { "Undefined", UndefinedRule, UndefinedOptionFlag, MagickTrue },
1087     { "Evenodd", EvenOddRule, UndefinedOptionFlag, MagickFalse },
1088     { "NonZero", NonZeroRule, UndefinedOptionFlag, MagickFalse },
1089     { (char *) NULL, UndefinedRule, UndefinedOptionFlag, MagickFalse }
1090   },
1091   FilterOptions[] =
1092   {
1093     { "Undefined", UndefinedFilter, UndefinedOptionFlag, MagickTrue },
1094     { "Bartlett", BartlettFilter, UndefinedOptionFlag, MagickFalse },
1095     { "Blackman", BlackmanFilter, UndefinedOptionFlag, MagickFalse },
1096     { "Bohman", BohmanFilter, UndefinedOptionFlag, MagickFalse },
1097     { "Box", BoxFilter, UndefinedOptionFlag, MagickFalse },
1098     { "Catrom", CatromFilter, UndefinedOptionFlag, MagickFalse },
1099     { "Cosine", CosineFilter, UndefinedOptionFlag, MagickFalse },
1100     { "Cubic", CubicFilter, UndefinedOptionFlag, MagickFalse },
1101     { "Gaussian", GaussianFilter, UndefinedOptionFlag, MagickFalse },
1102     { "Hamming", HammingFilter, UndefinedOptionFlag, MagickFalse },
1103     { "Hann", HannFilter, UndefinedOptionFlag, MagickFalse },
1104     { "Hanning", HannFilter, UndefinedOptionFlag, MagickTrue }, /*misspell*/
1105     { "Hermite", HermiteFilter, UndefinedOptionFlag, MagickFalse },
1106     { "Jinc", JincFilter, UndefinedOptionFlag, MagickFalse },
1107     { "Kaiser", KaiserFilter, UndefinedOptionFlag, MagickFalse },
1108     { "Lagrange", LagrangeFilter, UndefinedOptionFlag, MagickFalse },
1109     { "Lanczos", LanczosFilter, UndefinedOptionFlag, MagickFalse },
1110     { "Lanczos2", Lanczos2Filter, UndefinedOptionFlag, MagickFalse },
1111     { "Lanczos2Sharp", Lanczos2SharpFilter, UndefinedOptionFlag, MagickFalse },
1112     { "LanczosRadius", LanczosRadiusFilter, UndefinedOptionFlag, MagickFalse },
1113     { "LanczosSharp", LanczosSharpFilter, UndefinedOptionFlag, MagickFalse },
1114     { "Mitchell", MitchellFilter, UndefinedOptionFlag, MagickFalse },
1115     { "Parzen", ParzenFilter, UndefinedOptionFlag, MagickFalse },
1116     { "Point", PointFilter, UndefinedOptionFlag, MagickFalse },
1117     { "Quadratic", QuadraticFilter, UndefinedOptionFlag, MagickFalse },
1118     { "Robidoux", RobidouxFilter, UndefinedOptionFlag, MagickFalse },
1119     { "RobidouxSharp", RobidouxSharpFilter, UndefinedOptionFlag, MagickFalse },
1120     { "Sinc", SincFilter, UndefinedOptionFlag, MagickFalse },
1121     { "SincFast", SincFastFilter, UndefinedOptionFlag, MagickFalse },
1122     { "Spline", SplineFilter, UndefinedOptionFlag, MagickFalse },
1123     { "Triangle", TriangleFilter, UndefinedOptionFlag, MagickFalse },
1124     { "Welch", WelchFilter, UndefinedOptionFlag, MagickFalse },
1125     { "Welsh", WelchFilter, UndefinedOptionFlag, MagickTrue }, /*misspell*/
1126     { (char *) NULL, UndefinedFilter, UndefinedOptionFlag, MagickFalse }
1127   },
1128   FunctionOptions[] =
1129   {
1130     { "Undefined", UndefinedFunction, UndefinedOptionFlag, MagickTrue },
1131     { "Polynomial", PolynomialFunction, UndefinedOptionFlag, MagickFalse },
1132     { "Sinusoid", SinusoidFunction, UndefinedOptionFlag, MagickFalse },
1133     { "ArcSin", ArcsinFunction, UndefinedOptionFlag, MagickFalse },
1134     { "ArcTan", ArctanFunction, UndefinedOptionFlag, MagickFalse },
1135     { (char *) NULL, UndefinedFunction, UndefinedOptionFlag, MagickFalse }
1136   },
1137   GradientOptions[] =
1138   {
1139     { "Undefined", UndefinedGradient, UndefinedOptionFlag, MagickTrue },
1140     { "Linear", LinearGradient, UndefinedOptionFlag, MagickFalse },
1141     { "Radial", RadialGradient, UndefinedOptionFlag, MagickFalse },
1142     { (char *) NULL, UndefinedRule, UndefinedOptionFlag, MagickFalse }
1143   },
1144   GravityOptions[] =
1145   {
1146     { "Undefined", UndefinedGravity, UndefinedOptionFlag, MagickTrue },
1147     { "None", UndefinedGravity, UndefinedOptionFlag, MagickFalse },
1148     { "Center", CenterGravity, UndefinedOptionFlag, MagickFalse },
1149     { "East", EastGravity, UndefinedOptionFlag, MagickFalse },
1150     { "Forget", ForgetGravity, UndefinedOptionFlag, MagickFalse },
1151     { "NorthEast", NorthEastGravity, UndefinedOptionFlag, MagickFalse },
1152     { "North", NorthGravity, UndefinedOptionFlag, MagickFalse },
1153     { "NorthWest", NorthWestGravity, UndefinedOptionFlag, MagickFalse },
1154     { "SouthEast", SouthEastGravity, UndefinedOptionFlag, MagickFalse },
1155     { "South", SouthGravity, UndefinedOptionFlag, MagickFalse },
1156     { "SouthWest", SouthWestGravity, UndefinedOptionFlag, MagickFalse },
1157     { "West", WestGravity, UndefinedOptionFlag, MagickFalse },
1158     { (char *) NULL, UndefinedGravity, UndefinedOptionFlag, MagickFalse }
1159   },
1160   IntentOptions[] =
1161   {
1162     { "Undefined", UndefinedIntent, UndefinedOptionFlag, MagickTrue },
1163     { "Absolute", AbsoluteIntent, UndefinedOptionFlag, MagickFalse },
1164     { "Perceptual", PerceptualIntent, UndefinedOptionFlag, MagickFalse },
1165     { "Relative", RelativeIntent, UndefinedOptionFlag, MagickFalse },
1166     { "Saturation", SaturationIntent, UndefinedOptionFlag, MagickFalse },
1167     { (char *) NULL, UndefinedIntent, UndefinedOptionFlag, MagickFalse }
1168   },
1169   InterlaceOptions[] =
1170   {
1171     { "Undefined", UndefinedInterlace, UndefinedOptionFlag, MagickTrue },
1172     { "Line", LineInterlace, UndefinedOptionFlag, MagickFalse },
1173     { "None", NoInterlace, UndefinedOptionFlag, MagickFalse },
1174     { "Plane", PlaneInterlace, UndefinedOptionFlag, MagickFalse },
1175     { "Partition", PartitionInterlace, UndefinedOptionFlag, MagickFalse },
1176     { "GIF", GIFInterlace, UndefinedOptionFlag, MagickFalse },
1177     { "JPEG", JPEGInterlace, UndefinedOptionFlag, MagickFalse },
1178     { "PNG", PNGInterlace, UndefinedOptionFlag, MagickFalse },
1179     { (char *) NULL, UndefinedInterlace, UndefinedOptionFlag, MagickFalse }
1180   },
1181   InterpolateOptions[] =
1182   {
1183     { "Undefined", UndefinedInterpolatePixel, UndefinedOptionFlag, MagickTrue },
1184     { "Average", AverageInterpolatePixel, UndefinedOptionFlag, MagickFalse },
1185     { "Average4", AverageInterpolatePixel, UndefinedOptionFlag, MagickFalse },
1186     { "Average9", Average9InterpolatePixel, UndefinedOptionFlag, MagickFalse },
1187     { "Average16", Average16InterpolatePixel, UndefinedOptionFlag, MagickFalse },
1188     { "Background", BackgroundInterpolatePixel, UndefinedOptionFlag, MagickFalse },
1189     { "Bilinear", BilinearInterpolatePixel, UndefinedOptionFlag, MagickFalse },
1190     { "Blend", BlendInterpolatePixel, UndefinedOptionFlag, MagickFalse },
1191     { "Catrom", CatromInterpolatePixel, UndefinedOptionFlag, MagickFalse },
1192     { "Integer", IntegerInterpolatePixel, UndefinedOptionFlag, MagickFalse },
1193     { "Mesh", MeshInterpolatePixel, UndefinedOptionFlag, MagickFalse },
1194     { "Nearest", NearestInterpolatePixel, UndefinedOptionFlag, MagickFalse },
1195     { "NearestNeighbor", NearestInterpolatePixel, UndefinedOptionFlag, MagickTrue },
1196     { "Spline", SplineInterpolatePixel, UndefinedOptionFlag, MagickFalse },
1197 /*  { "Filter", FilterInterpolatePixel, UndefinedOptionFlag, MagickFalse }, */
1198     { (char *) NULL, UndefinedInterpolatePixel, UndefinedOptionFlag, MagickFalse }
1199   },
1200   KernelOptions[] =
1201   {
1202     { "Undefined", UndefinedKernel, UndefinedOptionFlag, MagickTrue },
1203     { "Unity", UnityKernel, UndefinedOptionFlag, MagickFalse },
1204     { "Gaussian", GaussianKernel, UndefinedOptionFlag, MagickFalse },
1205     { "DoG", DoGKernel, UndefinedOptionFlag, MagickFalse },
1206     { "LoG", LoGKernel, UndefinedOptionFlag, MagickFalse },
1207     { "Blur", BlurKernel, UndefinedOptionFlag, MagickFalse },
1208     { "Comet", CometKernel, UndefinedOptionFlag, MagickFalse },
1209     { "Binomial", BinomialKernel, UndefinedOptionFlag, MagickFalse },
1210     { "Laplacian", LaplacianKernel, UndefinedOptionFlag, MagickFalse },
1211     { "Sobel", SobelKernel, UndefinedOptionFlag, MagickFalse },
1212     { "FreiChen", FreiChenKernel, UndefinedOptionFlag, MagickFalse },
1213     { "Roberts", RobertsKernel, UndefinedOptionFlag, MagickFalse },
1214     { "Prewitt", PrewittKernel, UndefinedOptionFlag, MagickFalse },
1215     { "Compass", CompassKernel, UndefinedOptionFlag, MagickFalse },
1216     { "Kirsch", KirschKernel, UndefinedOptionFlag, MagickFalse },
1217     { "Diamond", DiamondKernel, UndefinedOptionFlag, MagickFalse },
1218     { "Square", SquareKernel, UndefinedOptionFlag, MagickFalse },
1219     { "Rectangle", RectangleKernel, UndefinedOptionFlag, MagickFalse },
1220     { "Disk", DiskKernel, UndefinedOptionFlag, MagickFalse },
1221     { "Octagon", OctagonKernel, UndefinedOptionFlag, MagickFalse },
1222     { "Plus", PlusKernel, UndefinedOptionFlag, MagickFalse },
1223     { "Cross", CrossKernel, UndefinedOptionFlag, MagickFalse },
1224     { "Ring", RingKernel, UndefinedOptionFlag, MagickFalse },
1225     { "Peaks", PeaksKernel, UndefinedOptionFlag, MagickFalse },
1226     { "Edges", EdgesKernel, UndefinedOptionFlag, MagickFalse },
1227     { "Corners", CornersKernel, UndefinedOptionFlag, MagickFalse },
1228     { "Diagonals", DiagonalsKernel, UndefinedOptionFlag, MagickFalse },
1229     { "LineEnds", LineEndsKernel, UndefinedOptionFlag, MagickFalse },
1230     { "LineJunctions", LineJunctionsKernel, UndefinedOptionFlag, MagickFalse },
1231     { "Ridges", RidgesKernel, UndefinedOptionFlag, MagickFalse },
1232     { "ConvexHull", ConvexHullKernel, UndefinedOptionFlag, MagickFalse },
1233     { "ThinSe", ThinSEKernel, UndefinedOptionFlag, MagickFalse },
1234     { "Skeleton", SkeletonKernel, UndefinedOptionFlag, MagickFalse },
1235     { "Chebyshev", ChebyshevKernel, UndefinedOptionFlag, MagickFalse },
1236     { "Manhattan", ManhattanKernel, UndefinedOptionFlag, MagickFalse },
1237     { "Octagonal", OctagonalKernel, UndefinedOptionFlag, MagickFalse },
1238     { "Euclidean", EuclideanKernel, UndefinedOptionFlag, MagickFalse },
1239     { "User Defined", UserDefinedKernel, UndefinedOptionFlag, MagickTrue },
1240     { (char *) NULL, UndefinedKernel, UndefinedOptionFlag, MagickFalse }
1241   },
1242   LayerOptions[] =
1243   {
1244     { "Undefined", UndefinedLayer, UndefinedOptionFlag, MagickTrue },
1245     { "Coalesce", CoalesceLayer, UndefinedOptionFlag, MagickFalse },
1246     { "CompareAny", CompareAnyLayer, UndefinedOptionFlag, MagickFalse },
1247     { "CompareClear", CompareClearLayer, UndefinedOptionFlag, MagickFalse },
1248     { "CompareOverlay", CompareOverlayLayer, UndefinedOptionFlag, MagickFalse },
1249     { "Dispose", DisposeLayer, UndefinedOptionFlag, MagickFalse },
1250     { "Optimize", OptimizeLayer, UndefinedOptionFlag, MagickFalse },
1251     { "OptimizeFrame", OptimizeImageLayer, UndefinedOptionFlag, MagickFalse },
1252     { "OptimizePlus", OptimizePlusLayer, UndefinedOptionFlag, MagickFalse },
1253     { "OptimizeTransparency", OptimizeTransLayer, UndefinedOptionFlag, MagickFalse },
1254     { "RemoveDups", RemoveDupsLayer, UndefinedOptionFlag, MagickFalse },
1255     { "RemoveZero", RemoveZeroLayer, UndefinedOptionFlag, MagickFalse },
1256     { "Composite", CompositeLayer, UndefinedOptionFlag, MagickFalse },
1257     { "Merge", MergeLayer, UndefinedOptionFlag, MagickFalse },
1258     { "Flatten", FlattenLayer, UndefinedOptionFlag, MagickFalse },
1259     { "Mosaic", MosaicLayer, UndefinedOptionFlag, MagickFalse },
1260     { "TrimBounds", TrimBoundsLayer, UndefinedOptionFlag, MagickFalse },
1261     { (char *) NULL, UndefinedLayer, UndefinedOptionFlag, MagickFalse }
1262   },
1263   LineCapOptions[] =
1264   {
1265     { "Undefined", UndefinedCap, UndefinedOptionFlag, MagickTrue },
1266     { "Butt", ButtCap, UndefinedOptionFlag, MagickFalse },
1267     { "Round", RoundCap, UndefinedOptionFlag, MagickFalse },
1268     { "Square", SquareCap, UndefinedOptionFlag, MagickFalse },
1269     { (char *) NULL, UndefinedCap, UndefinedOptionFlag, MagickFalse }
1270   },
1271   LineJoinOptions[] =
1272   {
1273     { "Undefined", UndefinedJoin, UndefinedOptionFlag, MagickTrue },
1274     { "Bevel", BevelJoin, UndefinedOptionFlag, MagickFalse },
1275     { "Miter", MiterJoin, UndefinedOptionFlag, MagickFalse },
1276     { "Round", RoundJoin, UndefinedOptionFlag, MagickFalse },
1277     { (char *) NULL, UndefinedJoin, UndefinedOptionFlag, MagickFalse }
1278   },
1279   ListOptions[] =
1280   {
1281     { "Align", MagickAlignOptions, UndefinedOptionFlag, MagickFalse },
1282     { "Alpha", MagickAlphaChannelOptions, UndefinedOptionFlag, MagickFalse },
1283     { "Boolean", MagickBooleanOptions, UndefinedOptionFlag, MagickFalse },
1284     { "Cache", MagickCacheOptions, UndefinedOptionFlag, MagickFalse },
1285     { "Channel", MagickChannelOptions, UndefinedOptionFlag, MagickFalse },
1286     { "Class", MagickClassOptions, UndefinedOptionFlag, MagickFalse },
1287     { "ClipPath", MagickClipPathOptions, UndefinedOptionFlag, MagickFalse },
1288     { "Coder", MagickCoderOptions, UndefinedOptionFlag, MagickFalse },
1289     { "Color", MagickColorOptions, UndefinedOptionFlag, MagickFalse },
1290     { "Colorspace", MagickColorspaceOptions, UndefinedOptionFlag, MagickFalse },
1291     { "Command", MagickCommandOptions, UndefinedOptionFlag, MagickFalse },
1292     { "Compliance", MagickComplianceOptions, UndefinedOptionFlag, MagickFalse },
1293     { "Complex", MagickComplexOptions, UndefinedOptionFlag, MagickFalse },
1294     { "Compose", MagickComposeOptions, UndefinedOptionFlag, MagickFalse },
1295     { "Compress", MagickCompressOptions, UndefinedOptionFlag, MagickFalse },
1296     { "Configure", MagickConfigureOptions, UndefinedOptionFlag, MagickFalse },
1297     { "DataType", MagickDataTypeOptions, UndefinedOptionFlag, MagickFalse },
1298     { "Debug", MagickDebugOptions, UndefinedOptionFlag, MagickFalse },
1299     { "Decoration", MagickDecorateOptions, UndefinedOptionFlag, MagickFalse },
1300     { "Delegate", MagickDelegateOptions, UndefinedOptionFlag, MagickFalse },
1301     { "Direction", MagickDirectionOptions, UndefinedOptionFlag, MagickFalse },
1302     { "Dispose", MagickDisposeOptions, UndefinedOptionFlag, MagickFalse },
1303     { "Distort", MagickDistortOptions, UndefinedOptionFlag, MagickFalse },
1304     { "Dither", MagickDitherOptions, UndefinedOptionFlag, MagickFalse },
1305     { "Endian", MagickEndianOptions, UndefinedOptionFlag, MagickFalse },
1306     { "Evaluate", MagickEvaluateOptions, UndefinedOptionFlag, MagickFalse },
1307     { "FillRule", MagickFillRuleOptions, UndefinedOptionFlag, MagickFalse },
1308     { "Filter", MagickFilterOptions, UndefinedOptionFlag, MagickFalse },
1309     { "Font", MagickFontOptions, UndefinedOptionFlag, MagickFalse },
1310     { "Format", MagickFormatOptions, UndefinedOptionFlag, MagickFalse },
1311     { "Function", MagickFunctionOptions, UndefinedOptionFlag, MagickFalse },
1312     { "Gradient", MagickGradientOptions, UndefinedOptionFlag, MagickFalse },
1313     { "Gravity", MagickGravityOptions, UndefinedOptionFlag, MagickFalse },
1314     { "Intensity", MagickPixelIntensityOptions, UndefinedOptionFlag, MagickFalse },
1315     { "Intent", MagickIntentOptions, UndefinedOptionFlag, MagickFalse },
1316     { "Interlace", MagickInterlaceOptions, UndefinedOptionFlag, MagickFalse },
1317     { "Interpolate", MagickInterpolateOptions, UndefinedOptionFlag, MagickFalse },
1318     { "Kernel", MagickKernelOptions, UndefinedOptionFlag, MagickFalse },
1319     { "Layers", MagickLayerOptions, UndefinedOptionFlag, MagickFalse },
1320     { "LineCap", MagickLineCapOptions, UndefinedOptionFlag, MagickFalse },
1321     { "LineJoin", MagickLineJoinOptions, UndefinedOptionFlag, MagickFalse },
1322     { "List", MagickListOptions, UndefinedOptionFlag, MagickFalse },
1323     { "Locale", MagickLocaleOptions, UndefinedOptionFlag, MagickFalse },
1324     { "LogEvent", MagickLogEventOptions, UndefinedOptionFlag, MagickFalse },
1325     { "Log", MagickLogOptions, UndefinedOptionFlag, MagickFalse },
1326     { "Magic", MagickMagicOptions, UndefinedOptionFlag, MagickFalse },
1327     { "Method", MagickMethodOptions, UndefinedOptionFlag, MagickFalse },
1328     { "Metric", MagickMetricOptions, UndefinedOptionFlag, MagickFalse },
1329     { "Mime", MagickMimeOptions, UndefinedOptionFlag, MagickFalse },
1330     { "Mode", MagickModeOptions, UndefinedOptionFlag, MagickFalse },
1331     { "Morphology", MagickMorphologyOptions, UndefinedOptionFlag, MagickFalse },
1332     { "Module", MagickModuleOptions, UndefinedOptionFlag, MagickFalse },
1333     { "Noise", MagickNoiseOptions, UndefinedOptionFlag, MagickFalse },
1334     { "Orientation", MagickOrientationOptions, UndefinedOptionFlag, MagickFalse },
1335     { "PixelChannel", MagickPixelChannelOptions, UndefinedOptionFlag, MagickFalse },
1336     { "PixelIntensity", MagickPixelIntensityOptions, UndefinedOptionFlag, MagickFalse },
1337     { "PixelMask", MagickPixelMaskOptions, UndefinedOptionFlag, MagickFalse },
1338     { "PixelTrait", MagickPixelTraitOptions, UndefinedOptionFlag, MagickFalse },
1339     { "Policy", MagickPolicyOptions, UndefinedOptionFlag, MagickFalse },
1340     { "PolicyDomain", MagickPolicyDomainOptions, UndefinedOptionFlag, MagickFalse },
1341     { "PolicyRights", MagickPolicyRightsOptions, UndefinedOptionFlag, MagickFalse },
1342     { "Preview", MagickPreviewOptions, UndefinedOptionFlag, MagickFalse },
1343     { "Primitive", MagickPrimitiveOptions, UndefinedOptionFlag, MagickFalse },
1344     { "QuantumFormat", MagickQuantumFormatOptions, UndefinedOptionFlag, MagickFalse },
1345     { "Resource", MagickResourceOptions, UndefinedOptionFlag, MagickFalse },
1346     { "SparseColor", MagickSparseColorOptions, UndefinedOptionFlag, MagickFalse },
1347     { "Statistic", MagickStatisticOptions, UndefinedOptionFlag, MagickFalse },
1348     { "Storage", MagickStorageOptions, UndefinedOptionFlag, MagickFalse },
1349     { "Stretch", MagickStretchOptions, UndefinedOptionFlag, MagickFalse },
1350     { "Style", MagickStyleOptions, UndefinedOptionFlag, MagickFalse },
1351     { "Threshold", MagickThresholdOptions, UndefinedOptionFlag, MagickFalse },
1352     { "Type", MagickTypeOptions, UndefinedOptionFlag, MagickFalse },
1353     { "Units", MagickResolutionOptions, UndefinedOptionFlag, MagickFalse },
1354     { "Undefined", MagickUndefinedOptions, UndefinedOptionFlag, MagickTrue },
1355     { "Validate", MagickValidateOptions, UndefinedOptionFlag, MagickFalse },
1356     { "VirtualPixel", MagickVirtualPixelOptions, UndefinedOptionFlag, MagickFalse },
1357     { "Weight", MagickWeightOptions, UndefinedOptionFlag, MagickFalse },
1358     { (char *) NULL, MagickUndefinedOptions, UndefinedOptionFlag, MagickFalse }
1359   },
1360   LogEventOptions[] =
1361   {
1362     { "Undefined", UndefinedEvents, UndefinedOptionFlag, MagickTrue },
1363     { "All", (AllEvents &~ TraceEvent), UndefinedOptionFlag, MagickFalse },
1364     { "Accelerate", AccelerateEvent, UndefinedOptionFlag, MagickFalse },
1365     { "Annotate", AnnotateEvent, UndefinedOptionFlag, MagickFalse },
1366     { "Blob", BlobEvent, UndefinedOptionFlag, MagickFalse },
1367     { "Cache", CacheEvent, UndefinedOptionFlag, MagickFalse },
1368     { "Coder", CoderEvent, UndefinedOptionFlag, MagickFalse },
1369     { "Command", CommandEvent, UndefinedOptionFlag, MagickFalse },
1370     { "Configure", ConfigureEvent, UndefinedOptionFlag, MagickFalse },
1371     { "Deprecate", DeprecateEvent, UndefinedOptionFlag, MagickFalse },
1372     { "Draw", DrawEvent, UndefinedOptionFlag, MagickFalse },
1373     { "Exception", ExceptionEvent, UndefinedOptionFlag, MagickFalse },
1374     { "Locale", LocaleEvent, UndefinedOptionFlag, MagickFalse },
1375     { "Module", ModuleEvent, UndefinedOptionFlag, MagickFalse },
1376     { "None", NoEvents, UndefinedOptionFlag, MagickFalse },
1377     { "Pixel", PixelEvent, UndefinedOptionFlag, MagickFalse },
1378     { "Policy", PolicyEvent, UndefinedOptionFlag, MagickFalse },
1379     { "Resource", ResourceEvent, UndefinedOptionFlag, MagickFalse },
1380     { "Trace", TraceEvent, UndefinedOptionFlag, MagickFalse },
1381     { "Transform", TransformEvent, UndefinedOptionFlag, MagickFalse },
1382     { "User", UserEvent, UndefinedOptionFlag, MagickFalse },
1383     { "Wand", WandEvent, UndefinedOptionFlag, MagickFalse },
1384     { "X11", X11Event, UndefinedOptionFlag, MagickFalse },
1385     { (char *) NULL, UndefinedEvents, UndefinedOptionFlag, MagickFalse }
1386   },
1387   MetricOptions[] =
1388   {
1389     { "Undefined", UndefinedErrorMetric, UndefinedOptionFlag, MagickTrue },
1390     { "AE", AbsoluteErrorMetric, UndefinedOptionFlag, MagickFalse },
1391     { "Fuzz", FuzzErrorMetric, UndefinedOptionFlag, MagickFalse },
1392     { "MAE", MeanAbsoluteErrorMetric, UndefinedOptionFlag, MagickFalse },
1393     { "MEPP", MeanErrorPerPixelErrorMetric, UndefinedOptionFlag, MagickFalse },
1394     { "MSE", MeanSquaredErrorMetric, UndefinedOptionFlag, MagickFalse },
1395     { "NCC", NormalizedCrossCorrelationErrorMetric, UndefinedOptionFlag, MagickFalse },
1396     { "PAE", PeakAbsoluteErrorMetric, UndefinedOptionFlag, MagickFalse },
1397     { "PHASh", PerceptualHashErrorMetric, UndefinedOptionFlag, MagickFalse },
1398     { "PSNR", PeakSignalToNoiseRatioErrorMetric, UndefinedOptionFlag, MagickFalse },
1399     { "RMSE", RootMeanSquaredErrorMetric, UndefinedOptionFlag, MagickFalse },
1400     { (char *) NULL, UndefinedErrorMetric, UndefinedOptionFlag, MagickFalse }
1401   },
1402   MethodOptions[] =
1403   {
1404     { "Undefined", UndefinedMethod, UndefinedOptionFlag, MagickTrue },
1405     { "FillToBorder", FillToBorderMethod, UndefinedOptionFlag, MagickFalse },
1406     { "Floodfill", FloodfillMethod, UndefinedOptionFlag, MagickFalse },
1407     { "Point", PointMethod, UndefinedOptionFlag, MagickFalse },
1408     { "Replace", ReplaceMethod, UndefinedOptionFlag, MagickFalse },
1409     { "Reset", ResetMethod, UndefinedOptionFlag, MagickFalse },
1410     { (char *) NULL, UndefinedMethod, UndefinedOptionFlag, MagickFalse }
1411   },
1412   ModeOptions[] =
1413   {
1414     { "Undefined", UndefinedMode, UndefinedOptionFlag, MagickTrue },
1415     { "Concatenate", ConcatenateMode, UndefinedOptionFlag, MagickFalse },
1416     { "Frame", FrameMode, UndefinedOptionFlag, MagickFalse },
1417     { "Unframe", UnframeMode, UndefinedOptionFlag, MagickFalse },
1418     { (char *) NULL, UndefinedMode, UndefinedOptionFlag, MagickFalse }
1419   },
1420   MorphologyOptions[] =
1421   {
1422     { "Undefined", UndefinedMorphology, UndefinedOptionFlag, MagickTrue },
1423     { "Correlate", CorrelateMorphology, UndefinedOptionFlag, MagickFalse },
1424     { "Convolve", ConvolveMorphology, UndefinedOptionFlag, MagickFalse },
1425     { "Dilate", DilateMorphology, UndefinedOptionFlag, MagickFalse },
1426     { "Erode", ErodeMorphology, UndefinedOptionFlag, MagickFalse },
1427     { "Close", CloseMorphology, UndefinedOptionFlag, MagickFalse },
1428     { "Open", OpenMorphology, UndefinedOptionFlag, MagickFalse },
1429     { "DilateIntensity", DilateIntensityMorphology, UndefinedOptionFlag, MagickFalse },
1430     { "ErodeIntensity", ErodeIntensityMorphology, UndefinedOptionFlag, MagickFalse },
1431     { "CloseIntensity", CloseIntensityMorphology, UndefinedOptionFlag, MagickFalse },
1432     { "OpenIntensity", OpenIntensityMorphology, UndefinedOptionFlag, MagickFalse },
1433     { "DilateI", DilateIntensityMorphology, UndefinedOptionFlag, MagickFalse },
1434     { "ErodeI", ErodeIntensityMorphology, UndefinedOptionFlag, MagickFalse },
1435     { "CloseI", CloseIntensityMorphology, UndefinedOptionFlag, MagickFalse },
1436     { "OpenI", OpenIntensityMorphology, UndefinedOptionFlag, MagickFalse },
1437     { "Smooth", SmoothMorphology, UndefinedOptionFlag, MagickFalse },
1438     { "EdgeOut", EdgeOutMorphology, UndefinedOptionFlag, MagickFalse },
1439     { "EdgeIn", EdgeInMorphology, UndefinedOptionFlag, MagickFalse },
1440     { "Edge", EdgeMorphology, UndefinedOptionFlag, MagickFalse },
1441     { "TopHat", TopHatMorphology, UndefinedOptionFlag, MagickFalse },
1442     { "BottomHat", BottomHatMorphology, UndefinedOptionFlag, MagickFalse },
1443     { "Hmt", HitAndMissMorphology, UndefinedOptionFlag, MagickFalse },
1444     { "HitNMiss", HitAndMissMorphology, UndefinedOptionFlag, MagickFalse },
1445     { "HitAndMiss", HitAndMissMorphology, UndefinedOptionFlag, MagickFalse },
1446     { "Thinning", ThinningMorphology, UndefinedOptionFlag, MagickFalse },
1447     { "Thicken", ThickenMorphology, UndefinedOptionFlag, MagickFalse },
1448     { "Distance", DistanceMorphology, UndefinedOptionFlag, MagickFalse },
1449     { "IterativeDistance", IterativeDistanceMorphology, UndefinedOptionFlag, MagickFalse },
1450     { "Voronoi", VoronoiMorphology, UndefinedOptionFlag, MagickTrue },
1451     { (char *) NULL, UndefinedMorphology, UndefinedOptionFlag, MagickFalse }
1452   },
1453   NoiseOptions[] =
1454   {
1455     { "Undefined", UndefinedNoise, UndefinedOptionFlag, MagickTrue },
1456     { "Gaussian", GaussianNoise, UndefinedOptionFlag, MagickFalse },
1457     { "Impulse", ImpulseNoise, UndefinedOptionFlag, MagickFalse },
1458     { "Laplacian", LaplacianNoise, UndefinedOptionFlag, MagickFalse },
1459     { "Multiplicative", MultiplicativeGaussianNoise, UndefinedOptionFlag, MagickFalse },
1460     { "Poisson", PoissonNoise, UndefinedOptionFlag, MagickFalse },
1461     { "Random", RandomNoise, UndefinedOptionFlag, MagickFalse },
1462     { "Uniform", UniformNoise, UndefinedOptionFlag, MagickFalse },
1463     { (char *) NULL, UndefinedNoise, UndefinedOptionFlag, MagickFalse }
1464   },
1465   OrientationOptions[] =
1466   {
1467     { "Undefined", UndefinedOrientation, UndefinedOptionFlag, MagickTrue },
1468     { "TopLeft", TopLeftOrientation, UndefinedOptionFlag, MagickFalse },
1469     { "TopRight", TopRightOrientation, UndefinedOptionFlag, MagickFalse },
1470     { "BottomRight", BottomRightOrientation, UndefinedOptionFlag, MagickFalse },
1471     { "BottomLeft", BottomLeftOrientation, UndefinedOptionFlag, MagickFalse },
1472     { "LeftTop", LeftTopOrientation, UndefinedOptionFlag, MagickFalse },
1473     { "RightTop", RightTopOrientation, UndefinedOptionFlag, MagickFalse },
1474     { "RightBottom", RightBottomOrientation, UndefinedOptionFlag, MagickFalse },
1475     { "LeftBottom", LeftBottomOrientation, UndefinedOptionFlag, MagickFalse },
1476     { (char *) NULL, UndefinedOrientation, UndefinedOptionFlag, MagickFalse }
1477   },
1478   PixelChannelOptions[] =
1479   {
1480     { "Undefined", UndefinedPixelChannel, UndefinedOptionFlag, MagickFalse },
1481     { "A", AlphaPixelChannel, UndefinedOptionFlag, MagickFalse },
1482     { "Alpha", AlphaPixelChannel, UndefinedOptionFlag, MagickFalse },
1483     { "B", BluePixelChannel, UndefinedOptionFlag, MagickFalse },
1484     { "Bk", BlackPixelChannel, UndefinedOptionFlag, MagickFalse },
1485     { "Black", BlackPixelChannel, UndefinedOptionFlag, MagickFalse },
1486     { "Blue", BluePixelChannel, UndefinedOptionFlag, MagickFalse },
1487     { "Cb", CbPixelChannel, UndefinedOptionFlag, MagickFalse },
1488     { "Composite", CompositePixelChannel, UndefinedOptionFlag, MagickFalse },
1489     { "C", CyanPixelChannel, UndefinedOptionFlag, MagickFalse },
1490     { "Cr", CrPixelChannel, UndefinedOptionFlag, MagickFalse },
1491     { "Cyan", CyanPixelChannel, UndefinedOptionFlag, MagickFalse },
1492     { "Gray", GrayPixelChannel, UndefinedOptionFlag, MagickFalse },
1493     { "G", GreenPixelChannel, UndefinedOptionFlag, MagickFalse },
1494     { "Green", GreenPixelChannel, UndefinedOptionFlag, MagickFalse },
1495     { "Index", IndexPixelChannel, UndefinedOptionFlag, MagickFalse },
1496     { "Intensity", IntensityPixelChannel, UndefinedOptionFlag, MagickFalse },
1497     { "K", BlackPixelChannel, UndefinedOptionFlag, MagickFalse },
1498     { "M", MagentaPixelChannel, UndefinedOptionFlag, MagickFalse },
1499     { "Magenta", MagentaPixelChannel, UndefinedOptionFlag, MagickFalse },
1500     { "R", RedPixelChannel, UndefinedOptionFlag, MagickFalse },
1501     { "ReadMask", ReadMaskPixelChannel, UndefinedOptionFlag, MagickFalse },
1502     { "Red", RedPixelChannel, UndefinedOptionFlag, MagickFalse },
1503     { "Sync", SyncPixelChannel, UndefinedOptionFlag, MagickFalse },
1504     { "WriteMask", WriteMaskPixelChannel, UndefinedOptionFlag, MagickFalse },
1505     { "Y", YellowPixelChannel, UndefinedOptionFlag, MagickFalse },
1506     { "Yellow", YellowPixelChannel, UndefinedOptionFlag, MagickFalse },
1507     { (char *) NULL, UndefinedPixelChannel, UndefinedOptionFlag, MagickFalse }
1508   },
1509   PixelIntensityOptions[] =
1510   {
1511     { "Undefined", UndefinedPixelIntensityMethod, UndefinedOptionFlag, MagickTrue },
1512     { "Average", AveragePixelIntensityMethod, UndefinedOptionFlag, MagickFalse },
1513     { "Brightness", BrightnessPixelIntensityMethod, UndefinedOptionFlag, MagickFalse },
1514     { "Lightness", LightnessPixelIntensityMethod, UndefinedOptionFlag, MagickFalse },
1515     { "Mean", AveragePixelIntensityMethod, UndefinedOptionFlag, MagickFalse },
1516     { "MS", MSPixelIntensityMethod, UndefinedOptionFlag, MagickFalse },
1517     { "Rec601Luma", Rec601LumaPixelIntensityMethod, UndefinedOptionFlag, MagickFalse },
1518     { "Rec601Luminance", Rec601LuminancePixelIntensityMethod, UndefinedOptionFlag, MagickFalse },
1519     { "Rec709Luma", Rec709LumaPixelIntensityMethod, UndefinedOptionFlag, MagickFalse },
1520     { "Rec709Luminance", Rec709LuminancePixelIntensityMethod, UndefinedOptionFlag, MagickFalse },
1521     { "RMS", RMSPixelIntensityMethod, UndefinedOptionFlag, MagickFalse },
1522     { (char *) NULL, UndefinedPixelIntensityMethod, UndefinedOptionFlag, MagickFalse }
1523   },
1524   PixelMaskOptions[] =
1525   {
1526     { "Undefined", UndefinedPixelMask, UndefinedOptionFlag, MagickTrue },
1527     { "R", ReadPixelMask, UndefinedOptionFlag, MagickFalse },
1528     { "Read", ReadPixelMask, UndefinedOptionFlag, MagickFalse },
1529     { "W", WritePixelMask, UndefinedOptionFlag, MagickFalse },
1530     { "Write", WritePixelMask, UndefinedOptionFlag, MagickFalse },
1531     { (char *) NULL, UndefinedPixelMask, UndefinedOptionFlag, MagickFalse }
1532   },
1533   PixelTraitOptions[] =
1534   {
1535     { "Undefined", UndefinedPixelTrait, UndefinedOptionFlag, MagickTrue },
1536     { "Blend", BlendPixelTrait, UndefinedOptionFlag, MagickFalse },
1537     { "Copy", CopyPixelTrait, UndefinedOptionFlag, MagickFalse },
1538     { "Update", UpdatePixelTrait, UndefinedOptionFlag, MagickFalse },
1539     { (char *) NULL, UndefinedPixelTrait, UndefinedOptionFlag, MagickFalse }
1540   },
1541   PolicyDomainOptions[] =
1542   {
1543     { "Undefined", UndefinedPolicyDomain, UndefinedOptionFlag, MagickTrue },
1544     { "Cache", CachePolicyDomain, UndefinedOptionFlag, MagickFalse },
1545     { "Coder", CoderPolicyDomain, UndefinedOptionFlag, MagickFalse },
1546     { "Delegate", DelegatePolicyDomain, UndefinedOptionFlag, MagickFalse },
1547     { "Filter", FilterPolicyDomain, UndefinedOptionFlag, MagickFalse },
1548     { "Path", PathPolicyDomain, UndefinedOptionFlag, MagickFalse },
1549     { "Resource", ResourcePolicyDomain, UndefinedOptionFlag, MagickFalse },
1550     { "System", SystemPolicyDomain, UndefinedOptionFlag, MagickFalse },
1551     { (char *) NULL, UndefinedPolicyDomain, UndefinedOptionFlag, MagickFalse }
1552   },
1553   PolicyRightsOptions[] =
1554   {
1555     { "Undefined", UndefinedPolicyRights, UndefinedOptionFlag, MagickTrue },
1556     { "None", NoPolicyRights, UndefinedOptionFlag, MagickFalse },
1557     { "Read", ReadPolicyRights, UndefinedOptionFlag, MagickFalse },
1558     { "Write", WritePolicyRights, UndefinedOptionFlag, MagickFalse },
1559     { "Execute", ExecutePolicyRights, UndefinedOptionFlag, MagickFalse },
1560     { (char *) NULL, UndefinedPolicyRights, UndefinedOptionFlag, MagickFalse }
1561   },
1562   PreviewOptions[] =
1563   {
1564     { "Undefined", UndefinedPreview, UndefinedOptionFlag, MagickTrue },
1565     { "AddNoise", AddNoisePreview, UndefinedOptionFlag, MagickFalse },
1566     { "Blur", BlurPreview, UndefinedOptionFlag, MagickFalse },
1567     { "Brightness", BrightnessPreview, UndefinedOptionFlag, MagickFalse },
1568     { "Charcoal", CharcoalDrawingPreview, UndefinedOptionFlag, MagickFalse },
1569     { "Despeckle", DespecklePreview, UndefinedOptionFlag, MagickFalse },
1570     { "Dull", DullPreview, UndefinedOptionFlag, MagickFalse },
1571     { "EdgeDetect", EdgeDetectPreview, UndefinedOptionFlag, MagickFalse },
1572     { "Gamma", GammaPreview, UndefinedOptionFlag, MagickFalse },
1573     { "Grayscale", GrayscalePreview, UndefinedOptionFlag, MagickFalse },
1574     { "Hue", HuePreview, UndefinedOptionFlag, MagickFalse },
1575     { "Implode", ImplodePreview, UndefinedOptionFlag, MagickFalse },
1576     { "JPEG", JPEGPreview, UndefinedOptionFlag, MagickFalse },
1577     { "OilPaint", OilPaintPreview, UndefinedOptionFlag, MagickFalse },
1578     { "Quantize", QuantizePreview, UndefinedOptionFlag, MagickFalse },
1579     { "Raise", RaisePreview, UndefinedOptionFlag, MagickFalse },
1580     { "ReduceNoise", ReduceNoisePreview, UndefinedOptionFlag, MagickFalse },
1581     { "Roll", RollPreview, UndefinedOptionFlag, MagickFalse },
1582     { "Rotate", RotatePreview, UndefinedOptionFlag, MagickFalse },
1583     { "Saturation", SaturationPreview, UndefinedOptionFlag, MagickFalse },
1584     { "Segment", SegmentPreview, UndefinedOptionFlag, MagickFalse },
1585     { "Shade", ShadePreview, UndefinedOptionFlag, MagickFalse },
1586     { "Sharpen", SharpenPreview, UndefinedOptionFlag, MagickFalse },
1587     { "Shear", ShearPreview, UndefinedOptionFlag, MagickFalse },
1588     { "Solarize", SolarizePreview, UndefinedOptionFlag, MagickFalse },
1589     { "Spiff", SpiffPreview, UndefinedOptionFlag, MagickFalse },
1590     { "Spread", SpreadPreview, UndefinedOptionFlag, MagickFalse },
1591     { "Swirl", SwirlPreview, UndefinedOptionFlag, MagickFalse },
1592     { "Threshold", ThresholdPreview, UndefinedOptionFlag, MagickFalse },
1593     { "Wave", WavePreview, UndefinedOptionFlag, MagickFalse },
1594     { (char *) NULL, UndefinedPreview, UndefinedOptionFlag, MagickFalse }
1595   },
1596   PrimitiveOptions[] =
1597   {
1598     { "Undefined", UndefinedPrimitive, UndefinedOptionFlag, MagickTrue },
1599     { "Alpha", AlphaPrimitive, UndefinedOptionFlag, MagickFalse },
1600     { "Arc", ArcPrimitive, UndefinedOptionFlag, MagickFalse },
1601     { "Bezier", BezierPrimitive, UndefinedOptionFlag, MagickFalse },
1602     { "Circle", CirclePrimitive, UndefinedOptionFlag, MagickFalse },
1603     { "Color", ColorPrimitive, UndefinedOptionFlag, MagickFalse },
1604     { "Ellipse", EllipsePrimitive, UndefinedOptionFlag, MagickFalse },
1605     { "Image", ImagePrimitive, UndefinedOptionFlag, MagickFalse },
1606     { "Line", LinePrimitive, UndefinedOptionFlag, MagickFalse },
1607     { "Matte", AlphaPrimitive, UndefinedOptionFlag, MagickFalse },
1608     { "Path", PathPrimitive, UndefinedOptionFlag, MagickFalse },
1609     { "Point", PointPrimitive, UndefinedOptionFlag, MagickFalse },
1610     { "Polygon", PolygonPrimitive, UndefinedOptionFlag, MagickFalse },
1611     { "Polyline", PolylinePrimitive, UndefinedOptionFlag, MagickFalse },
1612     { "Rectangle", RectanglePrimitive, UndefinedOptionFlag, MagickFalse },
1613     { "RoundRectangle", RoundRectanglePrimitive, UndefinedOptionFlag, MagickFalse },
1614     { "Text", TextPrimitive, UndefinedOptionFlag, MagickFalse },
1615     { (char *) NULL, UndefinedPrimitive, UndefinedOptionFlag, MagickFalse }
1616   },
1617   QuantumFormatOptions[] =
1618   {
1619     { "Undefined", UndefinedQuantumFormat, UndefinedOptionFlag, MagickTrue },
1620     { "FloatingPoint", FloatingPointQuantumFormat, UndefinedOptionFlag, MagickFalse },
1621     { "Signed", SignedQuantumFormat, UndefinedOptionFlag, MagickFalse },
1622     { "Unsigned", UnsignedQuantumFormat, UndefinedOptionFlag, MagickFalse },
1623     { (char *) NULL, FloatingPointQuantumFormat, UndefinedOptionFlag, MagickFalse }
1624   },
1625   ResolutionOptions[] =
1626   {
1627     { "Undefined", UndefinedResolution, UndefinedOptionFlag, MagickTrue },
1628     { "PixelsPerInch", PixelsPerInchResolution, UndefinedOptionFlag, MagickFalse },
1629     { "PixelsPerCentimeter", PixelsPerCentimeterResolution, UndefinedOptionFlag, MagickFalse },
1630     { (char *) NULL, UndefinedResolution, UndefinedOptionFlag, MagickFalse }
1631   },
1632   ResourceOptions[] =
1633   {
1634     { "Undefined", UndefinedResource, UndefinedOptionFlag, MagickTrue },
1635     { "Area", AreaResource, UndefinedOptionFlag, MagickFalse },
1636     { "Disk", DiskResource, UndefinedOptionFlag, MagickFalse },
1637     { "File", FileResource, UndefinedOptionFlag, MagickFalse },
1638     { "Height", HeightResource, UndefinedOptionFlag, MagickFalse },
1639     { "Map", MapResource, UndefinedOptionFlag, MagickFalse },
1640     { "Memory", MemoryResource, UndefinedOptionFlag, MagickFalse },
1641     { "Thread", ThreadResource, UndefinedOptionFlag, MagickFalse },
1642     { "Time", TimeResource, UndefinedOptionFlag, MagickFalse },
1643     { "Width", WidthResource, UndefinedOptionFlag, MagickFalse },
1644     { (char *) NULL, UndefinedResource, UndefinedOptionFlag, MagickFalse }
1645   },
1646   SparseColorOptions[] =
1647   {
1648     { "Undefined", UndefinedDistortion, UndefinedOptionFlag, MagickTrue },
1649     { "Barycentric", BarycentricColorInterpolate, UndefinedOptionFlag, MagickFalse },
1650     { "Bilinear", BilinearColorInterpolate, UndefinedOptionFlag, MagickFalse },
1651     { "Inverse", InverseColorInterpolate, UndefinedOptionFlag, MagickFalse },
1652     { "Shepards", ShepardsColorInterpolate, UndefinedOptionFlag, MagickFalse },
1653     { "Voronoi", VoronoiColorInterpolate, UndefinedOptionFlag, MagickFalse },
1654     { "Manhattan", ManhattanColorInterpolate, UndefinedOptionFlag, MagickFalse },
1655     { (char *) NULL, UndefinedResource, UndefinedOptionFlag, MagickFalse }
1656   },
1657   StatisticOptions[] =
1658   {
1659     { "Undefined", UndefinedStatistic, UndefinedOptionFlag, MagickTrue },
1660     { "Gradient", GradientStatistic, UndefinedOptionFlag, MagickFalse },
1661     { "Maximum", MaximumStatistic, UndefinedOptionFlag, MagickFalse },
1662     { "Mean", MeanStatistic, UndefinedOptionFlag, MagickFalse },
1663     { "Median", MedianStatistic, UndefinedOptionFlag, MagickFalse },
1664     { "Minimum", MinimumStatistic, UndefinedOptionFlag, MagickFalse },
1665     { "Mode", ModeStatistic, UndefinedOptionFlag, MagickFalse },
1666     { "NonPeak", NonpeakStatistic, UndefinedOptionFlag, MagickFalse },
1667     { "RootMeanSquare", RootMeanSquareStatistic, UndefinedOptionFlag, MagickFalse },
1668     { "RMS", RootMeanSquareStatistic, UndefinedOptionFlag, MagickFalse },
1669     { "StandardDeviation", StandardDeviationStatistic, UndefinedOptionFlag, MagickFalse },
1670     { (char *) NULL, UndefinedMethod, UndefinedOptionFlag, MagickFalse }
1671   },
1672   StorageOptions[] =
1673   {
1674     { "Undefined", UndefinedPixel, UndefinedOptionFlag, MagickTrue },
1675     { "Char", CharPixel, UndefinedOptionFlag, MagickFalse },
1676     { "Double", DoublePixel, UndefinedOptionFlag, MagickFalse },
1677     { "Float", FloatPixel, UndefinedOptionFlag, MagickFalse },
1678     { "Long", LongPixel, UndefinedOptionFlag, MagickFalse },
1679     { "LongLong", LongLongPixel, UndefinedOptionFlag, MagickFalse },
1680     { "Quantum", QuantumPixel, UndefinedOptionFlag, MagickFalse },
1681     { "Short", ShortPixel, UndefinedOptionFlag, MagickFalse },
1682     { (char *) NULL, UndefinedResource, UndefinedOptionFlag, MagickFalse }
1683   },
1684   StretchOptions[] =
1685   {
1686     { "Undefined", UndefinedStretch, UndefinedOptionFlag, MagickTrue },
1687     { "Any", AnyStretch, UndefinedOptionFlag, MagickFalse },
1688     { "Condensed", CondensedStretch, UndefinedOptionFlag, MagickFalse },
1689     { "Expanded", ExpandedStretch, UndefinedOptionFlag, MagickFalse },
1690     { "ExtraCondensed", ExtraCondensedStretch, UndefinedOptionFlag, MagickFalse },
1691     { "ExtraExpanded", ExtraExpandedStretch, UndefinedOptionFlag, MagickFalse },
1692     { "Normal", NormalStretch, UndefinedOptionFlag, MagickFalse },
1693     { "SemiCondensed", SemiCondensedStretch, UndefinedOptionFlag, MagickFalse },
1694     { "SemiExpanded", SemiExpandedStretch, UndefinedOptionFlag, MagickFalse },
1695     { "UltraCondensed", UltraCondensedStretch, UndefinedOptionFlag, MagickFalse },
1696     { "UltraExpanded", UltraExpandedStretch, UndefinedOptionFlag, MagickFalse },
1697     { (char *) NULL, UndefinedStretch, UndefinedOptionFlag, MagickFalse }
1698   },
1699   StyleOptions[] =
1700   {
1701     { "Undefined", UndefinedStyle, UndefinedOptionFlag, MagickTrue },
1702     { "Any", AnyStyle, UndefinedOptionFlag, MagickFalse },
1703     { "Italic", ItalicStyle, UndefinedOptionFlag, MagickFalse },
1704     { "Normal", NormalStyle, UndefinedOptionFlag, MagickFalse },
1705     { "Oblique", ObliqueStyle, UndefinedOptionFlag, MagickFalse },
1706     { (char *) NULL, UndefinedStyle, UndefinedOptionFlag, MagickFalse }
1707   },
1708   TypeOptions[] =
1709   {
1710     { "Undefined", UndefinedType, UndefinedOptionFlag, MagickTrue },
1711     { "Bilevel", BilevelType, UndefinedOptionFlag, MagickFalse },
1712     { "ColorSeparation", ColorSeparationType, UndefinedOptionFlag, MagickFalse },
1713     { "ColorSeparationAlpha", ColorSeparationAlphaType, UndefinedOptionFlag, MagickFalse },
1714     { "ColorSeparationMatte", ColorSeparationAlphaType, UndefinedOptionFlag, MagickFalse },
1715     { "Grayscale", GrayscaleType, UndefinedOptionFlag, MagickFalse },
1716     { "GrayscaleAlpha", GrayscaleAlphaType, UndefinedOptionFlag, MagickFalse },
1717     { "GrayscaleMatte", GrayscaleAlphaType, UndefinedOptionFlag, MagickFalse },
1718     { "Optimize", OptimizeType, UndefinedOptionFlag, MagickFalse },
1719     { "Palette", PaletteType, UndefinedOptionFlag, MagickFalse },
1720     { "PaletteBilevelAlpha", PaletteBilevelAlphaType, UndefinedOptionFlag, MagickFalse },
1721     { "PaletteBilevelMatte", PaletteBilevelAlphaType, UndefinedOptionFlag, MagickFalse },
1722     { "PaletteAlpha", PaletteAlphaType, UndefinedOptionFlag, MagickFalse },
1723     { "PaletteMatte", PaletteAlphaType, UndefinedOptionFlag, MagickFalse },
1724     { "TrueColorAlpha", TrueColorAlphaType, UndefinedOptionFlag, MagickFalse },
1725     { "TrueColorMatte", TrueColorAlphaType, UndefinedOptionFlag, MagickFalse },
1726     { "TrueColor", TrueColorType, UndefinedOptionFlag, MagickFalse },
1727     { (char *) NULL, UndefinedType, UndefinedOptionFlag, MagickFalse }
1728   },
1729   ValidateOptions[] =
1730   {
1731     { "Undefined", UndefinedValidate, UndefinedOptionFlag, MagickTrue },
1732     { "All", AllValidate, UndefinedOptionFlag, MagickFalse },
1733     { "Colorspace", ColorspaceValidate, UndefinedOptionFlag, MagickFalse },
1734     { "Compare", CompareValidate, UndefinedOptionFlag, MagickFalse },
1735     { "Composite", CompositeValidate, UndefinedOptionFlag, MagickFalse },
1736     { "Convert", ConvertValidate, UndefinedOptionFlag, MagickFalse },
1737     { "FormatsDisk", FormatsDiskValidate, UndefinedOptionFlag, MagickFalse },
1738     { "FormatsMap", FormatsMapValidate, UndefinedOptionFlag, MagickFalse },
1739     { "FormatsMemory", FormatsMemoryValidate, UndefinedOptionFlag, MagickFalse },
1740     { "Identify", IdentifyValidate, UndefinedOptionFlag, MagickFalse },
1741     { "ImportExport", ImportExportValidate, UndefinedOptionFlag, MagickFalse },
1742     { "Montage", MontageValidate, UndefinedOptionFlag, MagickFalse },
1743     { "Stream", StreamValidate, UndefinedOptionFlag, MagickFalse },
1744     { "None", NoValidate, UndefinedOptionFlag, MagickFalse },
1745     { (char *) NULL, UndefinedValidate, UndefinedOptionFlag, MagickFalse }
1746   },
1747   VirtualPixelOptions[] =
1748   {
1749     { "Undefined", UndefinedVirtualPixelMethod, UndefinedOptionFlag, MagickTrue },
1750     { "Background", BackgroundVirtualPixelMethod, UndefinedOptionFlag, MagickFalse },
1751     { "Black", BlackVirtualPixelMethod, UndefinedOptionFlag, MagickFalse },
1752     { "Constant", BackgroundVirtualPixelMethod, DeprecateOptionFlag, MagickTrue },
1753     { "CheckerTile", CheckerTileVirtualPixelMethod, UndefinedOptionFlag, MagickFalse },
1754     { "Dither", DitherVirtualPixelMethod, UndefinedOptionFlag, MagickFalse },
1755     { "Edge", EdgeVirtualPixelMethod, UndefinedOptionFlag, MagickFalse },
1756     { "Gray", GrayVirtualPixelMethod, UndefinedOptionFlag, MagickFalse },
1757     { "HorizontalTile", HorizontalTileVirtualPixelMethod, UndefinedOptionFlag, MagickFalse },
1758     { "HorizontalTileEdge", HorizontalTileEdgeVirtualPixelMethod, UndefinedOptionFlag, MagickFalse },
1759     { "Mirror", MirrorVirtualPixelMethod, UndefinedOptionFlag, MagickFalse },
1760     { "None", TransparentVirtualPixelMethod, UndefinedOptionFlag, MagickFalse },
1761     { "Random", RandomVirtualPixelMethod, UndefinedOptionFlag, MagickFalse },
1762     { "Tile", TileVirtualPixelMethod, UndefinedOptionFlag, MagickFalse },
1763     { "Transparent", TransparentVirtualPixelMethod, UndefinedOptionFlag, MagickFalse },
1764     { "VerticalTile", VerticalTileVirtualPixelMethod, UndefinedOptionFlag, MagickFalse },
1765     { "VerticalTileEdge", VerticalTileEdgeVirtualPixelMethod, UndefinedOptionFlag, MagickFalse },
1766     { "White", WhiteVirtualPixelMethod, UndefinedOptionFlag, MagickFalse },
1767     { (char *) NULL, UndefinedVirtualPixelMethod, UndefinedOptionFlag, MagickFalse }
1768   },
1769   WeightOptions[] =
1770   {
1771     { "Undefined", 0L, UndefinedOptionFlag, MagickTrue },
1772     { "Thin", 100L, UndefinedOptionFlag, MagickFalse },
1773     { "ExtraLight", 200L, UndefinedOptionFlag, MagickFalse },
1774     { "UltraLight", 200L, UndefinedOptionFlag, MagickFalse },
1775     { "Light", 300L, DeprecateOptionFlag, MagickTrue },
1776     { "Normal", 400L, UndefinedOptionFlag, MagickFalse },
1777     { "Regular", 400L, UndefinedOptionFlag, MagickFalse },
1778     { "Medium", 500L, UndefinedOptionFlag, MagickFalse },
1779     { "DemiBold", 600L, UndefinedOptionFlag, MagickFalse },
1780     { "SemiBold", 600L, UndefinedOptionFlag, MagickFalse },
1781     { "Bold", 700L, UndefinedOptionFlag, MagickFalse },
1782     { "ExtraBold", 800L, UndefinedOptionFlag, MagickFalse },
1783     { "UltraBold", 800L, UndefinedOptionFlag, MagickFalse },
1784     { "Heavy", 900L, UndefinedOptionFlag, MagickFalse },
1785     { "Black", 900L, UndefinedOptionFlag, MagickFalse },
1786     { (char *) NULL, 0L, UndefinedOptionFlag, MagickFalse }
1787   };
1788 
1789 /*
1790 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1791 %                                                                             %
1792 %                                                                             %
1793 %                                                                             %
1794 %   C l o n e I m a g e O p t i o n s                                         %
1795 %                                                                             %
1796 %                                                                             %
1797 %                                                                             %
1798 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1799 %
1800 %  CloneImageOptions() clones all global image options, to another image_info
1801 %
1802 %  The format of the CloneImageOptions method is:
1803 %
1804 %      MagickBooleanType CloneImageOptions(ImageInfo *image_info,
1805 %        const ImageInfo *clone_info)
1806 %
1807 %  A description of each parameter follows:
1808 %
1809 %    o image_info: the image info to recieve the cloned options.
1810 %
1811 %    o clone_info: the source image info for options to clone.
1812 %
1813 */
CloneImageOptions(ImageInfo * image_info,const ImageInfo * clone_info)1814 MagickExport MagickBooleanType CloneImageOptions(ImageInfo *image_info,
1815   const ImageInfo *clone_info)
1816 {
1817   assert(image_info != (ImageInfo *) NULL);
1818   assert(image_info->signature == MagickCoreSignature);
1819   if (image_info->debug != MagickFalse)
1820     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
1821       image_info->filename);
1822   assert(clone_info != (const ImageInfo *) NULL);
1823   assert(clone_info->signature == MagickCoreSignature);
1824   if (clone_info->options != (void *) NULL)
1825     {
1826       if (image_info->options != (void *) NULL)
1827         DestroyImageOptions(image_info);
1828       image_info->options=CloneSplayTree((SplayTreeInfo *) clone_info->options,
1829         (void *(*)(void *)) ConstantString,(void *(*)(void *)) ConstantString);
1830     }
1831   return(MagickTrue);
1832 }
1833 
1834 /*
1835 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1836 %                                                                             %
1837 %                                                                             %
1838 %                                                                             %
1839 %   D e f i n e I m a g e O p t i o n                                         %
1840 %                                                                             %
1841 %                                                                             %
1842 %                                                                             %
1843 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1844 %
1845 %  DefineImageOption() associates an assignment string of the form
1846 %  "key=value" with a global image option. It is equivelent to
1847 %  SetImageOption().
1848 %
1849 %  The format of the DefineImageOption method is:
1850 %
1851 %      MagickBooleanType DefineImageOption(ImageInfo *image_info,
1852 %        const char *option)
1853 %
1854 %  A description of each parameter follows:
1855 %
1856 %    o image_info: the image info.
1857 %
1858 %    o option: the image option assignment string.
1859 %
1860 */
DefineImageOption(ImageInfo * image_info,const char * option)1861 MagickExport MagickBooleanType DefineImageOption(ImageInfo *image_info,
1862   const char *option)
1863 {
1864   char
1865     key[MagickPathExtent],
1866     value[MagickPathExtent];
1867 
1868   register char
1869     *p;
1870 
1871   assert(image_info != (ImageInfo *) NULL);
1872   assert(option != (const char *) NULL);
1873   (void) CopyMagickString(key,option,MagickPathExtent);
1874   for (p=key; *p != '\0'; p++)
1875     if (*p == '=')
1876       break;
1877   *value='\0';
1878   if (*p == '=')
1879     (void) CopyMagickString(value,p+1,MagickPathExtent);
1880   *p='\0';
1881   return(SetImageOption(image_info,key,value));
1882 }
1883 
1884 /*
1885 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1886 %                                                                             %
1887 %                                                                             %
1888 %                                                                             %
1889 %   D e l e t e I m a g e O p t i o n                                         %
1890 %                                                                             %
1891 %                                                                             %
1892 %                                                                             %
1893 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1894 %
1895 %  DeleteImageOption() deletes an key from the global image options.
1896 %
1897 %  Returns MagickTrue is the option is found and deleted from the Options.
1898 %
1899 %  The format of the DeleteImageOption method is:
1900 %
1901 %      MagickBooleanType DeleteImageOption(ImageInfo *image_info,
1902 %        const char *key)
1903 %
1904 %  A description of each parameter follows:
1905 %
1906 %    o image_info: the image info.
1907 %
1908 %    o option: the image option.
1909 %
1910 */
DeleteImageOption(ImageInfo * image_info,const char * option)1911 MagickExport MagickBooleanType DeleteImageOption(ImageInfo *image_info,
1912   const char *option)
1913 {
1914   assert(image_info != (ImageInfo *) NULL);
1915   assert(image_info->signature == MagickCoreSignature);
1916   if (image_info->debug != MagickFalse)
1917     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
1918       image_info->filename);
1919   if (image_info->options == (void *) NULL)
1920     return(MagickFalse);
1921   return(DeleteNodeFromSplayTree((SplayTreeInfo *) image_info->options,option));
1922 }
1923 
1924 /*
1925 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1926 %                                                                             %
1927 %                                                                             %
1928 %                                                                             %
1929 %   D e s t r o y I m a g e O p t i o n s                                     %
1930 %                                                                             %
1931 %                                                                             %
1932 %                                                                             %
1933 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1934 %
1935 %  DestroyImageOptions() destroys all global options and associated memory
1936 %  attached to the given image_info image list.
1937 %
1938 %  The format of the DestroyDefines method is:
1939 %
1940 %      void DestroyImageOptions(ImageInfo *image_info)
1941 %
1942 %  A description of each parameter follows:
1943 %
1944 %    o image_info: the image info.
1945 %
1946 */
DestroyImageOptions(ImageInfo * image_info)1947 MagickExport void DestroyImageOptions(ImageInfo *image_info)
1948 {
1949   assert(image_info != (ImageInfo *) NULL);
1950   assert(image_info->signature == MagickCoreSignature);
1951   if (image_info->debug != MagickFalse)
1952     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
1953       image_info->filename);
1954   if (image_info->options != (void *) NULL)
1955     image_info->options=DestroySplayTree((SplayTreeInfo *) image_info->options);
1956 }
1957 
1958 /*
1959 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1960 %                                                                             %
1961 %                                                                             %
1962 %                                                                             %
1963 %   G e t I m a g e O p t i o n                                               %
1964 %                                                                             %
1965 %                                                                             %
1966 %                                                                             %
1967 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1968 %
1969 %  GetImageOption() gets a value associated with the global image options.
1970 %
1971 %  The returned string is a constant string in the tree and should NOT be
1972 %  freed by the caller.
1973 %
1974 %  The format of the GetImageOption method is:
1975 %
1976 %      const char *GetImageOption(const ImageInfo *image_info,
1977 %        const char *option)
1978 %
1979 %  A description of each parameter follows:
1980 %
1981 %    o image_info: the image info.
1982 %
1983 %    o option: the option.
1984 %
1985 */
GetImageOption(const ImageInfo * image_info,const char * option)1986 MagickExport const char *GetImageOption(const ImageInfo *image_info,
1987   const char *option)
1988 {
1989   assert(image_info != (ImageInfo *) NULL);
1990   assert(image_info->signature == MagickCoreSignature);
1991   if (image_info->debug != MagickFalse)
1992     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
1993       image_info->filename);
1994   if (image_info->options == (void *) NULL)
1995     return((const char *) NULL);
1996   return((const char *) GetValueFromSplayTree((SplayTreeInfo *)
1997     image_info->options,option));
1998 }
1999 
2000 /*
2001 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2002 %                                                                             %
2003 %                                                                             %
2004 %                                                                             %
2005 %   G e t C o m m a n d O p t i o n F l a g s                                 %
2006 %                                                                             %
2007 %                                                                             %
2008 %                                                                             %
2009 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2010 %
2011 %  GetCommandOptionFlags() parses a string and returns an enumerated option
2012 %  flags(s).  Return a value of -1 if no such option is found.
2013 %
2014 %  The format of the GetCommandOptionFlags method is:
2015 %
2016 %      ssize_t GetCommandOptionFlags(const CommandOption option,
2017 %        const MagickBooleanType list,const char *options)
2018 %
2019 %  A description of each parameter follows:
2020 %
2021 %    o option: Index to the option table to lookup
2022 %
2023 %    o list: A option other than zero permits more than one option separated by
2024 %      a comma or pipe.
2025 %
2026 %    o options: One or more options separated by commas.
2027 %
2028 */
2029 
GetOptionInfo(const CommandOption option)2030 static const OptionInfo *GetOptionInfo(const CommandOption option)
2031 {
2032   switch (option)
2033   {
2034     case MagickAlignOptions: return(AlignOptions);
2035     case MagickAlphaChannelOptions: return(AlphaChannelOptions);
2036     case MagickBooleanOptions: return(BooleanOptions);
2037     case MagickCacheOptions: return(CacheOptions);
2038     case MagickChannelOptions: return(ChannelOptions);
2039     case MagickClassOptions: return(ClassOptions);
2040     case MagickClipPathOptions: return(ClipPathOptions);
2041     case MagickColorspaceOptions: return(ColorspaceOptions);
2042     case MagickCommandOptions: return(CommandOptions);
2043     case MagickComplianceOptions: return(ComplianceOptions);
2044     case MagickComplexOptions: return(ComplexOptions);
2045     case MagickComposeOptions: return(ComposeOptions);
2046     case MagickCompressOptions: return(CompressOptions);
2047     case MagickDataTypeOptions: return(DataTypeOptions);
2048     case MagickDebugOptions: return(LogEventOptions);
2049     case MagickDecorateOptions: return(DecorateOptions);
2050     case MagickDirectionOptions: return(DirectionOptions);
2051     case MagickDisposeOptions: return(DisposeOptions);
2052     case MagickDistortOptions: return(DistortOptions);
2053     case MagickDitherOptions: return(DitherOptions);
2054     case MagickEndianOptions: return(EndianOptions);
2055     case MagickEvaluateOptions: return(EvaluateOptions);
2056     case MagickFillRuleOptions: return(FillRuleOptions);
2057     case MagickFilterOptions: return(FilterOptions);
2058     case MagickFunctionOptions: return(FunctionOptions);
2059     case MagickGradientOptions: return(GradientOptions);
2060     case MagickGravityOptions: return(GravityOptions);
2061     case MagickIntentOptions: return(IntentOptions);
2062     case MagickInterlaceOptions: return(InterlaceOptions);
2063     case MagickInterpolateOptions: return(InterpolateOptions);
2064     case MagickKernelOptions: return(KernelOptions);
2065     case MagickLayerOptions: return(LayerOptions);
2066     case MagickLineCapOptions: return(LineCapOptions);
2067     case MagickLineJoinOptions: return(LineJoinOptions);
2068     case MagickListOptions: return(ListOptions);
2069     case MagickLogEventOptions: return(LogEventOptions);
2070     case MagickMetricOptions: return(MetricOptions);
2071     case MagickMethodOptions: return(MethodOptions);
2072     case MagickModeOptions: return(ModeOptions);
2073     case MagickMorphologyOptions: return(MorphologyOptions);
2074     case MagickNoiseOptions: return(NoiseOptions);
2075     case MagickOrientationOptions: return(OrientationOptions);
2076     case MagickPixelChannelOptions: return(PixelChannelOptions);
2077     case MagickPixelIntensityOptions: return(PixelIntensityOptions);
2078     case MagickPixelMaskOptions: return(PixelMaskOptions);
2079     case MagickPixelTraitOptions: return(PixelTraitOptions);
2080     case MagickPolicyDomainOptions: return(PolicyDomainOptions);
2081     case MagickPolicyRightsOptions: return(PolicyRightsOptions);
2082     case MagickPreviewOptions: return(PreviewOptions);
2083     case MagickPrimitiveOptions: return(PrimitiveOptions);
2084     case MagickQuantumFormatOptions: return(QuantumFormatOptions);
2085     case MagickResolutionOptions: return(ResolutionOptions);
2086     case MagickResourceOptions: return(ResourceOptions);
2087     case MagickSparseColorOptions: return(SparseColorOptions);
2088     case MagickStatisticOptions: return(StatisticOptions);
2089     case MagickStorageOptions: return(StorageOptions);
2090     case MagickStretchOptions: return(StretchOptions);
2091     case MagickStyleOptions: return(StyleOptions);
2092     case MagickTypeOptions: return(TypeOptions);
2093     case MagickValidateOptions: return(ValidateOptions);
2094     case MagickVirtualPixelOptions: return(VirtualPixelOptions);
2095     case MagickWeightOptions: return(WeightOptions);
2096     default: break;
2097   }
2098   return((const OptionInfo *) NULL);
2099 }
2100 
GetCommandOptionFlags(const CommandOption option,const MagickBooleanType list,const char * options)2101 MagickExport ssize_t GetCommandOptionFlags(const CommandOption option,
2102   const MagickBooleanType list,const char *options)
2103 {
2104   char
2105     token[MagickPathExtent];
2106 
2107   const OptionInfo
2108     *command_info,
2109     *option_info;
2110 
2111   int
2112     sentinel;
2113 
2114   MagickBooleanType
2115     negate;
2116 
2117   register char
2118     *q;
2119 
2120   register const char
2121     *p;
2122 
2123   register ssize_t
2124     i;
2125 
2126   ssize_t
2127     option_types;
2128 
2129   option_info=GetOptionInfo(option);
2130   if (option_info == (const OptionInfo *) NULL)
2131     return(UndefinedOptionFlag);
2132   option_types=0;
2133   sentinel=',';
2134   if (strchr(options,'|') != (char *) NULL)
2135     sentinel='|';
2136   for (p=options; p != (char *) NULL; p=strchr(p,sentinel))
2137   {
2138     while (((isspace((int) ((unsigned char) *p)) != 0) || (*p == sentinel)) &&
2139            (*p != '\0'))
2140       p++;
2141     negate=(*p == '!') ? MagickTrue : MagickFalse;
2142     if (negate != MagickFalse)
2143       p++;
2144     q=token;
2145     while (((isspace((int) ((unsigned char) *p)) == 0) && (*p != sentinel)) &&
2146            (*p != '\0'))
2147     {
2148       if ((q-token) >= (MagickPathExtent-1))
2149         break;
2150       *q++=(*p++);
2151     }
2152     *q='\0';
2153     for (i=0; option_info[i].mnemonic != (char *) NULL; i++)
2154       if (LocaleCompare(token,option_info[i].mnemonic) == 0)
2155         break;
2156     command_info=option_info+i;
2157     if ((command_info->mnemonic == (const char *) NULL) &&
2158         ((strchr(token+1,'-') != (char *) NULL) ||
2159          (strchr(token+1,'_') != (char *) NULL)))
2160       {
2161         while ((q=strchr(token+1,'-')) != (char *) NULL)
2162           (void) CopyMagickString(q,q+1,MagickPathExtent-strlen(q));
2163         while ((q=strchr(token+1,'_')) != (char *) NULL)
2164           (void) CopyMagickString(q,q+1,MagickPathExtent-strlen(q));
2165         for (i=0; option_info[i].mnemonic != (char *) NULL; i++)
2166           if (LocaleCompare(token,option_info[i].mnemonic) == 0)
2167             break;
2168         command_info=option_info+i;
2169       }
2170     if (command_info->mnemonic == (const char *) NULL)
2171       return(-1);
2172     if (negate != MagickFalse)
2173       option_types=option_types &~ command_info->flags;
2174     else
2175       option_types=option_types | command_info->flags;
2176     if (list == MagickFalse)
2177       break;
2178   }
2179   return(option_types);
2180 }
2181 
2182 /*
2183 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2184 %                                                                             %
2185 %                                                                             %
2186 %                                                                             %
2187 %   G e t C o m m a n d O p t i o n I n f o                                   %
2188 %                                                                             %
2189 %                                                                             %
2190 %                                                                             %
2191 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2192 %
2193 %  GetCommandOptionInfo() returns a pointer to the matching OptionInfo entry
2194 %  for the "CommandOptions" table.  It returns both the type (argument count)
2195 %  and flags (argument type).
2196 %
2197 %  The format of the GetCommandOptionInfo method is:
2198 %
2199 %      const char **GetCommandOptionInfo(const char *option)
2200 %
2201 %  A description of each parameter follows:
2202 %
2203 %    o option: the option.
2204 %
2205 */
GetCommandOptionInfo(const char * option)2206 MagickExport const OptionInfo *GetCommandOptionInfo(const char *option)
2207 {
2208   register ssize_t
2209     i;
2210 
2211   for (i=0; CommandOptions[i].mnemonic != (char *) NULL; i++)
2212     if (LocaleCompare(option,CommandOptions[i].mnemonic) == 0)
2213       break;
2214   return(CommandOptions+i);
2215 }
2216 
2217 /*
2218 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2219 %                                                                             %
2220 %                                                                             %
2221 %                                                                             %
2222 %   G e t C o m m a n d O p t i o n s                                         %
2223 %                                                                             %
2224 %                                                                             %
2225 %                                                                             %
2226 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2227 %
2228 %  GetCommandOptions() returns a list of command options.
2229 %
2230 %  The format of the GetCommandOptions method is:
2231 %
2232 %      const char **GetCommandOptions(const CommandOption option)
2233 %
2234 %  A description of each parameter follows:
2235 %
2236 %    o option: the option.
2237 %
2238 */
GetCommandOptions(const CommandOption option)2239 MagickExport char **GetCommandOptions(const CommandOption option)
2240 {
2241   char
2242     **options;
2243 
2244   const OptionInfo
2245     *option_info;
2246 
2247   register ssize_t
2248     i;
2249 
2250   option_info=GetOptionInfo(option);
2251   if (option_info == (const OptionInfo *) NULL)
2252     return((char **) NULL);
2253   for (i=0; option_info[i].mnemonic != (const char *) NULL; i++) ;
2254   options=(char **) AcquireQuantumMemory((size_t) i+1UL,sizeof(*options));
2255   if (options == (char **) NULL)
2256     ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
2257   for (i=0; option_info[i].mnemonic != (const char *) NULL; i++)
2258     options[i]=AcquireString(option_info[i].mnemonic);
2259   options[i]=(char *) NULL;
2260   return(options);
2261 }
2262 
2263 /*
2264 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2265 %                                                                             %
2266 %                                                                             %
2267 %                                                                             %
2268 %   G e t N e x t I m a g e O p t i o n                                       %
2269 %                                                                             %
2270 %                                                                             %
2271 %                                                                             %
2272 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2273 %
2274 %  GetNextImageOption() gets the next global option value.
2275 %
2276 %  The format of the GetNextImageOption method is:
2277 %
2278 %      char *GetNextImageOption(const ImageInfo *image_info)
2279 %
2280 %  A description of each parameter follows:
2281 %
2282 %    o image_info: the image info.
2283 %
2284 */
GetNextImageOption(const ImageInfo * image_info)2285 MagickExport char *GetNextImageOption(const ImageInfo *image_info)
2286 {
2287   assert(image_info != (ImageInfo *) NULL);
2288   assert(image_info->signature == MagickCoreSignature);
2289   if (image_info->debug != MagickFalse)
2290     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
2291       image_info->filename);
2292   if (image_info->options == (void *) NULL)
2293     return((char *) NULL);
2294   return((char *) GetNextKeyInSplayTree((SplayTreeInfo *) image_info->options));
2295 }
2296 
2297 /*
2298 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2299 %                                                                             %
2300 %                                                                             %
2301 %                                                                             %
2302 %     I s C o m m a n d O p t i o n                                           %
2303 %                                                                             %
2304 %                                                                             %
2305 %                                                                             %
2306 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2307 %
2308 %  IsCommandOption() returns MagickTrue if the option begins with a - or + and
2309 %  the first character that follows is alphanumeric.
2310 %
2311 %  The format of the IsCommandOption method is:
2312 %
2313 %      MagickBooleanType IsCommandOption(const char *option)
2314 %
2315 %  A description of each parameter follows:
2316 %
2317 %    o option: the option.
2318 %
2319 */
IsCommandOption(const char * option)2320 MagickExport MagickBooleanType IsCommandOption(const char *option)
2321 {
2322   assert(option != (const char *) NULL);
2323   if ((*option != '-') && (*option != '+'))
2324     return(MagickFalse);
2325   if (strlen(option) == 1)
2326     return(((*option == '{') || (*option == '}') || (*option == '[') ||
2327       (*option == ']')) ? MagickTrue : MagickFalse);
2328   option++;
2329   if (*option == '-')
2330     return(MagickTrue);
2331   if (isalpha((int) ((unsigned char) *option)) == 0)
2332     return(MagickFalse);
2333   return(MagickTrue);
2334 }
2335 
2336 /*
2337 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2338 %                                                                             %
2339 %                                                                             %
2340 %                                                                             %
2341 %   C o m m a n d O p t i o n T o M n e m o n i c                             %
2342 %                                                                             %
2343 %                                                                             %
2344 %                                                                             %
2345 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2346 %
2347 %  CommandOptionToMnemonic() returns an enumerated value as a mnemonic.
2348 %
2349 %  The format of the CommandOptionToMnemonic method is:
2350 %
2351 %      const char *CommandOptionToMnemonic(const CommandOption option,
2352 %        const ssize_t type)
2353 %
2354 %  A description of each parameter follows:
2355 %
2356 %    o option: the option.
2357 %
2358 %    o type: one or more values separated by commas.
2359 %
2360 */
CommandOptionToMnemonic(const CommandOption option,const ssize_t type)2361 MagickExport const char *CommandOptionToMnemonic(const CommandOption option,
2362   const ssize_t type)
2363 {
2364   const OptionInfo
2365     *option_info;
2366 
2367   register ssize_t
2368     i;
2369 
2370   option_info=GetOptionInfo(option);
2371   if (option_info == (const OptionInfo *) NULL)
2372     return((const char *) NULL);
2373   for (i=0; option_info[i].mnemonic != (const char *) NULL; i++)
2374     if (type == option_info[i].type)
2375       break;
2376   if (option_info[i].mnemonic == (const char *) NULL)
2377     return("Unrecognized");
2378   return(option_info[i].mnemonic);
2379 }
2380 
2381 /*
2382 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2383 %                                                                             %
2384 %                                                                             %
2385 %                                                                             %
2386 %   I s O p t i o n M e m b e r                                               %
2387 %                                                                             %
2388 %                                                                             %
2389 %                                                                             %
2390 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2391 %
2392 %  IsOptionMember() returns MagickTrue if the option is a member of the options
2393 %  list (e.g. ICC is a member of xmp,icc,iptc).
2394 %
2395 %  The format of the IsOptionMember function is:
2396 %
2397 %      MagickBooleanType IsOptionMember(const char *option,
2398 %        const char *options)
2399 %
2400 %  A description of each parameter follows:
2401 %
2402 %    o option: an option or option expression (e.g. ICC or *).
2403 %
2404 %    o options: one or more options separated by commas.
2405 %
2406 */
IsOptionMember(const char * option,const char * options)2407 MagickExport MagickBooleanType IsOptionMember(const char *option,
2408   const char *options)
2409 {
2410   char
2411     **option_list,
2412     *string;
2413 
2414   int
2415     number_options;
2416 
2417   MagickBooleanType
2418     member;
2419 
2420   register ssize_t
2421     i;
2422 
2423   /*
2424     Is option a member of the options list?
2425   */
2426   if (options == (const char *) NULL)
2427     return(MagickFalse);
2428   string=ConstantString(options);
2429   (void) SubstituteString(&string,","," ");
2430   option_list=StringToArgv(string,&number_options);
2431   string=DestroyString(string);
2432   if (option_list == (char **) NULL)
2433     return(MagickFalse);
2434   member=MagickFalse;
2435   option_list[0]=DestroyString(option_list[0]);
2436   for (i=1; i < (ssize_t) number_options; i++)
2437   {
2438     if ((*option_list[i] == '!') &&
2439         (LocaleCompare(option,option_list[i]+1) == 0))
2440       break;
2441     if (GlobExpression(option,option_list[i],MagickTrue) != MagickFalse)
2442       {
2443         member=MagickTrue;
2444         break;
2445       }
2446     option_list[i]=DestroyString(option_list[i]);
2447   }
2448   for ( ; i < (ssize_t) number_options; i++)
2449     option_list[i]=DestroyString(option_list[i]);
2450   option_list=(char **) RelinquishMagickMemory(option_list);
2451   return(member);
2452 }
2453 
2454 /*
2455 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2456 %                                                                             %
2457 %                                                                             %
2458 %                                                                             %
2459 %   L i s t C o m m a n d O p t i o n s                                       %
2460 %                                                                             %
2461 %                                                                             %
2462 %                                                                             %
2463 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2464 %
2465 %  ListCommandOptions() lists the contents of enumerated option type(s).
2466 %
2467 %  The format of the ListCommandOptions method is:
2468 %
2469 %      MagickBooleanType ListCommandOptions(FILE *file,
2470 %        const CommandOption option,ExceptionInfo *exception)
2471 %
2472 %  A description of each parameter follows:
2473 %
2474 %    o file:  list options to this file handle.
2475 %
2476 %    o option:  list these options.
2477 %
2478 %    o exception:  return any errors or warnings in this structure.
2479 %
2480 */
ListCommandOptions(FILE * file,const CommandOption option,ExceptionInfo * magick_unused (exception))2481 MagickExport MagickBooleanType ListCommandOptions(FILE *file,
2482   const CommandOption option,ExceptionInfo *magick_unused(exception))
2483 {
2484   const OptionInfo
2485     *option_info;
2486 
2487   register ssize_t
2488     i;
2489 
2490   if (file == (FILE *) NULL)
2491     file=stdout;
2492   option_info=GetOptionInfo(option);
2493   if (option_info == (const OptionInfo *) NULL)
2494     return(MagickFalse);
2495   for (i=0; option_info[i].mnemonic != (char *) NULL; i++)
2496   {
2497     if (option_info[i].stealth != MagickFalse)
2498       continue;
2499     (void) FormatLocaleFile(file,"%s\n",option_info[i].mnemonic);
2500   }
2501   return(MagickTrue);
2502 }
2503 
2504 /*
2505 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2506 %                                                                             %
2507 %                                                                             %
2508 %                                                                             %
2509 %   P a r s e C h a n n e l O p t i o n                                       %
2510 %                                                                             %
2511 %                                                                             %
2512 %                                                                             %
2513 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2514 %
2515 %  ParseChannelOption() parses a string and returns an enumerated channel
2516 %  type(s).
2517 %
2518 %  The format of the ParseChannelOption method is:
2519 %
2520 %      ssize_t ParseChannelOption(const char *channels)
2521 %
2522 %  A description of each parameter follows:
2523 %
2524 %    o options: One or more values separated by commas.
2525 %
2526 */
ParseChannelOption(const char * channels)2527 MagickExport ssize_t ParseChannelOption(const char *channels)
2528 {
2529   register ssize_t
2530     i;
2531 
2532   ssize_t
2533     channel;
2534 
2535   channel=ParseCommandOption(MagickChannelOptions,MagickTrue,channels);
2536   if (channel >= 0)
2537     return(channel);
2538   channel=0;
2539   for (i=0; i < (ssize_t) strlen(channels); i++)
2540   {
2541     switch (channels[i])
2542     {
2543       case 'A':
2544       case 'a':
2545       {
2546         channel|=AlphaChannel;
2547         break;
2548       }
2549       case 'B':
2550       case 'b':
2551       {
2552         channel|=BlueChannel;
2553         break;
2554       }
2555       case 'C':
2556       case 'c':
2557       {
2558         channel|=CyanChannel;
2559         break;
2560       }
2561       case 'g':
2562       case 'G':
2563       {
2564         channel|=GreenChannel;
2565         break;
2566       }
2567       case 'K':
2568       case 'k':
2569       {
2570         channel|=BlackChannel;
2571         break;
2572       }
2573       case 'M':
2574       case 'm':
2575       {
2576         channel|=MagentaChannel;
2577         break;
2578       }
2579       case 'o':
2580       case 'O':
2581       {
2582         channel|=AlphaChannel; /* depreciate */
2583         break;
2584       }
2585       case 'R':
2586       case 'r':
2587       {
2588         channel|=RedChannel;
2589         break;
2590       }
2591       case 'Y':
2592       case 'y':
2593       {
2594         channel|=YellowChannel;
2595         break;
2596       }
2597       case ',':
2598       {
2599         ssize_t
2600           type;
2601 
2602         /*
2603           Gather the additional channel flags and merge with shorthand.
2604         */
2605         type=ParseCommandOption(MagickChannelOptions,MagickTrue,channels+i+1);
2606         if (type < 0)
2607           return(type);
2608         channel|=type;
2609         return(channel);
2610       }
2611       default:
2612         return(-1);
2613     }
2614   }
2615   return(channel);
2616 }
2617 
2618 /*
2619 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2620 %                                                                             %
2621 %                                                                             %
2622 %                                                                             %
2623 %   P a r s e C o m m a n d O p t i o n                                       %
2624 %                                                                             %
2625 %                                                                             %
2626 %                                                                             %
2627 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2628 %
2629 %  ParseCommandOption() parses a string and returns an enumerated option
2630 %  type(s).  Return a value of -1 if no such option is found.
2631 %
2632 %  The format of the ParseCommandOption method is:
2633 %
2634 %      ssize_t ParseCommandOption(const CommandOption option,
2635 %        const MagickBooleanType list,const char *options)
2636 %
2637 %  A description of each parameter follows:
2638 %
2639 %    o option: Index to the option table to lookup
2640 %
2641 %    o list: A option other than zero permits more than one option separated by
2642 %      a comma or pipe.
2643 %
2644 %    o options: One or more options separated by commas.
2645 %
2646 */
ParseCommandOption(const CommandOption option,const MagickBooleanType list,const char * options)2647 MagickExport ssize_t ParseCommandOption(const CommandOption option,
2648   const MagickBooleanType list,const char *options)
2649 {
2650   char
2651     token[MagickPathExtent];
2652 
2653   const OptionInfo
2654     *command_info,
2655     *option_info;
2656 
2657   int
2658     sentinel;
2659 
2660   MagickBooleanType
2661     negate;
2662 
2663   register char
2664     *q;
2665 
2666   register const char
2667     *p;
2668 
2669   register ssize_t
2670     i;
2671 
2672   ssize_t
2673     option_types;
2674 
2675   if (options == (const char *) NULL)
2676     return(-1);
2677   option_info=GetOptionInfo(option);
2678   if (option_info == (const OptionInfo *) NULL)
2679     return(-1);
2680   option_types=0;
2681   sentinel=',';
2682   if (strchr(options,'|') != (char *) NULL)
2683     sentinel='|';
2684   for (p=options; p != (char *) NULL; p=strchr(p,sentinel))
2685   {
2686     while (((isspace((int) ((unsigned char) *p)) != 0) || (*p == sentinel)) &&
2687            (*p != '\0'))
2688       p++;
2689     negate=(*p == '!') ? MagickTrue : MagickFalse;
2690     if (negate != MagickFalse)
2691       p++;
2692     q=token;
2693     while (((isspace((int) ((unsigned char) *p)) == 0) && (*p != sentinel)) &&
2694            (*p != '\0'))
2695     {
2696       if ((q-token) >= (MagickPathExtent-1))
2697         break;
2698       *q++=(*p++);
2699     }
2700     *q='\0';
2701     for (i=0; option_info[i].mnemonic != (char *) NULL; i++)
2702       if (LocaleCompare(token,option_info[i].mnemonic) == 0)
2703         break;
2704     command_info=option_info+i;
2705     if ((command_info->mnemonic == (const char *) NULL) &&
2706         ((strchr(token+1,'-') != (char *) NULL) ||
2707          (strchr(token+1,'_') != (char *) NULL)))
2708         {
2709           while ((q=strchr(token+1,'-')) != (char *) NULL)
2710             (void) CopyMagickString(q,q+1,MagickPathExtent-strlen(q));
2711           while ((q=strchr(token+1,'_')) != (char *) NULL)
2712             (void) CopyMagickString(q,q+1,MagickPathExtent-strlen(q));
2713           for (i=0; option_info[i].mnemonic != (char *) NULL; i++)
2714             if (LocaleCompare(token,option_info[i].mnemonic) == 0)
2715               break;
2716           command_info=option_info+i;
2717         }
2718     if (command_info->mnemonic == (const char *) NULL)
2719       return(-1);
2720     if (negate != MagickFalse)
2721       option_types=option_types &~ command_info->type;
2722     else
2723       option_types=option_types | command_info->type;
2724     if (list == MagickFalse)
2725       break;
2726   }
2727   return(option_types);
2728 }
2729 
2730 /*
2731 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2732 %                                                                             %
2733 %                                                                             %
2734 %                                                                             %
2735 %   P a r s e P i x e l C h a n n e l O p t i o n                             %
2736 %                                                                             %
2737 %                                                                             %
2738 %                                                                             %
2739 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2740 %
2741 %  ParsePixelChannelOption() parses a string and returns an enumerated pixel
2742 %  channel type(s).
2743 %
2744 %  The format of the ParsePixelChannelOption method is:
2745 %
2746 %      ssize_t ParsePixelChannelOption(const char *channels)
2747 %
2748 %  A description of each parameter follows:
2749 %
2750 %    o channels: One or more channels separated by commas.
2751 %
2752 */
ParsePixelChannelOption(const char * channels)2753 MagickExport ssize_t ParsePixelChannelOption(const char *channels)
2754 {
2755   char
2756     *q,
2757     token[MagickPathExtent];
2758 
2759   ssize_t
2760     channel;
2761 
2762   GetNextToken(channels,(const char **) NULL,MagickPathExtent,token);
2763   if ((*token == ';') || (*token == '|'))
2764     return(RedPixelChannel);
2765   channel=ParseCommandOption(MagickPixelChannelOptions,MagickTrue,token);
2766   if (channel >= 0)
2767     return(channel);
2768   q=(char *) token;
2769   channel=(ssize_t) InterpretLocaleValue(token,&q);
2770   if ((q == token) || (channel < 0) || (channel >= MaxPixelChannels))
2771     return(-1);
2772   return(channel);
2773 }
2774 
2775 /*
2776 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2777 %                                                                             %
2778 %                                                                             %
2779 %                                                                             %
2780 %   R e m o v e I m a g e O p t i o n                                         %
2781 %                                                                             %
2782 %                                                                             %
2783 %                                                                             %
2784 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2785 %
2786 %  RemoveImageOption() removes an option from the image and returns its value.
2787 %
2788 %  In this case the ConstantString() value returned should be freed by the
2789 %  caller when finished.
2790 %
2791 %  The format of the RemoveImageOption method is:
2792 %
2793 %      char *RemoveImageOption(ImageInfo *image_info,const char *option)
2794 %
2795 %  A description of each parameter follows:
2796 %
2797 %    o image_info: the image info.
2798 %
2799 %    o option: the image option.
2800 %
2801 */
RemoveImageOption(ImageInfo * image_info,const char * option)2802 MagickExport char *RemoveImageOption(ImageInfo *image_info,const char *option)
2803 {
2804   char
2805     *value;
2806 
2807   assert(image_info != (ImageInfo *) NULL);
2808   assert(image_info->signature == MagickCoreSignature);
2809   if (image_info->debug != MagickFalse)
2810     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
2811       image_info->filename);
2812   if (image_info->options == (void *) NULL)
2813     return((char *) NULL);
2814   value=(char *) RemoveNodeFromSplayTree((SplayTreeInfo *)
2815     image_info->options,option);
2816   return(value);
2817 }
2818 
2819 /*
2820 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2821 %                                                                             %
2822 %                                                                             %
2823 %                                                                             %
2824 %   R e s e t I m a g e O p t i o n                                           %
2825 %                                                                             %
2826 %                                                                             %
2827 %                                                                             %
2828 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2829 %
2830 %  ResetImageOptions() resets the image_info option.  That is, it deletes
2831 %  all global options associated with the image_info structure.
2832 %
2833 %  The format of the ResetImageOptions method is:
2834 %
2835 %      ResetImageOptions(ImageInfo *image_info)
2836 %
2837 %  A description of each parameter follows:
2838 %
2839 %    o image_info: the image info.
2840 %
2841 */
ResetImageOptions(const ImageInfo * image_info)2842 MagickExport void ResetImageOptions(const ImageInfo *image_info)
2843 {
2844   assert(image_info != (ImageInfo *) NULL);
2845   assert(image_info->signature == MagickCoreSignature);
2846   if (image_info->debug != MagickFalse)
2847     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
2848       image_info->filename);
2849   if (image_info->options == (void *) NULL)
2850     return;
2851   ResetSplayTree((SplayTreeInfo *) image_info->options);
2852 }
2853 
2854 /*
2855 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2856 %                                                                             %
2857 %                                                                             %
2858 %                                                                             %
2859 %   R e s e t I m a g e O p t i o n I t e r a t o r                           %
2860 %                                                                             %
2861 %                                                                             %
2862 %                                                                             %
2863 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2864 %
2865 %  ResetImageOptionIterator() resets the image_info values iterator.  Use it
2866 %  in conjunction with GetNextImageOption() to iterate over all the values
2867 %  associated with an image option.
2868 %
2869 %  The format of the ResetImageOptionIterator method is:
2870 %
2871 %      ResetImageOptionIterator(ImageInfo *image_info)
2872 %
2873 %  A description of each parameter follows:
2874 %
2875 %    o image_info: the image info.
2876 %
2877 */
ResetImageOptionIterator(const ImageInfo * image_info)2878 MagickExport void ResetImageOptionIterator(const ImageInfo *image_info)
2879 {
2880   assert(image_info != (ImageInfo *) NULL);
2881   assert(image_info->signature == MagickCoreSignature);
2882   if (image_info->debug != MagickFalse)
2883     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
2884       image_info->filename);
2885   if (image_info->options == (void *) NULL)
2886     return;
2887   ResetSplayTreeIterator((SplayTreeInfo *) image_info->options);
2888 }
2889 
2890 /*
2891 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2892 %                                                                             %
2893 %                                                                             %
2894 %                                                                             %
2895 %   S e t I m a g e O p t i o n                                               %
2896 %                                                                             %
2897 %                                                                             %
2898 %                                                                             %
2899 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2900 %
2901 %  SetImageOption() associates an value with an image option.
2902 %
2903 %  The format of the SetImageOption method is:
2904 %
2905 %      MagickBooleanType SetImageOption(ImageInfo *image_info,
2906 %        const char *option,const char *value)
2907 %
2908 %  A description of each parameter follows:
2909 %
2910 %    o image_info: the image info.
2911 %
2912 %    o option: the image option.
2913 %
2914 %    o values: the image option values.
2915 %
2916 */
SetImageOption(ImageInfo * image_info,const char * option,const char * value)2917 MagickExport MagickBooleanType SetImageOption(ImageInfo *image_info,
2918   const char *option,const char *value)
2919 {
2920   assert(image_info != (ImageInfo *) NULL);
2921   assert(image_info->signature == MagickCoreSignature);
2922   if (image_info->debug != MagickFalse)
2923     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
2924       image_info->filename);
2925   /*
2926     Specific global option settings.
2927   */
2928   if (LocaleCompare(option,"size") == 0) {
2929     (void) CloneString(&image_info->size,value);
2930     return(MagickTrue);
2931   }
2932   /*
2933     Create tree if needed - specify how key,values are to be freed.
2934   */
2935   if (image_info->options == (void *) NULL)
2936     image_info->options=NewSplayTree(CompareSplayTreeString,
2937       RelinquishMagickMemory,RelinquishMagickMemory);
2938   /*
2939     Delete Option if NULL --  empty string values are valid!
2940   */
2941   if (value == (const char *) NULL)
2942     return(DeleteImageOption(image_info,option));
2943   /*
2944     Add option to splay-tree.
2945   */
2946   return(AddValueToSplayTree((SplayTreeInfo *) image_info->options,
2947     ConstantString(option),ConstantString(value)));
2948 }
2949