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