47 uint8_t *out_end,
int pixelstride)
50 unsigned char *orig = out_buf;
52 while (out_buf < out_end) {
55 pixel = bytestream2_get_byteu(&s->
g);
56 if (!(count = (pixel & 0x7f))) {
61 if (out_end - out_buf <= pixelstride * (count - 1))
66 *out_buf = bytestream2_get_byte(&s->
g);
67 out_buf += pixelstride;
70 pixel = bytestream2_get_byte(&s->
g);
74 out_buf += pixelstride;
78 return (out_buf - orig) / pixelstride;
93 unsigned int start_offset;
100 for (z = 0; z < s->
depth; z++) {
102 for (y = 0; y < s->
height; y++) {
104 start_offset = bytestream2_get_be32(&g_table);
133 for (z = 0; z < s->
depth; z++) {
138 for (y = s->
height - 1; y >= 0; y--) {
139 out_end = out_buf + (y * s->
linesize);
141 for (x = s->
width; x > 0; x--)
142 for (z = 0; z < s->
depth; z++)
143 *out_end++ = bytestream2_get_byteu(&gp[z]);
145 uint16_t *out16 = (uint16_t *)out_end;
146 for (x = s->
width; x > 0; x--)
147 for (z = 0; z < s->
depth; z++)
155 void *
data,
int *got_frame,
160 unsigned int dimension, rle;
171 if (bytestream2_get_be16u(&s->
g) !=
SGI_MAGIC) {
176 rle = bytestream2_get_byteu(&s->
g);
178 dimension = bytestream2_get_be16u(&s->
g);
179 s->
width = bytestream2_get_be16u(&s->
g);
180 s->
height = bytestream2_get_be16u(&s->
g);
181 s->
depth = bytestream2_get_be16u(&s->
g);
189 if (dimension != 2 && dimension != 3) {
214 out_buf = p->
data[0];