xpm/xpm
version 1.0
Core XPM3 features one at a time (hex colours, multi-char pixels, cursor hotspot, multi-visual colour keys, XPMEXT, named colours, transparency)
- Format
- X PixMap (xpm)
- Authors
- The Fandango Fuzzer Team
- License
- Apache-2.0
- Fandango
- >=1.3
- Extensions
- xpm
- Media type
- image/x-xpixmap
- Specification
- https://www.x.org/docs/XPM/xpm.pdf
- Its files should decode
- always
- In the registry
- specs/xpm/xpm/xpm.fan
Use it
fanbase install xpm fandango fuzz -F xpm -n 10
How it does
accepts 100%, covers 71.5%, 0.05/s. 5 inputs, seed 1.
| Parser | Accepts | Version |
|---|---|---|
| ffmpeg | 100% | ffmpeg version 7.1.5-0+deb13u1 |
| ffmpeg-xpm-cov | 100% | FFmpeg (XPM) 9.0.2 |
| imagemagick | 100% | Version: ImageMagick 7.1.1-43 Q16 x86_64 22550 |
| pillow | 40% | 12.3.0 |
The spec says its files decode always: as expected.
ffmpeg-xpm-cov
- lines reached
- 71.5% of 151
- real files reach
- 65.6%
- only the generated files
- 9 lines
- only the real files
- 0 lines
Cite it
@software{fanbase_xpm_xpm_1_0,
author = {{The Fandango Fuzzer Team}},
title = {X PixMap (xpm/xpm), a Fandango input specification},
version = {1.0},
url = {https://github.com/fandango-fuzzer/fanbase},
note = {Fanbase registry, specs/xpm/xpm/xpm.fan, sha256 85d05a7d9b65},
}
Source
Source (131 lines)
# XPM3: "/* XPM */\nstatic char * NAME[] = {...}" with a values line (width
# height ncolors cpp, optional hotspot, optional XPMEXT), a colour table
# using the c/m/s/g/g4 keys, and pixel rows drawn only from the declared
# palette. Flavours: hex cpp=1, cpp=2 multi-char pixels, a cursor hotspot,
# multi-key colours, an XPMEXT extension block, symbolic X11 colour names,
# and a transparent (None) palette.
<start> ::= <f_hex> | <f_cpp2> | <f_hotspot> | <f_multikey> | <f_ext> | <f_named> | <f_none>
# flavour 1: basic colour, #RRGGBB, chars-per-pixel = 1, width 8
<f_hex> ::= (
"/* XPM */\n"
"static char * pixmap[] = {\n"
'"8 ' <dh1> ' 3 1",\n'
'". c #ffffff",\n'
'"X c #ff0000",\n'
'"o c #0000ff",\n'
<rows1>
"};\n"
)
where len(<rows1>) == int(<dh1>)
<dh1> ::= "4" | "6" | "8"
<rows1> ::= <row1>+
<row1> ::= '"' r'[.Xo]{8}' '",\n'
# flavour 2: chars-per-pixel = 2, width 4 (8 chars per row)
<f_cpp2> ::= (
"/* XPM */\n"
"static char * pixmap[] = {\n"
'"4 ' <dh2> ' 3 2",\n'
'".. c #000000",\n'
'"XX c #ffff00",\n'
'"oo c #00ffff",\n'
<rows2>
"};\n"
)
where len(<rows2>) == int(<dh2>)
<dh2> ::= "3" | "4" | "5"
<rows2> ::= <row2>+
<row2> ::= '"' r'(\.\.|XX|oo){4}' '",\n'
# flavour 3: hotspot cursor (x_hot y_hot after cpp), width 8
<f_hotspot> ::= (
"/* XPM */\n"
"static char * cursor[] = {\n"
'"8 ' <dh3> ' 2 1 ' <xhot> " " <yhot> '",\n'
'". c #000000",\n'
'"X c #ffffff",\n'
<rows3>
"};\n"
)
where len(<rows3>) == int(<dh3>)
where int(<yhot>) < int(<dh3>)
where int(<xhot>) < 8
<dh3> ::= "4" | "6" | "8"
<xhot> ::= "0" | "1" | "2" | "3"
<yhot> ::= "0" | "1" | "2" | "3"
<rows3> ::= <row3>+
<row3> ::= '"' r'[.X]{8}' '",\n'
# flavour 4: multiple visual keys per colour (c m s g g4), width 8
<f_multikey> ::= (
"/* XPM */\n"
"static char * pixmap[] = {\n"
'"8 ' <dh4> ' 2 1",\n'
'". c #ff0000 m #000000 g4 #808080 g #c0c0c0 s red",\n'
'"X c #0000ff m #ffffff g4 #404040 g #303030 s blue",\n'
<rows4>
"};\n"
)
where len(<rows4>) == int(<dh4>)
<dh4> ::= "4" | "6" | "8"
<rows4> ::= <row4>+
<row4> ::= '"' r'[.X]{8}' '",\n'
# flavour 5: XPMEXT extension section, width 8
<f_ext> ::= (
"/* XPM */\n"
"static char * pixmap[] = {\n"
'"8 ' <dh5> ' 3 1 XPMEXT",\n'
'". c #ffffff",\n'
'"X c #ff00ff",\n'
'"o c #00ff00",\n'
<rows5>
'"XPMEXT author",\n'
'"Generated by Fandango",\n'
'"XPMENDEXT"\n'
"};\n"
)
where len(<rows5>) == int(<dh5>)
<dh5> ::= "4" | "6" | "8"
<rows5> ::= <row5>+
<row5> ::= '"' r'[.Xo]{8}' '",\n'
# flavour 6: symbolic X11 colour names, width 8
<f_named> ::= (
"/* XPM */\n"
"static char * pixmap[] = {\n"
'"8 ' <dh6> ' 3 1",\n'
'". c white",\n'
'"X c black",\n'
'"o c cornflower blue",\n'
<rows6>
"};\n"
)
where len(<rows6>) == int(<dh6>)
<dh6> ::= "4" | "6" | "8"
<rows6> ::= <row6>+
<row6> ::= '"' r'[.Xo]{8}' '",\n'
# flavour 7: transparent (None) colour, space pixel char, width 8
<f_none> ::= (
"/* XPM */\n"
"static char * pixmap[] = {\n"
'"8 ' <dh7> ' 2 1",\n'
'" c None",\n'
'". c #000000",\n'
<rows7>
"};\n"
)
where len(<rows7>) == int(<dh7>)
<dh7> ::= "4" | "6" | "8"
<rows7> ::= <row7>+
<row7> ::= '"' r'[. ]{8}' '",\n'