hv_drv_OsdPalette.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /**
  2. * @file hv_drv_OsdPalette.h
  3. * @brief Osd driver layer palette interface.
  4. * @verbatim
  5. * ==============================================================================
  6. * ##### How to use this driver #####
  7. * ==============================================================================
  8. * (+) Use Hv_Drv_OsdPalette_Init(...) to init palette offset.
  9. * (+) Use Hv_Drv_OsdLogoPalette_Init(...) to init logo palette offset.
  10. * (+) Use Hv_Drv_OsdPalette_SetChangeRange(...) to record palette change range.
  11. * (+) Use Hv_Drv_OsdPalette_TransferPalette(...) to transfer palette change to OSD SRAM.
  12. * @endverbatim
  13. *
  14. * @author HiView SoC Software Team
  15. * @version 0.0.1
  16. * @date 2022-08-22
  17. */
  18. #ifndef __HV_DRV_OSDPALETTE_H
  19. #define __HV_DRV_OSDPALETTE_H
  20. #include "hv_cal_Osd.h"
  21. /**
  22. * @brief palette data copy
  23. * @param[in] usOffset color offset within palette, 0~511
  24. * @param[in] uiSrcAddr source address in DDR
  25. * @param[in] usLength data length to copy
  26. * @return VOID without return
  27. */
  28. VOID Hv_Drv_OsdPalette_Copy(USHORT16 usOffset, UINT32 uiSrcAddr, USHORT16 usLength);
  29. /**
  30. * @brief move colors of the same window from usSrcOffset to usDstOffset
  31. * @param[in] usSrcOffset source color offset, 0~511
  32. * @param[in] usDstOffset destination color offset, 0~511
  33. * @param[in] usColorCounts color counts to move
  34. * @return VOID without return
  35. */
  36. VOID Hv_Drv_OsdPalette_Move(USHORT16 usSrcOffset, USHORT16 usDstOffset, USHORT16 usColorCounts);
  37. /**
  38. * @brief set Palette change range
  39. * @param[in] enType palette change type OSD_SRAM_CHANGE_NONE: palette area clean
  40. * OSD_SRAM_CHANGE_PARTIAL: partial area of palette dirty
  41. * OSD_SRAM_CHANGE_FULL: whole area of palette dirty
  42. * @param[in] uiChangeStart start position of this change
  43. * @param[in] uiChangeEnd end position of this change
  44. * @return VOID without return
  45. */
  46. VOID Hv_Drv_OsdPalette_SetChangeRange(OsdSRAMChangeType enType,
  47. UINT32 uiChangeStart, UINT32 uiChangeEnd);
  48. /**
  49. * @brief transfer palette change area to OSD SRAM
  50. * @param[in] None
  51. * @return VOID without return
  52. */
  53. VOID Hv_Drv_OsdPalette_TransferPalette(VOID);
  54. /**
  55. * @brief change Palette color
  56. * @param[in] enWinIndex Window id
  57. * @param[in] usColorIndex Color index in palette
  58. * @param[in] uiBGR RGB888value
  59. * @return VOID without return
  60. */
  61. VOID Hv_Drv_OsdPalette_ChangeColor(OsdWindowPhyId enWinIndex, USHORT16 usColorIndex, UINT32 uiBGR);
  62. UINT32 Hv_Drv_OsdPalette_GetColor(OsdWindowPhyId enWinIndex, USHORT16 usColorIndex);
  63. UINT32 Hv_Drv_OsdPalette_GetPaletteColor(USHORT16 usColorIndex);
  64. /**
  65. * @brief palette data init function
  66. * @param[in] None
  67. * @return VOID without return
  68. */
  69. VOID Hv_Drv_OsdPalette_Init(VOID);
  70. #if (HV_PROJECT_CONFIG_OSD_LOGO_USE_SCENE == HV_CONFIG_ON)
  71. /**
  72. * @brief logo palette data init function
  73. * @param[in] None
  74. * @return VOID without return
  75. */
  76. VOID Hv_Drv_OsdLogoPalette_Init(VOID);
  77. #endif
  78. #endif