54 unsigned int header_len = bytestream2_get_be32(pgb);
56 out->
format = bytestream2_get_byte(pgb);
58 out->
width = bytestream2_get_be16(pgb);
59 out->
height = bytestream2_get_be16(pgb);
62 if (header_len < 11) {
73 void *
data,
int *got_frame,
82 unsigned int bytes_pp;
84 unsigned int magic[4];
85 unsigned int chunk_type;
86 unsigned int data_len;
91 magic[0] = bytestream2_get_be32(&gb);
92 magic[1] = bytestream2_get_be32(&gb);
93 magic[2] = bytestream2_get_be32(&gb);
94 magic[3] = bytestream2_get_be32(&gb);
96 if (magic[0] != 0x12 ||
104 chunk_type = bytestream2_get_be32(&gb);
105 if (chunk_type != 0x3 && chunk_type != 0x3d) {
160 chunk_type = bytestream2_get_be32(&gb);
163 (chunk_type == 0x3 || chunk_type == 0x3d)) {
165 uint32_t *pal_out = (uint32_t *)s->
frame.
data[1];
178 chunk_type = bytestream2_get_be32(&gb);
179 data_len = bytestream2_get_be32(&gb);
181 if (chunk_type != 0x21 || data_len != 1032 ||
187 for (i = 0; i < 256; ++i) {
189 *pal_out++ = (0xFF
U << 24) | bytestream2_get_be24u(&gb);
195 chunk_type = bytestream2_get_be32(&gb);
198 data_len = bytestream2_get_be32(&gb);
203 unsigned int bytes_per_scanline = bytes_pp * hdr.
width;
206 if (chunk_type != 0x21 || data_len != bytes_left ||
207 bytes_left / bytes_per_scanline < hdr.
height)
216 bytes_per_scanline, hdr.
height);
219 *frame_out = s->
frame;
236 .
name =
"brender_pix",