blob: 707fe53ceafcb468caa73ce0fa2db265ab7bd9bd [file] [log] [blame]
cristy3ed852e2009-09-05 21:47:34 +00001/*
cristyb56bb242014-11-25 17:12:48 +00002 Copyright 1999-2015 ImageMagick Studio LLC, a non-profit organization
cristy3ed852e2009-09-05 21:47:34 +00003 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 {
cristy44097f52012-12-16 19:56:20 +000027 "-metric RMSE -fuzz 5%",
cristy3ed852e2009-09-05 21:47:34 +000028 "-metric AE -fuzz 5%",
29 (const char *) NULL
30 };
31
32static const char
33 *composite_options[] =
34 {
35 "",
cristy3ed852e2009-09-05 21:47:34 +000036 "-compose Atop",
37 "-compose Blend",
38 "-compose Bumpmap",
39 "-compose ChangeMask",
40 "-compose Clear",
41 "-compose ColorBurn",
42 "-compose ColorDodge",
43 "-compose Colorize",
44 "-compose CopyBlack",
45 "-compose CopyBlue",
46 "-compose CopyCyan",
47 "-compose CopyGreen",
48 "-compose Copy",
49 "-compose CopyMagenta",
50 "-compose CopyOpacity",
51 "-compose CopyRed",
52 "-compose CopyYellow",
53 "-compose Darken",
54 "-compose Divide",
55 "-compose Dst",
56 "-compose Difference",
57 "-compose Displace",
58 "-compose Dissolve",
59 "-compose DstAtop",
60 "-compose DstIn",
61 "-compose DstOut",
62 "-compose DstOver",
63 "-compose Dst",
64 "-compose Exclusion",
65 "-compose HardLight",
66 "-compose Hue",
67 "-compose In",
68 "-compose Lighten",
69 "-compose LinearLight",
70 "-compose Luminize",
71 "-compose Minus",
72 "-compose Modulate",
cristybae8cb62014-05-27 00:17:34 +000073 "-compose ModulusAdd",
74 "-compose ModulusSubtract",
cristy3ed852e2009-09-05 21:47:34 +000075 "-compose Multiply",
76 "-compose None",
77 "-compose Out",
78 "-compose Overlay",
79 "-compose Over",
80 "-compose Plus",
81 "-compose Replace",
82 "-compose Saturate",
83 "-compose Screen",
84 "-compose SoftLight",
85 "-compose Src",
86 "-compose SrcAtop",
87 "-compose SrcIn",
88 "-compose SrcOut",
89 "-compose SrcOver",
90 "-compose Src",
cristy3ed852e2009-09-05 21:47:34 +000091 "-compose Threshold",
92 "-compose Xor",
93 "-geometry +35+65 -label Magick",
94 (const char *) NULL
95 };
96
97static const char
98 *convert_options[] =
99 {
100 "-noop",
101 "-affine 1,0,0.785,1,0,0 -transform",
102 "-black-threshold 20%",
103 "-blur 0x0.5",
104 "-border 6x6",
cristy85636be2014-04-04 19:16:53 +0000105 "-canny 0x1+10%+80%",
cristy3ed852e2009-09-05 21:47:34 +0000106 "-charcoal 0x1",
107 "-chop 8x6+20+30",
108 "-colors 16",
109 "-colorspace CMYK",
110 "-colorspace GRAY",
111 "-colorspace HSL",
112 "-colorspace HWB",
113 "-colorspace OHTA",
114 "-colorspace YCbCr",
115 "-colorspace YIQ",
116 "-colorspace YUV",
117 "-contrast",
118 "+contrast",
119 "-convolve 1,1,1,1,4,1,1,1,1",
120 "-colorize 30%/20%/50%",
121 "-crop 17x9+10+10",
122 "-cycle 200",
123 "-despeckle",
124 "-draw \"rectangle 20,10 80,50\"",
125 "-edge 0x1",
126 "-emboss 0x1",
127 "-enhance",
128 "-equalize",
129 "-flip",
130 "-flop",
131 "-frame 15x15+3+3",
132 "-fx \"(1.0/(1.0+exp(10.0*(0.5-u)))-0.006693)*1.0092503\"",
133 "-gamma 1.6",
134 "-gaussian 0x0.5",
135 "-implode 0.5",
136 "-implode -1",
137 "-label Magick",
138 "-lat 10x10-5%",
139 "-level 10%,1.2,90%",
140 "-map netscape:",
141 "-median 2",
142 "-modulate 110/100/95",
143 "-monochrome",
144 "-motion-blur 0x3+30",
145 "-negate",
146 "+noise Uniform",
147 "+noise Gaussian",
148 "+noise Multiplicative",
149 "+noise Impulse",
150 "+noise Laplacian",
151 "+noise Poisson",
152 "-noise 2",
153 "-normalize",
154 "-fill blue -fuzz 35% -opaque red",
155 "-ordered-dither 2x2",
156 "-paint 0x1",
157 "-raise 10x10",
158 "-random-threshold 10%",
cristybae8cb62014-05-27 00:17:34 +0000159 "-color-matrix '0.9 0 0, 0 0.9 0, 0 0 1.2'",
cristy3ed852e2009-09-05 21:47:34 +0000160 "-density 75x75 -resample 50x50",
161 "-resize 10%",
162 "-resize 50%",
163 "-resize 150%",
164 "-roll +20+10",
165 "-rotate 0",
166 "-rotate 45",
167 "-rotate 90",
168 "-rotate 180",
169 "-rotate 270",
170 "-sample 5%",
171 "-sample 50%",
172 "-sample 150%",
173 "-scale 5%",
174 "-scale 50%",
175 "-scale 150%",
176 "-segment 1x1.5",
177 "-shade 30x30",
178 "-sharpen 0x1.0",
179 "-shave 10x10",
180 "-shear 45x45",
181 "-size 130x194",
182 "-solarize 50%",
183 "-spread 3",
184 "-swirl 90",
185 "-threshold 35%",
186 "-fuzz 35% -transparent red",
187 "-fuzz 5% -trim",
188 "-unsharp 0x1.0+20+1",
189 "-wave 25x150",
190 "-white-threshold 80%",
191 (const char *) NULL
192 };
193
194static const char
195 *identify_options[] =
196 {
197 "",
198 "-verbose",
cristy3e3b2192010-03-03 03:06:13 +0000199 "-features 1 -verbose",
200 "-unique -verbose",
cristy3ed852e2009-09-05 21:47:34 +0000201 (const char *) NULL
202 };
203
204static const char
205 *montage_options[] =
206 {
207 "",
208 "-frame 5",
209 "-geometry 13x19+10+5 -gravity Center",
210 "-label %f",
211 "-pointsize 10",
212 "-shadow",
213 "-tile 3x3",
214 (const char *) NULL
215 };
216
217static const char
218 *stream_options[] =
219 {
220 "",
221 (const char *) NULL
222 };
223
224struct ReferenceFormats
225{
226 const char
227 *magick;
228
cristy7998e5f2009-10-08 02:45:33 +0000229 CompressionType
230 compression;
231
cristy3ed852e2009-09-05 21:47:34 +0000232 double
233 fuzz;
234};
235
236static const struct ReferenceFormats
237 reference_formats[] =
238 {
cristy7998e5f2009-10-08 02:45:33 +0000239 { "ART", UndefinedCompression, 0.0 },
240 { "AVS", UndefinedCompression, 0.0 },
241 { "BMP", UndefinedCompression, 0.0 },
242 { "CIN", UndefinedCompression, 0.0 },
243 { "CMYK", UndefinedCompression, 0.0 },
244 { "CMYKA", UndefinedCompression, 0.0 },
245 { "CUT", UndefinedCompression, 0.0 },
246 { "DCM", UndefinedCompression, 0.0 },
247 { "DCR", UndefinedCompression, 0.0 },
248 { "DCX", UndefinedCompression, 0.0 },
249 { "DDS", UndefinedCompression, 0.0 },
250 { "DFONT", UndefinedCompression, 0.0 },
251 { "DJVU", UndefinedCompression, 0.0 },
252 { "DNG", UndefinedCompression, 0.0 },
253 { "DOT", UndefinedCompression, 0.0 },
254 { "DPS", UndefinedCompression, 0.0 },
cristy304eaf02014-03-29 13:49:42 +0000255 { "DPX", UndefinedCompression, 0.004 },
cristy7998e5f2009-10-08 02:45:33 +0000256 { "ERF", UndefinedCompression, 0.0 },
257 { "EXR", UndefinedCompression, 0.0 },
cristy7998e5f2009-10-08 02:45:33 +0000258 { "FPX", UndefinedCompression, 0.0 },
259 { "FRACTAL", UndefinedCompression, 0.0 },
cristy7998e5f2009-10-08 02:45:33 +0000260 { "GIF", UndefinedCompression, 0.0 },
261 { "GIF87", UndefinedCompression, 0.0 },
cristy304eaf02014-03-29 13:49:42 +0000262 { "GRAY", UndefinedCompression, 0.004 },
cristy7998e5f2009-10-08 02:45:33 +0000263 { "HTM", UndefinedCompression, 0.0 },
cristy7998e5f2009-10-08 02:45:33 +0000264 { "HTML", UndefinedCompression, 0.0 },
265 { "ICB", UndefinedCompression, 0.0 },
266 { "ICO", UndefinedCompression, 0.0 },
267 { "ICON", UndefinedCompression, 0.0 },
268 { "INFO", UndefinedCompression, 0.0 },
cristy7998e5f2009-10-08 02:45:33 +0000269 { "JBG", UndefinedCompression, 0.0 },
cristy304eaf02014-03-29 13:49:42 +0000270 { "JNG", UndefinedCompression, 0.004 },
271 { "JNG", JPEGCompression, 0.004 },
272 { "JP2", UndefinedCompression, 0.004 },
273 { "J2K", UndefinedCompression, 0.004 },
274 { "JPEG", UndefinedCompression, 0.004 },
275 { "JPG", UndefinedCompression, 0.004 },
cristy7998e5f2009-10-08 02:45:33 +0000276 { "K25", UndefinedCompression, 0.0 },
277 { "KDC", UndefinedCompression, 0.0 },
cristy7998e5f2009-10-08 02:45:33 +0000278 { "MATTE", UndefinedCompression, 0.0 },
279 { "MIFF", UndefinedCompression, 0.0 },
280 { "MNG", UndefinedCompression, 0.0 },
281 { "MONO", UndefinedCompression, 0.0 },
cristy7998e5f2009-10-08 02:45:33 +0000282 { "MRW", UndefinedCompression, 0.0 },
283 { "MTV", UndefinedCompression, 0.0 },
284 { "NEF", UndefinedCompression, 0.0 },
285 { "ORF", UndefinedCompression, 0.0 },
286 { "OTB", UndefinedCompression, 0.0 },
287 { "OTF", UndefinedCompression, 0.0 },
288 { "PAL", UndefinedCompression, 0.0 },
289 { "PAM", UndefinedCompression, 0.0 },
290 { "PBM", UndefinedCompression, 0.0 },
cristy304eaf02014-03-29 13:49:42 +0000291 { "PCT", UndefinedCompression, 0.004 },
cristy7998e5f2009-10-08 02:45:33 +0000292 { "PCX", UndefinedCompression, 0.0 },
293 { "PEF", UndefinedCompression, 0.0 },
294 { "PFA", UndefinedCompression, 0.0 },
295 { "PFB", UndefinedCompression, 0.0 },
cristy304eaf02014-03-29 13:49:42 +0000296 { "PFM", UndefinedCompression, 0.004 },
cristy7998e5f2009-10-08 02:45:33 +0000297 { "PGM", UndefinedCompression, 0.0 },
298 { "PGX", UndefinedCompression, 0.0 },
cristy304eaf02014-03-29 13:49:42 +0000299 { "PICT", UndefinedCompression, 0.004 },
cristy7998e5f2009-10-08 02:45:33 +0000300 { "PIX", UndefinedCompression, 0.0 },
cristy304eaf02014-03-29 13:49:42 +0000301 { "PJPEG", UndefinedCompression, 0.004 },
cristy7998e5f2009-10-08 02:45:33 +0000302 { "PLASMA", UndefinedCompression, 0.0 },
303 { "PNG", UndefinedCompression, 0.0 },
glennrp4d3ddd82012-12-11 14:14:28 +0000304 { "PNG8", UndefinedCompression, 0.0 },
cristy7998e5f2009-10-08 02:45:33 +0000305 { "PNG24", UndefinedCompression, 0.0 },
306 { "PNG32", UndefinedCompression, 0.0 },
glennrpb49fd612013-01-26 21:25:45 +0000307 { "PNG48", UndefinedCompression, 0.0 },
308 { "PNG64", UndefinedCompression, 0.0 },
glennrp5830fbc2013-01-27 06:11:45 +0000309 { "PNG00", UndefinedCompression, 0.0 },
cristy7998e5f2009-10-08 02:45:33 +0000310 { "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 },
cristy304eaf02014-03-29 13:49:42 +0000319 { "RGBA", UndefinedCompression, 0.004 },
320 { "RGBO", UndefinedCompression, 0.004 },
cristy7998e5f2009-10-08 02:45:33 +0000321 { "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 },
cristya010f1a2014-03-29 14:00:24 +0000344 { "VIFF", UndefinedCompression, 0.004 },
cristy7998e5f2009-10-08 02:45:33 +0000345 { "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 },
cristy304eaf02014-03-29 13:49:42 +0000351 { "XPM", UndefinedCompression, 0.004 },
cristy7998e5f2009-10-08 02:45:33 +0000352 { "XPS", UndefinedCompression, 0.0 },
cristy304eaf02014-03-29 13:49:42 +0000353 { "XV", UndefinedCompression, 0.004 },
cristy0157aea2010-04-24 21:12:18 +0000354#if !defined(MAGICKCORE_WINDOWS_SUPPORT)
cristy7998e5f2009-10-08 02:45:33 +0000355 { "XWD", UndefinedCompression, 0.0 },
cristy31939262009-09-15 00:23:11 +0000356#endif
cristy7998e5f2009-10-08 02:45:33 +0000357 { "YUV", UndefinedCompression, 0.0 },
358 { "YCbCr", UndefinedCompression, 0.0 },
cristy2032fc92012-12-30 22:17:37 +0000359 { "YCbCrA", UndefinedCompression, 0.0 },
cristy3ed852e2009-09-05 21:47:34 +0000360#if defined(MAGICKCORE_GS_DELEGATE)
cristy2ce75af2009-10-09 17:57:50 +0000361 { "AI", UndefinedCompression, 0.0 },
cristy7998e5f2009-10-08 02:45:33 +0000362 { "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 },
cristy304eaf02014-03-29 13:49:42 +0000373 { "PDF", JPEGCompression, 0.004 },
cristy7998e5f2009-10-08 02:45:33 +0000374 { "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 },
cristy304eaf02014-03-29 13:49:42 +0000382 { "PS3", JPEGCompression, 0.004 },
cristy7998e5f2009-10-08 02:45:33 +0000383 { "PS3", RLECompression, 0.0 },
384 { "PS3", LZWCompression, 0.0 },
cristy3ed852e2009-09-05 21:47:34 +0000385#endif
cristy7998e5f2009-10-08 02:45:33 +0000386 { (const char *) NULL, UndefinedCompression, 0.0 }
cristy3ed852e2009-09-05 21:47:34 +0000387 };
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) },
cristy100b8d92012-01-08 00:32:49 +0000420 { LongPixel, sizeof(unsigned int) },
421 { LongLongPixel, sizeof(MagickSizeType) },
cristy3ed852e2009-09-05 21:47:34 +0000422 { ShortPixel, sizeof(unsigned short) },
423 { UndefinedPixel, 0 }
424 };
425
426struct ReferenceTypes
427{
428 ImageType
429 type;
430
cristybb503372010-05-27 20:51:26 +0000431 size_t
cristy3ed852e2009-09-05 21:47:34 +0000432 depth;
433};
434
435static const struct ReferenceTypes
436 reference_types[] =
437 {
438 { TrueColorType, 8 },
cristydef23e52015-01-22 11:52:01 +0000439 { TrueColorAlphaType, 8 },
cristy3ed852e2009-09-05 21:47:34 +0000440 { GrayscaleType, 8 },
cristydef23e52015-01-22 11:52:01 +0000441 { GrayscaleAlphaType, 8 },
cristy3ed852e2009-09-05 21:47:34 +0000442 { PaletteType, 8 },
cristydef23e52015-01-22 11:52:01 +0000443 { PaletteAlphaType, 8 },
444 { PaletteBilevelAlphaType, 8 },
cristy3ed852e2009-09-05 21:47:34 +0000445 { BilevelType, 1 },
446 { ColorSeparationType, 8 },
cristydef23e52015-01-22 11:52:01 +0000447 { ColorSeparationAlphaType, 8 },
cristy3ed852e2009-09-05 21:47:34 +0000448 { TrueColorType, 10 },
449 { TrueColorType, 12 },
450 { TrueColorType, 16 },
cristy5f1c1ff2010-12-23 21:38:06 +0000451 { UndefinedType, 0 }
cristy3ed852e2009-09-05 21:47:34 +0000452 };
453
454#endif