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