27 const uint8_t **poutbuf,
int *poutbuf_size,
28 const uint8_t *buf,
int buf_size)
31 uint8_t
flags, depth, chroma_format, alpha_channel_type;
34 *poutbuf_size = buf_size;
43 if (bytestream2_get_be32(&gb) != buf_size)
47 if (bytestream2_get_le32(&gb) !=
MKTAG(
'i',
'c',
'p',
'f'))
51 if (bytestream2_get_be16(&gb) < 20)
59 s->width = bytestream2_get_be16(&gb);
60 s->height = bytestream2_get_be16(&gb);
64 flags = bytestream2_get_byte(&gb);
67 switch (
flags >> 2 & 3) {
88 case MKTAG(
'a',
'p',
'c',
'o'):
89 case MKTAG(
'a',
'p',
'c',
's'):
90 case MKTAG(
'a',
'p',
'c',
'n'):
91 case MKTAG(
'a',
'p',
'c',
'h'):
94 case MKTAG(
'a',
'p',
'4',
'h'):
95 case MKTAG(
'a',
'p',
'4',
'x'):
102 chroma_format =
flags >> 6 & 3;
103 if (chroma_format < 2)
106 alpha_channel_type = bytestream2_get_byte(&gb) & 0xf;
108 switch (depth | (chroma_format << 4) | (alpha_channel_type << 8)) {
110 case 10 | (2 << 4) | (1 << 8):
113 case 10 | (3 << 4) | (1 << 8):
116 case 12 | (2 << 4) | (1 << 8):
119 case 12 | (3 << 4) | (1 << 8):