hv_mw_OsdComm.h 35 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195
  1. /*
  2. * @file hv_mw_OsdComm.h
  3. * @brief Header file of osd common.
  4. *
  5. * @verbatim
  6. * ==============================================================================
  7. * ##### How to use #####
  8. * ==============================================================================
  9. * (+) Use Hv_Mw_OsdGetPropAddr() to get osd component prop data address.
  10. * (+) Use Hv_Mw_OsdGetSceneNum() to get osd scene number.
  11. * (+) Use Hv_Mw_OsdGetDynamicPropAddr() to get osd dynamic component prop data address.
  12. * (+) Use Hv_Mw_OsdGetItemComponent() to get osd item's components.
  13. *
  14. * @endverbatim
  15. * @author HiView SoC Software Team
  16. * @version 1.0.0
  17. * @date 2022-09-01
  18. */
  19. #ifndef _HV_MW_OSD_COMM_H
  20. #define _HV_MW_OSD_COMM_H
  21. #include "hv_comm_DataType.h"
  22. #include "hv_res_OsdProp.h"
  23. #include "hv_res_OsdMenuOperation.h"
  24. #include "hv_res_OsdMoeRes.h"
  25. #define __END__ (0xffff)
  26. #define __NEXTLINE__ (0xfffe)
  27. #define __NEWLINE__ (0xfffd)
  28. #define __WORDSPLIT__ (0xfffc)
  29. #define OSD_LOGO_MAGIC_NUMBER (0x4fe182af) /* unicode: 信芯 */
  30. #define OSD_LOGO_VERSION (1)
  31. /* OSD Panel attribute start */
  32. USHORT16 Hv_Mw_OsdGetPanelHActive(VOID);
  33. USHORT16 Hv_Mw_OsdGetPanelVActive(VOID);
  34. #define _PANEL_OSD_H_ACTIVE Hv_Mw_OsdGetPanelHActive()
  35. #define _PANEL_OSD_V_ACTIVE Hv_Mw_OsdGetPanelVActive()
  36. #if (HV_PROJECT_CONFIG_OSD_SCALER == HV_CONFIG_ON)
  37. #if (defined(CONFIG_USER_PANEL_RESOLUTION_TYPE_UHD) && (HV_OSD_CONFIG_EXTRA_DDR_BUFFER == HV_CONFIG_ON))
  38. #define PANEL_OSD_H_ACTIVE (HV_OSD_CONFIG_EXTRA_BUFFER_HACTIVE)
  39. #define PANEL_OSD_V_ACTIVE (HV_OSD_CONFIG_EXTRA_BUFFER_VACTIVE)
  40. #else
  41. #define PANEL_OSD_H_ACTIVE (_PANEL_OSD_H_ACTIVE / 2)
  42. #define PANEL_OSD_V_ACTIVE (_PANEL_OSD_V_ACTIVE / 2)
  43. #endif
  44. #else
  45. #define PANEL_OSD_H_ACTIVE (_PANEL_OSD_H_ACTIVE)
  46. #define PANEL_OSD_V_ACTIVE (_PANEL_OSD_V_ACTIVE)
  47. #endif
  48. /* 通过 Hv_Drv_OsdSetPanelHtotal 动态屏参 */
  49. //#define PANEL_OSD_H_TOTAL (PANEL_H_TOTAL_TYP - 4)
  50. #define PANEL_OSD_V_TOTAL (PANEL_OSD_V_ACTIVE + 10)
  51. #if (HV_PROJECT_CONFIG_OSD_ROTATION == HV_CONFIG_ON)
  52. #define HV_OSD_CONFIG_ROTATION_H_ACTIVE (PANEL_OSD_H_ACTIVE / 2)
  53. #define HV_OSD_CONFIG_ROTATION_V_ACTIVE (PANEL_OSD_V_ACTIVE / 2)
  54. #endif
  55. #if (HV_PROJECT_CONFIG_OSD_GRAPHIC == HV_CONFIG_ON)
  56. #if (HV_OSD_CONFIG_GRAPHIC_FORMAT == 0)
  57. #define HV_OSD_CONFIG_GRAPHIC_PIXEL_BYTES 4
  58. #elif (HV_OSD_CONFIG_GRAPHIC_FORMAT == 1)
  59. #define HV_OSD_CONFIG_GRAPHIC_PIXEL_BYTES 2
  60. #elif (HV_OSD_CONFIG_GRAPHIC_FORMAT == 2)
  61. #define HV_OSD_CONFIG_GRAPHIC_PIXEL_BYTES 2
  62. #elif (HV_OSD_CONFIG_GRAPHIC_FORMAT == 5)
  63. #define HV_OSD_CONFIG_GRAPHIC_PIXEL_BYTES 3
  64. #else
  65. #error "OSD GRAPHIC format not supported"
  66. #endif
  67. #define HV_OSD_CONFIG_GRAPHIC_H_ACTIVE (PANEL_OSD_H_ACTIVE / 2)
  68. #define HV_OSD_CONFIG_GRAPHIC_V_ACTIVE (PANEL_OSD_V_ACTIVE / 2)
  69. #endif
  70. /* OSD Panel attribute end */
  71. /* 动态组件属性标志:uiDynamicFlag */
  72. #define DYN_STATE_COLOR (BIT_0) //状态颜色,Item与cursor内部组件自动生成
  73. #define DYN_POSITION (BIT_1) //位置,cursor内部组件自动生成,ItemDynamicPos打开时,内部组件自动生成
  74. #define DYN_X (BIT_2) //位置X(与userdata相关)
  75. #define DYN_Y (BIT_3) //位置Y(与userdata相关)
  76. #define DYN_WIDTH (BIT_4) //宽(与userdata相关)
  77. #define DYN_HEIGHT (BIT_5) //高(与userdata相关)
  78. #define DYN_RESOURCE (BIT_6) //资源
  79. #define DYN_COLOR (BIT_7) //颜色
  80. #if (HV_CONFIG_ON == HV_PROJECT_CONFIG_OSD_MIRROR)
  81. #define DYN_MIRROR (BIT_8) //镜像
  82. #define DYN_ICON_REVERSE (BIT_9) //图标镜像
  83. #endif
  84. #define DYN_CUSTOM1 (BIT_10) //用户自定义1
  85. #define DYN_CUSTOM2 (BIT_11) //用户自定义2
  86. #define DYN_CUSTOM3 (BIT_12) //用户自定义3
  87. #define OSD_A(color) ((UCHAR8)(color >> 24) & 0xFF)
  88. #define OSD_R(color) ((UCHAR8)(color) & 0xFF)
  89. #define OSD_G(color) ((UCHAR8)(color >> 8) & 0xFF)
  90. #define OSD_B(color) ((UCHAR8)(color >> 16) & 0xFF)
  91. typedef enum _OsdUniversalAlphaType
  92. {
  93. OSD_UNIVERSAL_ALPHA_TYPE_ALL = 0,
  94. OSD_UNIVERSAL_ALPHA_TYPE_EXCLUDE_FONT,
  95. OSD_UNIVERSAL_ALPHA_TYPE_NON_UNIVERSAL,
  96. } OsdUniversalAlphaType;
  97. typedef struct _OsdInfoMap
  98. {
  99. USHORT16 usItemId;
  100. USHORT16 usInfoStringId;
  101. } OsdInfoMap;
  102. typedef enum _OsdWindowPhyId
  103. {
  104. PHY_WIN_0,
  105. PHY_WIN_1,
  106. PHY_WIN_2,
  107. PHY_WIN_3,
  108. PHY_WIN_RECT_0,
  109. PHY_WIN_RECT_1,
  110. PHY_WIN_ID_MAX,
  111. PHY_GRAPHIC = PHY_WIN_ID_MAX,
  112. } OsdWindowPhyId;
  113. typedef enum _OsdResourceSize
  114. {
  115. OSD_RESOURCE_SIZE_8X8 = 0,
  116. OSD_RESOURCE_SIZE_12X12 = 1,
  117. OSD_RESOURCE_SIZE_12X14 = 2,
  118. OSD_RESOURCE_SIZE_12X16 = 3,
  119. OSD_RESOURCE_SIZE_12X18 = 4,
  120. OSD_RESOURCE_SIZE_16X16 = 5,
  121. OSD_RESOURCE_SIZE_16X18 = 6,
  122. OSD_RESOURCE_SIZE_16X24 = 7,
  123. OSD_RESOURCE_SIZE_20X20 = 8,
  124. OSD_RESOURCE_SIZE_20X24 = 9,
  125. OSD_RESOURCE_SIZE_20X28 = 10,
  126. OSD_RESOURCE_SIZE_24X24 = 11,
  127. OSD_RESOURCE_SIZE_24X30 = 12,
  128. OSD_RESOURCE_SIZE_32X32 = 13,
  129. OSD_RESOURCE_SIZE_32X36 = 14,
  130. OSD_RESOURCE_SIZE_USERDEFINED = 15,
  131. } OsdResourceSize;
  132. #define OSD_RESOURCE_DEFINED_WIDTH_SHIFT (4)
  133. #define OSD_RESOURCE_DEFINED_HEIGHT_SHIFT (9)
  134. typedef enum _OsdResourceType
  135. {
  136. OSD_RESOURCE_TYPE_1BIT = 0,
  137. OSD_RESOURCE_TYPE_2BIT,
  138. OSD_RESOURCE_TYPE_4BIT,
  139. OSD_RESOURCE_TYPE_6BIT,
  140. OSD_RESOURCE_TYPE_8BIT,
  141. } OsdResourceType;
  142. typedef enum _OsdRectPhyId
  143. {
  144. PHY_WIN0_RECT_0,
  145. PHY_WIN0_RECT_1,
  146. PHY_WIN0_RECT_2,
  147. PHY_WIN0_RECT_3,
  148. PHY_WIN1_RECT_0,
  149. PHY_WIN1_RECT_1,
  150. PHY_WIN1_RECT_2,
  151. PHY_WIN1_RECT_3,
  152. PHY_WIN2_RECT_0,
  153. PHY_WIN2_RECT_1,
  154. PHY_WIN2_RECT_2,
  155. PHY_WIN2_RECT_3,
  156. PHY_WIN3_RECT_0,
  157. PHY_WIN3_RECT_1,
  158. PHY_WIN3_RECT_2,
  159. PHY_WIN3_RECT_3,
  160. PHY_RECT0_RECT_0,
  161. PHY_RECT0_RECT_1,
  162. PHY_RECT0_RECT_2,
  163. PHY_RECT0_RECT_3,
  164. PHY_RECT0_RECT_4,
  165. PHY_RECT0_RECT_5,
  166. PHY_RECT0_RECT_6,
  167. PHY_RECT0_RECT_7,
  168. PHY_RECT1_RECT_0,
  169. PHY_RECT1_RECT_1,
  170. PHY_RECT1_RECT_2,
  171. PHY_RECT1_RECT_3,
  172. PHY_RECT1_RECT_4,
  173. PHY_RECT1_RECT_5,
  174. PHY_RECT1_RECT_6,
  175. PHY_RECT1_RECT_7,
  176. PHY_RECT_ID_MAX,
  177. } OsdRectPhyId;
  178. typedef enum _OsdGridPhyId
  179. {
  180. PHY_WIN0_GRID_0,
  181. PHY_WIN0_GRID_1,
  182. PHY_WIN1_GRID_0,
  183. PHY_WIN1_GRID_1,
  184. PHY_WIN2_GRID_0,
  185. PHY_WIN2_GRID_1,
  186. PHY_WIN3_GRID_0,
  187. PHY_WIN3_GRID_1,
  188. PHY_RECT0_GRID_0,
  189. PHY_RECT0_GRID_1,
  190. PHY_RECT1_GRID_0,
  191. PHY_RECT1_GRID_1,
  192. PHY_GRID_ID_MAX,
  193. } OsdGridPhyId;
  194. typedef enum _OsdLinePhyId
  195. {
  196. PHY_WIN0_LINE_0,
  197. PHY_WIN0_LINE_1,
  198. PHY_WIN1_LINE_0,
  199. PHY_WIN1_LINE_1,
  200. PHY_WIN2_LINE_0,
  201. PHY_WIN2_LINE_1,
  202. PHY_WIN3_LINE_0,
  203. PHY_WIN3_LINE_1,
  204. PHY_RECT0_LINE_0,
  205. PHY_RECT0_LINE_1,
  206. PHY_RECT1_LINE_0,
  207. PHY_RECT1_LINE_1,
  208. PHY_LINE_ID_MAX,
  209. } OsdLinePhyId;
  210. typedef enum _OsdStrAlignType
  211. {
  212. OSD_STRING_ALIGN_LEFT = 0,
  213. OSD_STRING_ALIGN_CENTER,
  214. OSD_STRING_ALIGN_RIGHT,
  215. } OsdStrAlignType;
  216. typedef enum _OsdRectBorderType
  217. {
  218. OSD_BORDER_2D = 0,
  219. OSD_BORDER_3D,
  220. OSD_BORDER_MAX
  221. } OsdRectBorderType;
  222. typedef enum _OsdRectShadowType
  223. {
  224. OSD_SHADOW_BOTTOM_RIGHT = 0,
  225. OSD_SHADOW_TOP_RIGHT,
  226. OSD_SHADOW_BOTTOM_LEFT,
  227. OSD_SHADOW_TOP_LEFT,
  228. OSD_SHADOW_MAX
  229. } OsdRectShadowType;
  230. typedef enum _OsdRegionType
  231. {
  232. OSD_REGION_NO_HIGHLIGHT = 0,
  233. OSD_REGION_HIGHLIGHT,
  234. OSD_REGION_MAX
  235. } OsdRegionType;
  236. typedef enum _OsdGradientType
  237. {
  238. OSD_GRADIENT_LEFT_RIGHT = 0,
  239. OSD_GRADIENT_TOP_BOTTOM,
  240. OSD_GRADIENT_CENTER_BORDER,
  241. OSD_GRADIENT_BORDER_CENTER,
  242. OSD_GRADIENT_LEFT_RIGHT_RGBINVERT,
  243. OSD_GRADIENT_TOP_BOTTOM_RGBINVERT,
  244. OSD_GRADIENT_CENTER_BORDER_RGBINVERT,
  245. OSD_GRADIENT_BORDER_CENTER_RGBINVERT,
  246. OSD_GRADIENT_MAX
  247. } OsdGradientType;
  248. typedef enum _OsdHighLightAxisMode
  249. {
  250. ALL_MATCH = 0,
  251. BIT0_MATCH,
  252. MATCH_MAX
  253. } OsdHighLightAxisMode;
  254. typedef enum _OsdHighlightMode
  255. {
  256. OSD_HIGHLIGHT_H_AND_V = 0,
  257. OSD_HIGHLIGHT_H_OR_V,
  258. OSD_HIGHLIGHT_H_ONLY,
  259. OSD_HIGHLIGHT_V_ONLY,
  260. OSD_HIGHLIGHT_MAX
  261. } OsdHighLightMode;
  262. typedef struct _OsdText
  263. {
  264. USHORT16 usX;
  265. USHORT16 usY;
  266. USHORT16 usWidth : 12; /* 对齐框的宽度 */
  267. USHORT16 usAlignType : 2; /* 对齐方式 */
  268. USHORT16 usIsLongText : 1;
  269. USHORT16 usReserved : 1;
  270. #if (HV_PROJECT_CONFIG_OSD_TEXT_WRAPPING == HV_CONFIG_ON)
  271. UCHAR8 ucWrapMaxRows;
  272. UCHAR8 ucWrapRowSpace;
  273. #endif
  274. UCHAR8 ucWindowIndex;
  275. UCHAR8 ucColorIndex;
  276. UCHAR8 ucBlockID;
  277. USHORT16 usStringId;
  278. UINT32 uiDynamicFlag : 24;
  279. UINT32 uiDynamicIndex : 8;
  280. } OsdText;
  281. typedef struct _OsdTextList
  282. {
  283. USHORT16 usX;
  284. USHORT16 usY;
  285. USHORT16 usWidth : 12; /* 对齐框的宽度 */
  286. USHORT16 usAlignType : 2; /* 对齐方式 */
  287. USHORT16 usIsLongText : 1;
  288. USHORT16 usReserved : 1;
  289. UCHAR8 ucWindowIndex;
  290. UCHAR8 ucColorIndex;
  291. const USHORT16 *pusStringIDList;
  292. UCHAR8 ucStringNum;
  293. UCHAR8 ucStringCurID;
  294. UCHAR8 ucBlockID;
  295. UINT32 uiDynamicFlag : 24;
  296. UINT32 uiDynamicIndex : 8;
  297. } OsdTextList;
  298. typedef struct _OsdNumber
  299. {
  300. UCHAR8 ucBlockID;
  301. UCHAR8 ucWindowIndex;
  302. UCHAR8 ucColorIndex;
  303. USHORT16 usX;
  304. USHORT16 usY;
  305. USHORT16 usWidth : 12; /* 对齐框的宽度 */
  306. USHORT16 usAlignType : 2; /* 对齐方式 */
  307. USHORT16 usShowSignSymbol : 1;
  308. USHORT16 usIsLongText : 1;
  309. INT32 iValue;
  310. UINT32 uiDynamicFlag : 24;
  311. UINT32 uiDynamicIndex : 8;
  312. } OsdNumber;
  313. typedef struct _OsdAsciiString
  314. {
  315. USHORT16 usX;
  316. USHORT16 usY;
  317. USHORT16 usWidth : 11; /* 对齐框的宽度 */
  318. USHORT16 usAlignType : 2; /* 对齐方式 */
  319. USHORT16 usIsLongText : 1;
  320. #if (HV_PROJECT_CONFIG_OSD_BIGFONT_SUPPORT == HV_CONFIG_ON)
  321. USHORT16 usIsBigIconFont : 1;
  322. USHORT16 usIsBigBmpFont : 1;
  323. #else
  324. USHORT16 usReserved : 2;
  325. #endif
  326. #if (HV_PROJECT_CONFIG_OSD_TEXT_WRAPPING == HV_CONFIG_ON)
  327. UCHAR8 ucWrapMaxRows;
  328. UCHAR8 ucWrapRowSpace;
  329. #endif
  330. UCHAR8 ucWindowIndex;
  331. USHORT16 ucColorIndex;
  332. USHORT16 ausString[OSD_ASCII_STRING_LENGTH_MAX];
  333. UCHAR8 ucStringLength;
  334. UCHAR8 ucBlockID;
  335. UINT32 uiDynamicFlag : 24;
  336. UINT32 uiDynamicIndex : 8;
  337. } OsdAsciiString;
  338. typedef struct _OsdIcon
  339. {
  340. USHORT16 usX;
  341. USHORT16 usY;
  342. UCHAR8 ucHCount;
  343. UCHAR8 ucVCount;
  344. USHORT16 usIconOffset;
  345. #if (HV_CONFIG_ON == HV_PROJECT_CONFIG_OSD_MIRROR)
  346. USHORT16 usReverseIconOffset;
  347. #endif
  348. UCHAR8 ucBlockID;
  349. UCHAR8 ucWindowIndex;
  350. UCHAR8 ucColorIndex;
  351. USHORT16 usIconCount;
  352. #if (HV_PROJECT_CONFIG_OSD_CPU_CANVAS_SUPPORT == HV_CONFIG_ON)
  353. UINT32 uiDynamicFlag : 23;
  354. UINT32 uiIsCPUCanvas : 1;
  355. #else
  356. UINT32 uiDynamicFlag : 24;
  357. #endif
  358. UINT32 uiDynamicIndex : 8;
  359. } OsdIcon;
  360. typedef struct _OsdIconAttr
  361. {
  362. USHORT16 usIconOffset;
  363. USHORT16 usIconCount;
  364. } OsdIconAttr;
  365. typedef struct _OsdIconList
  366. {
  367. USHORT16 usX;
  368. USHORT16 usY;
  369. UCHAR8 ucHCount;
  370. UCHAR8 ucVCount;
  371. UCHAR8 ucBlockID;
  372. UCHAR8 ucIconCurID;
  373. const OsdIconAttr *pstIconList;
  374. UCHAR8 ucIconNum;
  375. UCHAR8 ucWindowIndex;
  376. UCHAR8 ucColorIndex;
  377. UINT32 uiDynamicFlag : 24;
  378. UINT32 uiDynamicIndex : 8;
  379. } OsdIconList;
  380. typedef struct _OsdBmp
  381. {
  382. USHORT16 usX;
  383. USHORT16 usY;
  384. UCHAR8 ucHCount;
  385. UCHAR8 ucVCount;
  386. USHORT16 usBMPOffset;
  387. #if (HV_CONFIG_ON == HV_PROJECT_CONFIG_OSD_MIRROR)
  388. USHORT16 usReverseBMPOffset;
  389. #endif
  390. UCHAR8 ucBlockID;
  391. UCHAR8 ucWindowIndex;
  392. USHORT16 usPaletteOffset; /* 存放每块对应的palette偏移*/
  393. USHORT16 usBmpCount;
  394. #if (HV_PROJECT_CONFIG_OSD_CPU_CANVAS_SUPPORT == HV_CONFIG_ON)
  395. UINT32 uiDynamicFlag : 23;
  396. UINT32 uiIsCPUCanvas : 1;
  397. #else
  398. UINT32 uiDynamicFlag : 24;
  399. #endif
  400. UINT32 uiDynamicIndex : 8;
  401. } OsdBmp;
  402. typedef struct _OsdBmpAttr
  403. {
  404. USHORT16 usBMPOffset;
  405. USHORT16 usPaletteOffset; /* 存放每块对应的palette偏移*/
  406. USHORT16 usBmpCount;
  407. } OsdBmpAttr;
  408. typedef struct _OsdBmpList
  409. {
  410. USHORT16 usX;
  411. USHORT16 usY;
  412. UCHAR8 ucHCount;
  413. UCHAR8 ucVCount;
  414. UCHAR8 ucBlockID;
  415. UCHAR8 ucBmpCurID;
  416. const OsdBmpAttr *pstBmpList;
  417. UCHAR8 ucBmpNum;
  418. UCHAR8 ucWindowIndex;
  419. UINT32 uiDynamicFlag : 24;
  420. UINT32 uiDynamicIndex : 8;
  421. } OsdBmpList;
  422. typedef struct _OsdGraphic
  423. {
  424. USHORT16 usX;
  425. USHORT16 usY;
  426. USHORT16 usWidth;
  427. USHORT16 usHeight;
  428. UCHAR8 ucWindowIndex;
  429. UCHAR8 ucFormat : 3;
  430. UCHAR8 ucGraphicID : 3;
  431. UCHAR8 ucSetAlpha : 1;
  432. UCHAR8 ucCompressed : 1;
  433. UCHAR8 ucAlpha;
  434. UCHAR8 ucColorKeyEn;
  435. UINT32 uiColorKey;
  436. UINT32 uiColor;
  437. UINT32 uiDynamicFlag : 24;
  438. UINT32 uiDynamicIndex : 8;
  439. } OsdGraphic;
  440. typedef struct _OsdGraphicAddition
  441. {
  442. BOOL bIsAddition;
  443. UINT32 uiAdditionAddr;
  444. UINT32 uiAdditionSize;
  445. } OsdGraphicAddition;
  446. typedef struct _OsdBorder
  447. {
  448. UCHAR8 ucBorderEnable : 1;
  449. UCHAR8 ucBorderType : 7;
  450. UCHAR8 ucSizeY : 4;
  451. UCHAR8 ucSizeX : 4;
  452. USHORT16 usColor0;
  453. USHORT16 usColor1;
  454. USHORT16 usColor2;
  455. USHORT16 usColor3;
  456. } OsdBorder;
  457. typedef struct _OsdShadow
  458. {
  459. UCHAR8 ucShadowEnable : 1;
  460. UCHAR8 ucShadowType : 7;
  461. UCHAR8 ucSizeY : 4;
  462. UCHAR8 ucSizeX : 4;
  463. USHORT16 usShadowColor;
  464. } OsdShadow;
  465. typedef struct _OsdGradient
  466. {
  467. UCHAR8 ucGradientEnable : 1;
  468. UCHAR8 ucGradientType : 7;
  469. USHORT16 usStartColor;
  470. USHORT16 usEndColor;
  471. USHORT16 usStepR;
  472. USHORT16 usStepG;
  473. USHORT16 usStepB;
  474. } OsdGradient;
  475. typedef struct _OsdRectStyle
  476. {
  477. OsdBorder stBorder;
  478. OsdShadow stShadow;
  479. OsdGradient stGrad;
  480. } OsdRectStyle;
  481. typedef struct _OsdRect
  482. {
  483. UCHAR8 ucIndex;
  484. USHORT16 usX;
  485. USHORT16 usY;
  486. USHORT16 usWidth;
  487. USHORT16 usHeight;
  488. UCHAR8 ucWindowIndex;
  489. UCHAR8 ucStyleIndex : 7; /* 索引样式,规定0为无sytle */
  490. UCHAR8 ucBgColorEnable : 1; /* 填充背景色使能 */
  491. USHORT16 usBgColor;
  492. UINT32 uiDynamicFlag : 24;
  493. UINT32 uiDynamicIndex : 8;
  494. } OsdRect;
  495. typedef struct _OsdAxisHighlight
  496. {
  497. OsdHighLightAxisMode ucMode;
  498. UCHAR8 ucStartPos;
  499. UCHAR8 ucStopPos;
  500. } OsdAxisHighlight;
  501. typedef struct _OsdRectHighligh
  502. {
  503. UCHAR8 ucHighlightMode;
  504. OsdAxisHighlight stHOption;
  505. OsdAxisHighlight stVOption;
  506. UCHAR8 ucHlStyleIndex : 7; /* 样式index,规定0为无sytle */
  507. UCHAR8 ucBgColorEnable : 1; /* 填充背景色使能 */
  508. USHORT16 usBgColor;
  509. } OsdRectHighlight;
  510. typedef struct _OsdRectGrid
  511. {
  512. UCHAR8 ucIndex;
  513. UCHAR8 ucWindowIndex;
  514. USHORT16 usX;
  515. USHORT16 usY;
  516. USHORT16 usWidth;
  517. USHORT16 usHeight;
  518. UCHAR8 ucRectHCount : 4; /* 高4bit表示Vcount,低4bit表示Hcount*/
  519. UCHAR8 ucRectVCount : 4;
  520. UCHAR8 ucRectHSpace;
  521. UCHAR8 ucRectVSpace;
  522. UCHAR8 ucNonHlStyleIndex : 7; /* 索引样式,规定0为无sytle */
  523. UCHAR8 ucBgColorEnable : 1; /* 填充背景色使能 */
  524. USHORT16 usBgColor;
  525. UCHAR8 ucHlOptionIndex; /* 规定0为无高亮区*/
  526. UINT32 uiDynamicFlag : 24;
  527. UINT32 uiDynamicIndex : 8;
  528. } OsdRectGrid;
  529. typedef struct _OsdLine
  530. {
  531. UCHAR8 ucIndex;
  532. UCHAR8 ucWindowIndex;
  533. USHORT16 usX;
  534. USHORT16 usY;
  535. USHORT16 usWidth;
  536. USHORT16 usHeight;
  537. UCHAR8 ucBgColorEnable; /* 填充背景色使能 */
  538. USHORT16 usBgColor;
  539. USHORT16 usBorderColor;
  540. UINT32 uiDynamicFlag : 24;
  541. UINT32 uiDynamicIndex : 8;
  542. } OsdLine;
  543. typedef struct _OsdLineHighlight
  544. {
  545. UCHAR8 ucHighlightMode;
  546. OsdAxisHighlight stHOption;
  547. OsdAxisHighlight stVOption;
  548. UCHAR8 ucBgColorEnable; /* 填充背景色使能 */
  549. USHORT16 usBgColor;
  550. USHORT16 usBorderColor;
  551. } OsdLineHighlight;
  552. typedef struct _OsdLineGrid
  553. {
  554. UCHAR8 ucIndex;
  555. UCHAR8 ucWindowIndex;
  556. USHORT16 usX;
  557. USHORT16 usY;
  558. USHORT16 usWidth;
  559. USHORT16 usHeight;
  560. UCHAR8 ucLineHCount : 4; /* 高4bit表示Vcount,低4bit表示Hcount*/
  561. UCHAR8 ucLineVCount : 4;
  562. UCHAR8 ucLineHSpace;
  563. UCHAR8 ucLineVSpace;
  564. UCHAR8 ucBgColorEnable; /* 填充背景色使能 */
  565. USHORT16 usBgColor;
  566. USHORT16 usBorderColor;
  567. UCHAR8 ucHlOptionIndex; /* 规定0为无高亮区 */
  568. UINT32 uiDynamicFlag : 24;
  569. UINT32 uiDynamicIndex : 8;
  570. } OsdLineGrid;
  571. /* 组件类型 */
  572. typedef enum _OsdComponentType
  573. {
  574. OSD_CP_TYPE_NONE,
  575. OSD_CP_TYPE_TEXT,
  576. OSD_CP_TYPE_TEXT_LIST,
  577. OSD_CP_TYPE_NUMBER,
  578. OSD_CP_TYPE_INTACT_NUMBER,
  579. OSD_CP_TYPE_ASCII_STRING,
  580. OSD_CP_TYPE_ICON,
  581. OSD_CP_TYPE_ICON_LIST,
  582. OSD_CP_TYPE_BMP,
  583. OSD_CP_TYPE_BMP_LIST,
  584. #if (HV_PROJECT_CONFIG_OSD_CUSTOM_GROUP_SUPPORT == HV_CONFIG_ON)
  585. OSD_CP_TYPE_CUSTOM_GROUP,
  586. #endif
  587. /* FONT type must before here */
  588. OSD_CP_TYPE_RECT,
  589. OSD_CP_TYPE_RECTGRID,
  590. OSD_CP_TYPE_LINEGRID,
  591. OSD_CP_TYPE_LINE,
  592. OSD_CP_TYPE_GRAPHIC,
  593. OSD_CP_TYPE_MAX,
  594. } OsdComponentType;
  595. typedef struct _OsdComponent
  596. {
  597. /* 组件类型:OsdComponentType */
  598. USHORT16 enType : 5;
  599. /* 组件序号 */
  600. USHORT16 usIndex : 11;
  601. } OsdComponent;
  602. typedef struct _OsdBox
  603. {
  604. USHORT16 usX;
  605. USHORT16 usY;
  606. USHORT16 usW;
  607. USHORT16 usH;
  608. USHORT16 usRealWidth;
  609. USHORT16 usIndex;
  610. } OsdBox;
  611. #if (HV_PROJECT_CONFIG_OSD_MARQUEE == HV_CONFIG_ON)
  612. typedef enum _OsdMarqueeDirection
  613. {
  614. OSD_MARQUEE_LEFT = 0,
  615. OSD_MARQUEE_RIGHT,
  616. } OsdMarqueeDirection;
  617. typedef enum _OsdMarqueeType
  618. {
  619. /* disable marquee */
  620. OSD_MARQUEE_TYPE_NONE = 0,
  621. /* |ABCDE | -> |BCDE A| */
  622. OSD_MARQUEE_TYPE_CYCLING_LEFT,
  623. /* | ABCDE| -> |E ABCD| */
  624. OSD_MARQUEE_TYPE_CYCLING_RIGHT,
  625. /* */
  626. OSD_MARQUEE_TYPE_SCROLLING_LEFT,
  627. /* */
  628. OSD_MARQUEE_TYPE_SCROLLING_RIGHT,
  629. OSD_MARQUEE_TYPE_SLIDING_LEFT,
  630. OSD_MARQUEE_TYPE_SLIDING_RIGHT,
  631. /* Used for text list animation */
  632. OSD_MARQUEE_TYPE_SLIDING_NEXT,
  633. /* Pseudo type used for width excessed component marquee */
  634. OSD_MARQUEE_TYPE_DEFAULT,
  635. OSD_MARQUEE_TYPE_MAX,
  636. } OsdMarqueeType;
  637. struct _OsdMarqueeNode;
  638. #endif
  639. typedef struct _OsdComponentNode
  640. {
  641. /* 下一个组件 */
  642. struct _OsdComponentNode* pstNext;
  643. /* 组件属性数据 */
  644. VOID* pvCpData;
  645. /* 组件属性数据 */
  646. VOID* pvDynamicData;
  647. VOID *pstRowInfo;
  648. /* 组件位置大小 */
  649. OsdBox stBox;
  650. /* 组件类型 */
  651. OsdComponent stCp;
  652. UCHAR8 ucFontCount : 7;
  653. UCHAR8 bInCustomGroup : 1;
  654. #if (HV_OSD_CONFIG_FONT_AS_BACKGROUND == HV_CONFIG_ON)
  655. USHORT16 usBankSlot;
  656. #endif
  657. #if (HV_CONFIG_ON == HV_PROJECT_CONFIG_OSD_MIRROR)
  658. BOOL bIsMirrored;
  659. #endif
  660. #if (HV_PROJECT_CONFIG_OSD_MARQUEE == HV_CONFIG_ON)
  661. OsdMarqueeType enMarqueeType;
  662. BOOL bStartAfterCreate;
  663. struct _OsdMarqueeNode *pstMarquee;
  664. #endif
  665. } OsdComponentNode;
  666. #define HV_OSD_CONFIG_CUSTOM_GROUP_MAX_COMPONENTS 16
  667. typedef struct _OsdCustomGroup
  668. {
  669. USHORT16 usX;
  670. USHORT16 usY;
  671. USHORT16 usWidth : 12;
  672. USHORT16 usAlignType : 2;
  673. UCHAR8 ucComponentCount;
  674. UCHAR8 aucGapWidth[HV_OSD_CONFIG_CUSTOM_GROUP_MAX_COMPONENTS - 1];
  675. OsdComponent astComponents[HV_OSD_CONFIG_CUSTOM_GROUP_MAX_COMPONENTS];
  676. } OsdCustomGroup;
  677. typedef struct _OsdCustomGroupInfo
  678. {
  679. USHORT16 usX;
  680. USHORT16 usY;
  681. USHORT16 usWidth : 12;
  682. USHORT16 usAlignType : 2;
  683. UCHAR8 ucComponentCount;
  684. UCHAR8 aucGapWidth[HV_OSD_CONFIG_CUSTOM_GROUP_MAX_COMPONENTS - 1];
  685. OsdComponentNode *apComponents[HV_OSD_CONFIG_CUSTOM_GROUP_MAX_COMPONENTS];
  686. } OsdCustomGroupInfo;
  687. typedef struct _OsdNodeHead
  688. {
  689. /* 第一个组件 */
  690. OsdComponentNode* pstNode;
  691. /* 最后一个组件 */
  692. OsdComponentNode* pstLastNode;
  693. /* 当前显示的组件个数 */
  694. USHORT16 usTotalNum;
  695. /* 需要更新的组件个数(仅update window时有效) */
  696. USHORT16 usUpdateNum;
  697. } OsdNodeHead;
  698. typedef enum _OsdItemRelationship
  699. {
  700. ITEM_PREV,
  701. ITEM_NEXT,
  702. ITEM_PARENT,
  703. ITEM_CHILD,
  704. ITEM_VALUE,
  705. } OsdItemRelationship;
  706. typedef enum _OsdItemState
  707. {
  708. /* 普通 */
  709. OSD_ITEM_NORMAL,
  710. /* 正在聚焦 */
  711. OSD_ITEM_FOCUS,
  712. /* 聚焦保持 */
  713. OSD_ITEM_STAY,
  714. /* 被选中(用于设置选项) */
  715. OSD_ITEM_SELECT,
  716. /* 被选中且正在聚焦(用于设置选项) */
  717. OSD_ITEM_SELECT_FOCUS,
  718. /* 禁用 */
  719. OSD_ITEM_DISABLED,
  720. OSD_ITEM_STATE_NUM,
  721. } OsdItemState;
  722. typedef struct _OsdStateColor
  723. {
  724. UCHAR8 ucNormalColor;
  725. UCHAR8 ucFocusColor;
  726. UCHAR8 ucStayColor;
  727. UCHAR8 ucSelectColor;
  728. UCHAR8 ucSelectFocusColor;
  729. UCHAR8 ucDisableColor;
  730. } OsdStateColor;
  731. typedef struct _OsdItemStyle
  732. {
  733. const OsdComponent *pstNormal;
  734. const OsdComponent *pstFocus;
  735. const OsdComponent *pstStay;
  736. const OsdComponent *pstSelect;
  737. const OsdComponent *pstSelectFocus;
  738. const OsdComponent *pstDisable;
  739. } OsdItemStyle;
  740. typedef VOID(*OsdMenuOpsFn)(VOID);
  741. typedef struct _OsdItemProp OsdItemProp;
  742. typedef struct _OsdWindowProp OsdWindowProp;
  743. typedef struct _OsdFramePartProp OsdFramePartProp;
  744. typedef struct _OsdSceneProp OsdSceneProp;
  745. typedef struct _OsdItem OsdItem;
  746. typedef struct _OsdWindow OsdWindow;
  747. typedef struct _OsdScene OsdScene;
  748. struct _OsdItemProp
  749. {
  750. /* item的序号 */
  751. USHORT16 usItemId;
  752. /* item的X坐标 */
  753. USHORT16 usX;
  754. /* item的Y坐标 */
  755. USHORT16 usY;
  756. #if (HV_CONFIG_ON == HV_PROJECT_CONFIG_OSD_MIRROR)
  757. /* item的宽 */
  758. USHORT16 usWidth;
  759. #endif
  760. /* item的菜单操作句柄 */
  761. OsdMenuOpsFn pfMenuOpsHandle;
  762. /* 上一个item的id */
  763. USHORT16 usPrevItemId;
  764. /* 下一个item的id */
  765. USHORT16 usNextItemId;
  766. /* Item的value item的id */
  767. USHORT16 usValueItemId;
  768. /* Item的父Item的id */
  769. USHORT16 usParentItemId;
  770. /* Item的首个子Item的id */
  771. USHORT16 usChildItemId;
  772. /* 对应的Userdata */
  773. USHORT16 usUserdata : 9;
  774. /* 对应的Userdata Value */
  775. USHORT16 usUserdataValue : 6;
  776. /* 是否为Userdata Value */
  777. USHORT16 bIsValue : 1;
  778. /* item对应的CommonStyleId */
  779. UCHAR8 ucCursorStyleId : 7;
  780. /* item是否位置可变 */
  781. UCHAR8 ucIsDynamicPos : 1;
  782. };
  783. struct _OsdWindowProp
  784. {
  785. /* Window的物理Id */
  786. UCHAR8 ucWindowID : 3;
  787. /* Window的背景使能 */
  788. UCHAR8 ucBgEnable : 1;
  789. /* Window的边框使能 */
  790. UCHAR8 ucBorderEnable : 1;
  791. /* Window的字符换行使能 */
  792. UCHAR8 ucPunctuatedEnable : 1;
  793. UCHAR8 bIsBackground : 1;
  794. /* Window的自定义字体索引 */
  795. UCHAR8 ucReserved : 1;
  796. UCHAR8 ucFixColumns;
  797. /* Window的X坐标(工具提供相对与scene的位置,FW计算更新为绝对位置) */
  798. USHORT16 usX;
  799. /* Window的Y坐标(工具提供相对与scene的位置,FW计算更新为绝对位置) */
  800. USHORT16 usY;
  801. /* Window的宽 */
  802. USHORT16 usWidth;
  803. /* Window的高 */
  804. USHORT16 usHeight;
  805. /* Window的边框颜色 */
  806. USHORT16 usBgColor;
  807. /* Window的背景颜色 */
  808. USHORT16 usBorderColor;
  809. };
  810. struct _OsdFramePartProp
  811. {
  812. /* FramePart中包含的CP组件列表 */
  813. const OsdComponent* pstCpList;
  814. /* FramePart内所包含的首个WindowId */
  815. UCHAR8 ucWindowStartId;
  816. /* FramePart包含的Window个数 */
  817. UCHAR8 ucWindowNum;
  818. };
  819. struct _OsdSceneProp
  820. {
  821. /* Scene的X坐标(绝对位置) */
  822. USHORT16 usX;
  823. /* Scene的Y坐标(绝对位置) */
  824. USHORT16 usY;
  825. /* Scene的宽 */
  826. USHORT16 usWidth;
  827. /* Scene的高 */
  828. USHORT16 usHeight;
  829. /* Scene包含的首个itemId */
  830. USHORT16 usItemStartId;
  831. /* Scene包含Item数量 */
  832. USHORT16 usItemNum;
  833. /* Scene包含FramePart */
  834. OsdFramePartProp astFramePart[OSD_FRAME_PART_MAX];
  835. /* Scene包含FramePart数量 */
  836. UCHAR8 ucFramePartNum;
  837. #if (HV_CONFIG_ON == HV_PROJECT_CONFIG_OSD_MIRROR)
  838. /* RTL菜单时是否镜像 */
  839. BOOL bMirror;
  840. #endif
  841. };
  842. struct _OsdItem
  843. {
  844. /* item的X坐标(相对与window的位置) */
  845. USHORT16 usX;
  846. /* item的Y坐标(相对与window的位置) */
  847. USHORT16 usY;
  848. #if (HV_CONFIG_ON == HV_PROJECT_CONFIG_OSD_MIRROR)
  849. /* item的宽 */
  850. USHORT16 usWidth;
  851. #endif
  852. /* ItemId */
  853. USHORT16 usId;
  854. /* 所属的SceneID */
  855. UCHAR8 ucSceneId;
  856. /* item的显示状态 */
  857. UCHAR8 ucState;
  858. /* item当前是否可见 */
  859. BOOL bVisable;
  860. };
  861. struct _OsdWindow
  862. {
  863. /* 所属的Scene */
  864. OsdScene *pstScene;
  865. /* window中需要显示的一般组件链表 */
  866. OsdNodeHead stCpShowListHead;
  867. /* window中需要显示的font组件链表 */
  868. OsdNodeHead stFontShowListHead;
  869. /* window中需要删除的组件链表 */
  870. OsdNodeHead stDeleteListHead;
  871. /* window中需要删除的组件链表 */
  872. OsdNodeHead stFontDeleteListHead;
  873. /* Window的宽(画font需要) */
  874. USHORT16 usFontAreaWidth;
  875. /* 用户定义的一行的列的个数 */
  876. UCHAR8 ucFixColumns;
  877. /* WindowId */
  878. UCHAR8 ucId;
  879. UCHAR8 ucPhyId;
  880. /* window当前是否可见 */
  881. BOOL bVisable;
  882. /* window当前是否改变 */
  883. BOOL bModify;
  884. };
  885. struct _OsdScene
  886. {
  887. /* Scene的X坐标 */
  888. USHORT16 usX;
  889. /* Scene的Y坐标 */
  890. USHORT16 usY;
  891. /* Scene的宽 */
  892. USHORT16 usWidth;
  893. /* Scene的高 */
  894. USHORT16 usHeight;
  895. /* SceneId */
  896. UCHAR8 ucId;
  897. /* 当前绘制FramePart序号 */
  898. UCHAR8 ucCurFrame;
  899. /* scene当前是否可见 */
  900. BOOL bVisable;
  901. /* scene当前是否改变 */
  902. BOOL bModify;
  903. #if (HV_PROJECT_CONFIG_OSD_ROTATION == HV_CONFIG_ON)
  904. /* 是否不旋转 */
  905. BOOL bSkipRotate;
  906. /* scene绝对位置(不受旋转影响) */
  907. BOOL bAbsolutePostion;
  908. USHORT16 usAbsoluteX;
  909. USHORT16 usAbsoluteY;
  910. #endif
  911. #if (HV_PROJECT_CONFIG_OSD_MIRROR == HV_CONFIG_ON)
  912. /* RTL菜单时是否镜像 */
  913. BOOL bMirror;
  914. #endif
  915. };
  916. /* 获取组件 */
  917. #define COMPONENT(type, id) ({ OsdComponent __component = {type, id}; __component; })
  918. /* 对比是否为同一组件 */
  919. #define CP_COMPARE(cp1, cp2) ((cp1.enType == cp2.enType) && (cp1.usIndex == cp2.usIndex))
  920. /* 判断是否为font类型组件 */
  921. #define CP_IS_FONT(cp) ((cp.enType > OSD_CP_TYPE_NONE) && (cp.enType < OSD_CP_TYPE_RECT))
  922. extern OsdScene g_astOsdSceneArray[];
  923. extern OsdWindow g_astOsdWindowArray[];
  924. extern OsdItem g_astOsdItemArray[];
  925. #define OSD_GET_SCENE(i) (i < SCENE_ID_MAX ? &g_astOsdSceneArray[i] : NULL)
  926. #define OSD_GET_WINDOW(i) (i < WIN_ID_MAX ? &g_astOsdWindowArray[i] : NULL)
  927. #define OSD_GET_ITEM(i) (i < ITEM_ID_MAX ? &g_astOsdItemArray[i] : NULL)
  928. #define ITEM_GET_SCENEID(i) (i < ITEM_ID_MAX ? OSD_GET_ITEM(i)->ucSceneId : SCENE_ID_MAX)
  929. extern const OsdSceneProp g_astScenePropArray[];
  930. extern const OsdWindowProp g_astWindowPropArray[];
  931. extern const OsdItemProp g_astItemPropArray[];
  932. /* 获取Item属性数据地址 */
  933. #define OSD_GET_SCENE_PROP(i) (i < SCENE_ID_MAX ? &g_astScenePropArray[i] : NULL)
  934. /* 获取Window属性数据地址 */
  935. #define OSD_GET_WINDOW_PROP(i) (i < WIN_ID_MAX ? &g_astWindowPropArray[i] : NULL)
  936. /* 获取Scene属性数据地址 */
  937. #define OSD_GET_ITEM_PROP(i) (i < ITEM_ID_MAX ? &g_astItemPropArray[i] : NULL)
  938. #define NEXT_ITEM(i) (i < ITEM_ID_MAX ? g_astItemPropArray[i].usNextItemId : ITEM_NONE_ID)
  939. #define PREV_ITEM(i) (i < ITEM_ID_MAX ? g_astItemPropArray[i].usPrevItemId : ITEM_NONE_ID)
  940. #define PARENT_ITEM(i) (i < ITEM_ID_MAX ? g_astItemPropArray[i].usParentItemId : ITEM_NONE_ID)
  941. #define CHILD_ITEM(i) (i < ITEM_ID_MAX ? g_astItemPropArray[i].usChildItemId : ITEM_NONE_ID)
  942. #define VALUE_ITEM(i) (i < ITEM_ID_MAX ? g_astItemPropArray[i].usValueItemId : ITEM_NONE_ID)
  943. extern const OsdText g_astTextPropArray[];
  944. extern const OsdTextList g_astTextListPropArray[];
  945. extern const OsdNumber g_astNumberPropArray[];
  946. extern const OsdAsciiString g_astAsciiStringPropArray[];
  947. extern const OsdIcon g_astIconPropArray[];
  948. #if (HV_PROJECT_CONFIG_OSD_BIGFONT_SUPPORT == HV_CONFIG_ON)
  949. extern const OsdIcon g_astIconPropBigFontArray[];
  950. extern const USHORT16 g_usBigIconFontArrayLen;
  951. extern const OsdBmp g_astBmpPropBigFontArray[];
  952. extern const USHORT16 g_usBigBmpFontArrayLen;
  953. #endif
  954. extern const OsdIconList g_astIconListPropArray[];
  955. extern const OsdBmp g_astBmpPropArray[];
  956. extern const OsdBmpList g_astBmpListPropArray[];
  957. #if (HV_PROJECT_CONFIG_OSD_CUSTOM_GROUP_SUPPORT == HV_CONFIG_ON)
  958. extern const OsdCustomGroup g_astCustomGroupPropArray[];
  959. #endif
  960. extern const OsdGraphic g_astGraphicPropArray[];
  961. extern const OsdRect g_astRectPropArray[];
  962. extern const OsdRectGrid g_astRectGridPropArray[];
  963. extern const OsdLineGrid g_astLineGridPropArray[];
  964. extern const OsdLine g_astLinePropArray[];
  965. #define OSD_GET_TEXT_PROP(i) (i < TEXT_ID_MAX ? &g_astTextPropArray[i] : NULL)
  966. #define OSD_GET_TEXT_LIST_PROP(i) (i < TEXT_LIST_ID_MAX ? &g_astTextListPropArray[i] : NULL)
  967. #define OSD_GET_NUMBER_PROP(i) (i < NUMBER_ID_MAX ? &g_astNumberPropArray[i] : NULL)
  968. #define OSD_GET_ASCII_STRING_PROP(i) (i < ASCII_STRING_ID_MAX ? &g_astAsciiStringPropArray[i] : NULL)
  969. #define OSD_GET_ICON_PROP(i) (i < ICON_ID_MAX ? &g_astIconPropArray[i] : NULL)
  970. #define OSD_GET_ICON_LIST_PROP(i) (i < ICON_LIST_ID_MAX ? &g_astIconListPropArray[i] : NULL)
  971. #define OSD_GET_BMP_PROP(i) (i < BMP_ID_MAX ? &g_astBmpPropArray[i] : NULL)
  972. #define OSD_GET_BMP_LIST_PROP(i) (i < BMP_LIST_ID_MAX ? &g_astBmpListPropArray[i] : NULL)
  973. #if (HV_PROJECT_CONFIG_OSD_CUSTOM_GROUP_SUPPORT == HV_CONFIG_ON)
  974. #define OSD_GET_CUSTOM_GROUP_PROP(i) (i < GROUP_ID_MAX ? &g_astCustomGroupPropArray[i] : NULL)
  975. #else
  976. #define OSD_GET_CUSTOM_GROUP_PROP(i) NULL
  977. #endif
  978. #define OSD_GET_GRAPHIC_PROP(i) (i < GRAPHIC_ID_MAX ? &g_astGraphicPropArray[i] : NULL)
  979. #define OSD_GET_RECT_PROP(i) (i < RECT_ID_MAX ? &g_astRectPropArray[i] : NULL)
  980. #define OSD_GET_RECTGRID_PROP(i) (i < RECTGRID_ID_MAX ? &g_astRectGridPropArray[i] : NULL)
  981. #define OSD_GET_LINEGRID_PROP(i) (i < LINEGRID_ID_MAX ? &g_astLineGridPropArray[i] : NULL)
  982. #define OSD_GET_LINE_PROP(i) (i < LINE_ID_MAX ? &g_astLinePropArray[i] : NULL)
  983. #define PHY_RECT_ID(i) (OSD_GET_RECT_PROP(i) ? OSD_GET_RECT_PROP(i)->ucIndex : PHY_RECT_ID_MAX)
  984. #define PHY_RECTGRID_ID(i) (OSD_GET_RECTGRID_PROP(i) ? OSD_GET_RECTGRID_PROP(i)->ucIndex : PHY_GRID_ID_MAX)
  985. #define PHY_LINEGRID_ID(i) (OSD_GET_LINEGRID_PROP(i) ? OSD_GET_LINEGRID_PROP(i)->ucIndex : PHY_LINE_ID_MAX)
  986. #define PHY_LINE_ID(i) (OSD_GET_LINE_PROP(i) ? OSD_GET_LINE_PROP(i)->ucIndex : PHY_LINE_ID_MAX)
  987. extern const OsdRectStyle g_astRectStyleArray[];
  988. extern const OsdRectHighlight g_astRectHighlightArray[];
  989. extern const OsdLineHighlight g_astLineHighlightArray[];
  990. #define OSD_GET_RECT_STYLE(i) (i < COMPONET_RECT_STYLE_NUM_MAX ? &g_astRectStyleArray[i] : NULL)
  991. #define OSD_GET_RECTGRID_HIGHLIGHT(i) (i < COMPONET_RECT_HIGHLIGHT_NUM_MAX ? &g_astRectHighlightArray[i] : NULL)
  992. #define OSD_GET_LINEGRID_HIGHLIGHT(i) (i < COMPONET_LINE_HIGHLIGHT_NUM_MAX ? &g_astLineHighlightArray[i] : NULL)
  993. extern const OsdStateColor astOsdDynamicStateColor[];
  994. extern const OsdItemStyle g_astCursorStyleList[];
  995. extern const OsdItemStyle g_astItemStyleList[];
  996. /* 获取组件名称 */
  997. #define CP_NAME(component) Hv_Mw_OsdGetComponentName(component)
  998. /* 获取item名称 */
  999. #define ITEM_NAME(id) Hv_Mw_OsdGetItemName(id)
  1000. /* 获取scene名称 */
  1001. #define SCENE_NAME(id) Hv_Mw_OsdGetSceneName(id)
  1002. #if (HV_CONFIG_ON == HV_PROJECT_CONFIG_OSD_MIRROR)
  1003. BOOL bRTLShow;
  1004. #endif
  1005. /* Common Function Declaration */
  1006. /**
  1007. * @brief 获取组件名称
  1008. * @param[in] stComponent 组件结构
  1009. * @return CHAR8 * 组件名称字符串
  1010. */
  1011. const CHAR8 *Hv_Mw_OsdGetComponentName(OsdComponent stComponent);
  1012. /**
  1013. * @brief 获取item名称
  1014. * @param[in] usItemId item索引
  1015. * @return CHAR8 * item名称字符串
  1016. */
  1017. const CHAR8 *Hv_Mw_OsdGetItemName(USHORT16 usItemId);
  1018. /**
  1019. * @brief 获取scene名称
  1020. * @param[in] ucSceneId scene索引
  1021. * @return CHAR8 * scene名称字符串
  1022. */
  1023. const CHAR8 *Hv_Mw_OsdGetSceneName(UCHAR8 ucSceneId);
  1024. /**
  1025. * @brief 获取CommonStyle组件列表
  1026. * @param[in] ucCursorStyleId
  1027. * @param[in] enState
  1028. * @return OsdComponent 组件列表指针
  1029. */
  1030. const OsdComponent* Hv_Mw_OsdGetCursorStyle(UCHAR8 ucCursorStyleId, OsdItemState enState);
  1031. /**
  1032. * @brief 获取ItemStyle组件列表
  1033. * @param[in] usItemId
  1034. * @param[in] enState
  1035. * @return OsdComponent 组件列表指针
  1036. */
  1037. const OsdComponent* Hv_Mw_OsdGetItemStyle(USHORT16 usItemId, OsdItemState enState);
  1038. /**
  1039. * @brief 获取Component类型大小
  1040. * @param[in] enType 组件类型
  1041. * @return UINT32 组件类型大小
  1042. */
  1043. UINT32 Hv_Mw_OsdGetComponentPropSize(OsdComponentType enType);
  1044. /**
  1045. * @brief 获取Component属性数据地址
  1046. * @param[in] stCp 组件类型结构
  1047. * @return UINT32 组件属性数据地址
  1048. */
  1049. UINT32 Hv_Mw_OsdGetComponentPropAddr(OsdComponent stCp);
  1050. /**
  1051. * @brief 获取状态color index
  1052. * @param[in] ucColorChoose
  1053. * @param[in] ucState
  1054. * @return UCHAR8 对应状态的 color index
  1055. */
  1056. UCHAR8 Hv_Mw_OsdGetDynamicStateColor(UCHAR8 ucColorChoose, UCHAR8 ucState);
  1057. /**
  1058. * @brief 获取Rect类型组件的Style
  1059. * @param[in] ucStyleIndex
  1060. * @return OsdRectStyle Rect类型组件的Style指针
  1061. */
  1062. const OsdRectStyle* Hv_Mw_OsdGetRectStyle(UCHAR8 ucStyleIndex);
  1063. /**
  1064. * @brief 获取Rect类型组件的高亮Style
  1065. * @param[in] ucHlOptionIndex
  1066. * @return OsdRectHighlight Rect类型组件的高亮Style指针
  1067. */
  1068. const OsdRectHighlight* Hv_Mw_OsdGetRectHl(UCHAR8 ucHlOptionIndex);
  1069. /**
  1070. * @brief 获取Line类型组件的高亮Style
  1071. * @param[in] ucHlOptionIndex
  1072. * @return OsdLineHighlight Line类型组件的高亮Style指针
  1073. */
  1074. const OsdLineHighlight* Hv_Mw_OsdGetLineHl(UCHAR8 ucHlOptionIndex);
  1075. #endif