libtthimage/Lib/png.c

62 lines
1.3 KiB
C
Raw Normal View History

2022-06-26 11:06:35 +02:00
/*
PNG aka "portable network graphics"s.
*/
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <png.h>
2022-06-30 20:33:31 +02:00
#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; */
2022-06-26 11:06:35 +02:00
2022-06-30 20:33:31 +02:00
/*::------------------------------------------------------------------::*/
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);
}
2022-06-26 11:06:35 +02:00
/*::------------------------------------------------------------------::*/
Image_Desc * Image_PNG_alloc_load(char *fname, int k)
{
2022-06-30 20:33:31 +02:00
#if DEBUG_LEVEL
fprintf(stderr, "%s ( '%s' %d )\n", __func__, fname, k);
writepng_version_info();
#endif
2022-06-26 11:06:35 +02:00
return 666;
}
/*::------------------------------------------------------------------::*/
int Image_save_as_PNG(Image_Desc *img, char *fname, int p1, int p2)
{
FILE *fp;
2022-06-30 20:33:31 +02:00
int x, y, foo;
2022-06-26 11:06:35 +02:00
png_uint_32 pngv;
#if DEBUG_LEVEL
fprintf(stderr, "%s ( %p '%s' %d %d )\n", __func__, img, fname, p1, p2);
2022-06-30 20:33:31 +02:00
writepng_version_info();
2022-06-26 11:06:35 +02:00
#endif
return FULL_NUCKED;
}
/*::------------------------------------------------------------------::*/