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