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