gel_drawing.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. /** @file
  2. * Header file for GEL direct drawing API.
  3. *
  4. * @author mandy.wu 2010/03/24
  5. * @version 0.1
  6. */
  7. #ifndef __GEL_DRAWING__
  8. #define __GEL_DRAWING__
  9. #include "gui_eng/stddefs.h"
  10. #include "gui_eng/gui_engine.h"
  11. /**
  12. * Get the handle of bitmap of static resource via icon ID.
  13. *
  14. * @param stRgnHandle The target region handle to which desired bitmap belongs.
  15. * @param swIconId Icon ID of desired bitmap.
  16. * @param pstBitmapHandle Returned bitmap handle.
  17. * @return GUI_SUCCESS if succeed, error codes otherwise.
  18. */
  19. GUIResult_e GEL_GetStaticBmpHandle(GEL_RgnHandle_t stRgnHandle,
  20. INT16 swIconId, GEL_BitmapHandle_t *pstBitmapHandle)__attribute__ ((warn_unused_result));
  21. /**
  22. * Get the bitmap handle.
  23. *
  24. * @param pAddr The pointer to the bitmap data.
  25. * @param eFormat The pixel format of the bitmap.
  26. * @param wWidth The width of the bitamp.
  27. * @param wHeight The height of the bitamp.
  28. * @param pstBitmapHandle Return the bitmap handle.
  29. * @return GUI_SUCCESS if succeed, error codes otherwise.
  30. */
  31. GUIResult_e GEL_GetBitmapHandle(void *pAddr, GEL_PixelFormat_e eFormat, UINT16 wWidth,
  32. UINT16 wHeight, GEL_BitmapHandle_t *pstBitmapHandle)__attribute__ ((warn_unused_result));
  33. /**
  34. * Set a palette to a bitmap handle.
  35. * The source palette will be applied if the bitmap is 16/32 bits format.
  36. *
  37. * @param pstBitmapHandle The pointer to a bitmap handle.
  38. * @param pstPal The pointer to a 256 color palette.
  39. * @param wPalFirst The first pal index of the bitmap if the bitmap is 4bpp format(16 colors).
  40. * @return GUI_SUCCESS if succeed, error codes otherwise.
  41. */
  42. GUIResult_e GEL_SetBitmapPal(GEL_BitmapHandle_t *pstBitmapHandle, GEL_Palette_t *pstPal,
  43. UINT16 wPalFirst)__attribute__ ((warn_unused_result));
  44. /**
  45. * Draw string to OSD region.
  46. *
  47. * @param stRgnHandle The target region handle.
  48. * @param pStr The string data.
  49. * @param eStrType The encoded type of the string.
  50. * @param pstTextInfo The text rendering info of the string.
  51. * @param pstVFInfo The vector font related settings.
  52. * @param pstDstRect The area of the OSD region to be rendered to.
  53. * @return GUI_SUCCESS if succeed, error codes otherwise.
  54. */
  55. GUIResult_e GEL_DrawString(GEL_RgnHandle_t stRgnHandle, UINT8 *pStr, GEL_DynStrType_e eStrType,
  56. GEL_TextInfo_t *pstTextInfo, GEL_VFInfo_t *pstVFInfo, PRECT pstDstRect, INT32 *pBlockId)__attribute__ ((warn_unused_result));
  57. /**
  58. * Draw a bitmap to an OSD region.
  59. *
  60. * @param stRgnHandle The target region handle.
  61. * @param pstBitmapHandle The source bitmap handle.
  62. * @param pstSrcRect The pointer to a rect area of the source bitmap to be blited.
  63. * @param swDstX The x coordinate of the OSD region to be rendered to.
  64. * @param swDstY The y coordinate of the OSD region to be rendered to.
  65. * @return GUI_SUCCESS if succeed, error codes otherwise.
  66. */
  67. GUIResult_e GEL_DrawBitmap(GEL_RgnHandle_t stRgnHandle, GEL_BitmapHandle_t *pstBitmapHandle,
  68. PRECT pstSrcRect, INT16 swDstX, INT16 swDstY, INT32 *pBlockId)__attribute__ ((warn_unused_result));
  69. /**
  70. * Draw a bitmap to an OSD region repeatly to fill with the rect area.
  71. *
  72. * @param stRgnHandle The target region handle.
  73. * @param pstBitmapHandle The source bitmap handle.
  74. * @param pstSrcRect The pointer to a rect area of the source bitmap to be blited.
  75. * @param pstDstRect The pointer to a rect area of the OSD region to be blited to.
  76. * @return GUI_SUCCESS if succeed, error codes otherwise.
  77. */
  78. GUIResult_e GEL_FillBitmap(GEL_RgnHandle_t stRgnHandle, GEL_BitmapHandle_t *pstBitmapHandle,
  79. PRECT pstSrcRect, PRECT pstDstRect, INT32 *pBlockId)__attribute__ ((warn_unused_result));
  80. /**
  81. * Fill a rect area of an OSD region with a color.
  82. * If the region format is indexed mode, the "a" component of a GEL_Color_t will be regarded as an index of the region palette.
  83. *
  84. * @param stRgnHandle The target region handle.
  85. * @param stColor The color to be filled with the rect.
  86. * @param pstDstRect The target rect area to be filled with.
  87. * @return GUI_SUCCESS if succeed, error codes otherwise.
  88. */
  89. GUIResult_e GEL_FillRect(GEL_RgnHandle_t stRgnHandle, GEL_Color_t stColor,
  90. PRECT pstDstRect, INT32 *pBlockId)__attribute__ ((warn_unused_result));
  91. /**
  92. * Fill a rect area of an OSD region with a hole
  93. *
  94. * @param stRgnHandle The target region handle.
  95. * @param pstDstRect The target rect area to be filled with.
  96. * @return GUI_SUCCESS if succeed, error codes otherwise.
  97. */
  98. GUIResult_e GEL_DrawHoleRectangle(GEL_RgnHandle_t stRgnHandle, PRECT pstDstRect,
  99. UINT16 nLineWidth, INT32 *pBlockId, INT32 isEvenAlign)__attribute__ ((warn_unused_result));
  100. /**
  101. * Draw a line between two points of an OSD region.
  102. *
  103. * @param stRgnHandle The target region handle.
  104. * @param stColor The color to be filled with the line.
  105. * @param swX1 The x coordinate of the start point.
  106. * @param swY1 The y coordinate of the start point.
  107. * @param swX2 The x coordinate of the end point.
  108. * @param swY2 The y coordinate of the end point.
  109. * @param wThickness The thickness of a line.
  110. * @return GUI_SUCCESS if succeed, error codes otherwise.
  111. */
  112. GUIResult_e GEL_DrawLine(GEL_RgnHandle_t stRgnHandle, GEL_Color_t stColor,
  113. INT16 swX1, INT16 swY1, INT16 swX2, INT16 swY2, UINT16 wThickness, INT32 *pBlockId)__attribute__ ((warn_unused_result));
  114. //--
  115. /**
  116. * Set bitmap resource information to GUI engine.
  117. *
  118. * @param pBmpInfo The target bitmap resource set by user
  119. * @return GUI_SUCCESS if succeed, error codes otherwise.
  120. */
  121. GUIResult_e GEL_SetBmpInfo(const IMAGEHDR *pBmpInfo)__attribute__ ((warn_unused_result));
  122. #endif /* __GEL_DRAWING__ */