summaryrefslogtreecommitdiff
path: root/components/gui/include/rtgui/dc_trans.h
blob: 731571a3e0a9915242b8f33c7f4ccb1e524ef2c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef __RTGUI_DC_TRANS_H__
#define __RTGUI_DC_TRANS_H__

#include <rtgui/dc.h>
#include <rtgui/matrix.h>

struct rtgui_dc_trans;

/** Create a dc translator on the dc @owner
 *
 * @return RT_NULL is there is no memory.
 */
struct rtgui_dc_trans* rtgui_dc_trans_create(struct rtgui_dc *owner);

/** Rotate the dc clockwise.
 *
 * @param degree the degree to rotate.
 */
void rtgui_dc_trans_rotate(struct rtgui_dc_trans *dct, double degree);

void rtgui_dc_trans_set_aa(struct rtgui_dc_trans *dct, int use_aa);

void rtgui_dc_trans_scale(struct rtgui_dc_trans *dct, double sx, double sy);

/** Move the dc
 *
 * The unit of @dx and @dy is pixel.
 */
void rtgui_dc_trans_move(struct rtgui_dc_trans *dct, int dx, int dy);

void rtgui_dc_trans_get_new_wh(struct rtgui_dc_trans *dct, int *new_w, int *new_h);

void rtgui_dc_trans_blit(struct rtgui_dc_trans *dct,
                         struct rtgui_point *dc_point,
                         struct rtgui_dc *dest,
                         struct rtgui_rect *rect);

void rtgui_dc_trans_destroy(struct rtgui_dc_trans *dct);

#endif