hi_comm_vgs.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /******************************************************************************
  2. Copyright (C), 2016-2018, Hisilicon Tech. Co., Ltd.
  3. ******************************************************************************
  4. File Name : hi_comm_vgs.h
  5. Version :
  6. Author : Hisilicon multimedia software group
  7. Created : 2013/07/24
  8. Last Modified :
  9. Description : common struct definition for VGS
  10. Function List :
  11. ******************************************************************************/
  12. #ifndef __HI_COMM_VGS_H__
  13. #define __HI_COMM_VGS_H__
  14. #ifdef __cplusplus
  15. #if __cplusplus
  16. extern "C" {
  17. #endif
  18. #endif /* __cplusplus */
  19. #include "hi_type.h"
  20. #include "hi_common.h"
  21. #include "hi_errno.h"
  22. #include "hi_comm_video.h"
  23. /* failure caused by malloc buffer */
  24. #define HI_ERR_VGS_NOBUF HI_DEF_ERR(HI_ID_VGS, EN_ERR_LEVEL_ERROR, EN_ERR_NOBUF)
  25. #define HI_ERR_VGS_BUF_EMPTY HI_DEF_ERR(HI_ID_VGS, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_EMPTY)
  26. #define HI_ERR_VGS_NULL_PTR HI_DEF_ERR(HI_ID_VGS, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR)
  27. #define HI_ERR_VGS_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_VGS, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM)
  28. #define HI_ERR_VGS_BUF_FULL HI_DEF_ERR(HI_ID_VGS, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_FULL)
  29. #define HI_ERR_VGS_SYS_NOTREADY HI_DEF_ERR(HI_ID_VGS, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY)
  30. #define HI_ERR_VGS_NOT_SUPPORT HI_DEF_ERR(HI_ID_VGS, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT)
  31. #define HI_ERR_VGS_NOT_PERMITTED HI_DEF_ERR(HI_ID_VGS, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM)
  32. #define VGS_PRIVATE_DATA_LEN 6
  33. typedef HI_S32 VGS_HANDLE;
  34. typedef enum hiVGS_COLOR_REVERT_MODE_E
  35. {
  36. VGS_COLOR_REVERT_NONE = 0, /* Not revert */
  37. VGS_COLOR_REVERT_RGB, /* Revert RGB */
  38. VGS_COLOR_REVERT_ALPHA, /* Revert alpha */
  39. VGS_COLOR_REVERT_BOTH, /* Revert RGB and alpha*/
  40. VGS_COLOR_REVERT_BUTT
  41. } VGS_COLOR_REVERT_MODE_E;
  42. typedef struct hiVGS_OSD_REVERT_S
  43. {
  44. RECT_S stSrcRect; /* OSD color revert area */
  45. VGS_COLOR_REVERT_MODE_E enColorRevertMode; /* OSD color revert mode */
  46. } VGS_OSD_REVERT_S;
  47. typedef struct hiVGS_TASK_ATTR_S
  48. {
  49. VIDEO_FRAME_INFO_S stImgIn; /* Input picture */
  50. VIDEO_FRAME_INFO_S stImgOut; /* Output picture */
  51. HI_U64 au64PrivateData[4]; /* RW; Private data of task */
  52. HI_U32 reserved; /* RW; Debug information,state of current picture */
  53. } VGS_TASK_ATTR_S;
  54. typedef struct hiVGS_DRAW_LINE_S
  55. {
  56. POINT_S stStartPoint; /* Line start point */
  57. POINT_S stEndPoint; /* Line end point */
  58. HI_U32 u32Thick; /* RW; Width of line */
  59. HI_U32 u32Color; /* RW; Range: [0,0xFFFFFF]; Color of line */
  60. } VGS_DRAW_LINE_S;
  61. typedef enum hiVGS_COVER_TYPE_E
  62. {
  63. COVER_RECT = 0, /* Retangle cover */
  64. COVER_QUAD_RANGLE, /* Quadrangle cover */
  65. COVER_BUTT
  66. } VGS_COVER_TYPE_E;
  67. typedef struct hiVGS_QUADRANGLE_COVER_S
  68. {
  69. HI_BOOL bSolid; /* Solid or hollow cover */
  70. HI_U32 u32Thick; /* RW; Range: [2,8]; Thick of the hollow quadrangle */
  71. POINT_S stPoint[4]; /* Four points of the quadrangle */
  72. } VGS_QUADRANGLE_COVER_S;
  73. typedef struct hiVGS_ADD_COVER_S
  74. {
  75. VGS_COVER_TYPE_E enCoverType; /* Cover type */
  76. union
  77. {
  78. RECT_S stDstRect; /* The rectangle area */
  79. VGS_QUADRANGLE_COVER_S stQuadRangle; /* The quadrangle area */
  80. };
  81. HI_U32 u32Color; /* RW; Range: [0,0xFFFFFF]; Color of cover */
  82. } VGS_ADD_COVER_S;
  83. typedef struct hiVGS_ADD_OSD_S
  84. {
  85. RECT_S stRect; /* Osd area */
  86. HI_U32 u32BgColor; /* RW; Background color of osd, depends on pixel format of osd, ARGB8888:[0,0xFFFFFFFF], ARGB4444:[0,0xFFFF], ARGB1555:[0,0x1FFF] */
  87. PIXEL_FORMAT_E enPixelFmt; /* Pixel format of osd */
  88. HI_U64 u64PhyAddr; /* RW; Physical address of osd */
  89. HI_U32 u32Stride; /* RW; Range: [32,8192]; Stride of osd */
  90. HI_U32 u32BgAlpha; /* RW; Range: [0,255]; Background alpha of osd */
  91. HI_U32 u32FgAlpha; /* RW; Range: [0,255]; Foreground alpha of osd */
  92. HI_BOOL bOsdRevert; /* RW; Enable osd color revert */
  93. VGS_OSD_REVERT_S stOsdRevert; /* Osd color revert information */
  94. } VGS_ADD_OSD_S;
  95. typedef enum hiVGS_SCLCOEF_MODE_E
  96. {
  97. VGS_SCLCOEF_NORMAL = 0, /* normal scale coefficient*/
  98. VGS_SCLCOEF_TAP4 = 1, /* scale coefficient of 4 tap */
  99. VGS_SCLCOEF_TAP6 = 2, /* scale coefficient of 6 tap */
  100. VGS_SCLCOEF_TAP8 = 3, /* scale coefficient of 8 tap */
  101. VGS_SCLCOEF_BUTT
  102. } VGS_SCLCOEF_MODE_E;
  103. #ifdef __cplusplus
  104. #if __cplusplus
  105. }
  106. #endif
  107. #endif /* __cplusplus */
  108. #endif /* __HI_COMM_VGS_H__ */