path.h 732 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef DRIVERLIB_PATH_H
  2. #define DRIVERLIB_PATH_H
  3. enum path_mode {
  4. P_MOVE,
  5. P_CONT,
  6. P_CLOSE,
  7. };
  8. struct vertex {
  9. double x, y;
  10. int mode;
  11. };
  12. struct path {
  13. struct vertex *vertices;
  14. int count;
  15. int alloc;
  16. int start;
  17. };
  18. void path_init(struct path *);
  19. void path_free(struct path *);
  20. void path_alloc(struct path *, int);
  21. void path_reset(struct path *);
  22. void path_append(struct path *, double, double, int);
  23. void path_copy(struct path *, const struct path *);
  24. void path_begin(struct path *);
  25. void path_move(struct path *, double, double);
  26. void path_cont(struct path *, double, double);
  27. void path_close(struct path *);
  28. void path_stroke(struct path *, void (*)(double, double, double, double));
  29. #endif