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