PageRenderTime 43ms CodeModel.GetById 15ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/Root-branch-php-utl/SWIG/Examples/GIFPlot/Chicken/simple/simple.i

#
Swig | 34 lines | 22 code | 7 blank | 5 comment | 0 complexity | 3e262a013546a9ebb15228916b93179d MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. /* This example shows a very simple interface wrapping a few
  2. primitive declarations */
  3. %module simple
  4. %{
  5. #include "gifplot.h"
  6. %}
  7. typedef unsigned int Pixel;
  8. /* Here are a few useful functions */
  9. ColorMap *new_ColorMap(char *filename = 0);
  10. void delete_ColorMap(ColorMap *cmap);
  11. FrameBuffer *new_FrameBuffer(unsigned int width, unsigned int height);
  12. void delete_FrameBuffer(FrameBuffer *frame);
  13. void FrameBuffer_clear(FrameBuffer *frame, Pixel color);
  14. void FrameBuffer_line(FrameBuffer *frame, int x1, int y1, int x2, int y2, Pixel color);
  15. void FrameBuffer_box(FrameBuffer *frame, int x1, int y1, int x2, int y2, Pixel color);
  16. void FrameBuffer_circle(FrameBuffer *frame, int x1, int y1, int radius, Pixel color);
  17. int FrameBuffer_writeGIF(FrameBuffer *f, ColorMap *c, char *filename);
  18. /* And some useful constants, which we redefine (from gifplot.h) so
  19. that SWIG sees them */
  20. #define BLACK 0
  21. #define WHITE 1
  22. #define RED 2
  23. #define GREEN 3
  24. #define BLUE 4
  25. #define YELLOW 5
  26. #define CYAN 6
  27. #define MAGENTA 7