1 /* 2 * Copyright (C) 2021-2023 Alibaba Group Holding Limited 3 */ 4 5 #ifndef _ROTATE_H_ 6 #define _ROTATE_H_ 7 #include <stdbool.h> 8 #include <stdint.h> 9 10 /** @defgroup ugraphics_aos_api 11 * @{ 12 */ 13 14 /** 15 * Rotate graphic 90 degree clockwise. 16 * 17 * @param[in] src graphic source buffer. 18 * @param[in] src_w width of graphics. 19 * @param[in] src_h height of graphics. 20 * @param[in] channel channel number of graphics color. 21 * 22 * @return 0 on success, negative error on failure. 23 */ 24 int rotate_right90(unsigned char *src, int src_w, int src_h, int channel); 25 26 /** 27 * Rotate graphic 90 degree anticlockwise. 28 * 29 * @param[in] src graphic source buffer. 30 * @param[in] src_w width of graphics. 31 * @param[in] src_h height of graphics. 32 * @param[in] channel channel number of graphics color. 33 * 34 * @return 0 on success, negative error on failure. 35 */ 36 int rotate_left90(unsigned char *src, int src_w, int src_h, int channel); 37 38 /** 39 * Rotate graphic 180 degree clockwise. 40 * 41 * @param[in] src graphic source buffer. 42 * @param[in] src_w width of graphics. 43 * @param[in] src_h height of graphics. 44 * @param[in] channel channel number of graphics color. 45 * 46 * @return 0 on success, negative error on failure. 47 */ 48 int rotate_down(unsigned char *src, int src_w, int src_h, int channel); 49 50 /** 51 * @} 52 */ 53 54 #endif // _ROTATE_H_ 55 56