php-src/ext/gd/libgd/gd_ss.c
Rasmus Lerdorf 7a8cade379 Initial commit of the built-in libgd based on GD-2.0.1
This initial checkin has no changes to any of the libgd code so it can
be used as a basis for diffs.  It also will not build currently because
of this.  The PHP gd checks need to be incorporated along with a bit of
other config magic.  It also shouldn't break the build and will only
take effect if you use --with-gd=php right now.
2002-04-13 02:03:09 +00:00

39 lines
805 B
C

#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include "gd.h"
#define TRUE 1
#define FALSE 0
/* Exported functions: */
extern void gdImagePngToSink (gdImagePtr im, gdSinkPtr out);
extern gdImagePtr gdImageCreateFromPngSource (gdSourcePtr inSource);
/* Use this for commenting out debug-print statements. */
/* Just use the first '#define' to allow all the prints... */
/*#define GD_SS_DBG(s) (s) */
#define GD_SS_DBG(s)
void
gdImagePngToSink (gdImagePtr im, gdSinkPtr outSink)
{
gdIOCtx *out = gdNewSSCtx (NULL, outSink);
gdImagePngCtx (im, out);
out->free (out);
}
gdImagePtr
gdImageCreateFromPngSource (gdSourcePtr inSource)
{
gdIOCtx *in = gdNewSSCtx (inSource, NULL);
gdImagePtr im;
im = gdImageCreateFromPngCtx (in);
in->free (in);
return im;
}