]> granicus.if.org Git - imagemagick/blob - tests/validate.h
Bug fix on segv in not CLI apis (image->image_info pointer)
[imagemagick] / tests / validate.h
1 /*
2   Copyright 1999-2012 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     "",
28     "-compose Src",
29     "-highlight-color SeaGreen",
30     "-metric AE -fuzz 5%",
31     (const char *) NULL
32   };
33
34 static 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
99 static 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
195 static const char
196   *identify_options[] =
197   {
198     "",
199     "-verbose",
200     "-features 1 -verbose",
201     "-unique -verbose",
202     (const char *) NULL
203   };
204
205 static 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
218 static const char
219   *stream_options[] =
220   {
221     "",
222     (const char *) NULL
223   };
224
225 struct ReferenceFormats
226 {
227   const char
228     *magick;
229
230   CompressionType
231     compression;
232
233   double
234     fuzz;
235 };
236
237 static 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.003 },
257     { "ERF", UndefinedCompression, 0.0 },
258     { "EXR", UndefinedCompression, 0.0 },
259     { "FPX", UndefinedCompression, 0.0 },
260     { "FRACTAL", UndefinedCompression, 0.0 },
261     { "GIF", UndefinedCompression, 0.0 },
262     { "GIF87", UndefinedCompression, 0.0 },
263     { "GRAY", UndefinedCompression, 0.003 },
264     { "HTM", UndefinedCompression, 0.0 },
265     { "HTML", UndefinedCompression, 0.0 },
266     { "ICB", UndefinedCompression, 0.0 },
267     { "ICO", UndefinedCompression, 0.0 },
268     { "ICON", UndefinedCompression, 0.0 },
269     { "INFO", UndefinedCompression, 0.0 },
270     { "INLINE", UndefinedCompression, 0.0 },
271     { "JBG", UndefinedCompression, 0.0 },
272     { "JNG", UndefinedCompression, 0.003 },
273     { "JP2", UndefinedCompression, 0.003 },
274     { "JPC", UndefinedCompression, 0.003 },
275     { "JPEG", UndefinedCompression, 0.003 },
276     { "JPG", UndefinedCompression, 0.003 },
277     { "K25", UndefinedCompression, 0.0 },
278     { "KDC", UndefinedCompression, 0.0 },
279     { "MATTE", UndefinedCompression, 0.0 },
280     { "MIFF", UndefinedCompression, 0.0 },
281     { "MNG", UndefinedCompression, 0.0 },
282     { "MONO", UndefinedCompression, 0.0 },
283     { "MRW", UndefinedCompression, 0.0 },
284     { "MTV", UndefinedCompression, 0.0 },
285     { "NEF", UndefinedCompression, 0.0 },
286     { "ORF", UndefinedCompression, 0.0 },
287     { "OTB", UndefinedCompression, 0.0 },
288     { "OTF", UndefinedCompression, 0.0 },
289     { "PAL", UndefinedCompression, 0.0 },
290     { "PAM", UndefinedCompression, 0.0 },
291     { "PBM", UndefinedCompression, 0.0 },
292     { "PCT", UndefinedCompression, 0.003 },
293     { "PCX", UndefinedCompression, 0.0 },
294     { "PEF", UndefinedCompression, 0.0 },
295     { "PFA", UndefinedCompression, 0.0 },
296     { "PFB", UndefinedCompression, 0.0 },
297     { "PFM", UndefinedCompression, 0.003 },
298     { "PGM", UndefinedCompression, 0.0 },
299     { "PGX", UndefinedCompression, 0.0 },
300 #if !defined(MAGICKCORE_HDRI_SUPPORT)
301     { "PICT", UndefinedCompression, 0.003 },
302 #endif
303     { "PIX", UndefinedCompression, 0.0 },
304     { "PJPEG", UndefinedCompression, 0.003 },
305     { "PLASMA", UndefinedCompression, 0.0 },
306     { "PNG", 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