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