]> 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 %                                   Cristy                                    %
17 %                                 March 2000                                  %
18 %                                                                             %
19 %                                                                             %
20 %  Copyright 1999-2014 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, DeprecateOptionFlag | FireOptionFlag, MagickTrue },
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     { "MagnitudePhase", MagnitudePhaseComplexOperator, UndefinedOptionFlag, MagickFalse },
930     { "Multiply", MultiplyComplexOperator, UndefinedOptionFlag, MagickFalse },
931     { "RealImaginary", RealImaginaryComplexOperator, UndefinedOptionFlag, MagickFalse },
932     { "Subtract", SubtractComplexOperator, UndefinedOptionFlag, MagickFalse },
933     { (char *) NULL, UndefinedComplexOperator, UndefinedOptionFlag, MagickFalse }
934   },
935   DataTypeOptions[] =
936   {
937     { "Undefined", UndefinedData, UndefinedOptionFlag, MagickTrue },
938     { "Byte", ByteData, UndefinedOptionFlag, MagickFalse },
939     { "Long", LongData, UndefinedOptionFlag, MagickFalse },
940     { "Short", ShortData, UndefinedOptionFlag, MagickFalse },
941     { "String", StringData, UndefinedOptionFlag, MagickFalse },
942     { (char *) NULL, UndefinedData, UndefinedOptionFlag, MagickFalse }
943   },
944   DecorateOptions[] =
945   {
946     { "Undefined", UndefinedDecoration, UndefinedOptionFlag, MagickTrue },
947     { "LineThrough", LineThroughDecoration, UndefinedOptionFlag, MagickFalse },
948     { "None", NoDecoration, UndefinedOptionFlag, MagickFalse },
949     { "Overline", OverlineDecoration, UndefinedOptionFlag, MagickFalse },
950     { "Underline", UnderlineDecoration, UndefinedOptionFlag, MagickFalse },
951     { (char *) NULL, UndefinedDecoration, UndefinedOptionFlag, MagickFalse }
952   },
953   DirectionOptions[] =
954   {
955     { "Undefined", UndefinedDirection, UndefinedOptionFlag, MagickTrue },
956     { "right-to-left", RightToLeftDirection, UndefinedOptionFlag, MagickFalse },
957     { "left-to-right", LeftToRightDirection, UndefinedOptionFlag, MagickFalse },
958     { (char *) NULL, UndefinedDirection, UndefinedOptionFlag, MagickFalse }
959   },
960   DisposeOptions[] =
961   {
962     { "Undefined", UndefinedDispose, UndefinedOptionFlag, MagickTrue },
963     { "Background", BackgroundDispose, UndefinedOptionFlag, MagickFalse },
964     { "None", NoneDispose, UndefinedOptionFlag, MagickFalse },
965     { "Previous", PreviousDispose, UndefinedOptionFlag, MagickFalse },
966     { "Undefined", UndefinedDispose, UndefinedOptionFlag, MagickFalse },
967     { "0", UndefinedDispose, UndefinedOptionFlag, MagickFalse },
968     { "1", NoneDispose, UndefinedOptionFlag, MagickFalse },
969     { "2", BackgroundDispose, UndefinedOptionFlag, MagickFalse },
970     { "3", PreviousDispose, UndefinedOptionFlag, MagickFalse },
971     { (char *) NULL, UndefinedDispose, UndefinedOptionFlag, MagickFalse }
972   },
973   DistortOptions[] =
974   {
975     { "Affine", AffineDistortion, UndefinedOptionFlag, MagickFalse },
976     { "AffineProjection", AffineProjectionDistortion, UndefinedOptionFlag, MagickFalse },
977     { "ScaleRotateTranslate", ScaleRotateTranslateDistortion, UndefinedOptionFlag, MagickFalse },
978     { "SRT", ScaleRotateTranslateDistortion, UndefinedOptionFlag, MagickFalse },
979     { "Perspective", PerspectiveDistortion, UndefinedOptionFlag, MagickFalse },
980     { "PerspectiveProjection", PerspectiveProjectionDistortion, UndefinedOptionFlag, MagickFalse },
981     { "Bilinear", BilinearForwardDistortion, UndefinedOptionFlag, MagickTrue },
982     { "BilinearForward", BilinearForwardDistortion, UndefinedOptionFlag, MagickFalse },
983     { "BilinearReverse", BilinearReverseDistortion, UndefinedOptionFlag, MagickFalse },
984     { "Polynomial", PolynomialDistortion, UndefinedOptionFlag, MagickFalse },
985     { "Arc", ArcDistortion, UndefinedOptionFlag, MagickFalse },
986     { "Polar", PolarDistortion, UndefinedOptionFlag, MagickFalse },
987     { "DePolar", DePolarDistortion, UndefinedOptionFlag, MagickFalse },
988     { "Barrel", BarrelDistortion, UndefinedOptionFlag, MagickFalse },
989     { "Cylinder2Plane", Cylinder2PlaneDistortion, UndefinedOptionFlag, MagickTrue },
990     { "Plane2Cylinder", Plane2CylinderDistortion, UndefinedOptionFlag, MagickTrue },
991     { "BarrelInverse", BarrelInverseDistortion, UndefinedOptionFlag, MagickFalse },
992     { "Shepards", ShepardsDistortion, UndefinedOptionFlag, MagickFalse },
993     { "Resize", ResizeDistortion, UndefinedOptionFlag, MagickFalse },
994     { (char *) NULL, UndefinedDistortion, UndefinedOptionFlag, MagickFalse }
995   },
996   DitherOptions[] =
997   {
998     { "Undefined", UndefinedDitherMethod, UndefinedOptionFlag, MagickTrue },
999     { "None", NoDitherMethod, UndefinedOptionFlag, MagickFalse },
1000     { "FloydSteinberg", FloydSteinbergDitherMethod, UndefinedOptionFlag, MagickFalse },
1001     { "Riemersma", RiemersmaDitherMethod, UndefinedOptionFlag, MagickFalse },
1002     { (char *) NULL, UndefinedEndian, UndefinedOptionFlag, MagickFalse }
1003   },
1004   EndianOptions[] =
1005   {
1006     { "Undefined", UndefinedEndian, UndefinedOptionFlag, MagickTrue },
1007     { "LSB", LSBEndian, UndefinedOptionFlag, MagickFalse },
1008     { "MSB", MSBEndian, UndefinedOptionFlag, MagickFalse },
1009     { (char *) NULL, UndefinedEndian, UndefinedOptionFlag, MagickFalse }
1010   },
1011   EvaluateOptions[] =
1012   {
1013     { "Undefined", UndefinedEvaluateOperator, UndefinedOptionFlag, MagickTrue },
1014     { "Abs", AbsEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1015     { "Add", AddEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1016     { "AddModulus", AddModulusEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1017     { "And", AndEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1018     { "Cos", CosineEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1019     { "Cosine", CosineEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1020     { "Divide", DivideEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1021     { "Exp", ExponentialEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1022     { "Exponential", ExponentialEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1023     { "GaussianNoise", GaussianNoiseEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1024     { "ImpulseNoise", ImpulseNoiseEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1025     { "LaplacianNoise", LaplacianNoiseEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1026     { "LeftShift", LeftShiftEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1027     { "Log", LogEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1028     { "Max", MaxEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1029     { "Mean", MeanEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1030     { "Median", MedianEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1031     { "Min", MinEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1032     { "MultiplicativeNoise", MultiplicativeNoiseEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1033     { "Multiply", MultiplyEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1034     { "Or", OrEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1035     { "PoissonNoise", PoissonNoiseEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1036     { "Pow", PowEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1037     { "RightShift", RightShiftEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1038     { "Set", SetEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1039     { "Sin", SineEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1040     { "Sine", SineEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1041     { "Subtract", SubtractEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1042     { "Sum", SumEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1043     { "Threshold", ThresholdEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1044     { "ThresholdBlack", ThresholdBlackEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1045     { "ThresholdWhite", ThresholdWhiteEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1046     { "UniformNoise", UniformNoiseEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1047     { "Xor", XorEvaluateOperator, UndefinedOptionFlag, MagickFalse },
1048     { (char *) NULL, UndefinedEvaluateOperator, UndefinedOptionFlag, MagickFalse }
1049   },
1050   FillRuleOptions[] =
1051   {
1052     { "Undefined", UndefinedRule, UndefinedOptionFlag, MagickTrue },
1053     { "Evenodd", EvenOddRule, UndefinedOptionFlag, MagickFalse },
1054     { "NonZero", NonZeroRule, UndefinedOptionFlag, MagickFalse },
1055     { (char *) NULL, UndefinedRule, UndefinedOptionFlag, MagickFalse }
1056   },
1057   FilterOptions[] =
1058   {
1059     { "Undefined", UndefinedFilter, UndefinedOptionFlag, MagickTrue },
1060     { "Bartlett", BartlettFilter, UndefinedOptionFlag, MagickFalse },
1061     { "Blackman", BlackmanFilter, UndefinedOptionFlag, MagickFalse },
1062     { "Bohman", BohmanFilter, UndefinedOptionFlag, MagickFalse },
1063     { "Box", BoxFilter, UndefinedOptionFlag, MagickFalse },
1064     { "Catrom", CatromFilter, UndefinedOptionFlag, MagickFalse },
1065     { "Cosine", CosineFilter, UndefinedOptionFlag, MagickFalse },
1066     { "Cubic", CubicFilter, UndefinedOptionFlag, MagickFalse },
1067     { "Gaussian", GaussianFilter, UndefinedOptionFlag, MagickFalse },
1068     { "Hamming", HammingFilter, UndefinedOptionFlag, MagickFalse },
1069     { "Hann", HannFilter, UndefinedOptionFlag, MagickFalse },
1070     { "Hanning", HannFilter, UndefinedOptionFlag, MagickTrue }, /*misspell*/
1071     { "Hermite", HermiteFilter, UndefinedOptionFlag, MagickFalse },
1072     { "Jinc", JincFilter, UndefinedOptionFlag, MagickFalse },
1073     { "Kaiser", KaiserFilter, UndefinedOptionFlag, MagickFalse },
1074     { "Lagrange", LagrangeFilter, UndefinedOptionFlag, MagickFalse },
1075     { "Lanczos", LanczosFilter, UndefinedOptionFlag, MagickFalse },
1076     { "Lanczos2", Lanczos2Filter, UndefinedOptionFlag, MagickFalse },
1077     { "Lanczos2Sharp", Lanczos2SharpFilter, UndefinedOptionFlag, MagickFalse },
1078     { "LanczosRadius", LanczosRadiusFilter, UndefinedOptionFlag, MagickFalse },
1079     { "LanczosSharp", LanczosSharpFilter, UndefinedOptionFlag, MagickFalse },
1080     { "Mitchell", MitchellFilter, UndefinedOptionFlag, MagickFalse },
1081     { "Parzen", ParzenFilter, UndefinedOptionFlag, MagickFalse },
1082     { "Point", PointFilter, UndefinedOptionFlag, MagickFalse },
1083     { "Quadratic", QuadraticFilter, UndefinedOptionFlag, MagickFalse },
1084     { "Robidoux", RobidouxFilter, UndefinedOptionFlag, MagickFalse },
1085     { "RobidouxSharp", RobidouxSharpFilter, UndefinedOptionFlag, MagickFalse },
1086     { "Sinc", SincFilter, UndefinedOptionFlag, MagickFalse },
1087     { "SincFast", SincFastFilter, UndefinedOptionFlag, MagickFalse },
1088     { "Spline", SplineFilter, UndefinedOptionFlag, MagickFalse },
1089     { "Triangle", TriangleFilter, UndefinedOptionFlag, MagickFalse },
1090     { "Welch", WelchFilter, UndefinedOptionFlag, MagickFalse },
1091     { "Welsh", WelchFilter, UndefinedOptionFlag, MagickTrue }, /*misspell*/
1092     { (char *) NULL, UndefinedFilter, UndefinedOptionFlag, MagickFalse }
1093   },
1094   FunctionOptions[] =
1095   {
1096     { "Undefined", UndefinedFunction, UndefinedOptionFlag, MagickTrue },
1097     { "Polynomial", PolynomialFunction, UndefinedOptionFlag, MagickFalse },
1098     { "Sinusoid", SinusoidFunction, UndefinedOptionFlag, MagickFalse },
1099     { "ArcSin", ArcsinFunction, UndefinedOptionFlag, MagickFalse },
1100     { "ArcTan", ArctanFunction, UndefinedOptionFlag, MagickFalse },
1101     { (char *) NULL, UndefinedFunction, UndefinedOptionFlag, MagickFalse }
1102   },
1103   GravityOptions[] =
1104   {
1105     { "Undefined", UndefinedGravity, UndefinedOptionFlag, MagickTrue },
1106     { "None", UndefinedGravity, UndefinedOptionFlag, MagickFalse },
1107     { "Center", CenterGravity, UndefinedOptionFlag, MagickFalse },
1108     { "East", EastGravity, UndefinedOptionFlag, MagickFalse },
1109     { "Forget", ForgetGravity, UndefinedOptionFlag, MagickFalse },
1110     { "NorthEast", NorthEastGravity, UndefinedOptionFlag, MagickFalse },
1111     { "North", NorthGravity, UndefinedOptionFlag, MagickFalse },
1112     { "NorthWest", NorthWestGravity, UndefinedOptionFlag, MagickFalse },
1113     { "SouthEast", SouthEastGravity, UndefinedOptionFlag, MagickFalse },
1114     { "South", SouthGravity, UndefinedOptionFlag, MagickFalse },
1115     { "SouthWest", SouthWestGravity, UndefinedOptionFlag, MagickFalse },
1116     { "West", WestGravity, UndefinedOptionFlag, MagickFalse },
1117     { (char *) NULL, UndefinedGravity, UndefinedOptionFlag, MagickFalse }
1118   },
1119   IntentOptions[] =
1120   {
1121     { "Undefined", UndefinedIntent, UndefinedOptionFlag, MagickTrue },
1122     { "Absolute", AbsoluteIntent, UndefinedOptionFlag, MagickFalse },
1123     { "Perceptual", PerceptualIntent, UndefinedOptionFlag, MagickFalse },
1124     { "Relative", RelativeIntent, UndefinedOptionFlag, MagickFalse },
1125     { "Saturation", SaturationIntent, UndefinedOptionFlag, MagickFalse },
1126     { (char *) NULL, UndefinedIntent, UndefinedOptionFlag, MagickFalse }
1127   },
1128   InterlaceOptions[] =
1129   {
1130     { "Undefined", UndefinedInterlace, UndefinedOptionFlag, MagickTrue },
1131     { "Line", LineInterlace, UndefinedOptionFlag, MagickFalse },
1132     { "None", NoInterlace, UndefinedOptionFlag, MagickFalse },
1133     { "Plane", PlaneInterlace, UndefinedOptionFlag, MagickFalse },
1134     { "Partition", PartitionInterlace, UndefinedOptionFlag, MagickFalse },
1135     { "GIF", GIFInterlace, UndefinedOptionFlag, MagickFalse },
1136     { "JPEG", JPEGInterlace, UndefinedOptionFlag, MagickFalse },
1137     { "PNG", PNGInterlace, UndefinedOptionFlag, MagickFalse },
1138     { (char *) NULL, UndefinedInterlace, UndefinedOptionFlag, MagickFalse }
1139   },
1140   InterpolateOptions[] =
1141   {
1142     { "Undefined", UndefinedInterpolatePixel, UndefinedOptionFlag, MagickTrue },
1143     { "Average", AverageInterpolatePixel, UndefinedOptionFlag, MagickFalse },
1144     { "Average4", AverageInterpolatePixel, UndefinedOptionFlag, MagickFalse },
1145     { "Average9", Average9InterpolatePixel, UndefinedOptionFlag, MagickFalse },
1146     { "Average16", Average16InterpolatePixel, UndefinedOptionFlag, MagickFalse },
1147     { "Background", BackgroundInterpolatePixel, UndefinedOptionFlag, MagickFalse },
1148     { "Bilinear", BilinearInterpolatePixel, UndefinedOptionFlag, MagickFalse },
1149     { "Blend", BlendInterpolatePixel, UndefinedOptionFlag, MagickFalse },
1150     { "Catrom", CatromInterpolatePixel, UndefinedOptionFlag, MagickFalse },
1151     { "Integer", IntegerInterpolatePixel, UndefinedOptionFlag, MagickFalse },
1152     { "Mesh", MeshInterpolatePixel, UndefinedOptionFlag, MagickFalse },
1153     { "Nearest", NearestInterpolatePixel, UndefinedOptionFlag, MagickFalse },
1154     { "NearestNeighbor", NearestInterpolatePixel, UndefinedOptionFlag, MagickTrue },
1155     { "Spline", SplineInterpolatePixel, UndefinedOptionFlag, MagickFalse },
1156 /*  { "Filter", FilterInterpolatePixel, UndefinedOptionFlag, MagickFalse }, */
1157     { (char *) NULL, UndefinedInterpolatePixel, UndefinedOptionFlag, MagickFalse }
1158   },
1159   KernelOptions[] =
1160   {
1161     { "Undefined", UndefinedKernel, UndefinedOptionFlag, MagickTrue },
1162     { "Unity", UnityKernel, UndefinedOptionFlag, MagickFalse },
1163     { "Gaussian", GaussianKernel, UndefinedOptionFlag, MagickFalse },
1164     { "DoG", DoGKernel, UndefinedOptionFlag, MagickFalse },
1165     { "LoG", LoGKernel, UndefinedOptionFlag, MagickFalse },
1166     { "Blur", BlurKernel, UndefinedOptionFlag, MagickFalse },
1167     { "Comet", CometKernel, UndefinedOptionFlag, MagickFalse },
1168     { "Binomial", BinomialKernel, UndefinedOptionFlag, MagickFalse },
1169     { "Laplacian", LaplacianKernel, UndefinedOptionFlag, MagickFalse },
1170     { "Sobel", SobelKernel, UndefinedOptionFlag, MagickFalse },
1171     { "FreiChen", FreiChenKernel, UndefinedOptionFlag, MagickFalse },
1172     { "Roberts", RobertsKernel, UndefinedOptionFlag, MagickFalse },
1173     { "Prewitt", PrewittKernel, UndefinedOptionFlag, MagickFalse },
1174     { "Compass", CompassKernel, UndefinedOptionFlag, MagickFalse },
1175     { "Kirsch", KirschKernel, UndefinedOptionFlag, MagickFalse },
1176     { "Diamond", DiamondKernel, UndefinedOptionFlag, MagickFalse },
1177     { "Square", SquareKernel, UndefinedOptionFlag, MagickFalse },
1178     { "Rectangle", RectangleKernel, UndefinedOptionFlag, MagickFalse },
1179     { "Disk", DiskKernel, UndefinedOptionFlag, MagickFalse },
1180     { "Octagon", OctagonKernel, UndefinedOptionFlag, MagickFalse },
1181     { "Plus", PlusKernel, UndefinedOptionFlag, MagickFalse },
1182     { "Cross", CrossKernel, UndefinedOptionFlag, MagickFalse },
1183     { "Ring", RingKernel, UndefinedOptionFlag, MagickFalse },
1184     { "Peaks", PeaksKernel, UndefinedOptionFlag, MagickFalse },
1185     { "Edges", EdgesKernel, UndefinedOptionFlag, MagickFalse },
1186     { "Corners", CornersKernel, UndefinedOptionFlag, MagickFalse },
1187     { "Diagonals", DiagonalsKernel, UndefinedOptionFlag, MagickFalse },
1188     { "LineEnds", LineEndsKernel, UndefinedOptionFlag, MagickFalse },
1189     { "LineJunctions", LineJunctionsKernel, UndefinedOptionFlag, MagickFalse },
1190     { "Ridges", RidgesKernel, UndefinedOptionFlag, MagickFalse },
1191     { "ConvexHull", ConvexHullKernel, UndefinedOptionFlag, MagickFalse },
1192     { "ThinSe", ThinSEKernel, UndefinedOptionFlag, MagickFalse },
1193     { "Skeleton", SkeletonKernel, UndefinedOptionFlag, MagickFalse },
1194     { "Chebyshev", ChebyshevKernel, UndefinedOptionFlag, MagickFalse },
1195     { "Manhattan", ManhattanKernel, UndefinedOptionFlag, MagickFalse },
1196     { "Octagonal", OctagonalKernel, UndefinedOptionFlag, MagickFalse },
1197     { "Euclidean", EuclideanKernel, UndefinedOptionFlag, MagickFalse },
1198     { "User Defined", UserDefinedKernel, UndefinedOptionFlag, MagickTrue },
1199     { (char *) NULL, UndefinedKernel, UndefinedOptionFlag, MagickFalse }
1200   },
1201   LayerOptions[] =
1202   {
1203     { "Undefined", UndefinedLayer, UndefinedOptionFlag, MagickTrue },
1204     { "Coalesce", CoalesceLayer, UndefinedOptionFlag, MagickFalse },
1205     { "CompareAny", CompareAnyLayer, UndefinedOptionFlag, MagickFalse },
1206     { "CompareClear", CompareClearLayer, UndefinedOptionFlag, MagickFalse },
1207     { "CompareOverlay", CompareOverlayLayer, UndefinedOptionFlag, MagickFalse },
1208     { "Dispose", DisposeLayer, UndefinedOptionFlag, MagickFalse },
1209     { "Optimize", OptimizeLayer, UndefinedOptionFlag, MagickFalse },
1210     { "OptimizeFrame", OptimizeImageLayer, UndefinedOptionFlag, MagickFalse },
1211     { "OptimizePlus", OptimizePlusLayer, UndefinedOptionFlag, MagickFalse },
1212     { "OptimizeTransparency", OptimizeTransLayer, UndefinedOptionFlag, MagickFalse },
1213     { "RemoveDups", RemoveDupsLayer, UndefinedOptionFlag, MagickFalse },
1214     { "RemoveZero", RemoveZeroLayer, UndefinedOptionFlag, MagickFalse },
1215     { "Composite", CompositeLayer, UndefinedOptionFlag, MagickFalse },
1216     { "Merge", MergeLayer, UndefinedOptionFlag, MagickFalse },
1217     { "Flatten", FlattenLayer, UndefinedOptionFlag, MagickFalse },
1218     { "Mosaic", MosaicLayer, UndefinedOptionFlag, MagickFalse },
1219     { "TrimBounds", TrimBoundsLayer, UndefinedOptionFlag, MagickFalse },
1220     { (char *) NULL, UndefinedLayer, UndefinedOptionFlag, MagickFalse }
1221   },
1222   LineCapOptions[] =
1223   {
1224     { "Undefined", UndefinedCap, UndefinedOptionFlag, MagickTrue },
1225     { "Butt", ButtCap, UndefinedOptionFlag, MagickFalse },
1226     { "Round", RoundCap, UndefinedOptionFlag, MagickFalse },
1227     { "Square", SquareCap, UndefinedOptionFlag, MagickFalse },
1228     { (char *) NULL, UndefinedCap, UndefinedOptionFlag, MagickFalse }
1229   },
1230   LineJoinOptions[] =
1231   {
1232     { "Undefined", UndefinedJoin, UndefinedOptionFlag, MagickTrue },
1233     { "Bevel", BevelJoin, UndefinedOptionFlag, MagickFalse },
1234     { "Miter", MiterJoin, UndefinedOptionFlag, MagickFalse },
1235     { "Round", RoundJoin, UndefinedOptionFlag, MagickFalse },
1236     { (char *) NULL, UndefinedJoin, UndefinedOptionFlag, MagickFalse }
1237   },
1238   ListOptions[] =
1239   {
1240     { "Align", MagickAlignOptions, UndefinedOptionFlag, MagickFalse },
1241     { "Alpha", MagickAlphaChannelOptions, UndefinedOptionFlag, MagickFalse },
1242     { "Boolean", MagickBooleanOptions, UndefinedOptionFlag, MagickFalse },
1243     { "Cache", MagickCacheOptions, UndefinedOptionFlag, MagickFalse },
1244     { "Channel", MagickChannelOptions, UndefinedOptionFlag, MagickFalse },
1245     { "Class", MagickClassOptions, UndefinedOptionFlag, MagickFalse },
1246     { "ClipPath", MagickClipPathOptions, UndefinedOptionFlag, MagickFalse },
1247     { "Coder", MagickCoderOptions, UndefinedOptionFlag, MagickFalse },
1248     { "Color", MagickColorOptions, UndefinedOptionFlag, MagickFalse },
1249     { "Colorspace", MagickColorspaceOptions, UndefinedOptionFlag, MagickFalse },
1250     { "Command", MagickCommandOptions, UndefinedOptionFlag, MagickFalse },
1251     { "Complex", MagickComplexOptions, UndefinedOptionFlag, MagickFalse },
1252     { "Compose", MagickComposeOptions, UndefinedOptionFlag, MagickFalse },
1253     { "Compress", MagickCompressOptions, UndefinedOptionFlag, MagickFalse },
1254     { "Configure", MagickConfigureOptions, UndefinedOptionFlag, MagickFalse },
1255     { "DataType", MagickDataTypeOptions, UndefinedOptionFlag, MagickFalse },
1256     { "Debug", MagickDebugOptions, UndefinedOptionFlag, MagickFalse },
1257     { "Decoration", MagickDecorateOptions, UndefinedOptionFlag, MagickFalse },
1258     { "Delegate", MagickDelegateOptions, UndefinedOptionFlag, MagickFalse },
1259     { "Direction", MagickDirectionOptions, UndefinedOptionFlag, MagickFalse },
1260     { "Dispose", MagickDisposeOptions, UndefinedOptionFlag, MagickFalse },
1261     { "Distort", MagickDistortOptions, UndefinedOptionFlag, MagickFalse },
1262     { "Dither", MagickDitherOptions, UndefinedOptionFlag, MagickFalse },
1263     { "Endian", MagickEndianOptions, UndefinedOptionFlag, MagickFalse },
1264     { "Evaluate", MagickEvaluateOptions, UndefinedOptionFlag, MagickFalse },
1265     { "FillRule", MagickFillRuleOptions, UndefinedOptionFlag, MagickFalse },
1266     { "Filter", MagickFilterOptions, UndefinedOptionFlag, MagickFalse },
1267     { "Font", MagickFontOptions, UndefinedOptionFlag, MagickFalse },
1268     { "Format", MagickFormatOptions, UndefinedOptionFlag, MagickFalse },
1269     { "Function", MagickFunctionOptions, UndefinedOptionFlag, MagickFalse },
1270     { "Gravity", MagickGravityOptions, UndefinedOptionFlag, MagickFalse },
1271     { "Intensity", MagickPixelIntensityOptions, UndefinedOptionFlag, MagickFalse },
1272     { "Intent", MagickIntentOptions, UndefinedOptionFlag, MagickFalse },
1273     { "Interlace", MagickInterlaceOptions, UndefinedOptionFlag, MagickFalse },
1274     { "Interpolate", MagickInterpolateOptions, UndefinedOptionFlag, MagickFalse },
1275     { "Kernel", MagickKernelOptions, UndefinedOptionFlag, MagickFalse },
1276     { "Layers", MagickLayerOptions, UndefinedOptionFlag, MagickFalse },
1277     { "LineCap", MagickLineCapOptions, UndefinedOptionFlag, MagickFalse },
1278     { "LineJoin", MagickLineJoinOptions, UndefinedOptionFlag, MagickFalse },
1279     { "List", MagickListOptions, UndefinedOptionFlag, MagickFalse },
1280     { "Locale", MagickLocaleOptions, UndefinedOptionFlag, MagickFalse },
1281     { "LogEvent", MagickLogEventOptions, UndefinedOptionFlag, MagickFalse },
1282     { "Log", MagickLogOptions, UndefinedOptionFlag, MagickFalse },
1283     { "Magic", MagickMagicOptions, UndefinedOptionFlag, MagickFalse },
1284     { "Method", MagickMethodOptions, UndefinedOptionFlag, MagickFalse },
1285     { "Metric", MagickMetricOptions, UndefinedOptionFlag, MagickFalse },
1286     { "Mime", MagickMimeOptions, UndefinedOptionFlag, MagickFalse },
1287     { "Mode", MagickModeOptions, UndefinedOptionFlag, MagickFalse },
1288     { "Morphology", MagickMorphologyOptions, UndefinedOptionFlag, MagickFalse },
1289     { "Module", MagickModuleOptions, UndefinedOptionFlag, MagickFalse },
1290     { "Noise", MagickNoiseOptions, UndefinedOptionFlag, MagickFalse },
1291     { "Orientation", MagickOrientationOptions, UndefinedOptionFlag, MagickFalse },
1292     { "PixelChannel", MagickPixelChannelOptions, UndefinedOptionFlag, MagickFalse },
1293     { "PixelIntensity", MagickPixelIntensityOptions, UndefinedOptionFlag, MagickFalse },
1294     { "PixelMask", MagickPixelMaskOptions, UndefinedOptionFlag, MagickFalse },
1295     { "PixelTrait", MagickPixelTraitOptions, UndefinedOptionFlag, MagickFalse },
1296     { "Policy", MagickPolicyOptions, UndefinedOptionFlag, MagickFalse },
1297     { "PolicyDomain", MagickPolicyDomainOptions, UndefinedOptionFlag, MagickFalse },
1298     { "PolicyRights", MagickPolicyRightsOptions, UndefinedOptionFlag, MagickFalse },
1299     { "Preview", MagickPreviewOptions, UndefinedOptionFlag, MagickFalse },
1300     { "Primitive", MagickPrimitiveOptions, UndefinedOptionFlag, MagickFalse },
1301     { "QuantumFormat", MagickQuantumFormatOptions, UndefinedOptionFlag, MagickFalse },
1302     { "Resource", MagickResourceOptions, UndefinedOptionFlag, MagickFalse },
1303     { "SparseColor", MagickSparseColorOptions, UndefinedOptionFlag, MagickFalse },
1304     { "Statistic", MagickStatisticOptions, UndefinedOptionFlag, MagickFalse },
1305     { "Storage", MagickStorageOptions, UndefinedOptionFlag, MagickFalse },
1306     { "Stretch", MagickStretchOptions, UndefinedOptionFlag, MagickFalse },
1307     { "Style", MagickStyleOptions, UndefinedOptionFlag, MagickFalse },
1308     { "Threshold", MagickThresholdOptions, UndefinedOptionFlag, MagickFalse },
1309     { "Type", MagickTypeOptions, UndefinedOptionFlag, MagickFalse },
1310     { "Units", MagickResolutionOptions, UndefinedOptionFlag, MagickFalse },
1311     { "Undefined", MagickUndefinedOptions, UndefinedOptionFlag, MagickTrue },
1312     { "Validate", MagickValidateOptions, UndefinedOptionFlag, MagickFalse },
1313     { "VirtualPixel", MagickVirtualPixelOptions, UndefinedOptionFlag, MagickFalse },
1314     { (char *) NULL, MagickUndefinedOptions, UndefinedOptionFlag, MagickFalse }
1315   },
1316   LogEventOptions[] =
1317   {
1318     { "Undefined", UndefinedEvents, UndefinedOptionFlag, MagickTrue },
1319     { "All", (AllEvents &~ TraceEvent), UndefinedOptionFlag, MagickFalse },
1320     { "Accelerate", AccelerateEvent, UndefinedOptionFlag, MagickFalse },
1321     { "Annotate", AnnotateEvent, UndefinedOptionFlag, MagickFalse },
1322     { "Blob", BlobEvent, UndefinedOptionFlag, MagickFalse },
1323     { "Cache", CacheEvent, UndefinedOptionFlag, MagickFalse },
1324     { "Coder", CoderEvent, UndefinedOptionFlag, MagickFalse },
1325     { "Command", CommandEvent, UndefinedOptionFlag, MagickFalse },
1326     { "Configure", ConfigureEvent, UndefinedOptionFlag, MagickFalse },
1327     { "Deprecate", DeprecateEvent, UndefinedOptionFlag, MagickFalse },
1328     { "Draw", DrawEvent, UndefinedOptionFlag, MagickFalse },
1329     { "Exception", ExceptionEvent, UndefinedOptionFlag, MagickFalse },
1330     { "Locale", LocaleEvent, UndefinedOptionFlag, MagickFalse },
1331     { "Module", ModuleEvent, UndefinedOptionFlag, MagickFalse },
1332     { "None", NoEvents, UndefinedOptionFlag, MagickFalse },
1333     { "Pixel", PixelEvent, UndefinedOptionFlag, MagickFalse },
1334     { "Policy", PolicyEvent, UndefinedOptionFlag, MagickFalse },
1335     { "Resource", ResourceEvent, UndefinedOptionFlag, MagickFalse },
1336     { "Trace", TraceEvent, UndefinedOptionFlag, MagickFalse },
1337     { "Transform", TransformEvent, UndefinedOptionFlag, MagickFalse },
1338     { "User", UserEvent, UndefinedOptionFlag, MagickFalse },
1339     { "Wand", WandEvent, UndefinedOptionFlag, MagickFalse },
1340     { "X11", X11Event, UndefinedOptionFlag, MagickFalse },
1341     { (char *) NULL, UndefinedEvents, UndefinedOptionFlag, MagickFalse }
1342   },
1343   MetricOptions[] =
1344   {
1345     { "Undefined", UndefinedErrorMetric, UndefinedOptionFlag, MagickTrue },
1346     { "AE", AbsoluteErrorMetric, UndefinedOptionFlag, MagickFalse },
1347     { "Fuzz", FuzzErrorMetric, UndefinedOptionFlag, MagickFalse },
1348     { "MAE", MeanAbsoluteErrorMetric, UndefinedOptionFlag, MagickFalse },
1349     { "MEPP", MeanErrorPerPixelMetric, UndefinedOptionFlag, MagickFalse },
1350     { "MSE", MeanSquaredErrorMetric, UndefinedOptionFlag, MagickFalse },
1351     { "NCC", NormalizedCrossCorrelationErrorMetric, UndefinedOptionFlag, MagickFalse },
1352     { "PAE", PeakAbsoluteErrorMetric, UndefinedOptionFlag, MagickFalse },
1353     { "PSNR", PeakSignalToNoiseRatioMetric, UndefinedOptionFlag, MagickFalse },
1354     { "RMSE", RootMeanSquaredErrorMetric, UndefinedOptionFlag, MagickFalse },
1355     { (char *) NULL, UndefinedErrorMetric, UndefinedOptionFlag, MagickFalse }
1356   },
1357   MethodOptions[] =
1358   {
1359     { "Undefined", UndefinedMethod, UndefinedOptionFlag, MagickTrue },
1360     { "FillToBorder", FillToBorderMethod, UndefinedOptionFlag, MagickFalse },
1361     { "Floodfill", FloodfillMethod, UndefinedOptionFlag, MagickFalse },
1362     { "Point", PointMethod, UndefinedOptionFlag, MagickFalse },
1363     { "Replace", ReplaceMethod, UndefinedOptionFlag, MagickFalse },
1364     { "Reset", ResetMethod, UndefinedOptionFlag, MagickFalse },
1365     { (char *) NULL, UndefinedMethod, UndefinedOptionFlag, MagickFalse }
1366   },
1367   ModeOptions[] =
1368   {
1369     { "Undefined", UndefinedMode, UndefinedOptionFlag, MagickTrue },
1370     { "Concatenate", ConcatenateMode, UndefinedOptionFlag, MagickFalse },
1371     { "Frame", FrameMode, UndefinedOptionFlag, MagickFalse },
1372     { "Unframe", UnframeMode, UndefinedOptionFlag, MagickFalse },
1373     { (char *) NULL, UndefinedMode, UndefinedOptionFlag, MagickFalse }
1374   },
1375   MorphologyOptions[] =
1376   {
1377     { "Undefined", UndefinedMorphology, UndefinedOptionFlag, MagickTrue },
1378     { "Correlate", CorrelateMorphology, UndefinedOptionFlag, MagickFalse },
1379     { "Convolve", ConvolveMorphology, UndefinedOptionFlag, MagickFalse },
1380     { "Dilate", DilateMorphology, UndefinedOptionFlag, MagickFalse },
1381     { "Erode", ErodeMorphology, UndefinedOptionFlag, MagickFalse },
1382     { "Close", CloseMorphology, UndefinedOptionFlag, MagickFalse },
1383     { "Open", OpenMorphology, UndefinedOptionFlag, MagickFalse },
1384     { "DilateIntensity", DilateIntensityMorphology, UndefinedOptionFlag, MagickFalse },
1385     { "ErodeIntensity", ErodeIntensityMorphology, UndefinedOptionFlag, MagickFalse },
1386     { "CloseIntensity", CloseIntensityMorphology, UndefinedOptionFlag, MagickFalse },
1387     { "OpenIntensity", OpenIntensityMorphology, UndefinedOptionFlag, MagickFalse },
1388     { "DilateI", DilateIntensityMorphology, UndefinedOptionFlag, MagickFalse },
1389     { "ErodeI", ErodeIntensityMorphology, UndefinedOptionFlag, MagickFalse },
1390     { "CloseI", CloseIntensityMorphology, UndefinedOptionFlag, MagickFalse },
1391     { "OpenI", OpenIntensityMorphology, UndefinedOptionFlag, MagickFalse },
1392     { "Smooth", SmoothMorphology, UndefinedOptionFlag, MagickFalse },
1393     { "EdgeOut", EdgeOutMorphology, UndefinedOptionFlag, MagickFalse },
1394     { "EdgeIn", EdgeInMorphology, UndefinedOptionFlag, MagickFalse },
1395     { "Edge", EdgeMorphology, UndefinedOptionFlag, MagickFalse },
1396     { "TopHat", TopHatMorphology, UndefinedOptionFlag, MagickFalse },
1397     { "BottomHat", BottomHatMorphology, UndefinedOptionFlag, MagickFalse },
1398     { "Hmt", HitAndMissMorphology, UndefinedOptionFlag, MagickFalse },
1399     { "HitNMiss", HitAndMissMorphology, UndefinedOptionFlag, MagickFalse },
1400     { "HitAndMiss", HitAndMissMorphology, UndefinedOptionFlag, MagickFalse },
1401     { "Thinning", ThinningMorphology, UndefinedOptionFlag, MagickFalse },
1402     { "Thicken", ThickenMorphology, UndefinedOptionFlag, MagickFalse },
1403     { "Distance", DistanceMorphology, UndefinedOptionFlag, MagickFalse },
1404     { "IterativeDistance", IterativeDistanceMorphology, UndefinedOptionFlag, MagickFalse },
1405     { "Voronoi", VoronoiMorphology, UndefinedOptionFlag, MagickTrue },
1406     { (char *) NULL, UndefinedMorphology, UndefinedOptionFlag, MagickFalse }
1407   },
1408   NoiseOptions[] =
1409   {
1410     { "Undefined", UndefinedNoise, UndefinedOptionFlag, MagickTrue },
1411     { "Gaussian", GaussianNoise, UndefinedOptionFlag, MagickFalse },
1412     { "Impulse", ImpulseNoise, UndefinedOptionFlag, MagickFalse },
1413     { "Laplacian", LaplacianNoise, UndefinedOptionFlag, MagickFalse },
1414     { "Multiplicative", MultiplicativeGaussianNoise, UndefinedOptionFlag, MagickFalse },
1415     { "Poisson", PoissonNoise, UndefinedOptionFlag, MagickFalse },
1416     { "Random", RandomNoise, UndefinedOptionFlag, MagickFalse },
1417     { "Uniform", UniformNoise, UndefinedOptionFlag, MagickFalse },
1418     { (char *) NULL, UndefinedNoise, UndefinedOptionFlag, MagickFalse }
1419   },
1420   OrientationOptions[] =
1421   {
1422     { "Undefined", UndefinedOrientation, UndefinedOptionFlag, MagickTrue },
1423     { "TopLeft", TopLeftOrientation, UndefinedOptionFlag, MagickFalse },
1424     { "TopRight", TopRightOrientation, UndefinedOptionFlag, MagickFalse },
1425     { "BottomRight", BottomRightOrientation, UndefinedOptionFlag, MagickFalse },
1426     { "BottomLeft", BottomLeftOrientation, UndefinedOptionFlag, MagickFalse },
1427     { "LeftTop", LeftTopOrientation, UndefinedOptionFlag, MagickFalse },
1428     { "RightTop", RightTopOrientation, UndefinedOptionFlag, MagickFalse },
1429     { "RightBottom", RightBottomOrientation, UndefinedOptionFlag, MagickFalse },
1430     { "LeftBottom", LeftBottomOrientation, UndefinedOptionFlag, MagickFalse },
1431     { (char *) NULL, UndefinedOrientation, UndefinedOptionFlag, MagickFalse }
1432   },
1433   PixelChannelOptions[] =
1434   {
1435     { "Undefined", UndefinedPixelChannel, UndefinedOptionFlag, MagickFalse },
1436     { "A", AlphaPixelChannel, UndefinedOptionFlag, MagickFalse },
1437     { "Alpha", AlphaPixelChannel, UndefinedOptionFlag, MagickFalse },
1438     { "B", BluePixelChannel, UndefinedOptionFlag, MagickFalse },
1439     { "Bk", BlackPixelChannel, UndefinedOptionFlag, MagickFalse },
1440     { "Black", BlackPixelChannel, UndefinedOptionFlag, MagickFalse },
1441     { "Blue", BluePixelChannel, UndefinedOptionFlag, MagickFalse },
1442     { "Cb", CbPixelChannel, UndefinedOptionFlag, MagickFalse },
1443     { "Composite", CompositePixelChannel, UndefinedOptionFlag, MagickFalse },
1444     { "C", CyanPixelChannel, UndefinedOptionFlag, MagickFalse },
1445     { "Cr", CrPixelChannel, UndefinedOptionFlag, MagickFalse },
1446     { "Cyan", CyanPixelChannel, UndefinedOptionFlag, MagickFalse },
1447     { "Gray", GrayPixelChannel, UndefinedOptionFlag, MagickFalse },
1448     { "G", GreenPixelChannel, UndefinedOptionFlag, MagickFalse },
1449     { "Green", GreenPixelChannel, UndefinedOptionFlag, MagickFalse },
1450     { "Index", IndexPixelChannel, UndefinedOptionFlag, MagickFalse },
1451     { "Intensity", IntensityPixelChannel, UndefinedOptionFlag, MagickFalse },
1452     { "K", BlackPixelChannel, UndefinedOptionFlag, MagickFalse },
1453     { "M", MagentaPixelChannel, UndefinedOptionFlag, MagickFalse },
1454     { "Magenta", MagentaPixelChannel, UndefinedOptionFlag, MagickFalse },
1455     { "R", RedPixelChannel, UndefinedOptionFlag, MagickFalse },
1456     { "ReadMask", ReadMaskPixelChannel, UndefinedOptionFlag, MagickFalse },
1457     { "Red", RedPixelChannel, UndefinedOptionFlag, MagickFalse },
1458     { "Sync", SyncPixelChannel, UndefinedOptionFlag, MagickFalse },
1459     { "WriteMask", WriteMaskPixelChannel, UndefinedOptionFlag, MagickFalse },
1460     { "Y", YellowPixelChannel, UndefinedOptionFlag, MagickFalse },
1461     { "Yellow", YellowPixelChannel, UndefinedOptionFlag, MagickFalse },
1462     { (char *) NULL, UndefinedPixelChannel, UndefinedOptionFlag, MagickFalse }
1463   },
1464   PixelIntensityOptions[] =
1465   {
1466     { "Undefined", UndefinedPixelIntensityMethod, UndefinedOptionFlag, MagickTrue },
1467     { "Average", AveragePixelIntensityMethod, UndefinedOptionFlag, MagickFalse },
1468     { "Brightness", BrightnessPixelIntensityMethod, UndefinedOptionFlag, MagickFalse },
1469     { "Lightness", LightnessPixelIntensityMethod, UndefinedOptionFlag, MagickFalse },
1470     { "MS", MSPixelIntensityMethod, UndefinedOptionFlag, MagickFalse },
1471     { "Rec601Luma", Rec601LumaPixelIntensityMethod, UndefinedOptionFlag, MagickFalse },
1472     { "Rec601Luminance", Rec601LuminancePixelIntensityMethod, UndefinedOptionFlag, MagickFalse },
1473     { "Rec709Luma", Rec709LumaPixelIntensityMethod, UndefinedOptionFlag, MagickFalse },
1474     { "Rec709Luminance", Rec709LuminancePixelIntensityMethod, UndefinedOptionFlag, MagickFalse },
1475     { "RMS", RMSPixelIntensityMethod, UndefinedOptionFlag, MagickFalse },
1476     { (char *) NULL, UndefinedPixelIntensityMethod, UndefinedOptionFlag, MagickFalse }
1477   },
1478   PixelMaskOptions[] =
1479   {
1480     { "Undefined", UndefinedPixelMask, UndefinedOptionFlag, MagickTrue },
1481     { "R", ReadPixelMask, UndefinedOptionFlag, MagickFalse },
1482     { "Read", ReadPixelMask, UndefinedOptionFlag, MagickFalse },
1483     { "W", WritePixelMask, UndefinedOptionFlag, MagickFalse },
1484     { "Write", WritePixelMask, UndefinedOptionFlag, MagickFalse },
1485     { (char *) NULL, UndefinedPixelMask, UndefinedOptionFlag, MagickFalse }
1486   },
1487   PixelTraitOptions[] =
1488   {
1489     { "Undefined", UndefinedPixelTrait, UndefinedOptionFlag, MagickTrue },
1490     { "Blend", BlendPixelTrait, UndefinedOptionFlag, MagickFalse },
1491     { "Copy", CopyPixelTrait, UndefinedOptionFlag, MagickFalse },
1492     { "Update", UpdatePixelTrait, UndefinedOptionFlag, MagickFalse },
1493     { (char *) NULL, UndefinedPixelTrait, UndefinedOptionFlag, MagickFalse }
1494   },
1495   PolicyDomainOptions[] =
1496   {
1497     { "Undefined", UndefinedPolicyDomain, UndefinedOptionFlag, MagickTrue },
1498     { "Coder", CoderPolicyDomain, UndefinedOptionFlag, MagickFalse },
1499     { "Delegate", DelegatePolicyDomain, UndefinedOptionFlag, MagickFalse },
1500     { "Filter", FilterPolicyDomain, UndefinedOptionFlag, MagickFalse },
1501     { "Path", PathPolicyDomain, UndefinedOptionFlag, MagickFalse },
1502     { "Resource", ResourcePolicyDomain, UndefinedOptionFlag, MagickFalse },
1503     { "System", SystemPolicyDomain, UndefinedOptionFlag, MagickFalse },
1504     { (char *) NULL, UndefinedPolicyDomain, UndefinedOptionFlag, MagickFalse }
1505   },
1506   PolicyRightsOptions[] =
1507   {
1508     { "Undefined", UndefinedPolicyRights, UndefinedOptionFlag, MagickTrue },
1509     { "None", NoPolicyRights, UndefinedOptionFlag, MagickFalse },
1510     { "Read", ReadPolicyRights, UndefinedOptionFlag, MagickFalse },
1511     { "Write", WritePolicyRights, UndefinedOptionFlag, MagickFalse },
1512     { "Execute", ExecutePolicyRights, UndefinedOptionFlag, MagickFalse },
1513     { (char *) NULL, UndefinedPolicyRights, UndefinedOptionFlag, MagickFalse }
1514   },
1515   PreviewOptions[] =
1516   {
1517     { "Undefined", UndefinedPreview, UndefinedOptionFlag, MagickTrue },
1518     { "AddNoise", AddNoisePreview, UndefinedOptionFlag, MagickFalse },
1519     { "Blur", BlurPreview, UndefinedOptionFlag, MagickFalse },
1520     { "Brightness", BrightnessPreview, UndefinedOptionFlag, MagickFalse },
1521     { "Charcoal", CharcoalDrawingPreview, UndefinedOptionFlag, MagickFalse },
1522     { "Despeckle", DespecklePreview, UndefinedOptionFlag, MagickFalse },
1523     { "Dull", DullPreview, UndefinedOptionFlag, MagickFalse },
1524     { "EdgeDetect", EdgeDetectPreview, UndefinedOptionFlag, MagickFalse },
1525     { "Gamma", GammaPreview, UndefinedOptionFlag, MagickFalse },
1526     { "Grayscale", GrayscalePreview, UndefinedOptionFlag, MagickFalse },
1527     { "Hue", HuePreview, UndefinedOptionFlag, MagickFalse },
1528     { "Implode", ImplodePreview, UndefinedOptionFlag, MagickFalse },
1529     { "JPEG", JPEGPreview, UndefinedOptionFlag, MagickFalse },
1530     { "OilPaint", OilPaintPreview, UndefinedOptionFlag, MagickFalse },
1531     { "Quantize", QuantizePreview, UndefinedOptionFlag, MagickFalse },
1532     { "Raise", RaisePreview, UndefinedOptionFlag, MagickFalse },
1533     { "ReduceNoise", ReduceNoisePreview, UndefinedOptionFlag, MagickFalse },
1534     { "Roll", RollPreview, UndefinedOptionFlag, MagickFalse },
1535     { "Rotate", RotatePreview, UndefinedOptionFlag, MagickFalse },
1536     { "Saturation", SaturationPreview, UndefinedOptionFlag, MagickFalse },
1537     { "Segment", SegmentPreview, UndefinedOptionFlag, MagickFalse },
1538     { "Shade", ShadePreview, UndefinedOptionFlag, MagickFalse },
1539     { "Sharpen", SharpenPreview, UndefinedOptionFlag, MagickFalse },
1540     { "Shear", ShearPreview, UndefinedOptionFlag, MagickFalse },
1541     { "Solarize", SolarizePreview, UndefinedOptionFlag, MagickFalse },
1542     { "Spiff", SpiffPreview, UndefinedOptionFlag, MagickFalse },
1543     { "Spread", SpreadPreview, UndefinedOptionFlag, MagickFalse },
1544     { "Swirl", SwirlPreview, UndefinedOptionFlag, MagickFalse },
1545     { "Threshold", ThresholdPreview, UndefinedOptionFlag, MagickFalse },
1546     { "Wave", WavePreview, UndefinedOptionFlag, MagickFalse },
1547     { (char *) NULL, UndefinedPreview, UndefinedOptionFlag, MagickFalse }
1548   },
1549   PrimitiveOptions[] =
1550   {
1551     { "Undefined", UndefinedPrimitive, UndefinedOptionFlag, MagickTrue },
1552     { "Arc", ArcPrimitive, UndefinedOptionFlag, MagickFalse },
1553     { "Bezier", BezierPrimitive, UndefinedOptionFlag, MagickFalse },
1554     { "Circle", CirclePrimitive, UndefinedOptionFlag, MagickFalse },
1555     { "Color", ColorPrimitive, UndefinedOptionFlag, MagickFalse },
1556     { "Ellipse", EllipsePrimitive, UndefinedOptionFlag, MagickFalse },
1557     { "Image", ImagePrimitive, UndefinedOptionFlag, MagickFalse },
1558     { "Line", LinePrimitive, UndefinedOptionFlag, MagickFalse },
1559     { "Matte", MattePrimitive, UndefinedOptionFlag, MagickFalse },
1560     { "Path", PathPrimitive, UndefinedOptionFlag, MagickFalse },
1561     { "Point", PointPrimitive, UndefinedOptionFlag, MagickFalse },
1562     { "Polygon", PolygonPrimitive, UndefinedOptionFlag, MagickFalse },
1563     { "Polyline", PolylinePrimitive, UndefinedOptionFlag, MagickFalse },
1564     { "Rectangle", RectanglePrimitive, UndefinedOptionFlag, MagickFalse },
1565     { "RoundRectangle", RoundRectanglePrimitive, UndefinedOptionFlag, MagickFalse },
1566     { "Text", TextPrimitive, UndefinedOptionFlag, MagickFalse },
1567     { (char *) NULL, UndefinedPrimitive, UndefinedOptionFlag, MagickFalse }
1568   },
1569   QuantumFormatOptions[] =
1570   {
1571     { "Undefined", UndefinedQuantumFormat, UndefinedOptionFlag, MagickTrue },
1572     { "FloatingPoint", FloatingPointQuantumFormat, UndefinedOptionFlag, MagickFalse },
1573     { "Signed", SignedQuantumFormat, UndefinedOptionFlag, MagickFalse },
1574     { "Unsigned", UnsignedQuantumFormat, UndefinedOptionFlag, MagickFalse },
1575     { (char *) NULL, FloatingPointQuantumFormat, UndefinedOptionFlag, MagickFalse }
1576   },
1577   ResolutionOptions[] =
1578   {
1579     { "Undefined", UndefinedResolution, UndefinedOptionFlag, MagickTrue },
1580     { "PixelsPerInch", PixelsPerInchResolution, UndefinedOptionFlag, MagickFalse },
1581     { "PixelsPerCentimeter", PixelsPerCentimeterResolution, UndefinedOptionFlag, MagickFalse },
1582     { (char *) NULL, UndefinedResolution, UndefinedOptionFlag, MagickFalse }
1583   },
1584   ResourceOptions[] =
1585   {
1586     { "Undefined", UndefinedResource, UndefinedOptionFlag, MagickTrue },
1587     { "Area", AreaResource, UndefinedOptionFlag, MagickFalse },
1588     { "Disk", DiskResource, UndefinedOptionFlag, MagickFalse },
1589     { "File", FileResource, UndefinedOptionFlag, MagickFalse },
1590     { "Map", MapResource, UndefinedOptionFlag, MagickFalse },
1591     { "Memory", MemoryResource, UndefinedOptionFlag, MagickFalse },
1592     { "Thread", ThreadResource, UndefinedOptionFlag, MagickFalse },
1593     { "Time", TimeResource, UndefinedOptionFlag, MagickFalse },
1594     { (char *) NULL, UndefinedResource, UndefinedOptionFlag, MagickFalse }
1595   },
1596   SparseColorOptions[] =
1597   {
1598     { "Undefined", UndefinedDistortion, UndefinedOptionFlag, MagickTrue },
1599     { "Barycentric", BarycentricColorInterpolate, UndefinedOptionFlag, MagickFalse },
1600     { "Bilinear", BilinearColorInterpolate, UndefinedOptionFlag, MagickFalse },
1601     { "Inverse", InverseColorInterpolate, UndefinedOptionFlag, MagickFalse },
1602     { "Shepards", ShepardsColorInterpolate, UndefinedOptionFlag, MagickFalse },
1603     { "Voronoi", VoronoiColorInterpolate, UndefinedOptionFlag, MagickFalse },
1604     { (char *) NULL, UndefinedResource, UndefinedOptionFlag, MagickFalse }
1605   },
1606   StatisticOptions[] =
1607   {
1608     { "Undefined", UndefinedStatistic, UndefinedOptionFlag, MagickTrue },
1609     { "Gradient", GradientStatistic, UndefinedOptionFlag, MagickFalse },
1610     { "Maximum", MaximumStatistic, UndefinedOptionFlag, MagickFalse },
1611     { "Mean", MeanStatistic, UndefinedOptionFlag, MagickFalse },
1612     { "Median", MedianStatistic, UndefinedOptionFlag, MagickFalse },
1613     { "Minimum", MinimumStatistic, UndefinedOptionFlag, MagickFalse },
1614     { "Mode", ModeStatistic, UndefinedOptionFlag, MagickFalse },
1615     { "NonPeak", NonpeakStatistic, UndefinedOptionFlag, MagickFalse },
1616     { "StandardDeviation", StandardDeviationStatistic, UndefinedOptionFlag, MagickFalse },
1617     { (char *) NULL, UndefinedMethod, UndefinedOptionFlag, MagickFalse }
1618   },
1619   StorageOptions[] =
1620   {
1621     { "Undefined", UndefinedPixel, UndefinedOptionFlag, MagickTrue },
1622     { "Char", CharPixel, UndefinedOptionFlag, MagickFalse },
1623     { "Double", DoublePixel, UndefinedOptionFlag, MagickFalse },
1624     { "Float", FloatPixel, UndefinedOptionFlag, MagickFalse },
1625     { "Long", LongPixel, UndefinedOptionFlag, MagickFalse },
1626     { "LongLong", LongLongPixel, UndefinedOptionFlag, MagickFalse },
1627     { "Quantum", QuantumPixel, UndefinedOptionFlag, MagickFalse },
1628     { "Short", ShortPixel, UndefinedOptionFlag, MagickFalse },
1629     { (char *) NULL, UndefinedResource, UndefinedOptionFlag, MagickFalse }
1630   },
1631   StretchOptions[] =
1632   {
1633     { "Undefined", UndefinedStretch, UndefinedOptionFlag, MagickTrue },
1634     { "Any", AnyStretch, UndefinedOptionFlag, MagickFalse },
1635     { "Condensed", CondensedStretch, UndefinedOptionFlag, MagickFalse },
1636     { "Expanded", ExpandedStretch, UndefinedOptionFlag, MagickFalse },
1637     { "ExtraCondensed", ExtraCondensedStretch, UndefinedOptionFlag, MagickFalse },
1638     { "ExtraExpanded", ExtraExpandedStretch, UndefinedOptionFlag, MagickFalse },
1639     { "Normal", NormalStretch, UndefinedOptionFlag, MagickFalse },
1640     { "SemiCondensed", SemiCondensedStretch, UndefinedOptionFlag, MagickFalse },
1641     { "SemiExpanded", SemiExpandedStretch, UndefinedOptionFlag, MagickFalse },
1642     { "UltraCondensed", UltraCondensedStretch, UndefinedOptionFlag, MagickFalse },
1643     { "UltraExpanded", UltraExpandedStretch, UndefinedOptionFlag, MagickFalse },
1644     { (char *) NULL, UndefinedStretch, UndefinedOptionFlag, MagickFalse }
1645   },
1646   StyleOptions[] =
1647   {
1648     { "Undefined", UndefinedStyle, UndefinedOptionFlag, MagickTrue },
1649     { "Any", AnyStyle, UndefinedOptionFlag, MagickFalse },
1650     { "Italic", ItalicStyle, UndefinedOptionFlag, MagickFalse },
1651     { "Normal", NormalStyle, UndefinedOptionFlag, MagickFalse },
1652     { "Oblique", ObliqueStyle, UndefinedOptionFlag, MagickFalse },
1653     { (char *) NULL, UndefinedStyle, UndefinedOptionFlag, MagickFalse }
1654   },
1655   TypeOptions[] =
1656   {
1657     { "Undefined", UndefinedType, UndefinedOptionFlag, MagickTrue },
1658     { "Bilevel", BilevelType, UndefinedOptionFlag, MagickFalse },
1659     { "ColorSeparation", ColorSeparationType, UndefinedOptionFlag, MagickFalse },
1660     { "ColorSeparationAlpha", ColorSeparationMatteType, UndefinedOptionFlag, MagickFalse },
1661     { "ColorSeparationMatte", ColorSeparationMatteType, UndefinedOptionFlag, MagickFalse },
1662     { "Grayscale", GrayscaleType, UndefinedOptionFlag, MagickFalse },
1663     { "GrayscaleAlpha", GrayscaleMatteType, UndefinedOptionFlag, MagickFalse },
1664     { "GrayscaleMatte", GrayscaleMatteType, UndefinedOptionFlag, MagickFalse },
1665     { "Optimize", OptimizeType, UndefinedOptionFlag, MagickFalse },
1666     { "Palette", PaletteType, UndefinedOptionFlag, MagickFalse },
1667     { "PaletteBilevelAlpha", PaletteBilevelMatteType, UndefinedOptionFlag, MagickFalse },
1668     { "PaletteBilevelMatte", PaletteBilevelMatteType, UndefinedOptionFlag, MagickFalse },
1669     { "PaletteAlpha", PaletteMatteType, UndefinedOptionFlag, MagickFalse },
1670     { "PaletteMatte", PaletteMatteType, UndefinedOptionFlag, MagickFalse },
1671     { "TrueColorAlpha", TrueColorMatteType, UndefinedOptionFlag, MagickFalse },
1672     { "TrueColorMatte", TrueColorMatteType, UndefinedOptionFlag, MagickFalse },
1673     { "TrueColor", TrueColorType, UndefinedOptionFlag, MagickFalse },
1674     { (char *) NULL, UndefinedType, UndefinedOptionFlag, MagickFalse }
1675   },
1676   ValidateOptions[] =
1677   {
1678     { "Undefined", UndefinedValidate, UndefinedOptionFlag, MagickTrue },
1679     { "All", AllValidate, UndefinedOptionFlag, MagickFalse },
1680     { "Colorspace", ColorspaceValidate, UndefinedOptionFlag, MagickFalse },
1681     { "Compare", CompareValidate, UndefinedOptionFlag, MagickFalse },
1682     { "Composite", CompositeValidate, UndefinedOptionFlag, MagickFalse },
1683     { "Convert", ConvertValidate, UndefinedOptionFlag, MagickFalse },
1684     { "FormatsDisk", FormatsDiskValidate, UndefinedOptionFlag, MagickFalse },
1685     { "FormatsMap", FormatsMapValidate, UndefinedOptionFlag, MagickFalse },
1686     { "FormatsMemory", FormatsMemoryValidate, UndefinedOptionFlag, MagickFalse },
1687     { "Identify", IdentifyValidate, UndefinedOptionFlag, MagickFalse },
1688     { "ImportExport", ImportExportValidate, UndefinedOptionFlag, MagickFalse },
1689     { "Montage", MontageValidate, UndefinedOptionFlag, MagickFalse },
1690     { "Stream", StreamValidate, UndefinedOptionFlag, MagickFalse },
1691     { "None", NoValidate, UndefinedOptionFlag, MagickFalse },
1692     { (char *) NULL, UndefinedValidate, UndefinedOptionFlag, MagickFalse }
1693   },
1694   VirtualPixelOptions[] =
1695   {
1696     { "Undefined", UndefinedVirtualPixelMethod, UndefinedOptionFlag, MagickTrue },
1697     { "Background", BackgroundVirtualPixelMethod, UndefinedOptionFlag, MagickFalse },
1698     { "Black", BlackVirtualPixelMethod, UndefinedOptionFlag, MagickFalse },
1699     { "Constant", BackgroundVirtualPixelMethod, DeprecateOptionFlag, MagickTrue },
1700     { "CheckerTile", CheckerTileVirtualPixelMethod, UndefinedOptionFlag, MagickFalse },
1701     { "Dither", DitherVirtualPixelMethod, UndefinedOptionFlag, MagickFalse },
1702     { "Edge", EdgeVirtualPixelMethod, UndefinedOptionFlag, MagickFalse },
1703     { "Gray", GrayVirtualPixelMethod, UndefinedOptionFlag, MagickFalse },
1704     { "HorizontalTile", HorizontalTileVirtualPixelMethod, UndefinedOptionFlag, MagickFalse },
1705     { "HorizontalTileEdge", HorizontalTileEdgeVirtualPixelMethod, UndefinedOptionFlag, MagickFalse },
1706     { "Mirror", MirrorVirtualPixelMethod, UndefinedOptionFlag, MagickFalse },
1707     { "None", TransparentVirtualPixelMethod, UndefinedOptionFlag, MagickFalse },
1708     { "Random", RandomVirtualPixelMethod, UndefinedOptionFlag, MagickFalse },
1709     { "Tile", TileVirtualPixelMethod, UndefinedOptionFlag, MagickFalse },
1710     { "Transparent", TransparentVirtualPixelMethod, UndefinedOptionFlag, MagickFalse },
1711     { "VerticalTile", VerticalTileVirtualPixelMethod, UndefinedOptionFlag, MagickFalse },
1712     { "VerticalTileEdge", VerticalTileEdgeVirtualPixelMethod, UndefinedOptionFlag, MagickFalse },
1713     { "White", WhiteVirtualPixelMethod, UndefinedOptionFlag, MagickFalse },
1714     { (char *) NULL, UndefinedVirtualPixelMethod, UndefinedOptionFlag, MagickFalse }
1715   };
1716 \f
1717 static const OptionInfo *GetOptionInfo(const CommandOption option)
1718 {
1719   switch (option)
1720   {
1721     case MagickAlignOptions: return(AlignOptions);
1722     case MagickAlphaChannelOptions: return(AlphaChannelOptions);
1723     case MagickBooleanOptions: return(BooleanOptions);
1724     case MagickCacheOptions: return(CacheOptions);
1725     case MagickChannelOptions: return(ChannelOptions);
1726     case MagickClassOptions: return(ClassOptions);
1727     case MagickClipPathOptions: return(ClipPathOptions);
1728     case MagickColorspaceOptions: return(ColorspaceOptions);
1729     case MagickCommandOptions: return(CommandOptions);
1730     case MagickComplexOptions: return(ComplexOptions);
1731     case MagickComposeOptions: return(ComposeOptions);
1732     case MagickCompressOptions: return(CompressOptions);
1733     case MagickDataTypeOptions: return(DataTypeOptions);
1734     case MagickDebugOptions: return(LogEventOptions);
1735     case MagickDecorateOptions: return(DecorateOptions);
1736     case MagickDirectionOptions: return(DirectionOptions);
1737     case MagickDisposeOptions: return(DisposeOptions);
1738     case MagickDistortOptions: return(DistortOptions);
1739     case MagickDitherOptions: return(DitherOptions);
1740     case MagickEndianOptions: return(EndianOptions);
1741     case MagickEvaluateOptions: return(EvaluateOptions);
1742     case MagickFillRuleOptions: return(FillRuleOptions);
1743     case MagickFilterOptions: return(FilterOptions);
1744     case MagickFunctionOptions: return(FunctionOptions);
1745     case MagickGravityOptions: return(GravityOptions);
1746 /*  case MagickImageListOptions: return(ImageListOptions); */
1747     case MagickIntentOptions: return(IntentOptions);
1748     case MagickInterlaceOptions: return(InterlaceOptions);
1749     case MagickInterpolateOptions: return(InterpolateOptions);
1750     case MagickKernelOptions: return(KernelOptions);
1751     case MagickLayerOptions: return(LayerOptions);
1752     case MagickLineCapOptions: return(LineCapOptions);
1753     case MagickLineJoinOptions: return(LineJoinOptions);
1754     case MagickListOptions: return(ListOptions);
1755     case MagickLogEventOptions: return(LogEventOptions);
1756     case MagickMetricOptions: return(MetricOptions);
1757     case MagickMethodOptions: return(MethodOptions);
1758     case MagickModeOptions: return(ModeOptions);
1759     case MagickMorphologyOptions: return(MorphologyOptions);
1760     case MagickNoiseOptions: return(NoiseOptions);
1761     case MagickOrientationOptions: return(OrientationOptions);
1762     case MagickPixelChannelOptions: return(PixelChannelOptions);
1763     case MagickPixelIntensityOptions: return(PixelIntensityOptions);
1764     case MagickPixelMaskOptions: return(PixelMaskOptions);
1765     case MagickPixelTraitOptions: return(PixelTraitOptions);
1766     case MagickPolicyDomainOptions: return(PolicyDomainOptions);
1767     case MagickPolicyRightsOptions: return(PolicyRightsOptions);
1768     case MagickPreviewOptions: return(PreviewOptions);
1769     case MagickPrimitiveOptions: return(PrimitiveOptions);
1770     case MagickQuantumFormatOptions: return(QuantumFormatOptions);
1771     case MagickResolutionOptions: return(ResolutionOptions);
1772     case MagickResourceOptions: return(ResourceOptions);
1773     case MagickSparseColorOptions: return(SparseColorOptions);
1774     case MagickStatisticOptions: return(StatisticOptions);
1775     case MagickStorageOptions: return(StorageOptions);
1776     case MagickStretchOptions: return(StretchOptions);
1777     case MagickStyleOptions: return(StyleOptions);
1778     case MagickTypeOptions: return(TypeOptions);
1779     case MagickValidateOptions: return(ValidateOptions);
1780     case MagickVirtualPixelOptions: return(VirtualPixelOptions);
1781     default: break;
1782   }
1783   return((const OptionInfo *) NULL);
1784 }
1785 \f
1786 /*
1787 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1788 %                                                                             %
1789 %                                                                             %
1790 %                                                                             %
1791 %   C l o n e I m a g e O p t i o n s                                         %
1792 %                                                                             %
1793 %                                                                             %
1794 %                                                                             %
1795 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1796 %
1797 %  CloneImageOptions() clones all global image options, to another image_info
1798 %
1799 %  The format of the CloneImageOptions method is:
1800 %
1801 %      MagickBooleanType CloneImageOptions(ImageInfo *image_info,
1802 %        const ImageInfo *clone_info)
1803 %
1804 %  A description of each parameter follows:
1805 %
1806 %    o image_info: the image info to recieve the cloned options.
1807 %
1808 %    o clone_info: the source image info for options to clone.
1809 %
1810 */
1811 MagickExport MagickBooleanType CloneImageOptions(ImageInfo *image_info,
1812   const ImageInfo *clone_info)
1813 {
1814   assert(image_info != (ImageInfo *) NULL);
1815   assert(image_info->signature == MagickSignature);
1816   if (image_info->debug != MagickFalse)
1817     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
1818       image_info->filename);
1819   assert(clone_info != (const ImageInfo *) NULL);
1820   assert(clone_info->signature == MagickSignature);
1821   if (clone_info->options != (void *) NULL)
1822     {
1823       if (image_info->options != (void *) NULL)
1824         DestroyImageOptions(image_info);
1825       image_info->options=CloneSplayTree((SplayTreeInfo *) clone_info->options,
1826         (void *(*)(void *)) ConstantString,(void *(*)(void *)) ConstantString);
1827     }
1828   return(MagickTrue);
1829 }
1830 \f
1831 /*
1832 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1833 %                                                                             %
1834 %                                                                             %
1835 %                                                                             %
1836 %   D e f i n e I m a g e O p t i o n                                         %
1837 %                                                                             %
1838 %                                                                             %
1839 %                                                                             %
1840 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1841 %
1842 %  DefineImageOption() associates an assignment string of the form
1843 %  "key=value" with a global image option. It is equivelent to
1844 %  SetImageOption().
1845 %
1846 %  The format of the DefineImageOption method is:
1847 %
1848 %      MagickBooleanType DefineImageOption(ImageInfo *image_info,
1849 %        const char *option)
1850 %
1851 %  A description of each parameter follows:
1852 %
1853 %    o image_info: the image info.
1854 %
1855 %    o option: the image option assignment string.
1856 %
1857 */
1858 MagickExport MagickBooleanType DefineImageOption(ImageInfo *image_info,
1859   const char *option)
1860 {
1861   char
1862     key[MaxTextExtent],
1863     value[MaxTextExtent];
1864
1865   register char
1866     *p;
1867
1868   assert(image_info != (ImageInfo *) NULL);
1869   assert(option != (const char *) NULL);
1870   (void) CopyMagickString(key,option,MaxTextExtent);
1871   for (p=key; *p != '\0'; p++)
1872     if (*p == '=')
1873       break;
1874   *value='\0';
1875   if (*p == '=')
1876     (void) CopyMagickString(value,p+1,MaxTextExtent);
1877   *p='\0';
1878   return(SetImageOption(image_info,key,value));
1879 }
1880 \f
1881 /*
1882 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1883 %                                                                             %
1884 %                                                                             %
1885 %                                                                             %
1886 %   D e l e t e I m a g e O p t i o n                                         %
1887 %                                                                             %
1888 %                                                                             %
1889 %                                                                             %
1890 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1891 %
1892 %  DeleteImageOption() deletes an key from the global image options.
1893 %
1894 %  Returns MagickTrue is the option is found and deleted from the Options.
1895 %
1896 %  The format of the DeleteImageOption method is:
1897 %
1898 %      MagickBooleanType DeleteImageOption(ImageInfo *image_info,
1899 %        const char *key)
1900 %
1901 %  A description of each parameter follows:
1902 %
1903 %    o image_info: the image info.
1904 %
1905 %    o option: the image option.
1906 %
1907 */
1908 MagickExport MagickBooleanType DeleteImageOption(ImageInfo *image_info,
1909   const char *option)
1910 {
1911   assert(image_info != (ImageInfo *) NULL);
1912   assert(image_info->signature == MagickSignature);
1913   if (image_info->debug != MagickFalse)
1914     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
1915       image_info->filename);
1916   if (image_info->options == (void *) NULL)
1917     return(MagickFalse);
1918   return(DeleteNodeFromSplayTree((SplayTreeInfo *) image_info->options,option));
1919 }
1920 \f
1921 /*
1922 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1923 %                                                                             %
1924 %                                                                             %
1925 %                                                                             %
1926 %   D e s t r o y I m a g e O p t i o n s                                     %
1927 %                                                                             %
1928 %                                                                             %
1929 %                                                                             %
1930 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1931 %
1932 %  DestroyImageOptions() destroys all global options and associated memory
1933 %  attached to the given image_info image list.
1934 %
1935 %  The format of the DestroyDefines method is:
1936 %
1937 %      void DestroyImageOptions(ImageInfo *image_info)
1938 %
1939 %  A description of each parameter follows:
1940 %
1941 %    o image_info: the image info.
1942 %
1943 */
1944 MagickExport void DestroyImageOptions(ImageInfo *image_info)
1945 {
1946   assert(image_info != (ImageInfo *) NULL);
1947   assert(image_info->signature == MagickSignature);
1948   if (image_info->debug != MagickFalse)
1949     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
1950       image_info->filename);
1951   if (image_info->options != (void *) NULL)
1952     image_info->options=DestroySplayTree((SplayTreeInfo *) image_info->options);
1953 }
1954 \f
1955 /*
1956 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1957 %                                                                             %
1958 %                                                                             %
1959 %                                                                             %
1960 %   G e t I m a g e O p t i o n                                               %
1961 %                                                                             %
1962 %                                                                             %
1963 %                                                                             %
1964 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1965 %
1966 %  GetImageOption() gets a value associated with the global image options.
1967 %
1968 %  The returned string is a constant string in the tree and should NOT be
1969 %  freed by the caller.
1970 %
1971 %  The format of the GetImageOption method is:
1972 %
1973 %      const char *GetImageOption(const ImageInfo *image_info,
1974 %        const char *option)
1975 %
1976 %  A description of each parameter follows:
1977 %
1978 %    o image_info: the image info.
1979 %
1980 %    o option: the option.
1981 %
1982 */
1983 MagickExport const char *GetImageOption(const ImageInfo *image_info,
1984   const char *option)
1985 {
1986   assert(image_info != (ImageInfo *) NULL);
1987   assert(image_info->signature == MagickSignature);
1988   if (image_info->debug != MagickFalse)
1989     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
1990       image_info->filename);
1991   if (image_info->options == (void *) NULL)
1992     return((const char *) NULL);
1993   return((const char *) GetValueFromSplayTree((SplayTreeInfo *)
1994     image_info->options,option));
1995 }
1996 \f
1997 /*
1998 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1999 %                                                                             %
2000 %                                                                             %
2001 %                                                                             %
2002 %   G e t C o m m a n d O p t i o n F l a g s                                 %
2003 %                                                                             %
2004 %                                                                             %
2005 %                                                                             %
2006 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2007 %
2008 %  GetCommandOptionFlags() parses a string and returns an enumerated option
2009 %  flags(s).  Return a value of -1 if no such option is found.
2010 %
2011 %  The format of the GetCommandOptionFlags method is:
2012 %
2013 %      ssize_t GetCommandOptionFlags(const CommandOption option,
2014 %        const MagickBooleanType list,const char *options)
2015 %
2016 %  A description of each parameter follows:
2017 %
2018 %    o option: Index to the option table to lookup
2019 %
2020 %    o list: A option other than zero permits more than one option separated by
2021 %      a comma or pipe.
2022 %
2023 %    o options: One or more options separated by commas.
2024 %
2025 */
2026
2027 MagickExport ssize_t GetCommandOptionFlags(const CommandOption option,
2028   const MagickBooleanType list,const char *options)
2029 {
2030   char
2031     token[MaxTextExtent];
2032
2033   const OptionInfo
2034     *option_info;
2035
2036   int
2037     sentinel;
2038
2039   MagickBooleanType
2040     negate;
2041
2042   register char
2043     *q;
2044
2045   register const char
2046     *p;
2047
2048   register ssize_t
2049     i;
2050
2051   ssize_t
2052     option_types;
2053
2054   option_info=GetOptionInfo(option);
2055   if (option_info == (const OptionInfo *) NULL)
2056     return(UndefinedOptionFlag);
2057   option_types=0;
2058   sentinel=',';
2059   if (strchr(options,'|') != (char *) NULL)
2060     sentinel='|';
2061   for (p=options; p != (char *) NULL; p=strchr(p,sentinel))
2062   {
2063     while (((isspace((int) ((unsigned char) *p)) != 0) || (*p == sentinel)) &&
2064            (*p != '\0'))
2065       p++;
2066     negate=(*p == '!') ? MagickTrue : MagickFalse;
2067     if (negate != MagickFalse)
2068       p++;
2069     q=token;
2070     while (((isspace((int) ((unsigned char) *p)) == 0) && (*p != sentinel)) &&
2071            (*p != '\0'))
2072     {
2073       if ((q-token) >= (MaxTextExtent-1))
2074         break;
2075       *q++=(*p++);
2076     }
2077     *q='\0';
2078     for (i=0; option_info[i].mnemonic != (char *) NULL; i++)
2079       if (LocaleCompare(token,option_info[i].mnemonic) == 0)
2080         {
2081           if (*token == '!')
2082             option_types=option_types &~ option_info[i].flags;
2083           else
2084             option_types=option_types | option_info[i].flags;
2085           break;
2086         }
2087     if ((option_info[i].mnemonic == (char *) NULL) &&
2088         ((strchr(token+1,'-') != (char *) NULL) ||
2089          (strchr(token+1,'_') != (char *) NULL)))
2090       {
2091         while ((q=strchr(token+1,'-')) != (char *) NULL)
2092           (void) CopyMagickString(q,q+1,MaxTextExtent-strlen(q));
2093         while ((q=strchr(token+1,'_')) != (char *) NULL)
2094           (void) CopyMagickString(q,q+1,MaxTextExtent-strlen(q));
2095         for (i=0; option_info[i].mnemonic != (char *) NULL; i++)
2096           if (LocaleCompare(token,option_info[i].mnemonic) == 0)
2097             {
2098               if (*token == '!')
2099                 option_types=option_types &~ option_info[i].flags;
2100               else
2101                 option_types=option_types | option_info[i].flags;
2102               break;
2103             }
2104       }
2105     if (option_info[i].mnemonic == (char *) NULL)
2106       return(-1);
2107     if (list == MagickFalse)
2108       break;
2109   }
2110   return(option_types);
2111 }
2112 \f
2113 /*
2114 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2115 %                                                                             %
2116 %                                                                             %
2117 %                                                                             %
2118 %   G e t C o m m a n d O p t i o n I n f o                                   %
2119 %                                                                             %
2120 %                                                                             %
2121 %                                                                             %
2122 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2123 %
2124 %  GetCommandOptionInfo() returns pointer to the matching OptionInfo entry
2125 %  for the "CommandOptions" table only. A specialised binary search is used,
2126 %  to speed up the lookup for that very large table, and returns both the
2127 %  type (arg count) and flags (arg type).
2128 %
2129 %  This search reduces linear search of over 500 options (250 tests on
2130 %  average) to about 10 lookups!
2131 %
2132 %  The format of the GetCommandOptionInfo method is:
2133 %
2134 %      const char **GetCommandOptions(const CommandOption value)
2135 %
2136 %  A description of each parameter follows:
2137 %
2138 %    o value: the value.
2139 %
2140 */
2141 MagickExport const OptionInfo *GetCommandOptionInfo(const char *value)
2142 {
2143   const OptionInfo
2144     *option_info=CommandOptions;
2145
2146   static ssize_t
2147     table_size = 0;
2148
2149   register int
2150     i,l,h;
2151
2152   assert(value != (char *) NULL);
2153   assert(*value != '\0');
2154
2155   /* count up table items - first time only */
2156   if ( table_size == 0 )
2157     {
2158       l=-1;
2159       for (i=0; option_info[i].mnemonic != (const char *) NULL; i++)
2160         if ( LocaleCompare(value,option_info[i].mnemonic) == 0 )
2161           l=i;
2162       table_size = i;
2163       return( &option_info[(l>=0)?l:i] );
2164     }
2165
2166   /* faster binary search of command table, now that its length is known */
2167   l=0;
2168   h=table_size;
2169   while ( l < h )
2170   {
2171     int cmp;
2172     i = (l+h)/2; /* half the bounds */
2173     /* compare string part, then switch character! */
2174     cmp=LocaleCompare(value+1,option_info[i].mnemonic+1);
2175     if ( cmp == 0 )
2176       cmp = *value - *(option_info[i].mnemonic);
2177 #if 0
2178     (void) FormatLocaleFile(stderr,
2179       "%d --- %u < %u < %u --- \"%s\" < \"%s\" < \"%s\"\n",
2180       cmp,l,i,h,option_info[l].mnemonic,option_info[i].mnemonic,
2181       option_info[h].mnemonic);
2182 #endif
2183     if (cmp == 0)
2184       return(&option_info[i]);
2185     if (cmp > 0) l=i+1; else h=i;  /* reassign search bounds */
2186   }
2187   /* option was not found in table - return last 'null' entry. */
2188   return(&option_info[table_size]);
2189 }
2190 \f
2191 /*
2192 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2193 %                                                                             %
2194 %                                                                             %
2195 %                                                                             %
2196 %   G e t C o m m a n d O p t i o n s                                         %
2197 %                                                                             %
2198 %                                                                             %
2199 %                                                                             %
2200 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2201 %
2202 %  GetCommandOptions() returns a list of values.
2203 %
2204 %  The format of the GetCommandOptions method is:
2205 %
2206 %      const char **GetCommandOptions(const CommandOption value)
2207 %
2208 %  A description of each parameter follows:
2209 %
2210 %    o value: the value.
2211 %
2212 */
2213 MagickExport char **GetCommandOptions(const CommandOption value)
2214 {
2215   char
2216     **values;
2217
2218   const OptionInfo
2219     *option_info;
2220
2221   register ssize_t
2222     i;
2223
2224   option_info=GetOptionInfo(value);
2225   if (option_info == (const OptionInfo *) NULL)
2226     return((char **) NULL);
2227   for (i=0; option_info[i].mnemonic != (const char *) NULL; i++) ;
2228   values=(char **) AcquireQuantumMemory((size_t) i+1UL,sizeof(*values));
2229   if (values == (char **) NULL)
2230     ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
2231   for (i=0; option_info[i].mnemonic != (const char *) NULL; i++)
2232     values[i]=AcquireString(option_info[i].mnemonic);
2233   values[i]=(char *) NULL;
2234   return(values);
2235 }
2236 \f
2237 /*
2238 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2239 %                                                                             %
2240 %                                                                             %
2241 %                                                                             %
2242 %   G e t N e x t I m a g e O p t i o n                                       %
2243 %                                                                             %
2244 %                                                                             %
2245 %                                                                             %
2246 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2247 %
2248 %  GetNextImageOption() gets the next global option value.
2249 %
2250 %  The format of the GetNextImageOption method is:
2251 %
2252 %      char *GetNextImageOption(const ImageInfo *image_info)
2253 %
2254 %  A description of each parameter follows:
2255 %
2256 %    o image_info: the image info.
2257 %
2258 */
2259 MagickExport char *GetNextImageOption(const ImageInfo *image_info)
2260 {
2261   assert(image_info != (ImageInfo *) NULL);
2262   assert(image_info->signature == MagickSignature);
2263   if (image_info->debug != MagickFalse)
2264     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
2265       image_info->filename);
2266   if (image_info->options == (void *) NULL)
2267     return((char *) NULL);
2268   return((char *) GetNextKeyInSplayTree((SplayTreeInfo *) image_info->options));
2269 }
2270 \f
2271 /*
2272 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2273 %                                                                             %
2274 %                                                                             %
2275 %                                                                             %
2276 %     I s C o m m a n d O p t i o n                                           %
2277 %                                                                             %
2278 %                                                                             %
2279 %                                                                             %
2280 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2281 %
2282 %  IsCommandOption() returns MagickTrue if the option begins with a - or + and
2283 %  the first character that follows is alphanumeric.
2284 %
2285 %  The format of the IsCommandOption method is:
2286 %
2287 %      MagickBooleanType IsCommandOption(const char *option)
2288 %
2289 %  A description of each parameter follows:
2290 %
2291 %    o option: the option.
2292 %
2293 */
2294 MagickExport MagickBooleanType IsCommandOption(const char *option)
2295 {
2296   assert(option != (const char *) NULL);
2297   if ((*option != '-') && (*option != '+'))
2298     return(MagickFalse);
2299   if (strlen(option) == 1)
2300     return(IsMagickTrue( (*option == '{') || (*option == '}')
2301                       || (*option == '[') || (*option == ']') ));
2302   option++;
2303   if (*option == '-')
2304     return(MagickTrue);
2305   if (isalpha((int) ((unsigned char) *option)) == 0)
2306     return(MagickFalse);
2307   return(MagickTrue);
2308 }
2309 \f
2310 /*
2311 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2312 %                                                                             %
2313 %                                                                             %
2314 %                                                                             %
2315 %   C o m m a n d O p t i o n T o M n e m o n i c                             %
2316 %                                                                             %
2317 %                                                                             %
2318 %                                                                             %
2319 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2320 %
2321 %  CommandOptionToMnemonic() returns an enumerated value as a mnemonic.
2322 %
2323 %  The format of the CommandOptionToMnemonic method is:
2324 %
2325 %      const char *CommandOptionToMnemonic(const CommandOption option,
2326 %        const ssize_t type)
2327 %
2328 %  A description of each parameter follows:
2329 %
2330 %    o option: the option.
2331 %
2332 %    o type: one or more values separated by commas.
2333 %
2334 */
2335 MagickExport const char *CommandOptionToMnemonic(const CommandOption option,
2336   const ssize_t type)
2337 {
2338   const OptionInfo
2339     *option_info;
2340
2341   register ssize_t
2342     i;
2343
2344   option_info=GetOptionInfo(option);
2345   if (option_info == (const OptionInfo *) NULL)
2346     return((const char *) NULL);
2347   for (i=0; option_info[i].mnemonic != (const char *) NULL; i++)
2348     if (type == option_info[i].type)
2349       break;
2350   if (option_info[i].mnemonic == (const char *) NULL)
2351     return("undefined");
2352   return(option_info[i].mnemonic);
2353 }
2354 \f
2355 /*
2356 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2357 %                                                                             %
2358 %                                                                             %
2359 %                                                                             %
2360 %   L i s t C o m m a n d O p t i o n s                                       %
2361 %                                                                             %
2362 %                                                                             %
2363 %                                                                             %
2364 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2365 %
2366 %  ListCommandOptions() lists the contents of enumerated option type(s).
2367 %
2368 %  The format of the ListCommandOptions method is:
2369 %
2370 %      MagickBooleanType ListCommandOptions(FILE *file,
2371 %        const CommandOption option,ExceptionInfo *exception)
2372 %
2373 %  A description of each parameter follows:
2374 %
2375 %    o file:  list options to this file handle.
2376 %
2377 %    o option:  list these options.
2378 %
2379 %    o exception:  return any errors or warnings in this structure.
2380 %
2381 */
2382 MagickExport MagickBooleanType ListCommandOptions(FILE *file,
2383   const CommandOption option,ExceptionInfo *magick_unused(exception))
2384 {
2385   const OptionInfo
2386     *option_info;
2387
2388   register ssize_t
2389     i;
2390
2391   if (file == (FILE *) NULL)
2392     file=stdout;
2393   option_info=GetOptionInfo(option);
2394   if (option_info == (const OptionInfo *) NULL)
2395     return(MagickFalse);
2396   for (i=0; option_info[i].mnemonic != (char *) NULL; i++)
2397   {
2398     if (option_info[i].stealth != MagickFalse)
2399       continue;
2400     (void) FormatLocaleFile(file,"%s\n",option_info[i].mnemonic);
2401   }
2402   return(MagickTrue);
2403 }
2404 \f
2405 /*
2406 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2407 %                                                                             %
2408 %                                                                             %
2409 %                                                                             %
2410 %   P a r s e C h a n n e l O p t i o n                                       %
2411 %                                                                             %
2412 %                                                                             %
2413 %                                                                             %
2414 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2415 %
2416 %  ParseChannelOption() parses a string and returns an enumerated channel
2417 %  type(s).
2418 %
2419 %  The format of the ParseChannelOption method is:
2420 %
2421 %      ssize_t ParseChannelOption(const char *channels)
2422 %
2423 %  A description of each parameter follows:
2424 %
2425 %    o options: One or more values separated by commas.
2426 %
2427 */
2428 MagickExport ssize_t ParseChannelOption(const char *channels)
2429 {
2430   register ssize_t
2431     i;
2432
2433   ssize_t
2434     channel;
2435
2436   channel=ParseCommandOption(MagickChannelOptions,MagickTrue,channels);
2437   if (channel >= 0)
2438     return(channel);
2439   channel=0;
2440   for (i=0; i < (ssize_t) strlen(channels); i++)
2441   {
2442     switch (channels[i])
2443     {
2444       case 'A':
2445       case 'a':
2446       {
2447         channel|=AlphaChannel;
2448         break;
2449       }
2450       case 'B':
2451       case 'b':
2452       {
2453         channel|=BlueChannel;
2454         break;
2455       }
2456       case 'C':
2457       case 'c':
2458       {
2459         channel|=CyanChannel;
2460         break;
2461       }
2462       case 'g':
2463       case 'G':
2464       {
2465         channel|=GreenChannel;
2466         break;
2467       }
2468       case 'K':
2469       case 'k':
2470       {
2471         channel|=BlackChannel;
2472         break;
2473       }
2474       case 'M':
2475       case 'm':
2476       {
2477         channel|=MagentaChannel;
2478         break;
2479       }
2480       case 'o':
2481       case 'O':
2482       {
2483         channel|=AlphaChannel; /* depreciate */
2484         break;
2485       }
2486       case 'R':
2487       case 'r':
2488       {
2489         channel|=RedChannel;
2490         break;
2491       }
2492       case 'Y':
2493       case 'y':
2494       {
2495         channel|=YellowChannel;
2496         break;
2497       }
2498       case ',':
2499       {
2500         ssize_t
2501           type;
2502
2503         /*
2504           Gather the additional channel flags and merge with shorthand.
2505         */
2506         type=ParseCommandOption(MagickChannelOptions,MagickTrue,channels+i+1);
2507         if (type < 0)
2508           return(type);
2509         channel|=type;
2510         return(channel);
2511       }
2512       default:
2513         return(-1);
2514     }
2515   }
2516   return(channel);
2517 }
2518 \f
2519 /*
2520 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2521 %                                                                             %
2522 %                                                                             %
2523 %                                                                             %
2524 %   P a r s e C o m m a n d O p t i o n                                       %
2525 %                                                                             %
2526 %                                                                             %
2527 %                                                                             %
2528 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2529 %
2530 %  ParseCommandOption() parses a string and returns an enumerated option
2531 %  type(s).  Return a value of -1 if no such option is found.
2532 %
2533 %  The format of the ParseCommandOption method is:
2534 %
2535 %      ssize_t ParseCommandOption(const CommandOption option_table,
2536 %        const MagickBooleanType list,const char *options)
2537 %
2538 %  A description of each parameter follows:
2539 %
2540 %    o option_table: Index to the option table to lookup
2541 %
2542 %    o list: A option other than zero permits more than one option separated by
2543 %      a comma or pipe.
2544 %
2545 %    o options: One or more options separated by commas.
2546 %
2547 */
2548 MagickExport ssize_t ParseCommandOption(const CommandOption option_table,
2549   const MagickBooleanType list,const char *options)
2550 {
2551   char
2552     token[MaxTextExtent];
2553
2554   const OptionInfo
2555     *option_info;
2556
2557   int
2558     sentinel;
2559
2560   MagickBooleanType
2561     negate;
2562
2563   register char
2564     *q;
2565
2566   register const char
2567     *p;
2568
2569   register ssize_t
2570     i;
2571
2572   ssize_t
2573     option_types;
2574
2575   option_info=GetOptionInfo(option_table);
2576   if (option_info == (const OptionInfo *) NULL)
2577     return(-1);
2578   option_types=0;
2579   sentinel=',';
2580   if (strchr(options,'|') != (char *) NULL)
2581     sentinel='|';
2582   for (p=options; p != (char *) NULL; p=strchr(p,sentinel))
2583   {
2584     while (((isspace((int) ((unsigned char) *p)) != 0) || (*p == sentinel)) &&
2585            (*p != '\0'))
2586       p++;
2587     negate=(*p == '!') ? MagickTrue : MagickFalse;
2588     if (negate != MagickFalse)
2589       p++;
2590     q=token;
2591     while (((isspace((int) ((unsigned char) *p)) == 0) && (*p != sentinel)) &&
2592            (*p != '\0'))
2593     {
2594       if ((q-token) >= (MaxTextExtent-1))
2595         break;
2596       *q++=(*p++);
2597     }
2598     *q='\0';
2599     for (i=0; option_info[i].mnemonic != (char *) NULL; i++)
2600       if (LocaleCompare(token,option_info[i].mnemonic) == 0)
2601         {
2602           if (*token == '!')
2603             option_types=option_types &~ option_info[i].type;
2604           else
2605             option_types=option_types | option_info[i].type;
2606           break;
2607         }
2608     if ((option_info[i].mnemonic == (char *) NULL) &&
2609         ((strchr(token+1,'-') != (char *) NULL) ||
2610          (strchr(token+1,'_') != (char *) NULL)))
2611       {
2612         while ((q=strchr(token+1,'-')) != (char *) NULL)
2613           (void) CopyMagickString(q,q+1,MaxTextExtent-strlen(q));
2614         while ((q=strchr(token+1,'_')) != (char *) NULL)
2615           (void) CopyMagickString(q,q+1,MaxTextExtent-strlen(q));
2616         for (i=0; option_info[i].mnemonic != (char *) NULL; i++)
2617           if (LocaleCompare(token,option_info[i].mnemonic) == 0)
2618             {
2619               if (*token == '!')
2620                 option_types=option_types &~ option_info[i].type;
2621               else
2622                 option_types=option_types | option_info[i].type;
2623               break;
2624             }
2625       }
2626     if (option_info[i].mnemonic == (char *) NULL)
2627       return(-1);
2628     if (list == MagickFalse)
2629       break;
2630   }
2631   return(option_types);
2632 }
2633 \f
2634 /*
2635 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2636 %                                                                             %
2637 %                                                                             %
2638 %                                                                             %
2639 %   P a r s e P i x e l C h a n n e l O p t i o n                             %
2640 %                                                                             %
2641 %                                                                             %
2642 %                                                                             %
2643 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2644 %
2645 %  ParsePixelChannelOption() parses a string and returns an enumerated pixel
2646 %  channel type(s).
2647 %
2648 %  The format of the ParsePixelChannelOption method is:
2649 %
2650 %      ssize_t ParsePixelChannelOption(const char *channels)
2651 %
2652 %  A description of each parameter follows:
2653 %
2654 %    o channels: One or more channels separated by commas.
2655 %
2656 */
2657 MagickExport ssize_t ParsePixelChannelOption(const char *channels)
2658 {
2659   char
2660     *q,
2661     token[MaxTextExtent];
2662
2663   ssize_t
2664     channel;
2665
2666   GetMagickToken(channels,NULL,token);
2667   if ((*token == ';') || (*token == '|'))
2668     return(RedPixelChannel);
2669   channel=ParseCommandOption(MagickPixelChannelOptions,MagickTrue,token);
2670   if (channel >= 0)
2671     return(channel);
2672   q=(char *) token;
2673   channel=InterpretLocaleValue(token,&q);
2674   if ((q == token) || (channel < 0) || (channel >= MaxPixelChannels))
2675     return(-1);
2676   return(channel);
2677 }
2678 \f
2679 /*
2680 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2681 %                                                                             %
2682 %                                                                             %
2683 %                                                                             %
2684 %   R e m o v e I m a g e O p t i o n                                         %
2685 %                                                                             %
2686 %                                                                             %
2687 %                                                                             %
2688 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2689 %
2690 %  RemoveImageOption() removes an option from the image and returns its value.
2691 %
2692 %  In this case the ConstantString() value returned should be freed by the
2693 %  caller when finished.
2694 %
2695 %  The format of the RemoveImageOption method is:
2696 %
2697 %      char *RemoveImageOption(ImageInfo *image_info,const char *option)
2698 %
2699 %  A description of each parameter follows:
2700 %
2701 %    o image_info: the image info.
2702 %
2703 %    o option: the image option.
2704 %
2705 */
2706 MagickExport char *RemoveImageOption(ImageInfo *image_info,const char *option)
2707 {
2708   char
2709     *value;
2710
2711   assert(image_info != (ImageInfo *) NULL);
2712   assert(image_info->signature == MagickSignature);
2713   if (image_info->debug != MagickFalse)
2714     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
2715       image_info->filename);
2716   if (image_info->options == (void *) NULL)
2717     return((char *) NULL);
2718   value=(char *) RemoveNodeFromSplayTree((SplayTreeInfo *)
2719     image_info->options,option);
2720   return(value);
2721 }
2722 \f
2723 /*
2724 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2725 %                                                                             %
2726 %                                                                             %
2727 %                                                                             %
2728 %   R e s e t I m a g e O p t i o n                                           %
2729 %                                                                             %
2730 %                                                                             %
2731 %                                                                             %
2732 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2733 %
2734 %  ResetImageOptions() resets the image_info option.  That is, it deletes
2735 %  all global options associated with the image_info structure.
2736 %
2737 %  The format of the ResetImageOptions method is:
2738 %
2739 %      ResetImageOptions(ImageInfo *image_info)
2740 %
2741 %  A description of each parameter follows:
2742 %
2743 %    o image_info: the image info.
2744 %
2745 */
2746 MagickExport void ResetImageOptions(const ImageInfo *image_info)
2747 {
2748   assert(image_info != (ImageInfo *) NULL);
2749   assert(image_info->signature == MagickSignature);
2750   if (image_info->debug != MagickFalse)
2751     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
2752       image_info->filename);
2753   if (image_info->options == (void *) NULL)
2754     return;
2755   ResetSplayTree((SplayTreeInfo *) image_info->options);
2756 }
2757 \f
2758 /*
2759 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2760 %                                                                             %
2761 %                                                                             %
2762 %                                                                             %
2763 %   R e s e t I m a g e O p t i o n I t e r a t o r                           %
2764 %                                                                             %
2765 %                                                                             %
2766 %                                                                             %
2767 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2768 %
2769 %  ResetImageOptionIterator() resets the image_info values iterator.  Use it
2770 %  in conjunction with GetNextImageOption() to iterate over all the values
2771 %  associated with an image option.
2772 %
2773 %  The format of the ResetImageOptionIterator method is:
2774 %
2775 %      ResetImageOptionIterator(ImageInfo *image_info)
2776 %
2777 %  A description of each parameter follows:
2778 %
2779 %    o image_info: the image info.
2780 %
2781 */
2782 MagickExport void ResetImageOptionIterator(const ImageInfo *image_info)
2783 {
2784   assert(image_info != (ImageInfo *) NULL);
2785   assert(image_info->signature == MagickSignature);
2786   if (image_info->debug != MagickFalse)
2787     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
2788       image_info->filename);
2789   if (image_info->options == (void *) NULL)
2790     return;
2791   ResetSplayTreeIterator((SplayTreeInfo *) image_info->options);
2792 }
2793 \f
2794 /*
2795 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2796 %                                                                             %
2797 %                                                                             %
2798 %                                                                             %
2799 %   S e t I m a g e O p t i o n                                               %
2800 %                                                                             %
2801 %                                                                             %
2802 %                                                                             %
2803 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2804 %
2805 %  SetImageOption() associates an value with an image option.
2806 %
2807 %  The format of the SetImageOption method is:
2808 %
2809 %      MagickBooleanType SetImageOption(ImageInfo *image_info,
2810 %        const char *option,const char *value)
2811 %
2812 %  A description of each parameter follows:
2813 %
2814 %    o image_info: the image info.
2815 %
2816 %    o option: the image option.
2817 %
2818 %    o values: the image option values.
2819 %
2820 */
2821 MagickExport MagickBooleanType SetImageOption(ImageInfo *image_info,
2822   const char *option,const char *value)
2823 {
2824   assert(image_info != (ImageInfo *) NULL);
2825   assert(image_info->signature == MagickSignature);
2826   if (image_info->debug != MagickFalse)
2827     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
2828       image_info->filename);
2829   /*
2830     Specific global option settings.
2831   */
2832   if (LocaleCompare(option,"size") == 0) {
2833     (void) CloneString(&image_info->size,value);
2834     return(MagickTrue);
2835   }
2836   /*
2837     Create tree if needed - specify how key,values are to be freed.
2838   */
2839   if (image_info->options == (void *) NULL)
2840     image_info->options=NewSplayTree(CompareSplayTreeString,
2841       RelinquishMagickMemory,RelinquishMagickMemory);
2842   /*
2843     Delete Option if NULL --  empty string values are valid!
2844   */
2845   if (value == (const char *) NULL)
2846     return(DeleteImageOption(image_info,option));
2847   /*
2848     Add option to splay-tree.
2849   */
2850   return(AddValueToSplayTree((SplayTreeInfo *) image_info->options,
2851     ConstantString(option),ConstantString(value)));
2852 }