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