1 /*
2  * Copyright (C) 2015-2018 Alibaba Group Holding Limited
3  */
4 
5 #ifndef _TO_RGB565_H_
6 #define _TO_RGB565_H_
7 #include <stdbool.h>
8 #include <stdint.h>
9 
10 
11 /** @defgroup ugraphics_aos_api
12  * @{
13  */
14 
15 /**
16  * Rotate graphic 180 degree clockwise.
17  *
18  * @param[in]      rgb888_buf         rgb888 graphics buffer.
19  * @param[in]      rgb888_size        rgb888 graphics size.
20  * @param[out]     rgb565_buf         rgb565 grachics buffer after convert.
21  * @param[out]     rgb565_size        rgb565 grachics size after convert.
22  *
23  * @return  0 on success, negative error on failure.
24  */
25 int rgb888torgb565(unsigned char *rgb888_buf, int rgb888_size, \
26                      unsigned short *rgb565_buf, int rgb565_size);
27 
28 /**
29  * Rotate graphic 180 degree clockwise.
30  *
31  * @param[in]      rgb888_buf         rgb565 graphics buffer.
32  * @param[in]      rgb888_size        rgb565 graphics size.
33  * @param[out]     rgb565_buf         rgb888 grachics buffer after convert.
34  * @param[out]     rgb565_size        rgb888 grachics size after convert.
35  *
36  * @return  0 on success, negative error on failure.
37  */
38 int rgb565torgb888(unsigned short *rgb565_buf, int rgb565_size, \
39                      unsigned char *rgb888_buf, int rgb888_size);
40 
41 /**
42  * @}
43  */
44 
45 #endif // _TO_RGB565_H_
46 
47