1 #include <leptonica/allheaders.h>
6 int main(int argc
, char**argv
) {
9 dprintf(2, "spritesheet outfilename pic1 pic2 ...\n");
13 const char *out
= argv
[startarg
++];
16 const int pixcount
= argc
- startarg
;
17 while(startarg
< argc
) {
18 const char *a
= argv
[startarg
++];
19 struct Pix
* pa
= pixRead(a
);
20 struct Pix
* pa32
= pixConvertTo32(pa
);
23 pout
= pixCreate(pa32
->w
, pa32
->h
* pixcount
, 32);
26 assert(pa32
->w
== pout
->w
&& pa32
->h
== pout
->h
/ pixcount
);
29 for(y
= 0; y
< pa32
->h
; y
++, oy
++)
30 for(x
= 0; x
< pa32
->w
; x
++)
31 ((uint32_t*)pout
->data
)[oy
* pa32
->w
+ x
] = ((uint32_t*)pa32
->data
)[y
* pa32
->w
+ x
];
36 pixWritePng(out
, pout
, 0);