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