php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
gd_ss.c
Go to the documentation of this file.
1#include <stdio.h>
2#include <math.h>
3#include <string.h>
4#include <stdlib.h>
5#include "gd.h"
6
7#define TRUE 1
8#define FALSE 0
9
10/* Exported functions: */
13
14/* Use this for commenting out debug-print statements. */
15/* Just use the first '#define' to allow all the prints... */
16/*#define GD_SS_DBG(s) (s) */
17#define GD_SS_DBG(s)
18
19#ifdef HAVE_LIBPNG
20void gdImagePngToSink (gdImagePtr im, gdSinkPtr outSink)
21{
22 gdIOCtx *out = gdNewSSCtx(NULL, outSink);
23 gdImagePngCtx(im, out);
24 out->gd_free(out);
25}
26
28{
29 gdIOCtx *in = gdNewSSCtx(inSource, NULL);
30 gdImagePtr im;
31
33
34 in->gd_free(in);
35
36 return im;
37}
38#else /* no HAVE_LIBPNG */
40{
41 gd_error("PNG support is not available");
42}
44{
45 gd_error("PNG support is not available");
46 return NULL;
47}
48#endif /* HAVE_LIBPNG */
49
gdImagePtr gdImageCreateFromPngCtx(gdIOCtxPtr in)
void gdImagePngCtx(gdImagePtr im, gdIOCtx *out)
struct gdSink * gdSinkPtr
struct gdSource * gdSourcePtr
gdIOCtx * gdNewSSCtx(gdSourcePtr in, gdSinkPtr out)
Definition gd_io_ss.c:50
gdImage * gdImagePtr
Definition gd.h:248
gdImagePtr gdImageCreateFromPngSource(gdSourcePtr inSource)
Definition gd_ss.c:43
void gdImagePngToSink(gdImagePtr im, gdSinkPtr out)
Definition gd_ss.c:39
#define NULL
Definition gdcache.h:45
void gd_error(const char *format,...)
Definition gd.c:103
void(* gd_free)(struct gdIOCtx *)
Definition gd_io.h:20
out($f, $s)