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