⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 apiosdrender.h

📁 mstar 776 开发的车载dvd
💻 H
📖 第 1 页 / 共 2 页
字号:
    U32 b: 8;
    /// Green
    U32 g: 8;
    /// Red
    U32 r: 8;
    /// Alpha
    U32 a: 8;
    };

    /// 256 Paletle mode
    struct {
    /// resolved
    U32 Reserved: 24;
    /// Color Index
    U32 ColorIndex :8;
    };

    U32 u32AllColorValue;
} OSD_COLOR;
#else
typedef U32 OSD_COLOR;
#endif

/// Define Color format
typedef enum
{
    /// ARGB8888
    OSD_ARGB8888,
    /// 256 palette
    OSD_I8,

} OSD_COLOR_FMT;


/// Define RoundBar Style;
typedef enum
{
    ///horizontal round bar
    OSD_HRoundBar,
    ///Vertical round bar
    OSD_VRoundBar,
} OSD_RoundBar_Style;

//#define GERECT_FLAG_COLOR_CONSTANT      0x0
//#define GERECT_FLAG_COLOR_GRADIENT_X    0x1
//#define GERECT_FLAG_COLOR_GRADIENT_Y    0x2

///Define OSD GRADIENT TYPE
typedef enum
{
    ///NO GRADIENT
    OSD_GRADIENT_DISABLE = 0,
    ///GRADIENT based on X axis
    OSD_COLOR_GRADIENT_X = 1,
    ///GRADIENT based on Y axis
    OSD_COLOR_GRADIENT_Y = 2,
    ///GRADIENT based on X axis (center)
    OSD_COLOR_GRADIENT_X_CENTER = 3,
    ///GRADIENT based on Y axis (center)
    OSD_COLOR_GRADIENT_Y_CENTER = 4,

}OSD_GRADIENT;



/// Define Alpha Blending Type
typedef struct
{
    ///Enable / Disable Alpha Blending
    bool bEnable_Blend;
    /// Set BLEND COEF (it work when bEnable_Blend == TRUE)
    GE_BLEND_COEF eBLEND_COEF;
    /// Set  Alpha VALUE
    /// Only useful when GC format is ARGB8888 or ARGB4444 (for set GC alpha value)
    GE_ALPHA_SRC_FROM eALPHA_SRC_FROM;
    /// Constant Alpha Value
    /// Only useful when ((eBLEND_COEF == COEF_CONST) || (eALPHA_SRC_FROM = ABL_FROM_CONST))
    U8 u8Constant_Alpha;

} OSD_ALPHA_BLENDING;

//------------------------------------------------------------------------------
// Extern Functions
//------------------------------------------------------------------------------

bool MApi_Osd_DrawLine( OsdGC *pGC,
                        Pos *start,
                        Pos *end,
                        OSD_COLOR_FMT eOSD_COLOR_FMT,
                        OSD_COLOR fromColor,
                        OSD_COLOR toColor,
                        bool bGradient,
                        U8 Linewidth,
                        LineType lt,
                        OSD_ALPHA_BLENDING *pAlpha_Blending);

bool MApi_Osd_DrawRectangleBorder(  OsdGC *pGC,
                                    Rect *r,
                                    OSD_COLOR_FMT eOSD_COLOR_FMT,
                                    OSD_COLOR colorLeftTop,
                                    OSD_COLOR colorRightDown,
                                    U8 thickness,
                                    LineType lt,
                                    OSD_ALPHA_BLENDING *pAlpha_Blending);
bool MApi_Osd_DrawFillRect( OsdGC *pGC,
                            Rect *r,
                            OSD_COLOR_FMT eOSD_COLOR_FMT,
                            OSD_COLOR fromColor,
                            OSD_COLOR toColor,
                            OSD_GRADIENT eGradient,
                            OSD_ALPHA_BLENDING *pAlpha_Blending);
bool MApi_Osd_DrawRectangleBorderEx(
                                    OsdGC *pGC,
                                    Rect  *r,
                                    OSD_COLOR_FMT eOSD_COLOR_FMT,
                                    OSD_COLOR colorTopLeft,
                                    OSD_COLOR  colorTopRight,
                                    OSD_COLOR  colorRightTop,
                                    OSD_COLOR colorRightDown,
                                    OSD_COLOR colorDownRight,
                                    OSD_COLOR colorDownLeft,
                                    OSD_COLOR  colorLeftDown,
                                    OSD_COLOR  colorLeftTop,
                                    U8  thickness,
                                    LineType lt,
                                    OSD_ALPHA_BLENDING *pAlpha_Blending);

bool MApi_Osd_Draw3DRectangle(  OsdGC *pGC,
                                Rect  *r,
                                OSD_COLOR_FMT eOSD_COLOR_FMT,
                                OSD_COLOR COLOR_3DBORDER_DARK,
                                OSD_COLOR COLOR_3DBORDER_LIGHT,
                                U8 borderWidth,
                                U8 flag,
                                OSD_ALPHA_BLENDING *pAlpha_Blending);

bool MApi_Osd_BitBlit(OsdGC *pSrcGC,
                      OsdGC *pDstGC,
                      Rect *r_src,
                      Rect *r_dst,
                      bool bSrcColorKey,
                      OSD_COLOR srcColorKey,
                      OSD_ALPHA_BLENDING *pAlpha_Blending);

void MApi_Osd_DrawArc(  OsdGC *pGC,
                        OSD_COLOR_FMT eOSD_COLOR_FMT,
                        Pos *orig,
                        U32 radius,
                        S32 angleFrom,
                        S32 angleTo,
                        OSD_COLOR color,
                        OSD_ALPHA_BLENDING *pAlpha_Blending);
bool MApi_Osd_BeginDraw(OsdGC *pGC, Pos ClipStart, Pos ClipEnd);
void MApi_Osd_EndDraw(OsdGC *pGC);

U32 MApi_Osd_GetStrWidth(   OsdGC *pGC,
                            SystemFont eSystemFont,
                            U8 flag,
                            U8 u8dis,
                            U8 *pString,
                            U16 u16strLen );

bool MApi_Osd_BoxTextOut(   OsdGC *pGC,
                            SystemFont eSystemFont,
                            Rect *rect,
                            U8 *pString,
                            OSD_COLOR_FMT eOSD_COLOR_FMT,
                            OSD_COLOR TextColor,
                            TextAttrib eTextAttrib,
                            U8 flag,
                            U8 u8dis,
                            bool bShadow);
bool MApi_Osd_BoxTextOutConstAlpha(  OsdGC *pGC,
                            SystemFont eSysFont,
                            Rect *rect,
                            U8 *pString,
                            OSD_COLOR_FMT eOSD_COLOR_FMT,
                            OSD_COLOR TextColor,
                            TextAttrib eTextAttrib,
                            U8 u8Flag,
                            U8 u8Gap,
                            U8 u8Alpha,
                            bool bShadow);
bool MApi_Osd_DrawSmartString(OsdGC *pGC,
                                SystemFont eSystemFont,
                                Rect *rect,
                                U8 *pString,
                                OSD_COLOR_FMT eOSD_COLOR_FMT,
                                OSD_COLOR TextColor,
                                TextAttrib eTextAttrib,
                                U8 flag,
                                U8 u8dis,
                                bool bShadow);
bool MApi_Osd_DrawBitmap(OsdGC *pGC,
                         BMPHANDLE handle,
                         Rect *r,
                         bool bSrcColorKey,
                         OSD_COLOR srcColorKeyFrom,
                         OSD_COLOR srcColorKeyEnd,
                         OSD_ALPHA_BLENDING *pAlpha_Blending);

bool MApi_Osd_DrawBitmap_ClipRgn(OsdGC *pGC,
                        BMPHANDLE handle,
                        Rect *r,
                        bool bSrcColorKey,
                        OSD_COLOR srcColorKeyFrom,
                        OSD_COLOR srcColorKeyEnd,
                        Rect *rcClip,
                        OSD_ALPHA_BLENDING *pAlpha_Blending);

BMPHANDLE MApi_Osd_LoadBitmap(U32 addr, U32 u32Size, U32 width, U32 height, GC_ColorFmt fmt);

bool MApi_Osd_DrawRoundBar( OsdGC *pGC,
                            Rect *rect,
                            OSD_COLOR_FMT eOSD_COLOR_FMT,
                            OSD_COLOR colorFrom,
                            OSD_COLOR colorTo,
                            OSD_GRADIENT egradient,
                            bool bshadow,
                            OSD_RoundBar_Style eOSD_RoundBar,
                            OSD_ALPHA_BLENDING *pAlpha_Blending);

bool MApi_Osd_DrawWindow(   OsdGC *pGC,
                            OSD_COLOR_FMT eOSD_COLOR_FMT,
                            Rect *r,
                            S16 titleHeight,
                            OSD_COLOR colorTitle,
                            OSD_COLOR colorBkgnd,
                            RectAttrib attrib,
                            OSD_COLOR BroderColor,
                            U8 sizeBorder,
                            bool bShadow,
                            OSD_ALPHA_BLENDING *pAlpha_Blending);

bool MApi_Osd_DrawRectangle(   OsdGC *pGC,
                            OSD_COLOR_FMT eOSD_COLOR_FMT,
                            Rect *r,
                            OSD_COLOR RcolorFrom,
                            OSD_COLOR Rcolorto,
                            OSD_GRADIENT eRectGradient,
                            OSD_COLOR BroderColor,
                            RectAttrib attrib,
                            U8 sizeBorder,
                            bool bShadow,
                            OSD_ALPHA_BLENDING *pAlpha_Blending);


bool MApi_Osd_DrawDashBar(  OsdGC *pGC,
                            OSD_COLOR_FMT eOSD_COLOR_FMT,
                            Rect *r,
                            OSD_COLOR colorFrom,
                            OSD_COLOR colorTo,
                            bool bXdirection,
                            U8 dash_len,
                            OSD_ALPHA_BLENDING *pAlpha_Blending);

bool  MApi_Osd_DrawTriangle(OsdGC *pGC,
                            OSD_COLOR_FMT eOSD_COLOR_FMT,
                            TriangleStyle style,
                            Rect *r,
                            OSD_COLOR color,
                            OSD_ALPHA_BLENDING *pAlpha_Blending);

void MApi_Osd_DrawCircle(OsdGC *pGC,
                         Pos *orig,
                         U32 radius,
                         OSD_COLOR_FMT eOSD_COLOR_FMT,
                         OSD_COLOR colorFrom,
                         OSD_COLOR colorTo,
                         OSD_ALPHA_BLENDING *pAlpha_Blending,
                         bool bShadow);
bool MApi_Osd_DrawRoundBorder(OsdGC *pGC,
                              U32 radius,
                              Rect *r,
                              U16 u16BorderWidth,
                              OSD_COLOR_FMT eOSD_COLOR_FMT,
                              OSD_COLOR BorderColor,
                              OSD_ALPHA_BLENDING *pAlpha_Blending);

void Generate_Pattern(void);
bool MApi_Osd_Init(void);
bool MApi_Osd_SetDefaultTransClr(void);


//-------------------------------------------------------------------------------------------------
// Extern Global Variabls
//-------------------------------------------------------------------------------------------------


//------------------------------------------------------------------------------
// Macros
//------------------------------------------------------------------------------



//------------------------------------------------------------------------------
// Local Functions
//------------------------------------------------------------------------------


#endif //_APIOSDRENDER_H

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -