gel_subtitle.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. /** @file
  2. * Header file for GEL subtitle related API.
  3. *
  4. * @author mandy.wu 2010/08/16 (SUBT Y pos adjustment refinement)
  5. * @version 0.1
  6. */
  7. #ifndef __GEL_SUBTITLE__
  8. #define __GEL_SUBTITLE__
  9. #include "gui_eng/stddefs.h"
  10. #include "gui_eng/gui_engine.h"
  11. #define GEL_SUB_RGN_WIDTH (720)
  12. #define GEL_SUB_RGN_HEIGHT (480)
  13. /** Subtitle size */
  14. typedef enum {
  15. GEL_SUB_SIZE_1 = 0, /**< Large */
  16. GEL_SUB_SIZE_2, /**< */
  17. GEL_SUB_SIZE_3, /**< */
  18. GEL_SUB_SIZE_4, /**< */
  19. GEL_SUB_SIZE_5, /**< */
  20. GEL_SUB_SIZE_6, /**< Small */
  21. GEL_SUB_SIZE_LAST
  22. } GEL_SUB_Size_e;
  23. /** Subtitle display position in vertical */
  24. typedef enum {
  25. GEL_SUB_POSY_1 = 0, /**< Top */
  26. GEL_SUB_POSY_2, /**< */
  27. GEL_SUB_POSY_3, /**< */
  28. GEL_SUB_POSY_4, /**< */
  29. GEL_SUB_POSY_5, /**< */
  30. GEL_SUB_POSY_6, /**< Bottom */
  31. GEL_SUB_POSY_LAST
  32. } GEL_SUB_PosY_e;
  33. /** Subtitle color */
  34. typedef enum {
  35. GEL_SUB_COLOR_RED = 0, /**< R:255 G:0 B:0 A:255*/
  36. GEL_SUB_COLOR_GREEN, /**< R:0 G:255 B:0 A:255 */
  37. GEL_SUB_COLOR_YELLOW, /**< R:255 G:255 B:0 A:255 */
  38. GEL_SUB_COLOR_BLUE, /**< R:0 G:255 B:0 A:255 */
  39. GEL_SUB_COLOR_PINK, /**< R:255 G:0 B:255 A:255 */
  40. GEL_SUB_COLOR_CYAN, /**< R:255 G:255 B:255 A:255 */
  41. GEL_SUB_COLOR_LAST
  42. } GEL_SUB_Color_e;
  43. /* Subtitle attributes */
  44. extern LANGName_t gstSubCodepage;
  45. extern GEL_SUB_PosY_e geSubPosY;
  46. extern UINT8 gbSubLineSpacing;
  47. /* Subtitle resources */
  48. extern PALENTRY gstSubPal[256];
  49. /**
  50. * Initialize a region for subtitle rendering.
  51. *
  52. * @return GUI_SUCCESS if succeed, error codes otherwise.
  53. */
  54. GUIResult_e GEL_SUB_InitializeRgn(void)__attribute__ ((warn_unused_result));
  55. /**
  56. * Finalize the region for subtitle rendering.
  57. * @return GUI_SUCCESS if succeed, error codes otherwise.
  58. */
  59. GUIResult_e GEL_SUB_FinalizeRgn(void)__attribute__ ((warn_unused_result));
  60. /**
  61. * Clear subtitle .
  62. *
  63. * @return GUI_SUCCESS if succeed, error codes otherwise.
  64. */
  65. GUIResult_e GEL_SUB_ClearAllString(UINT8 bUpdateNow);
  66. /**
  67. * Set a fontbase group number for subtitle rendering.
  68. *
  69. * @param eFontStyleNum The fontbase group to indicate an index of UI fontbase resources for subtitle rendering.
  70. * the param should be one of TV_Standard, TV_Small, TV_Large or TV_Game(the TV_FONT_Style_t);
  71. * @return GUI_SUCCESS if succeed, error codes otherwise.
  72. */
  73. GUIResult_e GEL_SUB_SetFontbase(FontStyle_e eFontStyleNum)__attribute__ ((warn_unused_result));
  74. /**
  75. * Get the subtitle fontbase group number.
  76. *
  77. * @param pdFontSizeNum The pointer to get subtitle fontbase index of the UI fontbase resources.
  78. * @return GUI_SUCCESS if succeed, error codes otherwise.
  79. */
  80. GUIResult_e GEL_SUB_GetFontbase(UINT32 *pdFontSizeNum)__attribute__ ((warn_unused_result));
  81. #if 0
  82. /**
  83. * Set subtitle codepage for native string rendering.
  84. *
  85. * @param pstCodepage The codepage to be set to subtitle native string rendering.
  86. * @return GUI_SUCCESS if succeed, error codes otherwise.
  87. */
  88. GUIResult_e GEL_SUB_SetCodepage(LANGName_t pstCodepage)__attribute__ ((warn_unused_result));
  89. /**
  90. * Get subtitle codepage.
  91. *
  92. * @param pstCodepage The pointer to get subtitle native string displayed codepage.
  93. * @return GUI_SUCCESS if succeed, error codes otherwise.
  94. */
  95. GUIResult_e GEL_SUB_GetCodepage(LANGName_t *pstCodepage)__attribute__ ((warn_unused_result));
  96. #endif
  97. /**
  98. * Change subtitle color.
  99. *
  100. * @param eColor The String color to be drawn.
  101. * @return GUI_SUCCESS if succeed, error codes otherwise.
  102. */
  103. GUIResult_e GEL_SUB_ChangeColor(GEL_SUB_Color_e eColor)__attribute__ ((warn_unused_result));
  104. /**
  105. * Change subtitle size.
  106. *
  107. * @param eSize The String size to be drawn.
  108. * @return GUI_SUCCESS if succeed, error codes otherwise.
  109. */
  110. GUIResult_e GEL_SUB_ChangeSize(GEL_SUB_Size_e eSize)__attribute__ ((warn_unused_result));
  111. /**
  112. * Change subtitle position.
  113. *
  114. * @param ePosY The target position in vertical to be rendered.
  115. * @return GUI_SUCCESS if succeed, error codes otherwise.
  116. */
  117. GUIResult_e GEL_SUB_ChangePos(GEL_SUB_PosY_e ePosY)__attribute__ ((warn_unused_result));
  118. /**
  119. * Change subtitle line spacing.
  120. * @param bLineSpacing Spacing between each subtitle line, legal values [0,30].
  121. * @return GUI_SUCCESS if succeed, error codes otherwise.
  122. */
  123. GUIResult_e GEL_SUB_ChangeLineSpacing(UINT8 bLineSpacing)__attribute__ ((warn_unused_result));
  124. /**
  125. * Change subtitle character spacing.
  126. * @param bCharSpacing Spacing between each character, set 0 to disable this setting, that is,
  127. * use the default character spacing of target fontbase.
  128. * @return GUI_SUCCESS if succeed, error codes otherwise.
  129. */
  130. GUIResult_e GEL_SUB_ChangeCharSpacing(UINT8 bCharSpacing)__attribute__ ((warn_unused_result));
  131. /**
  132. * Subtitle rendering.
  133. *
  134. * @param pStr Pointer to the string to be rendered.
  135. * @param eStrType The String type.
  136. * @return GUI_SUCCESS if succeed, error codes otherwise.
  137. */
  138. GUIResult_e GEL_SUB_DrawString(UINT8 *pStr, GEL_DynStrType_e eStrType);
  139. /**
  140. * Set subtitle background to a specific color and on/off.
  141. * The 255th color in subtitle palette will be replaced by the specific color.
  142. *
  143. * @param pHandle Handle to a control object.
  144. * @param stColor The color to be set.
  145. * @param bBGDraw The flag to specific whether draw background.
  146. * @return GUI_SUCCESS if succeed, error codes otherwise.
  147. */
  148. GUIResult_e GEL_SUB_SetBackground(GEL_Color_t stColor, BOOLEAN bBGDraw)__attribute__ ((warn_unused_result));
  149. //GUIResult_e GEL_SUB_SetCodepage(LANGName_t stCodepage);
  150. #endif /* __GEL_SUBTITLE__ */