/** @file * Header file for GEL direct drawing API. * * @author mandy.wu 2010/03/24 * @version 0.1 */ #ifndef __GEL_DRAWING__ #define __GEL_DRAWING__ #include "gui_eng/stddefs.h" #include "gui_eng/gui_engine.h" /** * Get the handle of bitmap of static resource via icon ID. * * @param stRgnHandle The target region handle to which desired bitmap belongs. * @param swIconId Icon ID of desired bitmap. * @param pstBitmapHandle Returned bitmap handle. * @return GUI_SUCCESS if succeed, error codes otherwise. */ GUIResult_e GEL_GetStaticBmpHandle(GEL_RgnHandle_t stRgnHandle, INT16 swIconId, GEL_BitmapHandle_t *pstBitmapHandle)__attribute__ ((warn_unused_result)); /** * Get the bitmap handle. * * @param pAddr The pointer to the bitmap data. * @param eFormat The pixel format of the bitmap. * @param wWidth The width of the bitamp. * @param wHeight The height of the bitamp. * @param pstBitmapHandle Return the bitmap handle. * @return GUI_SUCCESS if succeed, error codes otherwise. */ GUIResult_e GEL_GetBitmapHandle(void *pAddr, GEL_PixelFormat_e eFormat, UINT16 wWidth, UINT16 wHeight, GEL_BitmapHandle_t *pstBitmapHandle)__attribute__ ((warn_unused_result)); /** * Set a palette to a bitmap handle. * The source palette will be applied if the bitmap is 16/32 bits format. * * @param pstBitmapHandle The pointer to a bitmap handle. * @param pstPal The pointer to a 256 color palette. * @param wPalFirst The first pal index of the bitmap if the bitmap is 4bpp format(16 colors). * @return GUI_SUCCESS if succeed, error codes otherwise. */ GUIResult_e GEL_SetBitmapPal(GEL_BitmapHandle_t *pstBitmapHandle, GEL_Palette_t *pstPal, UINT16 wPalFirst)__attribute__ ((warn_unused_result)); /** * Draw string to OSD region. * * @param stRgnHandle The target region handle. * @param pStr The string data. * @param eStrType The encoded type of the string. * @param pstTextInfo The text rendering info of the string. * @param pstVFInfo The vector font related settings. * @param pstDstRect The area of the OSD region to be rendered to. * @return GUI_SUCCESS if succeed, error codes otherwise. */ GUIResult_e GEL_DrawString(GEL_RgnHandle_t stRgnHandle, UINT8 *pStr, GEL_DynStrType_e eStrType, GEL_TextInfo_t *pstTextInfo, GEL_VFInfo_t *pstVFInfo, PRECT pstDstRect, INT32 *pBlockId)__attribute__ ((warn_unused_result)); /** * Draw a bitmap to an OSD region. * * @param stRgnHandle The target region handle. * @param pstBitmapHandle The source bitmap handle. * @param pstSrcRect The pointer to a rect area of the source bitmap to be blited. * @param swDstX The x coordinate of the OSD region to be rendered to. * @param swDstY The y coordinate of the OSD region to be rendered to. * @return GUI_SUCCESS if succeed, error codes otherwise. */ GUIResult_e GEL_DrawBitmap(GEL_RgnHandle_t stRgnHandle, GEL_BitmapHandle_t *pstBitmapHandle, PRECT pstSrcRect, INT16 swDstX, INT16 swDstY, INT32 *pBlockId)__attribute__ ((warn_unused_result)); /** * Draw a bitmap to an OSD region repeatly to fill with the rect area. * * @param stRgnHandle The target region handle. * @param pstBitmapHandle The source bitmap handle. * @param pstSrcRect The pointer to a rect area of the source bitmap to be blited. * @param pstDstRect The pointer to a rect area of the OSD region to be blited to. * @return GUI_SUCCESS if succeed, error codes otherwise. */ GUIResult_e GEL_FillBitmap(GEL_RgnHandle_t stRgnHandle, GEL_BitmapHandle_t *pstBitmapHandle, PRECT pstSrcRect, PRECT pstDstRect, INT32 *pBlockId)__attribute__ ((warn_unused_result)); /** * Fill a rect area of an OSD region with a color. * 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. * * @param stRgnHandle The target region handle. * @param stColor The color to be filled with the rect. * @param pstDstRect The target rect area to be filled with. * @return GUI_SUCCESS if succeed, error codes otherwise. */ GUIResult_e GEL_FillRect(GEL_RgnHandle_t stRgnHandle, GEL_Color_t stColor, PRECT pstDstRect, INT32 *pBlockId)__attribute__ ((warn_unused_result)); /** * Fill a rect area of an OSD region with a hole * * @param stRgnHandle The target region handle. * @param pstDstRect The target rect area to be filled with. * @return GUI_SUCCESS if succeed, error codes otherwise. */ GUIResult_e GEL_DrawHoleRectangle(GEL_RgnHandle_t stRgnHandle, PRECT pstDstRect, UINT16 nLineWidth, INT32 *pBlockId, INT32 isEvenAlign)__attribute__ ((warn_unused_result)); /** * Draw a line between two points of an OSD region. * * @param stRgnHandle The target region handle. * @param stColor The color to be filled with the line. * @param swX1 The x coordinate of the start point. * @param swY1 The y coordinate of the start point. * @param swX2 The x coordinate of the end point. * @param swY2 The y coordinate of the end point. * @param wThickness The thickness of a line. * @return GUI_SUCCESS if succeed, error codes otherwise. */ GUIResult_e GEL_DrawLine(GEL_RgnHandle_t stRgnHandle, GEL_Color_t stColor, INT16 swX1, INT16 swY1, INT16 swX2, INT16 swY2, UINT16 wThickness, INT32 *pBlockId)__attribute__ ((warn_unused_result)); //-- /** * Set bitmap resource information to GUI engine. * * @param pBmpInfo The target bitmap resource set by user * @return GUI_SUCCESS if succeed, error codes otherwise. */ GUIResult_e GEL_SetBmpInfo(const IMAGEHDR *pBmpInfo)__attribute__ ((warn_unused_result)); #endif /* __GEL_DRAWING__ */