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