39 #define ID_8SVX MKTAG('8','S','V','X')
40 #define ID_16SV MKTAG('1','6','S','V')
41 #define ID_MAUD MKTAG('M','A','U','D')
42 #define ID_MHDR MKTAG('M','H','D','R')
43 #define ID_MDAT MKTAG('M','D','A','T')
44 #define ID_VHDR MKTAG('V','H','D','R')
45 #define ID_ATAK MKTAG('A','T','A','K')
46 #define ID_RLSE MKTAG('R','L','S','E')
47 #define ID_CHAN MKTAG('C','H','A','N')
48 #define ID_PBM MKTAG('P','B','M',' ')
49 #define ID_ILBM MKTAG('I','L','B','M')
50 #define ID_BMHD MKTAG('B','M','H','D')
51 #define ID_DGBL MKTAG('D','G','B','L')
52 #define ID_CAMG MKTAG('C','A','M','G')
53 #define ID_CMAP MKTAG('C','M','A','P')
54 #define ID_ACBM MKTAG('A','C','B','M')
55 #define ID_DEEP MKTAG('D','E','E','P')
56 #define ID_RGB8 MKTAG('R','G','B','8')
57 #define ID_RGBN MKTAG('R','G','B','N')
59 #define ID_FORM MKTAG('F','O','R','M')
60 #define ID_ANNO MKTAG('A','N','N','O')
61 #define ID_AUTH MKTAG('A','U','T','H')
62 #define ID_CHRS MKTAG('C','H','R','S')
63 #define ID_COPYRIGHT MKTAG('(','c',')',' ')
64 #define ID_CSET MKTAG('C','S','E','T')
65 #define ID_FVER MKTAG('F','V','E','R')
66 #define ID_NAME MKTAG('N','A','M','E')
67 #define ID_TEXT MKTAG('T','E','X','T')
68 #define ID_ABIT MKTAG('A','B','I','T')
69 #define ID_BODY MKTAG('B','O','D','Y')
70 #define ID_DBOD MKTAG('D','B','O','D')
71 #define ID_DPEL MKTAG('D','P','E','L')
72 #define ID_DLOC MKTAG('D','L','O','C')
73 #define ID_TVDC MKTAG('T','V','D','C')
87 #define IFF_EXTRA_VIDEO_SIZE 41
113 const char *
const tag,
114 const unsigned data_size)
148 static const uint8_t deep_rgb24[] = {0, 0, 0, 3, 0, 1, 0, 8, 0, 2, 0, 8, 0, 3, 0, 8};
149 static const uint8_t deep_rgba[] = {0, 0, 0, 4, 0, 1, 0, 8, 0, 2, 0, 8, 0, 3, 0, 8};
150 static const uint8_t deep_bgra[] = {0, 0, 0, 4, 0, 3, 0, 8, 0, 2, 0, 8, 0, 1, 0, 8};
151 static const uint8_t deep_argb[] = {0, 0, 0, 4, 0,17, 0, 8, 0, 1, 0, 8, 0, 2, 0, 8};
152 static const uint8_t deep_abgr[] = {0, 0, 0, 4, 0,17, 0, 8, 0, 3, 0, 8, 0, 2, 0, 8};
160 uint32_t chunk_id, data_size;
161 uint32_t screenmode = 0, num, den;
162 unsigned transparency = 0;
163 unsigned masking = 0;
184 const char *metadata_tag =
NULL;
197 if (data_size >= 16) {
275 if (data_size >= 14) {
279 if (data_size >= 16) {
286 if (data_size < 4 || (data_size & 3))
288 if ((fmt_size =
avio_read(pb, fmt,
sizeof(fmt))) < 0)
326 if (data_size <
sizeof(iff->
tvdc))
334 case ID_TEXT: metadata_tag =
"comment";
break;
335 case ID_AUTH: metadata_tag =
"artist";
break;
337 case ID_NAME: metadata_tag =
"title";
break;
341 if ((res =
get_metadata(s, metadata_tag, data_size)) < 0) {
401 if ((screenmode & 0x800 ) && iff->
bpp <= 8) {
402 iff->
ham = iff->
bpp > 6 ? 6 : 4;
405 iff->
flags = (screenmode & 0x80 ) && iff->
bpp <= 8;
419 bytestream_put_byte(&buf, iff->
bpp);
420 bytestream_put_byte(&buf, iff->
ham);
421 bytestream_put_byte(&buf, iff->
flags);
423 bytestream_put_byte(&buf, iff->
masking);
460 bytestream_put_be16(&buf, 2);