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