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