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