sw_rotate.h 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935
  1. /*
  2. * Copyright (c) 2020 Actions Technology Co., Ltd
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. /**
  7. * @file
  8. * @brief Utilities of sw rotation API
  9. */
  10. #ifndef ZEPHYR_FRAMEWORK_INCLUDE_DISPLAY_SW_ROTATE_H_
  11. #define ZEPHYR_FRAMEWORK_INCLUDE_DISPLAY_SW_ROTATE_H_
  12. #include <stdbool.h>
  13. #include "sw_math.h"
  14. /**
  15. * @defgroup display-util Display Utilities
  16. * @ingroup display_libraries
  17. * @{
  18. */
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. /**
  23. * @brief Enumeration with possible predefined transformations
  24. */
  25. enum {
  26. SW_FLIP_H = 0x1, /* Flip source image horizontally */
  27. SW_FLIP_V = 0x2, /* Flip source image verticallye */
  28. SW_ROT_90 = 0x4, /* Rotate source image 90 degrees clock-wise */
  29. SW_ROT_180 = 0x3, /* Rotate source image 180 degrees clock-wise */
  30. SW_ROT_270 = 0x7, /* Rotate source image 270 degrees clock-wise */
  31. };
  32. /**
  33. * @struct sw_matrix
  34. * @brief Structure holding 2x3 affine transform.
  35. *
  36. * [ sx shx tx ]
  37. * [ shy sy ty ]
  38. * [ 0 0 1 ]
  39. *
  40. * Where:
  41. * sx and sy define scaling in the x and y directions, respectively;
  42. * shx and shy define shearing in the x and y directions, respectively;
  43. * tx and ty define translation in the x and y directions, respectively;
  44. *
  45. * An affine transformation maps a point (x, y) into the point (x', y') using
  46. * matrix multiplication:
  47. *
  48. * [ sx shx tx ] [x] [ x * sx + y * shx + tx ]
  49. * [ shy sy ty ] [y] = [ x * shy + y * sy + ty ]
  50. * [ 0 0 1 ] [1] [ 1 ]
  51. *
  52. * that is:
  53. * x' = sx * x + shx * y + tx
  54. * y' = shy * x + sy * y + ty
  55. */
  56. typedef struct sw_matrix {
  57. int32_t tx;
  58. int32_t ty;
  59. int32_t sx;
  60. int32_t shy;
  61. int32_t shx;
  62. int32_t sy;
  63. } sw_matrix_t;
  64. /*
  65. * @brief generate a rotation configuration width scaling first
  66. *
  67. * The src is scaled then rotated to dest.
  68. *
  69. * @param img_x x coord of top-left corner of image src before rotation in the display coordinate
  70. * @param img_y y coord of top-left corner of image src before rotation in the display coordinate
  71. * @param pivot_x rotate/scale pivot X offset relative to top-left corner of the image
  72. * @param pivot_y rotate/scale pivot Y offset relative to top-left corner of the image
  73. * @param angle rotation angle in 0.1 degree [0, 3600)
  74. * @param scale_x scale factor X, equal to "(1 << scale_bits) * dest_w / src_w"
  75. * @param scale_y scale factor Y, equal to "(1 << scale_bits) * dest_h / src_h"
  76. * @param scale_bits scale factor bits of scale_x and scale_y
  77. * @param matrix matrix generated in func sw_transform_config()
  78. *
  79. * @retval N/A
  80. */
  81. void sw_transform_config(int16_t img_x, int16_t img_y,
  82. int16_t pivot_x, int16_t pivot_y, uint16_t angle,
  83. uint16_t scale_x, uint16_t scale_y, uint16_t scale_bits,
  84. sw_matrix_t *matrix);
  85. /*
  86. * @brief generate a 90 (CW) degree rotation configuration
  87. *
  88. * Assume the top-left corner of image are (0, 0) in the display coordinate system
  89. * both before and after transformation.
  90. *
  91. * @param src_w transformed area width of source image
  92. * @param src_h transformed area height of source image
  93. * @param mode transformation mode
  94. *
  95. * @retval N/A
  96. */
  97. void sw_transform_config_with_mode(uint16_t img_w, uint16_t img_h,
  98. uint8_t mode, sw_matrix_t *matrix);
  99. /*
  100. * @brief rotate an rgb565 image over rgb565 image
  101. *
  102. * @param dst address of dst image
  103. * @param src address of src image
  104. * @param dst_pitch stride in bytes of dst image
  105. * @param src_pitch stride in bytes of src image
  106. * @param src_w width in pixels of src image
  107. * @param src_h height in pixels of src image
  108. * @param x x coordinate of the draw area in the display coordinate
  109. * @param y y coordinate of the draw area in the display coordinate
  110. * @param w width in pixels of the draw area
  111. * @param h height in pixels of the draw area
  112. * @param matrix matrix generated in func sw_transform_config()
  113. *
  114. * @retval N/A
  115. */
  116. void sw_transform_rgb565_over_rgb565(void *dst, const void *src,
  117. uint16_t dst_pitch, uint16_t src_pitch, uint16_t src_w, uint16_t src_h,
  118. int16_t x, int16_t y, uint16_t w, uint16_t h,
  119. const sw_matrix_t *matrix);
  120. /*
  121. * @brief rotate an rgb565 image over rg888 image
  122. *
  123. * @param dst address of dst image
  124. * @param src address of src image
  125. * @param dst_pitch stride in bytes of dst image
  126. * @param src_pitch stride in bytes of src image
  127. * @param src_w width in pixels of src image
  128. * @param src_h height in pixels of src image
  129. * @param x x coordinate of the draw area in the display coordinate
  130. * @param y y coordinate of the draw area in the display coordinate
  131. * @param w width in pixels of the draw area
  132. * @param h height in pixels of the draw area
  133. * @param matrix matrix generated in func sw_transform_config()
  134. *
  135. * @retval N/A
  136. */
  137. void sw_transform_rgb565_over_rgb888(void *dst, const void *src,
  138. uint16_t dst_pitch, uint16_t src_pitch, uint16_t src_w, uint16_t src_h,
  139. int16_t x, int16_t y, uint16_t w, uint16_t h,
  140. const sw_matrix_t *matrix);
  141. /*
  142. * @brief rotate an rgb565 image over argb8888 image
  143. *
  144. * @param dst address of dst image
  145. * @param src address of src image
  146. * @param dst_pitch stride in bytes of dst image
  147. * @param src_pitch stride in bytes of src image
  148. * @param src_w width in pixels of src image
  149. * @param src_h height in pixels of src image
  150. * @param x x coordinate of the draw area in the display coordinate
  151. * @param y y coordinate of the draw area in the display coordinate
  152. * @param w width in pixels of the draw area
  153. * @param h height in pixels of the draw area
  154. * @param matrix matrix generated in func sw_transform_config()
  155. *
  156. * @retval N/A
  157. */
  158. void sw_transform_rgb565_over_argb8888(void *dst, const void *src,
  159. uint16_t dst_pitch, uint16_t src_pitch, uint16_t src_w, uint16_t src_h,
  160. int16_t x, int16_t y, uint16_t w, uint16_t h,
  161. const sw_matrix_t *matrix);
  162. /*
  163. * @brief rotate an rgb565a8 image over rgb565 image
  164. *
  165. * @param dst address of dst image
  166. * @param src address of src image
  167. * @param src_opa address of src opa image
  168. * @param dst_pitch stride in bytes of dst image
  169. * @param src_pitch stride in bytes of src image
  170. * @param src_opa_pitch stride in bytes of src opa image
  171. * @param src_w width in pixels of src image
  172. * @param src_h height in pixels of src image
  173. * @param x x coordinate of the draw area in the display coordinate
  174. * @param y y coordinate of the draw area in the display coordinate
  175. * @param w width in pixels of the draw area
  176. * @param h height in pixels of the draw area
  177. * @param matrix matrix generated in func sw_transform_config()
  178. *
  179. * @retval N/A
  180. */
  181. void sw_transform_rgb565a8_over_rgb565(void *dst, const void *src, const void *src_opa,
  182. uint16_t dst_pitch, uint16_t src_pitch, uint16_t src_opa_pitch,
  183. uint16_t src_w, uint16_t src_h, int16_t x, int16_t y, uint16_t w, uint16_t h,
  184. const sw_matrix_t *matrix);
  185. /*
  186. * @brief rotate an rgb565a8 image over rg888 image
  187. *
  188. * @param dst address of dst image
  189. * @param src address of src image
  190. * @param src_opa address of src opa image
  191. * @param dst_pitch stride in bytes of dst image
  192. * @param src_pitch stride in bytes of src image
  193. * @param src_opa_pitch stride in bytes of src opa image
  194. * @param src_w width in pixels of src image
  195. * @param src_h height in pixels of src image
  196. * @param x x coordinate of the draw area in the display coordinate
  197. * @param y y coordinate of the draw area in the display coordinate
  198. * @param w width in pixels of the draw area
  199. * @param h height in pixels of the draw area
  200. * @param matrix matrix generated in func sw_transform_config()
  201. *
  202. * @retval N/A
  203. */
  204. void sw_transform_rgb565a8_over_rgb888(void *dst, const void *src, const void *src_opa,
  205. uint16_t dst_pitch, uint16_t src_pitch, uint16_t src_opa_pitch,
  206. uint16_t src_w, uint16_t src_h, int16_t x, int16_t y, uint16_t w, uint16_t h,
  207. const sw_matrix_t *matrix);
  208. /*
  209. * @brief rotate an rgb565a8 image over argb8888 image
  210. *
  211. * @param dst address of dst image
  212. * @param src address of src image
  213. * @param src_opa address of src opa image
  214. * @param dst_pitch stride in bytes of dst image
  215. * @param src_pitch stride in bytes of src image
  216. * @param src_opa_pitch stride in bytes of src opa image
  217. * @param src_w width in pixels of src image
  218. * @param src_h height in pixels of src image
  219. * @param x x coordinate of the draw area in the display coordinate
  220. * @param y y coordinate of the draw area in the display coordinate
  221. * @param w width in pixels of the draw area
  222. * @param h height in pixels of the draw area
  223. * @param matrix matrix generated in func sw_transform_config()
  224. *
  225. * @retval N/A
  226. */
  227. void sw_transform_rgb565a8_over_argb8888(void *dst, const void *src, const void *src_opa,
  228. uint16_t dst_pitch, uint16_t src_pitch, uint16_t src_opa_pitch,
  229. uint16_t src_w, uint16_t src_h, int16_t x, int16_t y, uint16_t w, uint16_t h,
  230. const sw_matrix_t *matrix);
  231. /*
  232. * @brief rotate an argb8565 image over rgb565 image
  233. *
  234. * @param dst address of dst image
  235. * @param src address of src image
  236. * @param dst_pitch stride in bytes of dst image
  237. * @param src_pitch stride in bytes of src image
  238. * @param src_w width in pixels of src image
  239. * @param src_h height in pixels of src image
  240. * @param x x coordinate of the draw area in the display coordinate
  241. * @param y y coordinate of the draw area in the display coordinate
  242. * @param w width in pixels of the draw area
  243. * @param h height in pixels of the draw area
  244. * @param matrix matrix generated in func sw_transform_config()
  245. *
  246. * @retval N/A
  247. */
  248. void sw_transform_argb8565_over_rgb565(void *dst, const void *src,
  249. uint16_t dst_pitch, uint16_t src_pitch, uint16_t src_w, uint16_t src_h,
  250. int16_t x, int16_t y, uint16_t w, uint16_t h,
  251. const sw_matrix_t *matrix);
  252. /*
  253. * @brief rotate an argb8565 image over rgb888 image
  254. *
  255. * @param dst address of dst image
  256. * @param src address of src image
  257. * @param dst_pitch stride in bytes of dst image
  258. * @param src_pitch stride in bytes of src image
  259. * @param src_w width in pixels of src image
  260. * @param src_h height in pixels of src image
  261. * @param x x coordinate of the draw area in the display coordinate
  262. * @param y y coordinate of the draw area in the display coordinate
  263. * @param w width in pixels of the draw area
  264. * @param h height in pixels of the draw area
  265. * @param matrix matrix generated in func sw_transform_config()
  266. *
  267. * @retval N/A
  268. */
  269. void sw_transform_argb8565_over_rgb888(void *dst, const void *src,
  270. uint16_t dst_pitch, uint16_t src_pitch, uint16_t src_w, uint16_t src_h,
  271. int16_t x, int16_t y, uint16_t w, uint16_t h,
  272. const sw_matrix_t *matrix);
  273. /*
  274. * @brief rotate an argb8565 image over argb8888 image
  275. *
  276. * @param dst address of dst image
  277. * @param src address of src image
  278. * @param dst_pitch stride in bytes of dst image
  279. * @param src_pitch stride in bytes of src image
  280. * @param src_w width in pixels of src image
  281. * @param src_h height in pixels of src image
  282. * @param x x coordinate of the draw area in the display coordinate
  283. * @param y y coordinate of the draw area in the display coordinate
  284. * @param w width in pixels of the draw area
  285. * @param h height in pixels of the draw area
  286. * @param matrix matrix generated in func sw_transform_config()
  287. *
  288. * @retval N/A
  289. */
  290. void sw_transform_argb8565_over_argb8888(void *dst, const void *src,
  291. uint16_t dst_pitch, uint16_t src_pitch, uint16_t src_w, uint16_t src_h,
  292. int16_t x, int16_t y, uint16_t w, uint16_t h,
  293. const sw_matrix_t *matrix);
  294. /*
  295. * @brief rotate an argb6666 image over rgb565 image
  296. *
  297. * @param dst address of dst image
  298. * @param src address of src image
  299. * @param dst_pitch stride in bytes of dst image
  300. * @param src_pitch stride in bytes of src image
  301. * @param src_w width in pixels of src image
  302. * @param src_h height in pixels of src image
  303. * @param x x coordinate of the draw area in the display coordinate
  304. * @param y y coordinate of the draw area in the display coordinate
  305. * @param w width in pixels of the draw area
  306. * @param h height in pixels of the draw area
  307. * @param matrix matrix generated in func sw_transform_config()
  308. *
  309. * @retval N/A
  310. */
  311. void sw_transform_argb6666_over_rgb565(void *dst, const void *src,
  312. uint16_t dst_pitch, uint16_t src_pitch, uint16_t src_w, uint16_t src_h,
  313. int16_t x, int16_t y, uint16_t w, uint16_t h,
  314. const sw_matrix_t *matrix);
  315. /*
  316. * @brief rotate an argb6666 image over rgb888 image
  317. *
  318. * @param dst address of dst image
  319. * @param src address of src image
  320. * @param dst_pitch stride in bytes of dst image
  321. * @param src_pitch stride in bytes of src image
  322. * @param src_w width in pixels of src image
  323. * @param src_h height in pixels of src image
  324. * @param x x coordinate of the draw area in the display coordinate
  325. * @param y y coordinate of the draw area in the display coordinate
  326. * @param w width in pixels of the draw area
  327. * @param h height in pixels of the draw area
  328. * @param matrix matrix generated in func sw_transform_config()
  329. *
  330. * @retval N/A
  331. */
  332. void sw_transform_argb6666_over_rgb888(void *dst, const void *src,
  333. uint16_t dst_pitch, uint16_t src_pitch, uint16_t src_w, uint16_t src_h,
  334. int16_t x, int16_t y, uint16_t w, uint16_t h,
  335. const sw_matrix_t *matrix);
  336. /*
  337. * @brief rotate an argb6666 image over argb8888 image
  338. *
  339. * @param dst address of dst image
  340. * @param src address of src image
  341. * @param dst_pitch stride in bytes of dst image
  342. * @param src_pitch stride in bytes of src image
  343. * @param src_w width in pixels of src image
  344. * @param src_h height in pixels of src image
  345. * @param x x coordinate of the draw area in the display coordinate
  346. * @param y y coordinate of the draw area in the display coordinate
  347. * @param w width in pixels of the draw area
  348. * @param h height in pixels of the draw area
  349. * @param matrix matrix generated in func sw_transform_config()
  350. *
  351. * @retval N/A
  352. */
  353. void sw_transform_argb6666_over_argb8888(void *dst, const void *src,
  354. uint16_t dst_pitch, uint16_t src_pitch, uint16_t src_w, uint16_t src_h,
  355. int16_t x, int16_t y, uint16_t w, uint16_t h,
  356. const sw_matrix_t *matrix);
  357. /*
  358. * @brief rotate an argb8888 image over rgb565 image
  359. *
  360. * @param dst address of dst image
  361. * @param src address of src image
  362. * @param dst_pitch stride in bytes of dst image
  363. * @param src_pitch stride in bytes of src image
  364. * @param src_w width in pixels of src image
  365. * @param src_h height in pixels of src image
  366. * @param x x coordinate of the draw area in the display coordinate
  367. * @param y y coordinate of the draw area in the display coordinate
  368. * @param w width in pixels of the draw area
  369. * @param h height in pixels of the draw area
  370. * @param matrix matrix generated in func sw_transform_config()
  371. *
  372. * @retval N/A
  373. */
  374. void sw_transform_argb8888_over_rgb565(void *dst, const void *src,
  375. uint16_t dst_pitch, uint16_t src_pitch, uint16_t src_w, uint16_t src_h,
  376. int16_t x, int16_t y, uint16_t w, uint16_t h,
  377. const sw_matrix_t *matrix);
  378. /*
  379. * @brief rotate an argb8888 image over rgb888 image
  380. *
  381. * @param dst address of dst image
  382. * @param src address of src image
  383. * @param dst_pitch stride in bytes of dst image
  384. * @param src_pitch stride in bytes of src image
  385. * @param src_w width in pixels of src image
  386. * @param src_h height in pixels of src image
  387. * @param x x coordinate of the draw area in the display coordinate
  388. * @param y y coordinate of the draw area in the display coordinate
  389. * @param w width in pixels of the draw area
  390. * @param h height in pixels of the draw area
  391. * @param matrix matrix generated in func sw_transform_config()
  392. *
  393. * @retval N/A
  394. */
  395. void sw_transform_argb8888_over_rgb888(void *dst, const void *src,
  396. uint16_t dst_pitch, uint16_t src_pitch, uint16_t src_w, uint16_t src_h,
  397. int16_t x, int16_t y, uint16_t w, uint16_t h,
  398. const sw_matrix_t *matrix);
  399. /*
  400. * @brief rotate an argb8888 image over argb8888 image
  401. *
  402. * @param dst address of dst image
  403. * @param src address of src image
  404. * @param dst_pitch stride in bytes of dst image
  405. * @param src_pitch stride in bytes of src image
  406. * @param src_w width in pixels of src image
  407. * @param src_h height in pixels of src image
  408. * @param x x coordinate of the draw area in the display coordinate
  409. * @param y y coordinate of the draw area in the display coordinate
  410. * @param w width in pixels of the draw area
  411. * @param h height in pixels of the draw area
  412. * @param matrix matrix generated in func sw_transform_config()
  413. *
  414. * @retval N/A
  415. */
  416. void sw_transform_argb8888_over_argb8888(void *dst, const void *src,
  417. uint16_t dst_pitch, uint16_t src_pitch, uint16_t src_w, uint16_t src_h,
  418. int16_t x, int16_t y, uint16_t w, uint16_t h,
  419. const sw_matrix_t *matrix);
  420. /*
  421. * @brief rotate an xrgb888 image over rgb565 image
  422. *
  423. * @param dst address of dst image
  424. * @param src address of src image
  425. * @param dst_pitch stride in bytes of dst image
  426. * @param src_pitch stride in bytes of src image
  427. * @param src_w width in pixels of src image
  428. * @param src_h height in pixels of src image
  429. * @param x x coordinate of the draw area in the display coordinate
  430. * @param y y coordinate of the draw area in the display coordinate
  431. * @param w width in pixels of the draw area
  432. * @param h height in pixels of the draw area
  433. * @param color color of src image
  434. * @param matrix matrix generated in func sw_transform_config()
  435. *
  436. * @retval N/A
  437. */
  438. void sw_transform_xrgb8888_over_rgb565(void *dst, const void *src,
  439. uint16_t dst_pitch, uint16_t src_pitch, uint16_t src_w, uint16_t src_h,
  440. int16_t x, int16_t y, uint16_t w, uint16_t h,
  441. const sw_matrix_t *matrix);
  442. /*
  443. * @brief rotate an xrgb888 image over rgb888 image
  444. *
  445. * @param dst address of dst image
  446. * @param src address of src image
  447. * @param dst_pitch stride in bytes of dst image
  448. * @param src_pitch stride in bytes of src image
  449. * @param src_w width in pixels of src image
  450. * @param src_h height in pixels of src image
  451. * @param x x coordinate of the draw area in the display coordinate
  452. * @param y y coordinate of the draw area in the display coordinate
  453. * @param w width in pixels of the draw area
  454. * @param h height in pixels of the draw area
  455. * @param color color of src image
  456. * @param matrix matrix generated in func sw_transform_config()
  457. *
  458. * @retval N/A
  459. */
  460. void sw_transform_xrgb8888_over_rgb888(void *dst, const void *src,
  461. uint16_t dst_pitch, uint16_t src_pitch, uint16_t src_w, uint16_t src_h,
  462. int16_t x, int16_t y, uint16_t w, uint16_t h,
  463. const sw_matrix_t *matrix);
  464. /*
  465. * @brief rotate an xrgb888 image over argb8888 image
  466. *
  467. * @param dst address of dst image
  468. * @param src address of src image
  469. * @param dst_pitch stride in bytes of dst image
  470. * @param src_pitch stride in bytes of src image
  471. * @param src_w width in pixels of src image
  472. * @param src_h height in pixels of src image
  473. * @param x x coordinate of the draw area in the display coordinate
  474. * @param y y coordinate of the draw area in the display coordinate
  475. * @param w width in pixels of the draw area
  476. * @param h height in pixels of the draw area
  477. * @param color color of src image
  478. * @param matrix matrix generated in func sw_transform_config()
  479. *
  480. * @retval N/A
  481. */
  482. void sw_transform_xrgb8888_over_argb8888(void *dst, const void *src,
  483. uint16_t dst_pitch, uint16_t src_pitch, uint16_t src_w, uint16_t src_h,
  484. int16_t x, int16_t y, uint16_t w, uint16_t h,
  485. const sw_matrix_t *matrix);
  486. /*
  487. * @brief rotate an rgb888 image over rgb565 image
  488. *
  489. * @param dst address of dst image
  490. * @param src address of src image
  491. * @param dst_pitch stride in bytes of dst image
  492. * @param src_pitch stride in bytes of src image
  493. * @param src_w width in pixels of src image
  494. * @param src_h height in pixels of src image
  495. * @param x x coordinate of the draw area in the display coordinate
  496. * @param y y coordinate of the draw area in the display coordinate
  497. * @param w width in pixels of the draw area
  498. * @param h height in pixels of the draw area
  499. * @param color color of src image
  500. * @param matrix matrix generated in func sw_transform_config()
  501. *
  502. * @retval N/A
  503. */
  504. void sw_transform_rgb888_over_rgb565(void *dst, const void *src,
  505. uint16_t dst_pitch, uint16_t src_pitch, uint16_t src_w, uint16_t src_h,
  506. int16_t x, int16_t y, uint16_t w, uint16_t h,
  507. const sw_matrix_t *matrix);
  508. /*
  509. * @brief rotate an rgb888 image over rgb888 image
  510. *
  511. * @param dst address of dst image
  512. * @param src address of src image
  513. * @param dst_pitch stride in bytes of dst image
  514. * @param src_pitch stride in bytes of src image
  515. * @param src_w width in pixels of src image
  516. * @param src_h height in pixels of src image
  517. * @param x x coordinate of the draw area in the display coordinate
  518. * @param y y coordinate of the draw area in the display coordinate
  519. * @param w width in pixels of the draw area
  520. * @param h height in pixels of the draw area
  521. * @param color color of src image
  522. * @param matrix matrix generated in func sw_transform_config()
  523. *
  524. * @retval N/A
  525. */
  526. void sw_transform_rgb888_over_rgb888(void *dst, const void *src,
  527. uint16_t dst_pitch, uint16_t src_pitch, uint16_t src_w, uint16_t src_h,
  528. int16_t x, int16_t y, uint16_t w, uint16_t h,
  529. const sw_matrix_t *matrix);
  530. /*
  531. * @brief rotate an rgb888 image over argb8888 image
  532. *
  533. * @param dst address of dst image
  534. * @param src address of src image
  535. * @param dst_pitch stride in bytes of dst image
  536. * @param src_pitch stride in bytes of src image
  537. * @param src_w width in pixels of src image
  538. * @param src_h height in pixels of src image
  539. * @param x x coordinate of the draw area in the display coordinate
  540. * @param y y coordinate of the draw area in the display coordinate
  541. * @param w width in pixels of the draw area
  542. * @param h height in pixels of the draw area
  543. * @param color color of src image
  544. * @param matrix matrix generated in func sw_transform_config()
  545. *
  546. * @retval N/A
  547. */
  548. void sw_transform_rgb888_over_argb8888(void *dst, const void *src,
  549. uint16_t dst_pitch, uint16_t src_pitch, uint16_t src_w, uint16_t src_h,
  550. int16_t x, int16_t y, uint16_t w, uint16_t h,
  551. const sw_matrix_t *matrix);
  552. /*
  553. * @brief rotate an a8 image over rgb565 image
  554. *
  555. * @param dst address of dst image
  556. * @param src address of src image
  557. * @param src_color color of src image
  558. * @param dst_pitch stride in bytes of dst image
  559. * @param src_pitch stride in bytes of src image
  560. * @param src_w width in pixels of src image
  561. * @param src_h height in pixels of src image
  562. * @param x x coordinate of the draw area in the display coordinate
  563. * @param y y coordinate of the draw area in the display coordinate
  564. * @param w width in pixels of the draw area
  565. * @param h height in pixels of the draw area
  566. * @param matrix matrix generated in func sw_transform_config()
  567. *
  568. * @retval N/A
  569. */
  570. void sw_transform_a8_over_rgb565(void *dst, const void *src, uint32_t src_color,
  571. uint16_t dst_pitch, uint16_t src_pitch, uint16_t src_w, uint16_t src_h,
  572. int16_t x, int16_t y, uint16_t w, uint16_t h,
  573. const sw_matrix_t *matrix);
  574. /*
  575. * @brief rotate an a8 image over rgb888 image
  576. *
  577. * @param dst address of dst image
  578. * @param src address of src image
  579. * @param src_color color of src image
  580. * @param dst_pitch stride in bytes of dst image
  581. * @param src_pitch stride in bytes of src image
  582. * @param src_w width in pixels of src image
  583. * @param src_h height in pixels of src image
  584. * @param x x coordinate of the draw area in the display coordinate
  585. * @param y y coordinate of the draw area in the display coordinate
  586. * @param w width in pixels of the draw area
  587. * @param h height in pixels of the draw area
  588. * @param matrix matrix generated in func sw_transform_config()
  589. *
  590. * @retval N/A
  591. */
  592. void sw_transform_a8_over_rgb888(void *dst, const void *src, uint32_t src_color,
  593. uint16_t dst_pitch, uint16_t src_pitch, uint16_t src_w, uint16_t src_h,
  594. int16_t x, int16_t y, uint16_t w, uint16_t h,
  595. const sw_matrix_t *matrix);
  596. /*
  597. * @brief rotate an a8 image over argb8888 image
  598. *
  599. * @param dst address of dst image
  600. * @param src address of src image
  601. * @param src_color color of src image
  602. * @param dst_pitch stride in bytes of dst image
  603. * @param src_pitch stride in bytes of src image
  604. * @param src_w width in pixels of src image
  605. * @param src_h height in pixels of src image
  606. * @param x x coordinate of the draw area in the display coordinate
  607. * @param y y coordinate of the draw area in the display coordinate
  608. * @param w width in pixels of the draw area
  609. * @param h height in pixels of the draw area
  610. * @param matrix matrix generated in func sw_transform_config()
  611. *
  612. * @retval N/A
  613. */
  614. void sw_transform_a8_over_argb8888(void *dst, const void *src, uint32_t src_color,
  615. uint16_t dst_pitch, uint16_t src_pitch, uint16_t src_w, uint16_t src_h,
  616. int16_t x, int16_t y, uint16_t w, uint16_t h,
  617. const sw_matrix_t *matrix);
  618. /*
  619. * @brief rotate an index8 image over rgb565 image
  620. *
  621. * @param dst address of dst image
  622. * @param src address of src image
  623. * @param src_clut address of src clut (ARGB8888 color lookup table)
  624. * @param dst_pitch stride in bytes of dst image
  625. * @param src_pitch stride in bytes of src image
  626. * @param src_w width in pixels of src image
  627. * @param src_h height in pixels of src image
  628. * @param x x coordinate of the draw area in the display coordinate
  629. * @param y y coordinate of the draw area in the display coordinate
  630. * @param w width in pixels of the draw area
  631. * @param h height in pixels of the draw area
  632. * @param matrix matrix generated in func sw_transform_config()
  633. *
  634. * @retval N/A
  635. */
  636. void sw_transform_index8_over_rgb565(void *dst, const void *src, const uint32_t *src_clut,
  637. uint16_t dst_pitch, uint16_t src_pitch, uint16_t src_w, uint16_t src_h,
  638. int16_t x, int16_t y, uint16_t w, uint16_t h,
  639. const sw_matrix_t *matrix);
  640. /*
  641. * @brief rotate an index8 image over rgb888 image
  642. *
  643. * @param dst address of dst image
  644. * @param src address of src image
  645. * @param src_clut address of src clut (ARGB8888 color lookup table)
  646. * @param dst_pitch stride in bytes of dst image
  647. * @param src_pitch stride in bytes of src image
  648. * @param src_w width in pixels of src image
  649. * @param src_h height in pixels of src image
  650. * @param x x coordinate of the draw area in the display coordinate
  651. * @param y y coordinate of the draw area in the display coordinate
  652. * @param w width in pixels of the draw area
  653. * @param h height in pixels of the draw area
  654. * @param matrix matrix generated in func sw_transform_config()
  655. *
  656. * @retval N/A
  657. */
  658. void sw_transform_index8_over_rgb888(void *dst, const void *src, const uint32_t *src_clut,
  659. uint16_t dst_pitch, uint16_t src_pitch, uint16_t src_w, uint16_t src_h,
  660. int16_t x, int16_t y, uint16_t w, uint16_t h,
  661. const sw_matrix_t *matrix);
  662. /*
  663. * @brief rotate an index8 image over argb8888 image
  664. *
  665. * @param dst address of dst image
  666. * @param src address of src image
  667. * @param src_clut address of src clut (ARGB8888 color lookup table)
  668. * @param dst_pitch stride in bytes of dst image
  669. * @param src_pitch stride in bytes of src image
  670. * @param src_w width in pixels of src image
  671. * @param src_h height in pixels of src image
  672. * @param x x coordinate of the draw area in the display coordinate
  673. * @param y y coordinate of the draw area in the display coordinate
  674. * @param w width in pixels of the draw area
  675. * @param h height in pixels of the draw area
  676. * @param matrix matrix generated in func sw_transform_config()
  677. *
  678. * @retval N/A
  679. */
  680. void sw_transform_index8_over_argb8888(void *dst, const void *src, const uint32_t *src_clut,
  681. uint16_t dst_pitch, uint16_t src_pitch, uint16_t src_w, uint16_t src_h,
  682. int16_t x, int16_t y, uint16_t w, uint16_t h,
  683. const sw_matrix_t *matrix);
  684. /*
  685. * @brief rotate an index4 (big endian) image over rgb565 image
  686. *
  687. * @param dst address of dst image
  688. * @param src address of src image
  689. * @param src_clut address of src clut (ARGB8888 color lookup table)
  690. * @param dst_pitch stride in bytes of dst image
  691. * @param src_pitch stride in bytes of src image
  692. * @param src_w width in pixels of src image
  693. * @param src_h height in pixels of src image
  694. * @param x x coordinate of the draw area in the display coordinate
  695. * @param y y coordinate of the draw area in the display coordinate
  696. * @param w width in pixels of the draw area
  697. * @param h height in pixels of the draw area
  698. * @param matrix matrix generated in func sw_transform_config()
  699. *
  700. * @retval N/A
  701. */
  702. void sw_transform_index4_over_rgb565(void *dst, const void *src, const uint32_t *src_clut,
  703. uint16_t dst_pitch, uint16_t src_pitch, uint16_t src_w, uint16_t src_h,
  704. int16_t x, int16_t y, uint16_t w, uint16_t h,
  705. const sw_matrix_t *matrix);
  706. /*
  707. * @brief rotate an index4 (big endian) image over rgb888 image
  708. *
  709. * @param dst address of dst image
  710. * @param src address of src image
  711. * @param src_clut address of src clut (ARGB8888 color lookup table)
  712. * @param dst_pitch stride in bytes of dst image
  713. * @param src_pitch stride in bytes of src image
  714. * @param src_w width in pixels of src image
  715. * @param src_h height in pixels of src image
  716. * @param x x coordinate of the draw area in the display coordinate
  717. * @param y y coordinate of the draw area in the display coordinate
  718. * @param w width in pixels of the draw area
  719. * @param h height in pixels of the draw area
  720. * @param matrix matrix generated in func sw_transform_config()
  721. *
  722. * @retval N/A
  723. */
  724. void sw_transform_index4_over_rgb888(void *dst, const void *src, const uint32_t *src_clut,
  725. uint16_t dst_pitch, uint16_t src_pitch, uint16_t src_w, uint16_t src_h,
  726. int16_t x, int16_t y, uint16_t w, uint16_t h,
  727. const sw_matrix_t *matrix);
  728. /*
  729. * @brief rotate an index4 (big endian) image over argb8888 image
  730. *
  731. * @param dst address of dst image
  732. * @param src address of src image
  733. * @param src_clut address of src clut (ARGB8888 color lookup table)
  734. * @param dst_pitch stride in bytes of dst image
  735. * @param src_pitch stride in bytes of src image
  736. * @param src_w width in pixels of src image
  737. * @param src_h height in pixels of src image
  738. * @param x x coordinate of the draw area in the display coordinate
  739. * @param y y coordinate of the draw area in the display coordinate
  740. * @param w width in pixels of the draw area
  741. * @param h height in pixels of the draw area
  742. * @param matrix matrix generated in func sw_transform_config()
  743. *
  744. * @retval N/A
  745. */
  746. void sw_transform_index4_over_argb8888(void *dst, const void *src, const uint32_t *src_clut,
  747. uint16_t dst_pitch, uint16_t src_pitch, uint16_t src_w, uint16_t src_h,
  748. int16_t x, int16_t y, uint16_t w, uint16_t h,
  749. const sw_matrix_t *matrix);
  750. /*
  751. * @brief rotate an index2 (big endian) image over rgb565 image
  752. *
  753. * @param dst address of dst image
  754. * @param src address of src image
  755. * @param src_clut address of src clut (ARGB8888 color lookup table)
  756. * @param dst_pitch stride in bytes of dst image
  757. * @param src_pitch stride in bytes of src image
  758. * @param src_w width in pixels of src image
  759. * @param src_h height in pixels of src image
  760. * @param x x coordinate of the draw area in the display coordinate
  761. * @param y y coordinate of the draw area in the display coordinate
  762. * @param w width in pixels of the draw area
  763. * @param h height in pixels of the draw area
  764. * @param matrix matrix generated in func sw_transform_config()
  765. *
  766. * @retval N/A
  767. */
  768. void sw_transform_index2_over_rgb565(void *dst, const void *src, const uint32_t *src_clut,
  769. uint16_t dst_pitch, uint16_t src_pitch, uint16_t src_w, uint16_t src_h,
  770. int16_t x, int16_t y, uint16_t w, uint16_t h,
  771. const sw_matrix_t *matrix);
  772. /*
  773. * @brief rotate an index2 (big endian) image over rgb888 image
  774. *
  775. * @param dst address of dst image
  776. * @param src address of src image
  777. * @param src_clut address of src clut (ARGB8888 color lookup table)
  778. * @param dst_pitch stride in bytes of dst image
  779. * @param src_pitch stride in bytes of src image
  780. * @param src_w width in pixels of src image
  781. * @param src_h height in pixels of src image
  782. * @param x x coordinate of the draw area in the display coordinate
  783. * @param y y coordinate of the draw area in the display coordinate
  784. * @param w width in pixels of the draw area
  785. * @param h height in pixels of the draw area
  786. * @param matrix matrix generated in func sw_transform_config()
  787. *
  788. * @retval N/A
  789. */
  790. void sw_transform_index2_over_rgb888(void *dst, const void *src, const uint32_t *src_clut,
  791. uint16_t dst_pitch, uint16_t src_pitch, uint16_t src_w, uint16_t src_h,
  792. int16_t x, int16_t y, uint16_t w, uint16_t h,
  793. const sw_matrix_t *matrix);
  794. /*
  795. * @brief rotate an index2 (big endian) image over argb8888 image
  796. *
  797. * @param dst address of dst image
  798. * @param src address of src image
  799. * @param src_clut address of src clut (ARGB8888 color lookup table)
  800. * @param dst_pitch stride in bytes of dst image
  801. * @param src_pitch stride in bytes of src image
  802. * @param src_w width in pixels of src image
  803. * @param src_h height in pixels of src image
  804. * @param x x coordinate of the draw area in the display coordinate
  805. * @param y y coordinate of the draw area in the display coordinate
  806. * @param w width in pixels of the draw area
  807. * @param h height in pixels of the draw area
  808. * @param matrix matrix generated in func sw_transform_config()
  809. *
  810. * @retval N/A
  811. */
  812. void sw_transform_index2_over_argb8888(void *dst, const void *src, const uint32_t *src_clut,
  813. uint16_t dst_pitch, uint16_t src_pitch, uint16_t src_w, uint16_t src_h,
  814. int16_t x, int16_t y, uint16_t w, uint16_t h,
  815. const sw_matrix_t *matrix);
  816. /*
  817. * @brief rotate an index1 (big endian) image over rgb565 image
  818. *
  819. * @param dst address of dst image
  820. * @param src address of src image
  821. * @param src_clut address of src clut (ARGB8888 color lookup table)
  822. * @param dst_pitch stride in bytes of dst image
  823. * @param src_pitch stride in bytes of src image
  824. * @param src_w width in pixels of src image
  825. * @param src_h height in pixels of src image
  826. * @param x x coordinate of the draw area in the display coordinate
  827. * @param y y coordinate of the draw area in the display coordinate
  828. * @param w width in pixels of the draw area
  829. * @param h height in pixels of the draw area
  830. * @param matrix matrix generated in func sw_transform_config()
  831. *
  832. * @retval N/A
  833. */
  834. void sw_transform_index1_over_rgb565(void *dst, const void *src, const uint32_t *src_clut,
  835. uint16_t dst_pitch, uint16_t src_pitch, uint16_t src_w, uint16_t src_h,
  836. int16_t x, int16_t y, uint16_t w, uint16_t h,
  837. const sw_matrix_t *matrix);
  838. /*
  839. * @brief rotate an index1 (big endian) image over rgb888 image
  840. *
  841. * @param dst address of dst image
  842. * @param src address of src image
  843. * @param src_clut address of src clut (ARGB8888 color lookup table)
  844. * @param dst_pitch stride in bytes of dst image
  845. * @param src_pitch stride in bytes of src image
  846. * @param src_w width in pixels of src image
  847. * @param src_h height in pixels of src image
  848. * @param x x coordinate of the draw area in the display coordinate
  849. * @param y y coordinate of the draw area in the display coordinate
  850. * @param w width in pixels of the draw area
  851. * @param h height in pixels of the draw area
  852. * @param matrix matrix generated in func sw_transform_config()
  853. *
  854. * @retval N/A
  855. */
  856. void sw_transform_index1_over_rgb888(void *dst, const void *src, const uint32_t *src_clut,
  857. uint16_t dst_pitch, uint16_t src_pitch, uint16_t src_w, uint16_t src_h,
  858. int16_t x, int16_t y, uint16_t w, uint16_t h,
  859. const sw_matrix_t *matrix);
  860. /*
  861. * @brief rotate an index1 (big endian) image over argb8888 image
  862. *
  863. * @param dst address of dst image
  864. * @param src address of src image
  865. * @param src_clut address of src clut (ARGB8888 color lookup table)
  866. * @param dst_pitch stride in bytes of dst image
  867. * @param src_pitch stride in bytes of src image
  868. * @param src_w width in pixels of src image
  869. * @param src_h height in pixels of src image
  870. * @param x x coordinate of the draw area in the display coordinate
  871. * @param y y coordinate of the draw area in the display coordinate
  872. * @param w width in pixels of the draw area
  873. * @param h height in pixels of the draw area
  874. * @param matrix matrix generated in func sw_transform_config()
  875. *
  876. * @retval N/A
  877. */
  878. void sw_transform_index1_over_argb8888(void *dst, const void *src, const uint32_t *src_clut,
  879. uint16_t dst_pitch, uint16_t src_pitch, uint16_t src_w, uint16_t src_h,
  880. int16_t x, int16_t y, uint16_t w, uint16_t h,
  881. const sw_matrix_t *matrix);
  882. #ifdef __cplusplus
  883. }
  884. #endif
  885. /**
  886. * @}
  887. */
  888. #endif /* ZEPHYR_FRAMEWORK_INCLUDE_DISPLAY_SW_ROTATE_H_ */