hv_drv_OsdFont.h 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. /**
  2. * @file hv_drv_OsdFont.h
  3. * @brief Osd driver layer font drawing interface.
  4. * @verbatim
  5. * ==============================================================================
  6. * ##### How to use this driver #####
  7. * ==============================================================================
  8. * (+) Use Hv_Drv_OsdFont_Init(...) to init font drawing data .
  9. * (+) Use Hv_Drv_OsdFont_DrawMenuFontList(...) to draw main menu fonts.
  10. * (+) Use Hv_Drv_OsdFont_DrawPunctuatedFontList(...) to draw INFO fonts.
  11. * (+) Use Hv_Drv_OsdFont_UpdateMenuFontList(...) to update menu fonts.
  12. * (+) Use Hv_Drv_OsdFont_HideMenuFontList(...) to hide menu fonts.
  13. * @endverbatim
  14. *
  15. * @author HiView SoC Software Team
  16. * @version 0.0.1
  17. * @date 2022-08-22
  18. */
  19. #ifndef __HV_DRV_OSDFONT_H
  20. #define __HV_DRV_OSDFONT_H
  21. #include "hv_mw_OsdComm.h"
  22. #include "hv_drv_OsdTypes.h"
  23. #include "hv_comm_DataType.h"
  24. #define OSD_REAL_FONTWIDTH(x) ((x) >= HV_OSD_CONFIG_COLUMN_MINWIDTH ? (x) : HV_OSD_CONFIG_COLUMN_MINWIDTH)
  25. typedef OsdIndexColumn* (*pfDrawComponentFunc)(OsdRowInfo *pstRowInfo, OsdComponentNode *pstNode,
  26. OsdIndexColumn *pstColumn, BOOL bUpdate);
  27. #if (HV_PROJECT_CONFIG_OSD_MARQUEE == HV_CONFIG_ON)
  28. typedef BOOL (*pfMarqueeStepFunc)(OsdMarqueeNode *pstNode);
  29. BOOL Hv_Drv_OsdFont_NeedMarquee(VOID);
  30. VOID Hv_Drv_OsdFont_ResetMarquee(OsdComponentNode *pstNode);
  31. VOID Hv_Drv_OsdFont_ResumeAll(OsdMarqueeDirection enDirection, INT32 iNextValue);
  32. VOID Hv_Drv_OsdFont_ResetAll(VOID);
  33. BOOL Hv_Drv_OsdFont_MarqueeNodeStep(OsdMarqueeNode *pstMarquee, BOOL bStepForward);
  34. VOID Hv_Drv_OsdFont_StartMarquee(OsdComponentNode *pstNode);
  35. VOID Hv_Drv_OsdFont_RemoveMarqueeNode(OsdMarqueeNode *pstMarquee);
  36. VOID Hv_Drv_OsdFont_MarqueeMarkSlotsFreed(VOID);
  37. VOID Hv_Drv_OsdFont_MarqueeStep(VOID);
  38. VOID Hv_Drv_OsdFont_RemoveAutoMarqueeNodes(VOID);
  39. VOID Hv_Drv_OsdFont_ResetAllMarqueeContents(VOID);
  40. VOID Hv_Drv_OsdFont_MarqueeDebug(VOID);
  41. #endif
  42. #if (HV_PROJECT_CONFIG_OSD_TEXT_WRAPPING == HV_CONFIG_ON)
  43. VOID Hv_Drv_OsdFont_RemoveAllWrapNodes(VOID);
  44. #endif
  45. /**
  46. * @brief Get font component's Y
  47. * @param[in] pstNode component node ptr
  48. * @return font Y
  49. */
  50. USHORT16 Hv_Drv_OsdFont_GetComponentY(OsdComponentNode *pstNode);
  51. /**
  52. * @brief Get font component's row num
  53. * @param[in] pstNode component node ptr
  54. * @return font row num
  55. */
  56. UCHAR8 Hv_Drv_OsdFont_GetComponentRows(OsdComponentNode *pstNode);
  57. /**
  58. * @brief Get font component's resource type
  59. * @param[in] pstNode component node ptr
  60. * @param[in] pusResourceSize component resource size
  61. * @param[in] pucBitType component resource bit
  62. * @return None
  63. */
  64. VOID Hv_Drv_OsdFont_GetComponentResType(OsdComponentNode *pstNode, USHORT16 *pusResourceSize, UCHAR8 *pucBitType);
  65. /**
  66. * @brief Get font management data of current window
  67. * @param[in] None
  68. * @return font management structure
  69. */
  70. OsdPhyFontInfo* Hv_Drv_OsdFont_GetCurrentFontInfo(VOID);
  71. /**
  72. * @brief set font display position
  73. * @param[in] usX X-axis value, offset within window
  74. * @param[in] usY Y-axis value, offset within window
  75. * @return VOID without return
  76. */
  77. VOID Hv_Drv_OsdFont_SetFontStart(USHORT16 usX, USHORT16 usY);
  78. /**
  79. * @brief font showing enable/disable function
  80. * @param[in] bEnable font showing enable or not
  81. * @return VOID without return
  82. */
  83. VOID Hv_Drv_OsdFont_SetFontEnable(BOOL bEnable);
  84. USHORT16 Hv_Drv_OsdFont_TakeCurrentSlot(OsdRowInfo *pstRowInfo, BOOL bIsUpdate);
  85. /**
  86. * @brief get component's resource type
  87. * @param[in] pstNode component node ptr
  88. * @return resource type of component
  89. */
  90. OsdResourceType Hv_Drv_OsdFont_GetComponentResourceType(OsdComponentNode *pstNode);
  91. /**
  92. * @brief calculate component's box: x,y,width,height
  93. * @param[in] pstNode component node ptr
  94. * @return VOID without return
  95. */
  96. VOID Hv_Drv_OsdFont_CalculateComponentBox(OsdComponentNode *pstNode, BOOL bFixupPosition);
  97. /**
  98. * @brief Get rowInfo struct by Y-axis
  99. * @param[in] usY Y-axis value of the row, offset within window
  100. * @param[in] bInsert if insert if row not found
  101. * @return row structure if found or newly inserted, otherwise NULL
  102. */
  103. OsdRowInfo* Hv_Drv_OsdFont_GetRowInfoByYaxis(USHORT16 usY, BOOL bInsert);
  104. VOID Hv_Drv_OsdFont_FreeRangedRowSlots(OsdRowInfo *pstRowInfo, OsdIndexColumn *pstColumnStart, OsdIndexColumn *pstColumnEnd, BOOL bSkipCPUCanvas);
  105. /**
  106. * @brief menu font components draw function
  107. * @param[in] pstWindow window of which to draw stFontShowListHead
  108. * @return HV_SUCCESS for success, HV_FAILURE for failure
  109. */
  110. Status Hv_Drv_OsdFont_DrawMenuFontList(OsdWindow *pstWindow);
  111. /**
  112. * @brief INFO font components draw function
  113. * @param[in] pstWindow window of which to draw Punctuated Text
  114. * @return VOID without return
  115. */
  116. VOID Hv_Drv_OsdFont_DrawPunctuatedFontList(OsdWindow *pstWindow);
  117. /**
  118. * @brief menu font components update function
  119. * @param[in] pstWindow window of which to update stFontShowListHead
  120. * @return VOID without return
  121. */
  122. VOID Hv_Drv_OsdFont_UpdateMenuFontList(OsdWindow *pstWindow);
  123. /**
  124. * @brief menu font components hide function
  125. * @param[in] pstWindow window of which to hide stFontDeleteListHead
  126. * @return VOID without return
  127. */
  128. VOID Hv_Drv_OsdFont_HideMenuFontList(OsdWindow *pstWindow);
  129. VOID Hv_Drv_OsdFont_FreeComponentDrawingmap(VOID);
  130. UCHAR8* Hv_Drv_OsdFont_GetComponentDrawingmap(OsdComponentNode *pstNode, USHORT16 *pusTotalWidth, USHORT16 *pusTotalHeight);
  131. Status Hv_Drv_OsdFont_GetFontResouceInfo(OsdComponentNode *pstNode, OsdFontResourceInfo *pstResInfo);
  132. #if (HV_PROJECT_CONFIG_OSD_CUSTOM_GROUP_SUPPORT == HV_CONFIG_ON)
  133. VOID Hv_Drv_OsdFont_PrepareCustomGroup(OsdComponent stCp, OsdCustomGroupInfo *pstCGInfo);
  134. VOID Hv_Drv_OsdFont_RelocateAllCustomGroup(VOID);
  135. VOID Hv_Drv_OsdFont_RemoveCustomGroup(OsdComponent stCp);
  136. #endif
  137. #if (HV_OSD_CONFIG_RESERVE_SLOTS_BYROW == HV_CONFIG_OFF)
  138. /**
  139. * @brief get current drawing row catalog
  140. * @param[VOID] None
  141. * @return current row catalog structure
  142. */
  143. OsdRowCatalog* Hv_Drv_OsdFont_GetCurrentCatalog(VOID);
  144. #endif
  145. #if (HV_PROJECT_CONFIG_OSD_CPU_CANVAS_SUPPORT == HV_CONFIG_ON)
  146. Status Hv_Drv_OsdFont_ClearCPUCanvas(OsdComponentNode *pstComponent);
  147. Status Hv_Drv_OsdFont_DrawCPUCanvasPoint(OsdComponentNode *pstComponent, USHORT16 usX, USHORT16 usY, UINT32 uiColor, BOOL bIsClear);
  148. /*TODO fix here */
  149. VOID Hv_Drv_OsdFont_CPUCanvasStep();
  150. #endif
  151. #if (HV_PROJECT_CONFIG_OSD_BIGFONT_SUPPORT == HV_CONFIG_ON)
  152. VOID Hv_Drv_OsdFont_TestBigFont(VOID);
  153. VOID Hv_Drv_OsdFont_TestBigFontBMP(VOID);
  154. #endif
  155. /**
  156. * @brief Osd Driver font init function
  157. * @param[in] None
  158. * @return VOID without return
  159. */
  160. VOID Hv_Drv_OsdFont_Init(VOID);
  161. #ifdef HV_SCALER_DEBUG_VERSION
  162. extern USHORT16 g_usTotalComponentWidth;
  163. extern USHORT16 g_usMaxComponentWidth;
  164. /**
  165. * @brief Print osd font debug info
  166. * @param[in] None
  167. * @return VOID without return
  168. */
  169. VOID Hv_Drv_OsdFont_DubugInfo(VOID);
  170. VOID Hv_Drv_OsdFont_TestGroup(UCHAR8 ucGapWidth);
  171. #endif
  172. #endif