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