blob: 5763a317bd614eb7fee612ff89e450221b630a30 [file] [log] [blame]
cristy3ed852e2009-09-05 21:47:34 +00001/*
Cristy7ce65e72015-12-12 18:03:16 -05002 Copyright 1999-2016 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%",
Cristycc3dc5c2015-11-01 20:14:11 -0500163 "-resize 50x150%",
164 "-resize 100%",
cristy3ed852e2009-09-05 21:47:34 +0000165 "-resize 150%",
Cristycc3dc5c2015-11-01 20:14:11 -0500166 "-resize 150x75%",
cristy3ed852e2009-09-05 21:47:34 +0000167 "-roll +20+10",
168 "-rotate 0",
169 "-rotate 45",
170 "-rotate 90",
171 "-rotate 180",
172 "-rotate 270",
173 "-sample 5%",
174 "-sample 50%",
Cristycc3dc5c2015-11-01 20:14:11 -0500175 "-sample 50x150%",
176 "-sample 100%",
cristy3ed852e2009-09-05 21:47:34 +0000177 "-sample 150%",
Cristycc3dc5c2015-11-01 20:14:11 -0500178 "-sample 150x50%",
cristy3ed852e2009-09-05 21:47:34 +0000179 "-scale 5%",
180 "-scale 50%",
Cristycc3dc5c2015-11-01 20:14:11 -0500181 "-scale 50x150%",
182 "-scale 100%",
cristy3ed852e2009-09-05 21:47:34 +0000183 "-scale 150%",
Cristycc3dc5c2015-11-01 20:14:11 -0500184 "-scale 150x50%",
cristy3ed852e2009-09-05 21:47:34 +0000185 "-segment 1x1.5",
186 "-shade 30x30",
187 "-sharpen 0x1.0",
188 "-shave 10x10",
189 "-shear 45x45",
190 "-size 130x194",
191 "-solarize 50%",
192 "-spread 3",
193 "-swirl 90",
194 "-threshold 35%",
195 "-fuzz 35% -transparent red",
196 "-fuzz 5% -trim",
197 "-unsharp 0x1.0+20+1",
198 "-wave 25x150",
199 "-white-threshold 80%",
200 (const char *) NULL
201 };
202
203static const char
204 *identify_options[] =
205 {
206 "",
207 "-verbose",
cristy3e3b2192010-03-03 03:06:13 +0000208 "-features 1 -verbose",
209 "-unique -verbose",
cristy3ed852e2009-09-05 21:47:34 +0000210 (const char *) NULL
211 };
212
213static const char
214 *montage_options[] =
215 {
216 "",
217 "-frame 5",
218 "-geometry 13x19+10+5 -gravity Center",
219 "-label %f",
220 "-pointsize 10",
221 "-shadow",
222 "-tile 3x3",
223 (const char *) NULL
224 };
225
226static const char
227 *stream_options[] =
228 {
229 "",
230 (const char *) NULL
231 };
232
233struct ReferenceFormats
234{
235 const char
236 *magick;
237
cristy7998e5f2009-10-08 02:45:33 +0000238 CompressionType
239 compression;
240
cristy3ed852e2009-09-05 21:47:34 +0000241 double
242 fuzz;
243};
244
245static const struct ReferenceFormats
246 reference_formats[] =
247 {
cristy7998e5f2009-10-08 02:45:33 +0000248 { "ART", UndefinedCompression, 0.0 },
249 { "AVS", UndefinedCompression, 0.0 },
250 { "BMP", UndefinedCompression, 0.0 },
Cristy087a0592015-08-30 16:40:35 -0400251 { "BMP2", UndefinedCompression, 0.0 },
252 { "BMP3", UndefinedCompression, 0.0 },
cristy7998e5f2009-10-08 02:45:33 +0000253 { "CIN", UndefinedCompression, 0.0 },
254 { "CMYK", UndefinedCompression, 0.0 },
255 { "CMYKA", UndefinedCompression, 0.0 },
256 { "CUT", UndefinedCompression, 0.0 },
257 { "DCM", UndefinedCompression, 0.0 },
258 { "DCR", UndefinedCompression, 0.0 },
259 { "DCX", UndefinedCompression, 0.0 },
260 { "DDS", UndefinedCompression, 0.0 },
261 { "DFONT", UndefinedCompression, 0.0 },
262 { "DJVU", UndefinedCompression, 0.0 },
263 { "DNG", UndefinedCompression, 0.0 },
264 { "DOT", UndefinedCompression, 0.0 },
265 { "DPS", UndefinedCompression, 0.0 },
cristy304eaf02014-03-29 13:49:42 +0000266 { "DPX", UndefinedCompression, 0.004 },
cristy7998e5f2009-10-08 02:45:33 +0000267 { "ERF", UndefinedCompression, 0.0 },
268 { "EXR", UndefinedCompression, 0.0 },
cristy7998e5f2009-10-08 02:45:33 +0000269 { "FPX", UndefinedCompression, 0.0 },
270 { "FRACTAL", UndefinedCompression, 0.0 },
cristy7998e5f2009-10-08 02:45:33 +0000271 { "GIF", UndefinedCompression, 0.0 },
272 { "GIF87", UndefinedCompression, 0.0 },
cristy304eaf02014-03-29 13:49:42 +0000273 { "GRAY", UndefinedCompression, 0.004 },
cristy7998e5f2009-10-08 02:45:33 +0000274 { "HTM", UndefinedCompression, 0.0 },
cristy7998e5f2009-10-08 02:45:33 +0000275 { "HTML", UndefinedCompression, 0.0 },
276 { "ICB", UndefinedCompression, 0.0 },
277 { "ICO", UndefinedCompression, 0.0 },
278 { "ICON", UndefinedCompression, 0.0 },
279 { "INFO", UndefinedCompression, 0.0 },
cristy7998e5f2009-10-08 02:45:33 +0000280 { "JBG", UndefinedCompression, 0.0 },
cristy304eaf02014-03-29 13:49:42 +0000281 { "JNG", UndefinedCompression, 0.004 },
282 { "JNG", JPEGCompression, 0.004 },
283 { "JP2", UndefinedCompression, 0.004 },
284 { "J2K", UndefinedCompression, 0.004 },
285 { "JPEG", UndefinedCompression, 0.004 },
286 { "JPG", UndefinedCompression, 0.004 },
cristy7998e5f2009-10-08 02:45:33 +0000287 { "K25", UndefinedCompression, 0.0 },
288 { "KDC", UndefinedCompression, 0.0 },
cristy7998e5f2009-10-08 02:45:33 +0000289 { "MATTE", UndefinedCompression, 0.0 },
290 { "MIFF", UndefinedCompression, 0.0 },
291 { "MNG", UndefinedCompression, 0.0 },
292 { "MONO", UndefinedCompression, 0.0 },
cristy7998e5f2009-10-08 02:45:33 +0000293 { "MRW", UndefinedCompression, 0.0 },
294 { "MTV", UndefinedCompression, 0.0 },
295 { "NEF", UndefinedCompression, 0.0 },
296 { "ORF", UndefinedCompression, 0.0 },
297 { "OTB", UndefinedCompression, 0.0 },
298 { "OTF", UndefinedCompression, 0.0 },
299 { "PAL", UndefinedCompression, 0.0 },
300 { "PAM", UndefinedCompression, 0.0 },
301 { "PBM", UndefinedCompression, 0.0 },
cristy304eaf02014-03-29 13:49:42 +0000302 { "PCT", UndefinedCompression, 0.004 },
cristy7998e5f2009-10-08 02:45:33 +0000303 { "PCX", UndefinedCompression, 0.0 },
304 { "PEF", UndefinedCompression, 0.0 },
305 { "PFA", UndefinedCompression, 0.0 },
306 { "PFB", UndefinedCompression, 0.0 },
cristy304eaf02014-03-29 13:49:42 +0000307 { "PFM", UndefinedCompression, 0.004 },
cristy7998e5f2009-10-08 02:45:33 +0000308 { "PGM", UndefinedCompression, 0.0 },
309 { "PGX", UndefinedCompression, 0.0 },
cristy304eaf02014-03-29 13:49:42 +0000310 { "PICT", UndefinedCompression, 0.004 },
cristy7998e5f2009-10-08 02:45:33 +0000311 { "PIX", UndefinedCompression, 0.0 },
cristy304eaf02014-03-29 13:49:42 +0000312 { "PJPEG", UndefinedCompression, 0.004 },
cristy7998e5f2009-10-08 02:45:33 +0000313 { "PLASMA", UndefinedCompression, 0.0 },
314 { "PNG", UndefinedCompression, 0.0 },
glennrp4d3ddd82012-12-11 14:14:28 +0000315 { "PNG8", UndefinedCompression, 0.0 },
cristy7998e5f2009-10-08 02:45:33 +0000316 { "PNG24", UndefinedCompression, 0.0 },
317 { "PNG32", UndefinedCompression, 0.0 },
glennrpb49fd612013-01-26 21:25:45 +0000318 { "PNG48", UndefinedCompression, 0.0 },
319 { "PNG64", UndefinedCompression, 0.0 },
glennrp5830fbc2013-01-27 06:11:45 +0000320 { "PNG00", UndefinedCompression, 0.0 },
cristy7998e5f2009-10-08 02:45:33 +0000321 { "PNM", UndefinedCompression, 0.0 },
322 { "PPM", UndefinedCompression, 0.0 },
323 { "PREVIEW", UndefinedCompression, 0.0 },
324 { "PTIF", UndefinedCompression, 0.0 },
325 { "PWP", UndefinedCompression, 0.0 },
326 { "RADIAL-GR", UndefinedCompression, 0.0 },
327 { "RAF", UndefinedCompression, 0.0 },
328 { "RAS", UndefinedCompression, 0.0 },
329 { "RGB", UndefinedCompression, 0.0 },
cristy304eaf02014-03-29 13:49:42 +0000330 { "RGBA", UndefinedCompression, 0.004 },
331 { "RGBO", UndefinedCompression, 0.004 },
cristy7998e5f2009-10-08 02:45:33 +0000332 { "RLA", UndefinedCompression, 0.0 },
333 { "RLE", UndefinedCompression, 0.0 },
334 { "SCR", UndefinedCompression, 0.0 },
335 { "SCT", UndefinedCompression, 0.0 },
336 { "SFW", UndefinedCompression, 0.0 },
337 { "SGI", UndefinedCompression, 0.0 },
338 { "SHTML", UndefinedCompression, 0.0 },
339 { "SR2", UndefinedCompression, 0.0 },
340 { "SRF", UndefinedCompression, 0.0 },
341 { "STEGANO", UndefinedCompression, 0.0 },
342 { "SUN", UndefinedCompression, 0.0 },
343 { "TGA", UndefinedCompression, 0.0 },
344 { "TIFF", UndefinedCompression, 0.0 },
345 { "TIFF64", UndefinedCompression, 0.0 },
346 { "TILE", UndefinedCompression, 0.0 },
347 { "TIM", UndefinedCompression, 0.0 },
348 { "TTC", UndefinedCompression, 0.0 },
349 { "TTF", UndefinedCompression, 0.0 },
350 { "TXT", UndefinedCompression, 0.0 },
351 { "UIL", UndefinedCompression, 0.0 },
352 { "UYVY", UndefinedCompression, 0.0 },
353 { "VDA", UndefinedCompression, 0.0 },
354 { "VICAR", UndefinedCompression, 0.0 },
cristya010f1a2014-03-29 14:00:24 +0000355 { "VIFF", UndefinedCompression, 0.004 },
cristy7998e5f2009-10-08 02:45:33 +0000356 { "VST", UndefinedCompression, 0.0 },
357 { "WBMP", UndefinedCompression, 0.0 },
358 { "WPG", UndefinedCompression, 0.0 },
359 { "X3F", UndefinedCompression, 0.0 },
360 { "XBM", UndefinedCompression, 0.0 },
361 { "XCF", UndefinedCompression, 0.0 },
cristy304eaf02014-03-29 13:49:42 +0000362 { "XPM", UndefinedCompression, 0.004 },
cristy7998e5f2009-10-08 02:45:33 +0000363 { "XPS", UndefinedCompression, 0.0 },
cristy304eaf02014-03-29 13:49:42 +0000364 { "XV", UndefinedCompression, 0.004 },
cristy0157aea2010-04-24 21:12:18 +0000365#if !defined(MAGICKCORE_WINDOWS_SUPPORT)
cristy7998e5f2009-10-08 02:45:33 +0000366 { "XWD", UndefinedCompression, 0.0 },
cristy31939262009-09-15 00:23:11 +0000367#endif
cristy7998e5f2009-10-08 02:45:33 +0000368 { "YUV", UndefinedCompression, 0.0 },
369 { "YCbCr", UndefinedCompression, 0.0 },
cristy2032fc92012-12-30 22:17:37 +0000370 { "YCbCrA", UndefinedCompression, 0.0 },
cristy3ed852e2009-09-05 21:47:34 +0000371#if defined(MAGICKCORE_GS_DELEGATE)
cristy2ce75af2009-10-09 17:57:50 +0000372 { "AI", UndefinedCompression, 0.0 },
cristy7998e5f2009-10-08 02:45:33 +0000373 { "EPDF", UndefinedCompression, 0.0 },
374 { "EPI", UndefinedCompression, 0.0 },
375 { "EPS", UndefinedCompression, 0.0 },
376 { "EPS2", UndefinedCompression, 0.0 },
377 { "EPS3", UndefinedCompression, 0.0 },
378 { "EPSF", UndefinedCompression, 0.0 },
379 { "EPSI", UndefinedCompression, 0.0 },
380 { "EPT", UndefinedCompression, 0.0 },
381 { "PDF", UndefinedCompression, 0.0 },
382 { "PDF", ZipCompression, 0.0 },
383 { "PDF", FaxCompression, 0.0 },
cristy304eaf02014-03-29 13:49:42 +0000384 { "PDF", JPEGCompression, 0.004 },
cristy7998e5f2009-10-08 02:45:33 +0000385 { "PDF", RLECompression, 0.0 },
386 { "PDF", LZWCompression, 0.0 },
387 { "PDFA", UndefinedCompression, 0.0 },
388 { "PS", UndefinedCompression, 0.0 },
389 { "PS2", UndefinedCompression, 0.0 },
390 { "PS3", UndefinedCompression, 0.0 },
391 { "PS3", ZipCompression, 0.0 },
392 { "PS3", FaxCompression, 0.0 },
cristy304eaf02014-03-29 13:49:42 +0000393 { "PS3", JPEGCompression, 0.004 },
cristy7998e5f2009-10-08 02:45:33 +0000394 { "PS3", RLECompression, 0.0 },
395 { "PS3", LZWCompression, 0.0 },
cristy3ed852e2009-09-05 21:47:34 +0000396#endif
cristy7998e5f2009-10-08 02:45:33 +0000397 { (const char *) NULL, UndefinedCompression, 0.0 }
cristy3ed852e2009-09-05 21:47:34 +0000398 };
399
400static const char
401 *reference_map[] =
402 {
403 "bgro",
404 "bgrp",
405 "bgr",
406 "cmyk",
407 "cmy",
408 "i",
409 "prgb",
410 "rgba",
411 "rgbo",
412 "rgb",
413 (char *) NULL
414 };
415
416struct ReferenceStorage
417{
418 StorageType
419 type;
420
421 size_t
422 quantum;
423};
424
425static const struct ReferenceStorage
426 reference_storage[] =
427 {
428 { CharPixel, sizeof(unsigned char) },
429 { DoublePixel, sizeof(double) },
430 { FloatPixel, sizeof(float) },
cristy100b8d92012-01-08 00:32:49 +0000431 { LongPixel, sizeof(unsigned int) },
432 { LongLongPixel, sizeof(MagickSizeType) },
cristy3ed852e2009-09-05 21:47:34 +0000433 { ShortPixel, sizeof(unsigned short) },
434 { UndefinedPixel, 0 }
435 };
436
437struct ReferenceTypes
438{
439 ImageType
440 type;
441
cristybb503372010-05-27 20:51:26 +0000442 size_t
cristy3ed852e2009-09-05 21:47:34 +0000443 depth;
444};
445
446static const struct ReferenceTypes
447 reference_types[] =
448 {
449 { TrueColorType, 8 },
cristydef23e52015-01-22 11:52:01 +0000450 { TrueColorAlphaType, 8 },
cristy3ed852e2009-09-05 21:47:34 +0000451 { GrayscaleType, 8 },
cristydef23e52015-01-22 11:52:01 +0000452 { GrayscaleAlphaType, 8 },
cristy3ed852e2009-09-05 21:47:34 +0000453 { PaletteType, 8 },
cristydef23e52015-01-22 11:52:01 +0000454 { PaletteAlphaType, 8 },
455 { PaletteBilevelAlphaType, 8 },
cristy3ed852e2009-09-05 21:47:34 +0000456 { BilevelType, 1 },
457 { ColorSeparationType, 8 },
cristydef23e52015-01-22 11:52:01 +0000458 { ColorSeparationAlphaType, 8 },
cristy3ed852e2009-09-05 21:47:34 +0000459 { TrueColorType, 10 },
460 { TrueColorType, 12 },
461 { TrueColorType, 16 },
cristy5f1c1ff2010-12-23 21:38:06 +0000462 { UndefinedType, 0 }
cristy3ed852e2009-09-05 21:47:34 +0000463 };
464
465#endif