Home | History | Annotate | Download | only in tests
      1 /*
      2   Copyright 1999-2016 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 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     { "MNG", UndefinedCompression, 0.0 },
    292     { "MONO", UndefinedCompression, 0.0 },
    293     { "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 },
    302     { "PCT", UndefinedCompression, 0.004 },
    303     { "PCX", UndefinedCompression, 0.0 },
    304     { "PEF", UndefinedCompression, 0.0 },
    305     { "PFA", UndefinedCompression, 0.0 },
    306     { "PFB", UndefinedCompression, 0.0 },
    307     { "PFM", UndefinedCompression, 0.004 },
    308     { "PGM", UndefinedCompression, 0.0 },
    309     { "PGX", UndefinedCompression, 0.0 },
    310     { "PICT", UndefinedCompression, 0.004 },
    311     { "PIX", UndefinedCompression, 0.0 },
    312     { "PJPEG", UndefinedCompression, 0.004 },
    313     { "PLASMA", UndefinedCompression, 0.0 },
    314     { "PNG", UndefinedCompression, 0.0 },
    315     { "PNG8", UndefinedCompression, 0.0 },
    316     { "PNG24", UndefinedCompression, 0.0 },
    317     { "PNG32", UndefinedCompression, 0.0 },
    318     { "PNG48", UndefinedCompression, 0.0 },
    319     { "PNG64", UndefinedCompression, 0.0 },
    320     { "PNG00", UndefinedCompression, 0.0 },
    321     { "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 },
    330     { "RGBA", UndefinedCompression, 0.004 },
    331     { "RGBO", UndefinedCompression, 0.004 },
    332     { "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 },
    355     { "VIFF", UndefinedCompression, 0.004 },
    356     { "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 },
    362     { "XPM", UndefinedCompression, 0.004 },
    363     { "XPS", UndefinedCompression, 0.0 },
    364     { "XV", UndefinedCompression, 0.004 },
    365 #if !defined(MAGICKCORE_WINDOWS_SUPPORT)
    366     { "XWD", UndefinedCompression, 0.0 },
    367 #endif
    368     { "YUV", UndefinedCompression, 0.0 },
    369     { "YCbCr", UndefinedCompression, 0.0 },
    370     { "YCbCrA", UndefinedCompression, 0.0 },
    371 #if defined(MAGICKCORE_GS_DELEGATE)
    372     { "AI", UndefinedCompression, 0.0 },
    373     { "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 },
    384     { "PDF", JPEGCompression, 0.004 },
    385     { "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 },
    393     { "PS3", JPEGCompression, 0.004 },
    394     { "PS3", RLECompression, 0.0 },
    395     { "PS3", LZWCompression, 0.0 },
    396 #endif
    397     { (const char *) NULL, UndefinedCompression, 0.0 }
    398   };
    399 
    400 static 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 
    416 struct ReferenceStorage
    417 {
    418   StorageType
    419     type;
    420 
    421   size_t
    422     quantum;
    423 };
    424 
    425 static const struct ReferenceStorage
    426   reference_storage[] =
    427   {
    428     { CharPixel, sizeof(unsigned char) },
    429     { DoublePixel, sizeof(double) },
    430     { FloatPixel, sizeof(float) },
    431     { LongPixel, sizeof(unsigned int) },
    432     { LongLongPixel, sizeof(MagickSizeType) },
    433     { ShortPixel, sizeof(unsigned short) },
    434     { UndefinedPixel, 0 }
    435   };
    436 
    437 struct ReferenceTypes
    438 {
    439   ImageType
    440     type;
    441 
    442   size_t
    443     depth;
    444 };
    445 
    446 static const struct ReferenceTypes
    447   reference_types[] =
    448   {
    449     { TrueColorType, 8 },
    450     { TrueColorAlphaType, 8 },
    451     { GrayscaleType, 8 },
    452     { GrayscaleAlphaType, 8 },
    453     { PaletteType, 8 },
    454     { PaletteAlphaType, 8 },
    455     { PaletteBilevelAlphaType, 8 },
    456     { BilevelType, 1 },
    457     { ColorSeparationType, 8 },
    458     { ColorSeparationAlphaType, 8 },
    459     { TrueColorType, 10 },
    460     { TrueColorType, 12 },
    461     { TrueColorType, 16 },
    462     { UndefinedType, 0 }
    463   };
    464 
    465 #endif
    466