home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / gd201.zip / gd-2.0.1 / gd_ss.c < prev    next >
C/C++ Source or Header  |  2001-04-03  |  805b  |  39 lines

  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: */
  11. extern void gdImagePngToSink (gdImagePtr im, gdSinkPtr out);
  12. extern gdImagePtr gdImageCreateFromPngSource (gdSourcePtr inSource);
  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. void
  20. gdImagePngToSink (gdImagePtr im, gdSinkPtr outSink)
  21. {
  22.   gdIOCtx *out = gdNewSSCtx (NULL, outSink);
  23.   gdImagePngCtx (im, out);
  24.   out->free (out);
  25. }
  26.  
  27. gdImagePtr
  28. gdImageCreateFromPngSource (gdSourcePtr inSource)
  29. {
  30.   gdIOCtx *in = gdNewSSCtx (inSource, NULL);
  31.   gdImagePtr im;
  32.  
  33.   im = gdImageCreateFromPngCtx (in);
  34.  
  35.   in->free (in);
  36.  
  37.   return im;
  38. }
  39.