1
0

plot_curve.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * File : plot_curve.h
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2012, RT-Thread Development Team
  5. *
  6. * The license and distribution terms for this file may be
  7. * found in the file LICENSE in this distribution or at
  8. * http://www.rt-thread.org/license/LICENSE
  9. *
  10. * Change Logs:
  11. * Date Author Notes
  12. * 2012-09-03 Grissiom first version
  13. */
  14. #ifndef __RTGUI_PLOT_CURVE_H__
  15. #define __RTGUI_PLOT_CURVE_H__
  16. #include <rtgui/rtgui.h>
  17. DECLARE_CLASS_TYPE(plot_curve);
  18. /** Gets the type of a plot_curve */
  19. #define RTGUI_PLOT_CURVE_TYPE (RTGUI_TYPE(plot_curve))
  20. /** Casts the object to an rtgui_plot */
  21. #define RTGUI_PLOT_CURVE(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_PLOT_CURVE_TYPE, struct rtgui_plot_curve))
  22. /** Checks if the object is an rtgui_plot */
  23. #define RTGUI_IS_PLOT_CURVE(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_PLOT_CURVE_TYPE))
  24. /* change this if you want to use other type of data.
  25. * For example, rt_uint8_t or rt_uint32_t. */
  26. #define rtgui_plot_curve_dtype rt_int16_t
  27. struct rtgui_plot_curve
  28. {
  29. struct rtgui_object parent;
  30. rtgui_color_t color;
  31. rt_size_t length;
  32. rtgui_plot_curve_dtype *x_data;
  33. rtgui_plot_curve_dtype *y_data;
  34. };
  35. struct rtgui_plot_curve *rtgui_plot_curve_create(void);
  36. void rtgui_plot_curve_destroy(struct rtgui_plot_curve *curve);
  37. #endif