libtthimage/Lib/png.c
2022-07-07 12:52:00 +02:00

62 lines
1.3 KiB
C

/*
PNG aka "portable network graphics"s.
*/
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <png.h>
#include <zlib.h>
#undef DEBUG_LEVEL
#define DEBUG_LEVEL 1
#include "../tthimage.h"
/*
* les infos et le code ici viennent de
* http://www.libpng.org/pub/png/pngbook.html
*/
/* static mainprog_info wpng_info; */
/*::------------------------------------------------------------------::*/
static void writepng_version_info(void)
{
fprintf(stderr, " Compiled with libpng %s; using libpng %s.\n",
PNG_LIBPNG_VER_STRING, png_libpng_ver);
fprintf(stderr, " Compiled with zlib %s; using zlib %s.\n",
ZLIB_VERSION, zlib_version);
}
/*::------------------------------------------------------------------::*/
Image_Desc * Image_PNG_alloc_load(char *fname, int k)
{
#if DEBUG_LEVEL
fprintf(stderr, "%s ( '%s' %d )\n", __func__, fname, k);
writepng_version_info();
#endif
return NULL;
}
/*::------------------------------------------------------------------::*/
int Image_save_as_PNG(Image_Desc *img, char *fname, int p1, int p2)
{
FILE *fp;
int x, y, foo;
png_uint_32 pngv;
#if DEBUG_LEVEL
fprintf(stderr, "%s ( %p '%s' %d %d )\n", __func__, img, fname, p1, p2);
writepng_version_info();
#endif
return FULL_NUCKED;
}
/*::------------------------------------------------------------------::*/