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