2 #include "leptonica/allheaders.h"
10 const struct palpic
* f
= & sprite
.header
;
11 PIX
* o
= pixCreate(f
->width
, f
->height
, 32);
12 prgb
* palette
= palpic_getpalette(f
);
13 prgb
* bufptr
= (prgb
*) o
->data
;
15 for(i
= 0; i
< f
->spritecount
; i
++) {
17 const uint8_t *source
= palpic_getspritedata(f
, i
);
18 for(y
= 0; y
< palpic_getspriteheight(f
); y
++) {
19 for(x
= 0; x
< palpic_getspritewidth(f
); x
++) {
20 *bufptr
++ = palette
[*source
++];
24 pixWritePng("test.png", o
, 0.0);