2022-06-30 20:33:31 +02:00
|
|
|
/*
|
|
|
|
* test des fonctionsPNG
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2022-09-13 00:11:53 +02:00
|
|
|
#include <png.h>
|
|
|
|
|
2022-06-30 20:33:31 +02:00
|
|
|
#include "../tthimage.h"
|
|
|
|
|
2022-09-13 00:11:53 +02:00
|
|
|
void write_png_version_info(void);
|
2022-06-30 20:33:31 +02:00
|
|
|
|
|
|
|
/*::------------------------------------------------------------------::*/
|
|
|
|
/*::------------------------------------------------------------------::*/
|
|
|
|
/*::------------------------------------------------------------------::*/
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
Image_Desc *img;
|
|
|
|
int foo;
|
2022-09-13 00:11:53 +02:00
|
|
|
char *fname = "proto.png";
|
2022-06-30 20:33:31 +02: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;
|
|
|
|
}
|
|
|
|
/*::------------------------------------------------------------------::*/
|
|
|
|
|