gdioctx_wrapper.h 420 B

12345678910111213141516171819
  1. #pragma once
  2. #include <gd.h>
  3. #include <gvc/gvcext.h>
  4. #include <stddef.h>
  5. typedef struct {
  6. gdIOCtx ctx;
  7. GVJ_t *job;
  8. } gd_context_t;
  9. static inline gd_context_t *get_containing_context(gdIOCtx *ctx) {
  10. return (gd_context_t *)((char *)ctx - offsetof(gd_context_t, ctx));
  11. }
  12. int gvdevice_gd_putBuf(gdIOCtx *context, const void *buffer, int len);
  13. // used by gif output
  14. void gvdevice_gd_putC(gdIOCtx *context, int C);