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