Debian Codegraph @

tests/validate.h

raw symbols SCIP
1 /*
2 Copyright 1999 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. You may
6 obtain a copy of the License at
7
8 https://imagemagick.org/license/
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
24 static const char
25 *compare_options[] =
26 {
27 "-metric RMSE -fuzz 5%",
28 "-metric AE -fuzz 5%",
29 (const char *) NULL
30 };
31
32 static const char
33 *composite_options[] =
34 {
35 "",
36 "-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",
73 "-compose ModulusAdd",
74 "-compose ModulusSubtract",
75 "-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",
91 "-compose Threshold",
92 "-compose Xor",
93 "-geometry +35+65 -label Magick",
94 (const char *) NULL
95 };
96
97 static const char
98 *convert_options[] =
99 {
100 "",
101 "-affine 1,0,0.785,1,0,0 -transform",
102 "-alpha set",
103 "-black-threshold 20%",
104 "-blur 0x0.5",
105 "-blur 0x1.0",
106 "-blur 0x2.0",
107 "-bordercolor red -border 6x6",
108 "-canny 0x1+10%+80%",
109 "-channel red",
110 "-colorspace CMYK -channel Cyan",
111 "-charcoal 0x1",
112 "-chop 80x60+10+20",
113 "-chop 8x6+20+30",
114 "-colorize 30%/20%/50%",
115 "-color-matrix '0,0,1,0,1,0,1,0,0'",
116 "-color-matrix '0.9 0 0, 0 0.9 0, 0 0 1.2'",
117 "-color-matrix '0.9,0,0,0,0.9,0,0,0,1.2'",
118 "-color-matrix '1,0,0,0,1,0,0,0,1'",
119 "-color-matrix '.22,.72,.07,.22,.72,.07,.22,.72,.07'",
120 "-colors 16",
121 "-colorspace CMYK",
122 "-colorspace GRAY",
123 "-colorspace HSL",
124 "-colorspace HWB",
125 "-colorspace OHTA",
126 "-colorspace YCbCr",
127 "-colorspace YIQ",
128 "-colorspace YUV",
129 "-convolve 1,1,1,1,4,1,1,1,1",
130 "-crop 17x9+10+10",
131 "-crop 60x70+10+10",
132 "-cycle 200",
133 "-density 75x75 -resample 50x50",
134 "-depth 7",
135 "-depth 16",
136 "-depth 32",
137 "-despeckle",
138 "-draw \"affine 1,0,0.785,1,0,0\"",
139 "-draw \"rectangle 20,10 80,50\"",
140 "-edge 0x1",
141 "-emboss 0x1",
142 "-enhance",
143 "-equalize",
144 "-evaluate Abs 2%",
145 "-evaluate Add 233",
146 "-evaluate AddModulus 50%",
147 "-evaluate And 6",
148 "-evaluate Cosine 2",
149 "-evaluate Divide 0.7",
150 "-evaluate Exponential 1.0",
151 "-evaluate InverseLog 2",
152 "-evaluate Xor 233",
153 "-extent 1200x1200-100-100",
154 "-fill blue -fuzz 35% -opaque red",
155 "-fill blue -stroke gold -draw 'Bezier 400,200 1100,800 100,300'",
156 "-fill blue -stroke gold -draw 'polygon 400,200 1100,800 100,300'",
157 "-fill blue -stroke gold -draw 'rectangle 400,200 1100,800'",
158 "-fill blue -stroke gold -draw 'roundRectangle 400,200 1100,800 20,20'",
159 "-fill green -stroke gold -draw 'circle 800,500 1100,800'",
160 "-fill none -stroke gold -draw 'Bezier 400,200 1100,800 100,300'",
161 "-fill none -stroke gold -draw 'circle 800,500 1100,800'",
162 "-fill none -stroke gold -draw 'polygon 400,200 1100,800 100,300'",
163 "-fill none -stroke gold -draw 'rectangle 400,200 1100,800'",
164 "-fill none -stroke gold -draw 'roundRectangle 400,200 1100,800 20,20'",
165 "-flip",
166 "-flop",
167 "-frame 15x15+3+3",
168 "-fuzz 35% -transparent red",
169 "-fuzz 5% -trim",
170 "-fx \"(1.0/(1.0+exp(10.0*(0.5-u)))-0.006693)*1.0092503\"",
171 "-gamma 1.6",
172 "-gaussian-blur 0x0.5",
173 "-gaussian-blur 0x1.0",
174 "-gaussian-blur 0x2.0",
175 "-implode 0.5",
176 "-implode -1",
177 "-label Magick",
178 "-lat 10x10-5%",
179 "-level 100%",
180 "-level 10%,1.2,90%",
181 "+level 100% +level 100% +level 100%",
182 "-level 100% -level 100% -level 100%",
183 "+level 100%",
184 "-magnify",
185 "-modulate 110/100/95",
186 "-monochrome",
187 "-motion-blur 0x3+30",
188 "-negate",
189 "+noise Gaussian",
190 "+noise Impulse",
191 "+noise Laplacian",
192 "+noise Multiplicative",
193 "+noise Poisson",
194 "+noise Random",
195 "+noise Uniform",
196 "-noop",
197 "-normalize",
198 "-ordered-dither 2x2",
199 "-ordered-dither 3x3",
200 "-ordered-dither 4x4",
201 "-paint 0x1",
202 "-raise 10x10",
203 "-random-threshold 10%",
204 "-random-threshold 20x80",
205 "-remap netscape:",
206 "-resize 100%",
207 "-resize 10%",
208 "-resize 150%",
209 "-resize 150x75%",
210 "-resize 50%",
211 "-resize 50x150%",
212 "-roll +20+10",
213 "-rotate 0",
214 "-rotate 15",
215 "-rotate 180",
216 "-rotate 270",
217 "-rotate 45",
218 "-rotate 90",
219 "-sample 100%",
220 "-sample 150%",
221 "-sample 150x50%",
222 "-sample 50%",
223 "-sample 50x150%",
224 "-sample 5%",
225 "-scale 100%",
226 "-scale 150%",
227 "-scale 150x50%",
228 "-scale 50%",
229 "-scale 50x150%",
230 "-scale 5%",
231 "-segment 0.5x0.25",
232 "-segment 1x1.5",
233 "-shade 30x30",
234 "-sharpen 0x0.5",
235 "-sharpen 0x1.0",
236 "-sharpen 0x2.0",
237 "-shave 10x10",
238 "-shear 25x20",
239 "-shear 45x45",
240 "-size 130x194",
241 "-solarize 50%",
242 "-spread 1",
243 "-spread 3",
244 "-statistic Median 1",
245 "-statistic Median 2",
246 "-statistic NonPeak 1",
247 "-statistic NonPeak 2",
248 "-swirl 90",
249 "-threshold 35%",
250 "-trim",
251 "-unsharp 0x0.5+20+1",
252 "-unsharp 0x1.0+20+1",
253 "-wave 25x150",
254 "-white-threshold 80%",
255 (const char *) NULL
256 };
257
258 static const char
259 *identify_options[] =
260 {
261 "",
262 "-verbose",
263 "-features 1 -verbose",
264 "-unique -verbose",
265 (const char *) NULL
266 };
267
268 static const char
269 *montage_options[] =
270 {
271 "",
272 "-frame 5",
273 "-geometry 13x19+10+5 -gravity Center",
274 "-label %f",
275 "-pointsize 10",
276 "-shadow",
277 "-tile 3x3",
278 (const char *) NULL
279 };
280
281 static const char
282 *stream_options[] =
283 {
284 "",
285 (const char *) NULL
286 };
287
288 struct ReferenceFormats
289 {
290 const char
291 *magick;
292
293 CompressionType
294 compression;
295
296 double
297 fuzz;
298 };
299
300 static const struct ReferenceFormats
301 reference_formats[] =
302 {
303 { "ART", UndefinedCompression, 0.0 },
304 { "AVS", UndefinedCompression, 0.0 },
305 { "BMP", UndefinedCompression, 0.0 },
306 { "BMP2", UndefinedCompression, 0.0 },
307 { "BMP3", UndefinedCompression, 0.0 },
308 { "CIN", UndefinedCompression, 0.0 },
309 { "CMYK", UndefinedCompression, 0.0 },
310 { "CMYKA", UndefinedCompression, 0.0 },
311 { "CUT", UndefinedCompression, 0.0 },
312 { "DCM", UndefinedCompression, 0.0 },
313 { "DCR", UndefinedCompression, 0.0 },
314 { "DCX", UndefinedCompression, 0.0 },
315 { "DDS", UndefinedCompression, 0.0 },
316 { "DFONT", UndefinedCompression, 0.0 },
317 { "DJVU", UndefinedCompression, 0.0 },
318 { "DNG", UndefinedCompression, 0.0 },
319 { "DOT", UndefinedCompression, 0.0 },
320 { "DPS", UndefinedCompression, 0.0 },
321 { "DPX", UndefinedCompression, 0.004 },
322 { "ERF", UndefinedCompression, 0.0 },
323 { "EXR", UndefinedCompression, 0.0 },
324 { "FPX", UndefinedCompression, 0.0 },
325 { "FRACTAL", UndefinedCompression, 0.0 },
326 { "GIF", UndefinedCompression, 0.0 },
327 { "GIF87", UndefinedCompression, 0.0 },
328 { "GRAY", UndefinedCompression, 0.004 },
329 { "HTM", UndefinedCompression, 0.0 },
330 { "HTML", UndefinedCompression, 0.0 },
331 { "ICB", UndefinedCompression, 0.0 },
332 { "ICO", UndefinedCompression, 0.0 },
333 { "ICON", UndefinedCompression, 0.0 },
334 { "INFO", UndefinedCompression, 0.0 },
335 { "JBG", UndefinedCompression, 0.0 },
336 { "JNG", UndefinedCompression, 0.004 },
337 { "JNG", JPEGCompression, 0.004 },
338 { "JP2", UndefinedCompression, 0.004 },
339 { "J2K", UndefinedCompression, 0.004 },
340 { "JPEG", UndefinedCompression, 0.004 },
341 { "JPG", UndefinedCompression, 0.004 },
342 { "K25", UndefinedCompression, 0.0 },
343 { "KDC", UndefinedCompression, 0.0 },
344 { "MATTE", UndefinedCompression, 0.0 },
345 { "MIFF", UndefinedCompression, 0.0 },
346 { "MIFF", RLECompression, 0.0 },
347 { "MIFF", ZipCompression, 0.0 },
348 { "MNG", UndefinedCompression, 0.0 },
349 { "MONO", UndefinedCompression, 0.0 },
350 { "MRW", UndefinedCompression, 0.0 },
351 { "MTV", UndefinedCompression, 0.0 },
352 { "NEF", UndefinedCompression, 0.0 },
353 { "ORF", UndefinedCompression, 0.0 },
354 { "OTB", UndefinedCompression, 0.0 },
355 { "OTF", UndefinedCompression, 0.0 },
356 { "PAL", UndefinedCompression, 0.0 },
357 { "PAM", UndefinedCompression, 0.0 },
358 { "PBM", UndefinedCompression, 0.0 },
359 { "PCT", UndefinedCompression, 0.004 },
360 { "PCX", UndefinedCompression, 0.0 },
361 { "PEF", UndefinedCompression, 0.0 },
362 { "PFA", UndefinedCompression, 0.0 },
363 { "PFB", UndefinedCompression, 0.0 },
364 { "PFM", UndefinedCompression, 0.004 },
365 { "PGM", UndefinedCompression, 0.0 },
366 { "PGX", UndefinedCompression, 0.0 },
367 { "PICT", UndefinedCompression, 0.004 },
368 { "PIX", UndefinedCompression, 0.0 },
369 { "PJPEG", UndefinedCompression, 0.004 },
370 { "PLASMA", UndefinedCompression, 0.0 },
371 { "PNG", UndefinedCompression, 0.0 },
372 { "PNG8", UndefinedCompression, 0.0 },
373 { "PNG24", UndefinedCompression, 0.0 },
374 { "PNG32", UndefinedCompression, 0.0 },
375 { "PNG48", UndefinedCompression, 0.0 },
376 { "PNG64", UndefinedCompression, 0.0 },
377 { "PNG00", UndefinedCompression, 0.0 },
378 { "PNM", UndefinedCompression, 0.0 },
379 { "PPM", UndefinedCompression, 0.0 },
380 { "PREVIEW", UndefinedCompression, 0.0 },
381 { "PTIF", UndefinedCompression, 0.0 },
382 { "PWP", UndefinedCompression, 0.0 },
383 { "RADIAL-GR", UndefinedCompression, 0.0 },
384 { "RAF", UndefinedCompression, 0.0 },
385 { "RAS", UndefinedCompression, 0.0 },
386 { "RGB", UndefinedCompression, 0.0 },
387 { "RGBA", UndefinedCompression, 0.004 },
388 { "RGBO", UndefinedCompression, 0.004 },
389 { "RLA", UndefinedCompression, 0.0 },
390 { "RLE", UndefinedCompression, 0.0 },
391 { "SCR", UndefinedCompression, 0.0 },
392 { "SCT", UndefinedCompression, 0.0 },
393 { "SF3", UndefinedCompression, 0.0 },
394 { "SFW", UndefinedCompression, 0.0 },
395 { "SGI", UndefinedCompression, 0.0 },
396 { "SHTML", UndefinedCompression, 0.0 },
397 { "SR2", UndefinedCompression, 0.0 },
398 { "SRF", UndefinedCompression, 0.0 },
399 { "STEGANO", UndefinedCompression, 0.0 },
400 { "SUN", UndefinedCompression, 0.0 },
401 { "TGA", UndefinedCompression, 0.0 },
402 { "TIFF", UndefinedCompression, 0.0 },
403 { "TIFF64", UndefinedCompression, 0.0 },
404 { "TILE", UndefinedCompression, 0.0 },
405 { "TIM", UndefinedCompression, 0.0 },
406 { "TIM2", UndefinedCompression, 0.0 },
407 { "TTC", UndefinedCompression, 0.0 },
408 { "TTF", UndefinedCompression, 0.0 },
409 { "TXT", UndefinedCompression, 0.0 },
410 { "UIL", UndefinedCompression, 0.0 },
411 { "UYVY", UndefinedCompression, 0.0 },
412 { "VDA", UndefinedCompression, 0.0 },
413 { "VICAR", UndefinedCompression, 0.0 },
414 { "VIFF", UndefinedCompression, 0.004 },
415 { "VST", UndefinedCompression, 0.0 },
416 { "WBMP", UndefinedCompression, 0.0 },
417 { "WPG", UndefinedCompression, 0.0 },
418 { "X3F", UndefinedCompression, 0.0 },
419 { "XBM", UndefinedCompression, 0.0 },
420 { "XCF", UndefinedCompression, 0.0 },
421 { "XPM", UndefinedCompression, 0.004 },
422 { "XPS", UndefinedCompression, 0.0 },
423 { "XV", UndefinedCompression, 0.004 },
424 #if !defined(MAGICKCORE_WINDOWS_SUPPORT)
425 { "XWD", UndefinedCompression, 0.0 },
426 #endif
427 { "YUV", UndefinedCompression, 0.0 },
428 { "YCbCr", UndefinedCompression, 0.0 },
429 { "YCbCrA", UndefinedCompression, 0.0 },
430 #if defined(MAGICKCORE_GS_DELEGATE)
431 { "AI", UndefinedCompression, 0.0 },
432 { "EPDF", UndefinedCompression, 0.0 },
433 { "EPI", UndefinedCompression, 0.0 },
434 { "EPS", UndefinedCompression, 0.0 },
435 { "EPS2", UndefinedCompression, 0.0 },
436 { "EPS3", UndefinedCompression, 0.0 },
437 { "EPSF", UndefinedCompression, 0.0 },
438 { "EPSI", UndefinedCompression, 0.0 },
439 { "EPT", UndefinedCompression, 0.0 },
440 { "PDF", UndefinedCompression, 0.0 },
441 { "PDF", ZipCompression, 0.0 },
442 { "PDF", FaxCompression, 0.0 },
443 { "PDF", JPEGCompression, 0.004 },
444 { "PDF", RLECompression, 0.0 },
445 { "PDF", LZWCompression, 0.0 },
446 { "PDFA", UndefinedCompression, 0.0 },
447 { "PS", UndefinedCompression, 0.0 },
448 { "PS2", UndefinedCompression, 0.0 },
449 { "PS3", UndefinedCompression, 0.0 },
450 { "PS3", ZipCompression, 0.0 },
451 { "PS3", FaxCompression, 0.0 },
452 { "PS3", JPEGCompression, 0.004 },
453 { "PS3", RLECompression, 0.0 },
454 { "PS3", LZWCompression, 0.0 },
455 #endif
456 { (const char *) NULL, UndefinedCompression, 0.0 }
457 };
458
459 static const char
460 *reference_map[] =
461 {
462 "bgro",
463 "bgrp",
464 "bgr",
465 "cmyk",
466 "cmy",
467 "i",
468 "prgb",
469 "rgba",
470 "rgbo",
471 "rgb",
472 (char *) NULL
473 };
474
475 struct ReferenceStorage
476 {
477 StorageType
478 type;
479
480 size_t
481 quantum;
482 };
483
484 static const struct ReferenceStorage
485 reference_storage[] =
486 {
487 { CharPixel, sizeof(unsigned char) },
488 { DoublePixel, sizeof(double) },
489 { FloatPixel, sizeof(float) },
490 { LongPixel, sizeof(unsigned int) },
491 { LongLongPixel, sizeof(MagickSizeType) },
492 { ShortPixel, sizeof(unsigned short) },
493 { UndefinedPixel, 0 }
494 };
495
496 struct ReferenceTypes
497 {
498 ImageType
499 type;
500
501 size_t
502 depth;
503 };
504
505 static const struct ReferenceTypes
506 reference_types[] =
507 {
508 { BilevelType, 1 },
509 { ColorSeparationType, 8 },
510 { ColorSeparationAlphaType, 8 },
511 { GrayscaleType, 8 },
512 { GrayscaleAlphaType, 8 },
513 { PaletteType, 8 },
514 { PaletteAlphaType, 8 },
515 { PaletteBilevelAlphaType, 8 },
516 { TrueColorType, 8 },
517 { TrueColorType, 10 },
518 { TrueColorType, 12 },
519 { TrueColorType, 16 },
520 { TrueColorAlphaType, 8 },
521 { UndefinedType, 0 }
522 };
523
524 #endif