effects_inner.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /*
  2. * Copyright (c) 2020 Actions Technology Co., Ltd
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #ifndef FRAMEWORK_DISPLAY_UI_SERVICE_EFFECTS_INNER_H_
  7. #define FRAMEWORK_DISPLAY_UI_SERVICE_EFFECTS_INNER_H_
  8. /*********************
  9. * INCLUDES
  10. *********************/
  11. #include <stdint.h>
  12. #include <ui_manager.h>
  13. #ifdef CONFIG_DMA2D_HAL
  14. # include <dma2d_hal.h>
  15. #endif
  16. #ifdef CONFIG_VG_LITE
  17. # include <vg_lite/vglite_util.h>
  18. #endif
  19. #ifdef CONFIG_UI_SCROLL_EFFECT
  20. # include <ui_effects/scroll_effect.h>
  21. #endif
  22. #ifdef CONFIG_UI_SWITCH_EFFECT
  23. # include <ui_effects/switch_effect.h>
  24. #endif
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28. /**********************
  29. * TYPEDEFS
  30. **********************/
  31. typedef struct {
  32. uint8_t type; /* effect type */
  33. #ifdef CONFIG_VG_LITE
  34. bool param_inited;
  35. /* set true on setting effect type if one buffer's foreground content
  36. * overlapped with another buffer's corner background garbage.
  37. */
  38. bool opt_round_screen_overlapped;
  39. float camera_distance;
  40. /* SCROLL_EFFECT_CUBE */
  41. struct {
  42. bool out;
  43. uint8_t alpha;
  44. float angle;
  45. float radius;
  46. } cube;
  47. struct {
  48. float angle; /* range (0, 90] */
  49. float radius;
  50. float pivot_x;
  51. float pivot_y;
  52. } fan;
  53. struct {
  54. float min_ratio;
  55. } scale;
  56. #endif
  57. } scroll_effect_ctx_t;
  58. typedef struct {
  59. uint8_t type; /* effect type */
  60. uint8_t new_type; /* new effect type to applied later */
  61. int16_t frame; /* current frame count */
  62. int16_t max_frames; /* maximum frames */
  63. uint8_t trans_end : 1;
  64. #ifdef CONFIG_VG_LITE
  65. /* set true on setting effect type if one buffer's foreground content
  66. * overlapped with another buffer's corner background garbage.
  67. */
  68. bool opt_round_screen_overlapped;
  69. float camera_distance;
  70. struct {
  71. float angle; /* range (0, 90.0f] */
  72. float radius;
  73. float pivot_x;
  74. float pivot_y;
  75. } fan;
  76. #endif
  77. #ifdef CONFIG_DMA2D_HAL
  78. hal_dma2d_handle_t dma2d;
  79. bool dma2d_inited;
  80. #endif
  81. } switch_effect_ctx_t;
  82. /**********************
  83. * GLOBAL PROTOTYPES
  84. **********************/
  85. int32_t switch_effects_path_cos(int32_t start, int32_t end);
  86. #ifdef CONFIG_VG_LITE
  87. void vglite_scroll_proc_cube_effect(scroll_effect_ctx_t *ctx, const ui_transform_param_t *param);
  88. void vglite_scroll_proc_fan_effect(scroll_effect_ctx_t *ctx, const ui_transform_param_t *param);
  89. void vglite_scroll_proc_page_effect(scroll_effect_ctx_t *ctx, const ui_transform_param_t *param);
  90. void vglite_scroll_proc_scale_effect(scroll_effect_ctx_t *ctx, const ui_transform_param_t *param);
  91. int vglite_switch_proc_fan_effect(switch_effect_ctx_t *ctx, const ui_transform_param_t *param);
  92. int vglite_switch_proc_scale_effect(switch_effect_ctx_t *ctx, const ui_transform_param_t *param);
  93. int vglite_switch_proc_page_effect(switch_effect_ctx_t *ctx, const ui_transform_param_t *param);
  94. #endif /* CONFIG_VG_LITE */
  95. #ifdef __cplusplus
  96. }
  97. #endif
  98. #endif /*FRAMEWORK_DISPLAY_UI_SERVICE_EFFECTS_INNER_H_*/