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