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

📄 drvge2.h

📁 mstar 776 开发的车载dvd
💻 H
📖 第 1 页 / 共 3 页
字号:
{
    /// Blue
    U8 b;
    /// Green
    U8 g;
    /// Red
    U8 r;
    /// Alpha
    U8 a;
} GE_RGB_COLOR;
#endif
//-------------------------------------------------
/// Define the start color & end color
typedef struct
{
    /// start color
    GE_RGB_COLOR color_s;
    /// end color
    GE_RGB_COLOR color_e;
} GE_COLOR_RANGE;

//-------------------------------------------------
/// Define the position of one point.
typedef struct
{
    /// X address
    U16 x;
    /// Y address
    U16 y;
} GE_POINT;

//-------------------------------------------------
/// Specify the blink data
typedef struct
{
    /// BG color (for blink mode use)
    U8 background;
    /// FG color (for blink mode use)
    U8 foreground;
    /// Control flag\n
    union{
        U16 ctrl_flag;
        struct{
            U16 BlinkAlpha:4;
            U16 Alpha:3;
            U16 Blink:2;
            U16 reserved:7;
        }Bits;
        struct{
            U16 BlinkAlpha:4;
            U16 Alpha:2;
            U16 Blink:3;
            U16 reserved:7;
        }Bits2;
    }flag;

} GE_BLINK_DATA;

/// Define the start blink color & end blink color.
typedef struct
{
    /// start blink color
    GE_BLINK_DATA blink_data_s;
    /// end blink color
    GE_BLINK_DATA blink_data_e;
} GE_BLINK_DATA_RANGE;

//-------------------------------------------------
//-------------------------------------------------
//#define GELINE_FLAG_COLOR_CONSTANT      0x00
//#define GELINE_FLAG_COLOR_GRADIENT      0x01
/// Define the attribute of line.
typedef struct
{
    /// start X address
    U16 x1;
    /// Start Y address
    U16 y1;
    /// End X address
    U16 x2;
    /// End Y address
    U16 y2;
    /// Color format
    GE_Buffer_Format fmt;
    union
    {
        /// Color
        ///For all RGB color, the color set as the ARGB8888 format.\r\n
        ///Each color component need to shift to high bit.\r\n
        ///Use ARGB1555 as the example, the source color key as the following:\r\n
        ///ARGB1555  --> ARRRRRGGGGGBBBBB                   (every character represents one bit)\r\n
        ///colorRange.color_s --> A0000000RRRRR000GGGGG000BBBBB000   (every character represents one bit)\r\n\n
        ///For GE_FMT_I8 format, the index set to b component (colorRange.color_s.b = b).\r\n
        GE_COLOR_RANGE       colorRange;
        ///Blink attribute
        ///For GE_FMT_1BAAFGBG123433 foramt, the foramt set as the GE_BLINK_DATA.\r\n
        GE_BLINK_DATA_RANGE  blkDataRange;
    }range;
    /// Line width
    U32 width;
    /// GELINE_FLAG_COLOR_CONSTANT: Constant color\n
    /// GELINE_FLAG_COLOR_GRADIENT: Gradient color
    U32 flag;

} GE_DRAW_LINE_INFO;

//-------------------------------------------------

/// Define the dimension of one block
typedef struct
{
    /// X start address
    U16 x;
    /// Y start address
    U16 y;
    /// width
    U16 width;
    /// height
    U16 height;
} GE_BLOCK;


//-------------------------------------------------
#if 0
#define GERECT_FLAG_COLOR_CONSTANT      0x0
#define GERECT_FLAG_COLOR_GRADIENT_X    0x1
#define GERECT_FLAG_COLOR_GRADIENT_Y    0x2
#endif
/// Define the info. of one block.
typedef struct
{
    /// dst block info
    GE_BLOCK       dstBlock;
    /// Color format
    GE_Buffer_Format fmt;
    union
    {
        /// Color
        ///For all RGB color, the color set as the ARGB8888 format.\r\n
        ///Each color component need to shift to high bit.\r\n
        ///Use ARGB1555 as the example, the source color key as the following:\r\n
        ///ARGB1555  --> ARRRRRGGGGGBBBBB                   (every character represents one bit)\r\n
        ///color_s   --> A0000000RRRRR000GGGGG000BBBBB000   (every character represents one bit)\r\n\n
        ///For GE_FMT_I8 format, the index set to b component (colorRange.color_s.b = b).\r\n
        GE_COLOR_RANGE       colorRange;
        ///Blink attribute
        ///For GE_FMT_1BAAFGBG123433 foramt, the foramt set as the GE_BLINK_DATA.\r\n
        GE_BLINK_DATA_RANGE  blkDataRange;
    }range;

    /// GERECT_FLAG_COLOR_CONSTANT: Constant color\n
    /// GERECT_FLAG_COLOR_GRADIENT_X: X direction gradient color\n
    /// GERECT_FLAG_COLOR_GRADIENT_Y: Y direction gradient color\n
    U32 flag;

} GE_RECT_FILL_INFO;

//-------------------------------------------------
#if 0
#define GEFONT_FLAG_DEFAULT             0x0
#define GEFONT_FLAG_ITALIC              0x1
#define GEFONT_FLAG_SCALE               0x2
#define GEFONT_FLAG_COMPACT             0x4
#define GEFONT_FLAG_BACKGROUND          0x8
#define GEFONT_FLAG_BLINK               0x10
#define GEFONT_FLAG_GAP                 0x20    // gap (specified by font_tab) between fonts
#endif

/// Font source information
/*
typedef struct
{
    GE_Buffer_Format fmt;
    U32 u32Width;
    U32 u32Height;
    U32 u32Pitch;
    U32 u32Addr;
} GE_TEXT_SRC_INFO;
*/


/// Font format
typedef struct
{
    /// GEFONT_FLAG_DEFAULT: Default font format\n
    /// GEFONT_FLAG_SCALE: scalable font\n
    ///  GEFONT_FLAG_COMPACT: Compact font\n
    U8 flag;

    /// dst block first character position , and each character width , height
    GE_BLOCK  dstblk;

    /// set compact distant(take indent effect) when GEFONT_FLAG_COMPACT is set
    U8 dis;

} GE_TEXT_OUT_INFO;

#if 0
typedef enum
{
    GEBLINK_NONE = 0x0,
    GEBLINK_BACKGROUND,
    GEBLINK_FOREGROUND,
    GEBLINK_BOTH,
} GE_BLINK_TYPE;
#endif

//-------------------------------------------------
typedef struct
{
    U8 flag;
    U32 delta_r;
    U32 delta_g;
    U32 delta_b;
} GEColorDelta;


//-------------------------------------------------
/// Specify the attribute of a bitmap
typedef struct
{
    /// Do scaling operation
    BOOLEAN bScale;
    /// X start address
    U16 x;
    /// Y start address
    U16 y;
    /// width
    U16 width;
    /// height
    U16 height;
} GE_DRAW_BMP_INFO;


//-------------------------------------------------
/// Define rotation angle
typedef enum
{
    /// Do not rotate
    GEROTATE_0   = 0,
    /// Rotate 90 degree
    GEROTATE_90  = 1,
    /// Rotate 180 degree
    GEROTATE_180 = 2,
    /// Rotate 270 degree
    GEROTATE_270 = 3
}GEROTATE_ANGLE;

//=============================================================================
// Font information
//=============================================================================
/// Define font offset
typedef struct
{
    ///Font offset
    U8 u8Offset;
    ///Font length (horizontal or vertical)
    U8 u8Length;
}GE_FONT_OFFSET;

/// define character information
typedef struct
{
    /// Character start address (128 bits alignment)
    U32 addr;
    /// Character width
    U32 width;
    /// Character pitch
    U32 pitch;
    /// Character height
    U32 height;
    /// Character horizontal offset
    U32 Hoffset;
    /// Character vertical offset
    U32 Voffset;
    /// Character format
    GE_Buffer_Format fmt;
} GE_CHAR_INFO;

/// Define font table information
typedef struct
{
    /// font start address
    U32 addr;
    /// font length
    U32 len;
    /// font structure is used
    BOOLEAN inUsed;
    /// character width (pixel unit)
    U32 width;
    /// character pitch (byte unit)
    U32 pitch;
    /// character height (pixel unit)
    U32 height;
    /// one character length (byte unit)
    U32 offset;
    /// horizontal font offset
    GE_FONT_OFFSET* pHOffset;
    /// vertical font offst
    GE_FONT_OFFSET* pVOffset;
    /// font format
    GE_Buffer_Format fmt;
} GE_FONT_INFO;


//=============================================================================
// Bitmap information
//=============================================================================
/// Obsoleted structure
typedef struct
{
    U32 addr;
    U32 len;
    BOOLEAN inUsed;
    U32 width;
    U32 pitch;
    U32 height;
    GE_Buffer_Format fmt;
} GE_BITMAP_INFO;


//=============================================================================
// Draw Rect info
//=============================================================================
/// Define the bitblt source & destination block.
typedef struct
{
    /// Source block
    GE_BLOCK srcblk;
    /// Destination block
    GE_BLOCK dstblk;
}GE_DRAW_RECT;

//=============================================================================
// Data Buffer info
//=============================================================================
/// Data buffer info.
typedef struct
{
    /// start memory address
    U32 u32Addr;       // flat address of whole memory map
    /// width
    U32 u32Width;
    /// height
    U32 u32Height;
    /// pitch
    U32 u32Pitch;
    /// Color format\n
    /// - GE_FMT_I1\n
    /// - GE_FMT_I2\n
    /// - GE_FMT_I4\n
    /// - GE_FMT_I8\n
    /// - GE_FMT_RGB565\n
    /// - GE_FMT_ARGB1555\n
    /// - GE_FMT_ARGB4444\n
    /// - GE_FMT_1BAAFGBG123433\n
    /// - GE_FMT_ARGB8888\n
    GE_Buffer_Format u32ColorFmt;
} GE_BUFFER_INFO2;

#define GEDRAW_FLAG_DEFAULT             0x0
#define GEDRAW_FLAG_SCALE               0x1
#define GEDRAW_FLAG_DUPLICAPE           0x2


#define FB_FMT_AS_DEFAULT               0xFFFF


//=============================================================================
// GE Driver Function
//=============================================================================

INTERFACE void MDrv_GE_Init(U16 width, U16 height, U8 mode);
INTERFACE void MDrv_GE_PE_SetIntensity(U8 id, GE_Buffer_Format fmt, U32 *pColor);
INTERFACE void MDrv_GE_RectDraw(GELineRectInfo *pRectDraw);
INTERFACE void MDrv_GE_PixelEngine(GEPESettings *PESet);
INTERFACE void MDrv_GE_SetSrcCoordinate(U16 v2_x, U16 v2_y);
INTERFACE void MDrv_GE_SetInitial_TT();

INTERFACE void MDrv_GE_SetFormat_TT(GEBlinkMode BlinkMode);
INTERFACE void MDrv_GE_EngineFire(U16 Primitive);

//INTERFACE void MDrv_GE_SetIndexColor(U8 FgIndex,U8 BgIndex);
//INTERFACE void MDrv_GE_SetI1Color(U32 FgColor,U32 BgColor);

//INTERFACE void MDrv_GE_ClearFrameBuffer(U8 miu, U32 StrAddr, U32 length, U8 ClearValue);
//INTERFACE void MDrv_GE_ClearFrameBufferByWord(U8 miu, U32 StrAddr, U32 length, U16 ClearValue);
INTERFACE void MDrv_GE_ClearFrameBuffer(U32 StrAddr, U32 length, U8 ClearValue);
INTERFACE void MDrv_GE_ClearFrameBufferByWord( U32 StrAddr, U32 length, U32 ClearValue);

#if 1
INTERFACE void MDrv_GE_DrawBitmap2(GEBitBltInfo *pBitBltInfo);
INTERFACE void MDrv_GE_FontBitBlt(GEFontInfo *pFontBitBlt, U8 (*fontAttr)[2], U8 *pindex,U8 strwidth);
#endif

INTERFACE void Font_TextOut_2(GEFontInfo *pFontBitBlt, U8 (*fontAttr)[2], U8 VarwFlag, U16 *pindex, U16 u16width);
INTERFACE void Font_TextOut_1(GEFontInfo *pFontBitBlt, U8 (*fontAttr)[2], U8 VarwFlag, U8 *pindex, U16 u16width);
INTERFACE void MDrv_GE_SET_SCK_Font(GEFontInfo *pFontBitBlt);

//end of Jeff code-----------------------------------------------------------//
//INTERFACE void MDrv_GE_Init(U16 width, U16 height);

INTERFACE void MDrv_GE_SetDither(BOOLEAN enable);

INTERFACE void MDrv_GE_SetSCK(BOOLEAN enable, GE_COLOR_KEY_MODE opMode,
    GE_Buffer_Format fmt, GERGBColor *ps_color, GERGBColor *pe_color);

INTERFACE void MDrv_GE_SetDCK(BOOLEAN enable, GE_COLOR_KEY_MODE opMode,
    GE_Buffer_Format fmt, GERGBColor *ps_color, GERGBColor *pe_color);


INTERFACE FONTHANDLE MDrv_GE_LoadFont(U32 start_addr, U32 glyph_addr, U32 bbox_addr, U32 codemap_addr, U16 u16char_num, U16 codemap_block_num, U8 width, U8 height, U8 bpp, U16 char_glyph_bytes,  U32 pitch, MEMTYPE memory_type);

INTERFACE void MDrv_GE_GetGlyphDispInfo(FONTHANDLE handle, U16 u16Unicode, GLYPH_DISP_INFO *pGlyphDispInfo);
INTERFACE void MDrv_GE_GetBBox_X(FONTHANDLE handle, U16 u16Unicode, GLYPH_BBOX_X *pGlyphBBox_X);
INTERFACE U16 MDrv_GE_UnicodeToIndex(FONTHANDLE handle, U16 u16Unicode);

INTERFACE void MDrv_GE_GetFontInfo(FONTHANDLE handle, FONT_INFO* pinfo);
INTERFACE U32 MDrv_GE_GetFontBBoxAddress(FONTHANDLE handle);

INTERFACE void MDrv_GE_TextOut(FONTHANDLE fhandle, U8 *pindex, U8 strwidth, GEClrPoint *ppoint, GEFontFmt *pfmt, GLYPH_DISP_INFO *pGlyphDispInfo);

INTERFACE void MDrv_GE_DrawCharRow ( GE_DRAWCHARROWDATA dcrData );
INTERFACE void MDrv_GE_TT_Change_Db_Base(U32 Addr,U8 Enable);


INTERFACE void MDrv_GE_LineTo(GEClrLine *pline, GELineFmt *plinefmt);
INTERFACE void MDrv_GE_SetLinePattern(U8 u8LinePattern, U8 u8RepeatFactor);
INTERFACE void MDrv_GE_ResetLinePatternIndex(void);
INTERFACE void MDrv_GE_SetLineDrawLastPixel(BOOLEAN bDrawLastPixel);


INTERFACE void MDrv_GE_Rectangle(GEClrBlock *pblock, GERectFmt *prectfmt);
INTERFACE void MDrv_GE_RectFrame(GEClrBlock *pblock, GELineFmt *plinefmt);

INTERFACE BMPHANDLE MDrv_GE_LoadBitmap(U32 addr, U32 u32len, U16 u16width, U16 u16height, U8 dstloc);

INTERFACE void MDrv_GE_DrawBitmap(BMPHANDLE handle, GEPoint *ppoint, GEBitmapFmt *pbmpfmt);

//extern void MDrv_GE_BitBlt(GEBlock *psrcblk, GEBlock *pdstblk, GEDir *pdir);
INTERFACE void MDrv_GE_BitBlt(GEBitBltInfo *BitbltInfo, GEPitBaseInfo *PitBaseInfo);

INTERFACE void MDrv_GE_DMA(U32 u32srcaddr, U32 u32dstaddr, U32 u32len, U8 type);
//INTERFACE void MDrv_GE_xMiuDMA(U8 srcMIU, U32 u32srcaddr, U8 dstMIU, U32 u32dstaddr, U32 u32len);

INTERFACE void MDrv_GE_SetAlpha(BOOLEAN enable, U8 coef, U8 db_abl, U8 abl_const);

INTERFACE void MDrv_GE_SetClipWindow(U16 left, U16 top, U16 right, U16 bottom);
INTERFACE void MDrv_GE_GetClipWindow(U16* left, U16* top, U16* right, U16* bottom);

//INTERFACE void MDrv_GE_SetRotate(U8 locRot, U8 glbRot);
INTERFACE void MDrv_GE_SetRotate(GEROTATE_ANGLE angle);
//INTERFACE void MDrv_GE_SetMirror(U8 locX, U8 locY, U8 glbX, U8 glbY);
INTERFACE void MDrv_GE_SetMirror(U8 locX, U8 locY);

//INTERFACE void MDrv_GE_SetAntiAliasing(U8 enable);

INTERFACE void MDrv_GE_SetFrameBufferInfo(U16 width, U16 height, U16 pitch, U16 fbFmt, U32 addr);
INTERFACE void MDrv_GE_GetFrameBufferInfo(U16 *width, U16 *height, U16 *pitch, U16 *fbFmt, U32 *addr);
INTERFACE void MDrv_GE_FrameBufferCopy(GE_FB_INFO srcFb, GE_FB_INFO dstFb);

//INTERFACE void MDrv_GE_SwitchMIU4GE(U8 u8GEMIU);
void MDrv_GE_TT_InitSTBB(U8 CharW, U8 CharH, U8 FntW, U8 FntH);

/// Added for verify.
INTERFACE U8 MDrv_GE_PE_CreateBuffer(U32 addr, U32 width, U32 height, GE_Buffer_Format fbFmt);
INTERFACE void MDrv_GE_PE_SetAlphaSrcFrom(GE_ALPHA_SRC_FROM eMode);
INTERFACE void MDrv_GE_SetItalic(BOOLEAN enable,U8 ini_line, U8 ini_dis, U8 delta);
INTERFACE void MDrv_GE_LineDraw(GELineRectInfo *pLineDraw);
INTERFACE void MDrv_GE_PE_SetSrcBufferInfo(PGE_BUFFER_INFO bufInfo, U32 offsetofByte);
INTERFACE void MDrv_GE_PE_SetDstBufferInfo(PGE_BUFFER_INFO bufInfo, U32 offsetofByte);
INTERFACE void MDrv_GE_ScreenCopy(GE_BLOCK *psrcblk, GE_BLOCK *pdstblk);
INTERFACE void MDrv_GE_SetLPT(BOOLEAN enable, U8 u8LinePattern, U8 u8RepeatFactor);
INTERFACE void MDrv_GE_SetAlphaBlending(GEABLSet *ABL);
INTERFACE void MDrv_GE_SetROP2(BOOLEAN enable, GE_ROP2_OP eRopMode);
INTERFACE void TextOut_common(FONTHANDLE fhandle, U8 *pindex, U8 strwidth, GEClrPoint *ppoint, GEFontFmt *pfmt, GLYPH_DISP_INFO *pGlyphDispInfo, U16 faaidx);
INTERFACE void MDrv_GE_DrawBitmap_new(BMPHANDLE handle, GEPoint *ppoint, GEBitmapFmt *pbmpfmt);
INTERFACE BMPHANDLE MDrv_GE_LoadBitmap2(U32 addr, U32 u32len, U16 u16width, U16 u16height,GE_Buffer_Format fmt ,U8 dstloc);
INTERFACE U16 MUtil_CalcPitch(U8 fbFmt, U16 width);
INTERFACE void PE_ConvertRGB2DBFmt(GE_Buffer_Format Fmt, U32 *colorinfo, U16* low, U16* high);

INTERFACE void MDrv_GE_BitBltCompress(GEBitBltInfo *BitbltInfo, GEPitBaseInfo *PitBaseInfo);
INTERFACE void MDrv_GE_SetNearestMode(BOOLEAN enable);
INTERFACE void MDrv_GE_SetPatchMode(BOOLEAN repeat);
INTERFACE void GE_Fast_Write16Reg(U8 u8addr, U16 u16val);
INTERFACE void MDrv_GE_SetAlphaCmp(BOOLEAN bEnable, PE_ALPHA_CMP_TYPE OP);
INTERFACE void MDrv_GE_SetDC_CSC_FMT(PE_DC_CSC_TYPE mode, PE_YUV_RANGE_TYPE yuv_out_range, PE_UV_RANGE_TYPE uv_in_range,
    PE_YUV_FMT_TYPE srcfmt, PE_YUV_FMT_TYPE dstfmt);
#if (GE_DEBUG_CODE == 1)
INTERFACE void MDrv_GE_RegTest(U16 nNum, U8 pattern, U32 delayCnt);
#endif

#undef INTERFACE

#endif // _DRVGE2_H_

⌨️ 快捷键说明

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