1 /* 2 Copyright 1999-2020 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/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 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 "-noop", 101 "-affine 1,0,0.785,1,0,0 -transform", 102 "-black-threshold 20%", 103 "-blur 0x0.5", 104 "-border 6x6", 105 "-canny 0x1+10%+80%", 106 "-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%", 159 "-color-matrix '0.9 0 0, 0 0.9 0, 0 0 1.2'", 160 "-density 75x75 -resample 50x50", 161 "-resize 10%", 162 "-resize 50%", 163 "-resize 50x150%", 164 "-resize 100%", 165 "-resize 150%", 166 "-resize 150x75%", 167 "-roll +20+10", 168 "-rotate 0", 169 "-rotate 45", 170 "-rotate 90", 171 "-rotate 180", 172 "-rotate 270", 173 "-sample 5%", 174 "-sample 50%", 175 "-sample 50x150%", 176 "-sample 100%", 177 "-sample 150%", 178 "-sample 150x50%", 179 "-scale 5%", 180 "-scale 50%", 181 "-scale 50x150%", 182 "-scale 100%", 183 "-scale 150%", 184 "-scale 150x50%", 185 "-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 203 static const char 204 *identify_options[] = 205 { 206 "", 207 "-verbose", 208 "-features 1 -verbose", 209 "-unique -verbose", 210 (const char *) NULL 211 }; 212 213 static 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 226 static const char 227 *stream_options[] = 228 { 229 "", 230 (const char *) NULL 231 }; 232 233 struct ReferenceFormats 234 { 235 const char 236 *magick; 237 238 CompressionType 239 compression; 240 241 double 242 fuzz; 243 }; 244 245 static const struct ReferenceFormats 246 reference_formats[] = 247 { 248 { "ART", UndefinedCompression, 0.0 }, 249 { "AVS", UndefinedCompression, 0.0 }, 250 { "BMP", UndefinedCompression, 0.0 }, 251 { "BMP2", UndefinedCompression, 0.0 }, 252 { "BMP3", UndefinedCompression, 0.0 }, 253 { "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 }, 266 { "DPX", UndefinedCompression, 0.004 }, 267 { "ERF", UndefinedCompression, 0.0 }, 268 { "EXR", UndefinedCompression, 0.0 }, 269 { "FPX", UndefinedCompression, 0.0 }, 270 { "FRACTAL", UndefinedCompression, 0.0 }, 271 { "GIF", UndefinedCompression, 0.0 }, 272 { "GIF87", UndefinedCompression, 0.0 }, 273 { "GRAY", UndefinedCompression, 0.004 }, 274 { "HTM", UndefinedCompression, 0.0 }, 275 { "HTML", UndefinedCompression, 0.0 }, 276 { "ICB", UndefinedCompression, 0.0 }, 277 { "ICO", UndefinedCompression, 0.0 }, 278 { "ICON", UndefinedCompression, 0.0 }, 279 { "INFO", UndefinedCompression, 0.0 }, 280 { "JBG", UndefinedCompression, 0.0 }, 281 { "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 }, 287 { "K25", UndefinedCompression, 0.0 }, 288 { "KDC", UndefinedCompression, 0.0 }, 289 { "MATTE", UndefinedCompression, 0.0 }, 290 { "MIFF", UndefinedCompression, 0.0 }, 291 { "MIFF", RLECompression, 0.0 }, 292 { "MIFF", ZipCompression, 0.0 }, 293 { "MNG", UndefinedCompression, 0.0 }, 294 { "MONO", UndefinedCompression, 0.0 }, 295 { "MRW", UndefinedCompression, 0.0 }, 296 { "MTV", UndefinedCompression, 0.0 }, 297 { "NEF", UndefinedCompression, 0.0 }, 298 { "ORF", UndefinedCompression, 0.0 }, 299 { "OTB", UndefinedCompression, 0.0 }, 300 { "OTF", UndefinedCompression, 0.0 }, 301 { "PAL", UndefinedCompression, 0.0 }, 302 { "PAM", UndefinedCompression, 0.0 }, 303 { "PBM", UndefinedCompression, 0.0 }, 304 { "PCT", UndefinedCompression, 0.004 }, 305 { "PCX", UndefinedCompression, 0.0 }, 306 { "PEF", UndefinedCompression, 0.0 }, 307 { "PFA", UndefinedCompression, 0.0 }, 308 { "PFB", UndefinedCompression, 0.0 }, 309 { "PFM", UndefinedCompression, 0.004 }, 310 { "PGM", UndefinedCompression, 0.0 }, 311 { "PGX", UndefinedCompression, 0.0 }, 312 { "PICT", UndefinedCompression, 0.004 }, 313 { "PIX", UndefinedCompression, 0.0 }, 314 { "PJPEG", UndefinedCompression, 0.004 }, 315 { "PLASMA", UndefinedCompression, 0.0 }, 316 { "PNG", UndefinedCompression, 0.0 }, 317 { "PNG8", UndefinedCompression, 0.0 }, 318 { "PNG24", UndefinedCompression, 0.0 }, 319 { "PNG32", UndefinedCompression, 0.0 }, 320 { "PNG48", UndefinedCompression, 0.0 }, 321 { "PNG64", UndefinedCompression, 0.0 }, 322 { "PNG00", UndefinedCompression, 0.0 }, 323 { "PNM", UndefinedCompression, 0.0 }, 324 { "PPM", UndefinedCompression, 0.0 }, 325 { "PREVIEW", UndefinedCompression, 0.0 }, 326 { "PTIF", UndefinedCompression, 0.0 }, 327 { "PWP", UndefinedCompression, 0.0 }, 328 { "RADIAL-GR", UndefinedCompression, 0.0 }, 329 { "RAF", UndefinedCompression, 0.0 }, 330 { "RAS", UndefinedCompression, 0.0 }, 331 { "RGB", UndefinedCompression, 0.0 }, 332 { "RGBA", UndefinedCompression, 0.004 }, 333 { "RGBO", UndefinedCompression, 0.004 }, 334 { "RLA", UndefinedCompression, 0.0 }, 335 { "RLE", UndefinedCompression, 0.0 }, 336 { "SCR", UndefinedCompression, 0.0 }, 337 { "SCT", UndefinedCompression, 0.0 }, 338 { "SFW", UndefinedCompression, 0.0 }, 339 { "SGI", UndefinedCompression, 0.0 }, 340 { "SHTML", UndefinedCompression, 0.0 }, 341 { "SR2", UndefinedCompression, 0.0 }, 342 { "SRF", UndefinedCompression, 0.0 }, 343 { "STEGANO", UndefinedCompression, 0.0 }, 344 { "SUN", UndefinedCompression, 0.0 }, 345 { "TGA", UndefinedCompression, 0.0 }, 346 { "TIFF", UndefinedCompression, 0.0 }, 347 { "TIFF64", UndefinedCompression, 0.0 }, 348 { "TILE", UndefinedCompression, 0.0 }, 349 { "TIM", UndefinedCompression, 0.0 }, 350 { "TIM2", UndefinedCompression, 0.0 }, 351 { "TTC", UndefinedCompression, 0.0 }, 352 { "TTF", UndefinedCompression, 0.0 }, 353 { "TXT", UndefinedCompression, 0.0 }, 354 { "UIL", UndefinedCompression, 0.0 }, 355 { "UYVY", UndefinedCompression, 0.0 }, 356 { "VDA", UndefinedCompression, 0.0 }, 357 { "VICAR", UndefinedCompression, 0.0 }, 358 { "VIFF", UndefinedCompression, 0.004 }, 359 { "VST", UndefinedCompression, 0.0 }, 360 { "WBMP", UndefinedCompression, 0.0 }, 361 { "WPG", UndefinedCompression, 0.0 }, 362 { "X3F", UndefinedCompression, 0.0 }, 363 { "XBM", UndefinedCompression, 0.0 }, 364 { "XCF", UndefinedCompression, 0.0 }, 365 { "XPM", UndefinedCompression, 0.004 }, 366 { "XPS", UndefinedCompression, 0.0 }, 367 { "XV", UndefinedCompression, 0.004 }, 368 #if !defined(MAGICKCORE_WINDOWS_SUPPORT) 369 { "XWD", UndefinedCompression, 0.0 }, 370 #endif 371 { "YUV", UndefinedCompression, 0.0 }, 372 { "YCbCr", UndefinedCompression, 0.0 }, 373 { "YCbCrA", UndefinedCompression, 0.0 }, 374 #if defined(MAGICKCORE_GS_DELEGATE) 375 { "AI", UndefinedCompression, 0.0 }, 376 { "EPDF", UndefinedCompression, 0.0 }, 377 { "EPI", UndefinedCompression, 0.0 }, 378 { "EPS", UndefinedCompression, 0.0 }, 379 { "EPS2", UndefinedCompression, 0.0 }, 380 { "EPS3", UndefinedCompression, 0.0 }, 381 { "EPSF", UndefinedCompression, 0.0 }, 382 { "EPSI", UndefinedCompression, 0.0 }, 383 { "EPT", UndefinedCompression, 0.0 }, 384 { "PDF", UndefinedCompression, 0.0 }, 385 { "PDF", ZipCompression, 0.0 }, 386 { "PDF", FaxCompression, 0.0 }, 387 { "PDF", JPEGCompression, 0.004 }, 388 { "PDF", RLECompression, 0.0 }, 389 { "PDF", LZWCompression, 0.0 }, 390 { "PDFA", UndefinedCompression, 0.0 }, 391 { "PS", UndefinedCompression, 0.0 }, 392 { "PS2", UndefinedCompression, 0.0 }, 393 { "PS3", UndefinedCompression, 0.0 }, 394 { "PS3", ZipCompression, 0.0 }, 395 { "PS3", FaxCompression, 0.0 }, 396 { "PS3", JPEGCompression, 0.004 }, 397 { "PS3", RLECompression, 0.0 }, 398 { "PS3", LZWCompression, 0.0 }, 399 #endif 400 { (const char *) NULL, UndefinedCompression, 0.0 } 401 }; 402 403 static const char 404 *reference_map[] = 405 { 406 "bgro", 407 "bgrp", 408 "bgr", 409 "cmyk", 410 "cmy", 411 "i", 412 "prgb", 413 "rgba", 414 "rgbo", 415 "rgb", 416 (char *) NULL 417 }; 418 419 struct ReferenceStorage 420 { 421 StorageType 422 type; 423 424 size_t 425 quantum; 426 }; 427 428 static const struct ReferenceStorage 429 reference_storage[] = 430 { 431 { CharPixel, sizeof(unsigned char) }, 432 { DoublePixel, sizeof(double) }, 433 { FloatPixel, sizeof(float) }, 434 { LongPixel, sizeof(unsigned int) }, 435 { LongLongPixel, sizeof(MagickSizeType) }, 436 { ShortPixel, sizeof(unsigned short) }, 437 { UndefinedPixel, 0 } 438 }; 439 440 struct ReferenceTypes 441 { 442 ImageType 443 type; 444 445 size_t 446 depth; 447 }; 448 449 static const struct ReferenceTypes 450 reference_types[] = 451 { 452 { TrueColorType, 8 }, 453 { TrueColorAlphaType, 8 }, 454 { GrayscaleType, 8 }, 455 { GrayscaleAlphaType, 8 }, 456 { PaletteType, 8 }, 457 { PaletteAlphaType, 8 }, 458 { PaletteBilevelAlphaType, 8 }, 459 { BilevelType, 1 }, 460 { ColorSeparationType, 8 }, 461 { ColorSeparationAlphaType, 8 }, 462 { TrueColorType, 10 }, 463 { TrueColorType, 12 }, 464 { TrueColorType, 16 }, 465 { UndefinedType, 0 } 466 }; 467 468 #endif 469