PageRenderTime 46ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/rel-1-3-26/SWIG/Examples/GIFPlot/Python/simple/simple.i

#
Swig | 38 lines | 22 code | 12 blank | 4 comment | 0 complexity | 8da1232fe1c4c06c85531044d99aec16 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 char 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 */
  19. #define BLACK 0
  20. #define WHITE 1
  21. #define RED 2
  22. #define GREEN 3
  23. #define BLUE 4
  24. #define YELLOW 5
  25. #define CYAN 6
  26. #define MAGENTA 7