dc_trans.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * File : dc_trans.h
  3. * This file is part of RT-Thread GUI Engine
  4. * COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with this program; if not, write to the Free Software Foundation, Inc.,
  18. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  19. *
  20. * Change Logs:
  21. * Date Author Notes
  22. * 2010-04-10 Bernard first version
  23. */
  24. #ifndef __RTGUI_DC_TRANS_H__
  25. #define __RTGUI_DC_TRANS_H__
  26. #include <rtgui/dc.h>
  27. #include <rtgui/matrix.h>
  28. struct rtgui_dc_trans;
  29. /** Create a dc translator on the dc @owner
  30. *
  31. * @return RT_NULL is there is no memory.
  32. */
  33. struct rtgui_dc_trans* rtgui_dc_trans_create(struct rtgui_dc *owner);
  34. /** Rotate the dc clockwise.
  35. *
  36. * @param degree the degree to rotate.
  37. */
  38. void rtgui_dc_trans_rotate(struct rtgui_dc_trans *dct, double degree);
  39. void rtgui_dc_trans_set_aa(struct rtgui_dc_trans *dct, int use_aa);
  40. void rtgui_dc_trans_scale(struct rtgui_dc_trans *dct, double sx, double sy);
  41. /** Move the dc
  42. *
  43. * The unit of @dx and @dy is pixel.
  44. */
  45. void rtgui_dc_trans_move(struct rtgui_dc_trans *dct, int dx, int dy);
  46. void rtgui_dc_trans_get_new_wh(struct rtgui_dc_trans *dct, int *new_w, int *new_h);
  47. void rtgui_dc_trans_blit(struct rtgui_dc_trans *dct,
  48. struct rtgui_point *dc_point,
  49. struct rtgui_dc *dest,
  50. struct rtgui_rect *rect);
  51. void rtgui_dc_trans_destroy(struct rtgui_dc_trans *dct);
  52. #endif