validate.h revision 3e3b219afd0ae422c35f10a12b55807d37df0615
1/*
2  Copyright 1999-2010 ImageMagick Studio LLC, a non-profit organization
3  dedicated to making software imaging solutions freely available.
4
5  You may not use this file except in compliance with the License.
6  obtain a copy of the License at
7
8    http://www.imagemagick.org/script/license.php
9
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  Wizard the License for the specific language governing permissions and
14  limitations under the License.
15
16  ImageMagick test vectors.
17*/
18#ifndef _IMAGEMAGICK_VALIDATE_H
19#define _IMAGEMAGICK_VALIDATE_H
20
21#define ReferenceFilename  "rose:"
22#define ReferenceImageFormat  "MIFF"
23
24static const char
25  *compare_options[] =
26  {
27    "",
28    "-compose Src",
29    "-highlight-color SeaGreen",
30    "-metric AE -fuzz 5%",
31    (const char *) NULL
32  };
33
34static const char
35  *composite_options[] =
36  {
37    "",
38    "-compose Add",
39    "-compose Atop",
40    "-compose Blend",
41    "-compose Bumpmap",
42    "-compose ChangeMask",
43    "-compose Clear",
44    "-compose ColorBurn",
45    "-compose ColorDodge",
46    "-compose Colorize",
47    "-compose CopyBlack",
48    "-compose CopyBlue",
49    "-compose CopyCyan",
50    "-compose CopyGreen",
51    "-compose Copy",
52    "-compose CopyMagenta",
53    "-compose CopyOpacity",
54    "-compose CopyRed",
55    "-compose CopyYellow",
56    "-compose Darken",
57    "-compose Divide",
58    "-compose Dst",
59    "-compose Difference",
60    "-compose Displace",
61    "-compose Dissolve",
62    "-compose DstAtop",
63    "-compose DstIn",
64    "-compose DstOut",
65    "-compose DstOver",
66    "-compose Dst",
67    "-compose Exclusion",
68    "-compose HardLight",
69    "-compose Hue",
70    "-compose In",
71    "-compose Lighten",
72    "-compose LinearLight",
73    "-compose Luminize",
74    "-compose Minus",
75    "-compose Modulate",
76    "-compose Multiply",
77    "-compose None",
78    "-compose Out",
79    "-compose Overlay",
80    "-compose Over",
81    "-compose Plus",
82    "-compose Replace",
83    "-compose Saturate",
84    "-compose Screen",
85    "-compose SoftLight",
86    "-compose Src",
87    "-compose SrcAtop",
88    "-compose SrcIn",
89    "-compose SrcOut",
90    "-compose SrcOver",
91    "-compose Src",
92    "-compose Subtract",
93    "-compose Threshold",
94    "-compose Xor",
95    "-geometry +35+65 -label Magick",
96    (const char *) NULL
97  };
98
99static const char
100  *convert_options[] =
101  {
102    "-noop",
103    "-affine 1,0,0.785,1,0,0 -transform",
104    "-black-threshold 20%",
105    "-blur 0x0.5",
106    "-border 6x6",
107    "-charcoal 0x1",
108    "-chop 8x6+20+30",
109    "-colors 16",
110    "-colorspace CMYK",
111    "-colorspace GRAY",
112    "-colorspace HSL",
113    "-colorspace HWB",
114    "-colorspace OHTA",
115    "-colorspace YCbCr",
116    "-colorspace YIQ",
117    "-colorspace YUV",
118    "-contrast",
119    "+contrast",
120    "-convolve 1,1,1,1,4,1,1,1,1",
121    "-colorize 30%/20%/50%",
122    "-crop 17x9+10+10",
123    "-cycle 200",
124    "-despeckle",
125    "-draw \"rectangle 20,10 80,50\"",
126    "-edge 0x1",
127    "-emboss 0x1",
128    "-enhance",
129    "-equalize",
130    "-flip",
131    "-flop",
132    "-frame 15x15+3+3",
133    "-fx \"(1.0/(1.0+exp(10.0*(0.5-u)))-0.006693)*1.0092503\"",
134    "-gamma 1.6",
135    "-gaussian 0x0.5",
136    "-implode 0.5",
137    "-implode -1",
138    "-label Magick",
139    "-lat 10x10-5%",
140    "-level 10%,1.2,90%",
141    "-map netscape:",
142    "-median 2",
143    "-modulate 110/100/95",
144    "-monochrome",
145    "-motion-blur 0x3+30",
146    "-negate",
147    "+noise Uniform",
148    "+noise Gaussian",
149    "+noise Multiplicative",
150    "+noise Impulse",
151    "+noise Laplacian",
152    "+noise Poisson",
153    "-noise 2",
154    "-normalize",
155    "-fill blue -fuzz 35% -opaque red",
156    "-ordered-dither 2x2",
157    "-paint 0x1",
158    "-raise 10x10",
159    "-random-threshold 10%",
160    "-recolor '0.9 0 0, 0 0.9 0, 0 0 1.2'",
161    "-density 75x75 -resample 50x50",
162    "-resize 10%",
163    "-resize 50%",
164    "-resize 150%",
165    "-roll +20+10",
166    "-rotate 0",
167    "-rotate 45",
168    "-rotate 90",
169    "-rotate 180",
170    "-rotate 270",
171    "-sample 5%",
172    "-sample 50%",
173    "-sample 150%",
174    "-scale 5%",
175    "-scale 50%",
176    "-scale 150%",
177    "-segment 1x1.5",
178    "-shade 30x30",
179    "-sharpen 0x1.0",
180    "-shave 10x10",
181    "-shear 45x45",
182    "-size 130x194",
183    "-solarize 50%",
184    "-spread 3",
185    "-swirl 90",
186    "-threshold 35%",
187    "-fuzz 35% -transparent red",
188    "-fuzz 5% -trim",
189    "-unsharp 0x1.0+20+1",
190    "-wave 25x150",
191    "-white-threshold 80%",
192    (const char *) NULL
193  };
194
195static const char
196  *identify_options[] =
197  {
198    "",
199    "-verbose",
200    "-features 1 -verbose",
201    "-unique -verbose",
202    (const char *) NULL
203  };
204
205static const char
206  *montage_options[] =
207  {
208    "",
209    "-frame 5",
210    "-geometry 13x19+10+5 -gravity Center",
211    "-label %f",
212    "-pointsize 10",
213    "-shadow",
214    "-tile 3x3",
215    (const char *) NULL
216  };
217
218static const char
219  *stream_options[] =
220  {
221    "",
222    (const char *) NULL
223  };
224
225struct ReferenceFormats
226{
227  const char
228    *magick;
229
230  CompressionType
231    compression;
232
233  double
234    fuzz;
235};
236
237static const struct ReferenceFormats
238  reference_formats[] =
239  {
240    { "ART", UndefinedCompression, 0.0 },
241    { "AVS", UndefinedCompression, 0.0 },
242    { "BMP", UndefinedCompression, 0.0 },
243    { "CIN", UndefinedCompression, 0.0 },
244    { "CMYK", UndefinedCompression, 0.0 },
245    { "CMYKA", UndefinedCompression, 0.0 },
246    { "CUT", UndefinedCompression, 0.0 },
247    { "DCM", UndefinedCompression, 0.0 },
248    { "DCR", UndefinedCompression, 0.0 },
249    { "DCX", UndefinedCompression, 0.0 },
250    { "DDS", UndefinedCompression, 0.0 },
251    { "DFONT", UndefinedCompression, 0.0 },
252    { "DJVU", UndefinedCompression, 0.0 },
253    { "DNG", UndefinedCompression, 0.0 },
254    { "DOT", UndefinedCompression, 0.0 },
255    { "DPS", UndefinedCompression, 0.0 },
256    { "DPX", UndefinedCompression, 0.0 },
257    { "ERF", UndefinedCompression, 0.0 },
258    { "EXR", UndefinedCompression, 0.0 },
259    { "FITS", UndefinedCompression, 0.003 },
260    { "FPX", UndefinedCompression, 0.0 },
261    { "FRACTAL", UndefinedCompression, 0.0 },
262    { "FTS", UndefinedCompression, 0.003 },
263    { "GIF", UndefinedCompression, 0.0 },
264    { "GIF87", UndefinedCompression, 0.0 },
265    { "GRAY", UndefinedCompression, 0.0 },
266    { "HTM", UndefinedCompression, 0.0 },
267    { "HRZ", UndefinedCompression, 0.0 },
268    { "HTML", UndefinedCompression, 0.0 },
269    { "ICB", UndefinedCompression, 0.0 },
270    { "ICO", UndefinedCompression, 0.0 },
271    { "ICON", UndefinedCompression, 0.0 },
272    { "INFO", UndefinedCompression, 0.0 },
273    { "INLINE", UndefinedCompression, 0.0 },
274    { "JBG", UndefinedCompression, 0.0 },
275    { "JNG", UndefinedCompression, 0.003 },
276    { "JP2", UndefinedCompression, 0.0 },
277    { "JPC", UndefinedCompression, 0.0 },
278    { "JPEG", UndefinedCompression, 0.003 },
279    { "JPG", UndefinedCompression, 0.003 },
280    { "K25", UndefinedCompression, 0.0 },
281    { "KDC", UndefinedCompression, 0.0 },
282    { "MATTE", UndefinedCompression, 0.0 },
283    { "MIFF", UndefinedCompression, 0.0 },
284    { "MNG", UndefinedCompression, 0.0 },
285    { "MONO", UndefinedCompression, 0.0 },
286    { "MRW", UndefinedCompression, 0.0 },
287    { "MTV", UndefinedCompression, 0.0 },
288    { "NEF", UndefinedCompression, 0.0 },
289    { "ORF", UndefinedCompression, 0.0 },
290    { "OTB", UndefinedCompression, 0.0 },
291    { "OTF", UndefinedCompression, 0.0 },
292    { "PAL", UndefinedCompression, 0.0 },
293    { "PAM", UndefinedCompression, 0.0 },
294    { "PBM", UndefinedCompression, 0.0 },
295    { "PCT", UndefinedCompression, 0.003 },
296    { "PCX", UndefinedCompression, 0.0 },
297    { "PEF", UndefinedCompression, 0.0 },
298    { "PFA", UndefinedCompression, 0.0 },
299    { "PFB", UndefinedCompression, 0.0 },
300    { "PFM", UndefinedCompression, 0.0 },
301    { "PGM", UndefinedCompression, 0.0 },
302    { "PGX", UndefinedCompression, 0.0 },
303    { "PICT", UndefinedCompression, 0.003 },
304    { "PIX", UndefinedCompression, 0.0 },
305    { "PJPEG", UndefinedCompression, 0.003 },
306    { "PLASMA", UndefinedCompression, 0.0 },
307    { "PNG", UndefinedCompression, 0.0 },
308    { "PNG24", UndefinedCompression, 0.0 },
309    { "PNG32", UndefinedCompression, 0.0 },
310    { "PNM", UndefinedCompression, 0.0 },
311    { "PPM", UndefinedCompression, 0.0 },
312    { "PREVIEW", UndefinedCompression, 0.0 },
313    { "PTIF", UndefinedCompression, 0.0 },
314    { "PWP", UndefinedCompression, 0.0 },
315    { "RADIAL-GR", UndefinedCompression, 0.0 },
316    { "RAF", UndefinedCompression, 0.0 },
317    { "RAS", UndefinedCompression, 0.0 },
318    { "RGB", UndefinedCompression, 0.0 },
319    { "RGBA", UndefinedCompression, 0.003 },
320    { "RGBO", UndefinedCompression, 0.0 },
321    { "RLA", UndefinedCompression, 0.0 },
322    { "RLE", UndefinedCompression, 0.0 },
323    { "SCR", UndefinedCompression, 0.0 },
324    { "SCT", UndefinedCompression, 0.0 },
325    { "SFW", UndefinedCompression, 0.0 },
326    { "SGI", UndefinedCompression, 0.0 },
327    { "SHTML", UndefinedCompression, 0.0 },
328    { "SR2", UndefinedCompression, 0.0 },
329    { "SRF", UndefinedCompression, 0.0 },
330    { "STEGANO", UndefinedCompression, 0.0 },
331    { "SUN", UndefinedCompression, 0.0 },
332    { "TGA", UndefinedCompression, 0.0 },
333    { "TIFF", UndefinedCompression, 0.0 },
334    { "TIFF64", UndefinedCompression, 0.0 },
335    { "TILE", UndefinedCompression, 0.0 },
336    { "TIM", UndefinedCompression, 0.0 },
337    { "TTC", UndefinedCompression, 0.0 },
338    { "TTF", UndefinedCompression, 0.0 },
339    { "TXT", UndefinedCompression, 0.0 },
340    { "UIL", UndefinedCompression, 0.0 },
341    { "UYVY", UndefinedCompression, 0.0 },
342    { "VDA", UndefinedCompression, 0.0 },
343    { "VICAR", UndefinedCompression, 0.0 },
344    { "VIFF", UndefinedCompression, 0.0 },
345    { "VST", UndefinedCompression, 0.0 },
346    { "WBMP", UndefinedCompression, 0.0 },
347    { "WPG", UndefinedCompression, 0.0 },
348    { "X3F", UndefinedCompression, 0.0 },
349    { "XBM", UndefinedCompression, 0.0 },
350    { "XCF", UndefinedCompression, 0.0 },
351    { "XPM", UndefinedCompression, 0.0 },
352    { "XPS", UndefinedCompression, 0.0 },
353    { "XV", UndefinedCompression, 0.0 },
354#if !defined(__WINDOWS__)
355    { "XWD", UndefinedCompression, 0.0 },
356#endif
357    { "YUV", UndefinedCompression, 0.0 },
358    { "YCbCr", UndefinedCompression, 0.0 },
359    { "YCbCrA", UndefinedCompression, 0.0 },
360#if defined(MAGICKCORE_GS_DELEGATE)
361    { "AI", UndefinedCompression, 0.0 },
362    { "EPDF", UndefinedCompression, 0.0 },
363    { "EPI", UndefinedCompression, 0.0 },
364    { "EPS", UndefinedCompression, 0.0 },
365    { "EPS2", UndefinedCompression, 0.0 },
366    { "EPS3", UndefinedCompression, 0.0 },
367    { "EPSF", UndefinedCompression, 0.0 },
368    { "EPSI", UndefinedCompression, 0.0 },
369    { "EPT", UndefinedCompression, 0.0 },
370    { "PDF", UndefinedCompression, 0.0 },
371    { "PDF", ZipCompression, 0.0 },
372    { "PDF", FaxCompression, 0.0 },
373    { "PDF", JPEGCompression, 0.003 },
374    { "PDF", RLECompression, 0.0 },
375    { "PDF", LZWCompression, 0.0 },
376    { "PDFA", UndefinedCompression, 0.0 },
377    { "PS", UndefinedCompression, 0.0 },
378    { "PS2", UndefinedCompression, 0.0 },
379    { "PS3", UndefinedCompression, 0.0 },
380    { "PS3", ZipCompression, 0.0 },
381    { "PS3", FaxCompression, 0.0 },
382    { "PS3", JPEGCompression, 0.003 },
383    { "PS3", RLECompression, 0.0 },
384    { "PS3", LZWCompression, 0.0 },
385#endif
386    { (const char *) NULL, UndefinedCompression, 0.0 }
387  };
388
389static const char
390  *reference_map[] =
391  {
392    "bgro",
393    "bgrp",
394    "bgr",
395    "cmyk",
396    "cmy",
397    "i",
398    "prgb",
399    "rgba",
400    "rgbo",
401    "rgb",
402    (char *) NULL
403  };
404
405struct ReferenceStorage
406{
407  StorageType
408    type;
409
410  size_t
411    quantum;
412};
413
414static const struct ReferenceStorage
415  reference_storage[] =
416  {
417    { CharPixel, sizeof(unsigned char) },
418    { DoublePixel, sizeof(double) },
419    { FloatPixel, sizeof(float) },
420    { IntegerPixel, sizeof(unsigned int) },
421    { LongPixel, sizeof(unsigned long) },
422    { ShortPixel, sizeof(unsigned short) },
423    { UndefinedPixel, 0 }
424  };
425
426struct ReferenceTypes
427{
428  ImageType
429    type;
430
431  unsigned long
432    depth;
433};
434
435static const struct ReferenceTypes
436  reference_types[] =
437  {
438    { TrueColorType, 8 },
439    { TrueColorMatteType, 8 },
440    { GrayscaleType, 8 },
441    { GrayscaleMatteType, 8 },
442    { PaletteType, 8 },
443    { PaletteMatteType, 8 },
444    { PaletteBilevelMatteType, 8 },
445    { BilevelType, 1 },
446    { ColorSeparationType, 8 },
447    { ColorSeparationMatteType, 8 },
448    { TrueColorType, 10 },
449    { TrueColorType, 12 },
450    { TrueColorType, 16 },
451    { UndefinedType, 0 }
452  };
453
454#endif
455