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