libtthimage/Lib/t_png.c

41 lines
788 B
C
Raw Normal View History

2022-07-01 05:33:31 +11:00
/*
* test des fonctionsPNG
*/
#include <stdio.h>
#include <stdlib.h>
2022-09-13 09:11:53 +11:00
#include <png.h>
2022-07-01 05:33:31 +11:00
#include "../tthimage.h"
2022-09-13 09:11:53 +11:00
void write_png_version_info(void);
2022-07-01 05:33:31 +11:00
/*::------------------------------------------------------------------::*/
/*::------------------------------------------------------------------::*/
/*::------------------------------------------------------------------::*/
int main(int argc, char *argv[])
{
Image_Desc *img;
int foo;
2022-09-13 09:11:53 +11:00
char *fname = "proto.png";
2022-07-01 05:33:31 +11:00
Image_print_version(0);
if (2==argc) {
fname = argv[1];
}
img = Image_alloc(640, 480, IMAGE_RGB);
foo = Image_save_as_PNG(img, fname, 0, 0);
if (foo) {
fprintf(stderr, "save as '%s' -> %d\n", fname, foo);
exit(1);
}
return 0;
}
/*::------------------------------------------------------------------::*/