mirror of
https://gitee.com/Polarix/simplegui.git
synced 2025-06-17 13:37:52 +00:00
更正字库与位图灰度位深信息使用SGUI_UINT8,并更改对应变量名为uiDepthBits
This commit is contained in:
parent
5fe64fcdf6
commit
e97344c5c1
@ -7743,7 +7743,7 @@ const SGUI_CBYTE GB2312_H12[] = {
|
||||
|
||||
const SGUI_FONT_RES SGUI_FONT(GB2312_FZXS12) = {
|
||||
/*SGUI_INT iHeight*/ 12,
|
||||
/*SGUI_INT iDepthBits*/ 1,
|
||||
/*SGUI_UINT uiDepthBits*/ 1,
|
||||
/*SGUI_FN_IF_GET_DATA fnGetBitmap*/ SGUI_Resource_GetBitmap_GB2312,
|
||||
/*SGUI_FN_IF_STEP_NEXT fnStepNext*/ SGUI_TEXT_DECODER_GB2312,
|
||||
};
|
||||
@ -7765,7 +7765,7 @@ void SGUI_Resource_GetBitmap_GB2312(SGUI_BMP_RES* pstBitmapData,SGUI_UINT32 uiCo
|
||||
|
||||
pstBitmapData->fnGetPixel = SGUI_BMP_SCAN_MODE_DHPV;
|
||||
pstBitmapData->iHeight = pstFontRes->iHeight;
|
||||
pstBitmapData->iDepthBits = pstFontRes->iDepthBits;
|
||||
pstBitmapData->uiDepthBits = pstFontRes->uiDepthBits;
|
||||
|
||||
uiHighByte = (uiCode & 0xFF00)>>8;
|
||||
uiLowByte = uiCode & 0x00FF;
|
||||
|
@ -17,7 +17,7 @@
|
||||
//= Data type definition. =//
|
||||
//=======================================================================//
|
||||
typedef struct {
|
||||
SGUI_INT8 uiDepthBits;
|
||||
SGUI_UINT8 uiDepthBits;
|
||||
SGUI_COLOR eTextColor;
|
||||
SGUI_COLOR eFocusTextColor;
|
||||
SGUI_COLOR eBackgroundColor;
|
||||
|
@ -40,9 +40,9 @@ static void SGUI_Resource_GetBitmap_##NAME(SGUI_BMP_RES* pBitmapData,SGUI_UINT32
|
||||
{\
|
||||
SGUI_INT iCharIndex = INDEXMAPPER(uiCode);\
|
||||
if(NULL != pBitmapData) {\
|
||||
pBitmapData->iHeight = SGUI_FONT_##NAME.iHeight;\
|
||||
pBitmapData->iWidth = WIDTH;\
|
||||
pBitmapData->iDepthBits = SGUI_FONT_##NAME.iDepthBits;\
|
||||
pBitmapData->iHeight = SGUI_FONT_##NAME.iHeight;\
|
||||
pBitmapData->iWidth = WIDTH;\
|
||||
pBitmapData->uiDepthBits = SGUI_FONT_##NAME.uiDepthBits;\
|
||||
if(!bDryRun) {\
|
||||
pBitmapData->fnGetPixel = SCANMODE;\
|
||||
pBitmapData->pData = DATA_##NAME + iCharIndex*BLOCKSIZE;\
|
||||
@ -171,7 +171,7 @@ typedef struct _bmp_res
|
||||
{
|
||||
SGUI_INT iWidth;
|
||||
SGUI_INT iHeight;
|
||||
SGUI_INT iDepthBits;
|
||||
SGUI_UINT8 uiDepthBits;
|
||||
SGUI_FN_IF_BMP_GET_PIXEL fnGetPixel;
|
||||
//SGUI_COLOR (*fnGetPixel)(const struct _bmp_res* pstBitmapData,SGUI_UINT8 uiX,SGUI_UINT8 uiY);
|
||||
const SGUI_BYTE* pData;
|
||||
@ -185,7 +185,7 @@ SGUI_DEVPF_IF_DEFINE(void, SGUI_FN_IF_GET_BITMAP, (SGU
|
||||
typedef struct _font_res
|
||||
{
|
||||
SGUI_INT iHeight;
|
||||
SGUI_INT iDepthBits;
|
||||
SGUI_UINT8 uiDepthBits;
|
||||
SGUI_FN_IF_GET_BITMAP fnGetBitmap;
|
||||
SGUI_FN_IF_STEP_NEXT fnStepNext;
|
||||
}SGUI_FONT_RES;
|
||||
|
@ -625,9 +625,9 @@ void SGUI_Basic_DrawAlphaBitMap(SGUI_SCR_DEV* pstDeviceIF, SGUI_RECT* pstDisplay
|
||||
eAlpha = SGUI_Basic_BitMapScanDVPV(pstBitmapData,iBmpPixX,iBmpPixY);
|
||||
}
|
||||
|
||||
if(pstDeviceIF->uiDepthBits != pstBitmapData->iDepthBits)
|
||||
if(pstDeviceIF->uiDepthBits != pstBitmapData->uiDepthBits)
|
||||
{
|
||||
eAlpha = SGUI_Basic_MapColor(pstBitmapData->iDepthBits,eAlpha,pstDeviceIF->uiDepthBits);
|
||||
eAlpha = SGUI_Basic_MapColor(pstBitmapData->uiDepthBits,eAlpha,pstDeviceIF->uiDepthBits);
|
||||
}
|
||||
|
||||
eColor = SGUI_Basic_GetPoint(pstDeviceIF,iDrawPixX,iDrawPixY);
|
||||
@ -729,11 +729,11 @@ void SGUI_Basic_DrawBitMap(SGUI_SCR_DEV* pstDeviceIF, SGUI_RECT* pstDisplayArea,
|
||||
|
||||
if(eDrawMode == SGUI_DRAW_REVERSE)
|
||||
{
|
||||
eColor = SGUI_Basic_GetReverseColor(pstBitmapData->iDepthBits,eColor);
|
||||
eColor = SGUI_Basic_GetReverseColor(pstBitmapData->uiDepthBits,eColor);
|
||||
}
|
||||
if(pstDeviceIF->uiDepthBits != pstBitmapData->iDepthBits)
|
||||
if(pstDeviceIF->uiDepthBits != pstBitmapData->uiDepthBits)
|
||||
{
|
||||
eColor = SGUI_Basic_MapColor(pstBitmapData->iDepthBits,eColor,pstDeviceIF->uiDepthBits);
|
||||
eColor = SGUI_Basic_MapColor(pstBitmapData->uiDepthBits,eColor,pstDeviceIF->uiDepthBits);
|
||||
}
|
||||
SGUI_Basic_DrawPoint(pstDeviceIF,iDrawPixX,iDrawPixY,eColor);
|
||||
iDrawnHeightIndex ++;
|
||||
@ -773,19 +773,19 @@ SGUI_COLOR SGUI_Basic_BitMapScanDHPH(const SGUI_BMP_RES* pstBitmapData,SGUI_UI
|
||||
/* Initialize */
|
||||
/*----------------------------------*/
|
||||
eColor = 0;
|
||||
uiBytesPerRow = (pstBitmapData->iWidth * pstBitmapData->iDepthBits + 7)/8;
|
||||
uiBytesPerRow = (pstBitmapData->iWidth * pstBitmapData->uiDepthBits + 7)/8;
|
||||
pData = pstBitmapData->pData;
|
||||
/*----------------------------------*/
|
||||
/* Process */
|
||||
/*----------------------------------*/
|
||||
if( pstBitmapData->iDepthBits == 1 ||
|
||||
pstBitmapData->iDepthBits == 2 ||
|
||||
pstBitmapData->iDepthBits == 4 ||
|
||||
pstBitmapData->iDepthBits == 8 )
|
||||
if( pstBitmapData->uiDepthBits == 1 ||
|
||||
pstBitmapData->uiDepthBits == 2 ||
|
||||
pstBitmapData->uiDepthBits == 4 ||
|
||||
pstBitmapData->uiDepthBits == 8 )
|
||||
{
|
||||
pData += uiBytesPerRow * uiY + (uiX*pstBitmapData->iDepthBits)/8;
|
||||
cTemp = (*pData)>>((uiX*pstBitmapData->iDepthBits)%8);
|
||||
eColor = cTemp & ((0x1<<pstBitmapData->iDepthBits)-1);
|
||||
pData += uiBytesPerRow * uiY + (uiX*pstBitmapData->uiDepthBits)/8;
|
||||
cTemp = (*pData)>>((uiX*pstBitmapData->uiDepthBits)%8);
|
||||
eColor = cTemp & ((0x1<<pstBitmapData->uiDepthBits)-1);
|
||||
}
|
||||
return eColor;
|
||||
}
|
||||
@ -821,16 +821,16 @@ SGUI_COLOR SGUI_Basic_BitMapScanDHPV(const SGUI_BMP_RES* pstBitmapData,SGUI_UI
|
||||
/*----------------------------------*/
|
||||
/* Process */
|
||||
/*----------------------------------*/
|
||||
if( pstBitmapData->iDepthBits == 1 ||
|
||||
pstBitmapData->iDepthBits == 2 ||
|
||||
pstBitmapData->iDepthBits == 4 ||
|
||||
pstBitmapData->iDepthBits == 8 )
|
||||
if( pstBitmapData->uiDepthBits == 1 ||
|
||||
pstBitmapData->uiDepthBits == 2 ||
|
||||
pstBitmapData->uiDepthBits == 4 ||
|
||||
pstBitmapData->uiDepthBits == 8 )
|
||||
{
|
||||
uiPixelPerByte = 8 / pstBitmapData->iDepthBits;
|
||||
uiPixelPerByte = 8 / pstBitmapData->uiDepthBits;
|
||||
uiByteRow = uiY / uiPixelPerByte;
|
||||
pData += uiByteRow * pstBitmapData->iWidth + uiX;
|
||||
cTemp = (*pData)>>(uiY%uiPixelPerByte*pstBitmapData->iDepthBits);
|
||||
eColor |= cTemp & ((0x1<<pstBitmapData->iDepthBits)-1);
|
||||
cTemp = (*pData)>>(uiY%uiPixelPerByte*pstBitmapData->uiDepthBits);
|
||||
eColor |= cTemp & ((0x1<<pstBitmapData->uiDepthBits)-1);
|
||||
}
|
||||
return eColor;
|
||||
}
|
||||
@ -866,16 +866,16 @@ SGUI_COLOR SGUI_Basic_BitMapScanDVPH(const SGUI_BMP_RES* pstBitmapData,SGUI_UI
|
||||
/*----------------------------------*/
|
||||
/* Process */
|
||||
/*----------------------------------*/
|
||||
if( pstBitmapData->iDepthBits == 1 ||
|
||||
pstBitmapData->iDepthBits == 2 ||
|
||||
pstBitmapData->iDepthBits == 4 ||
|
||||
pstBitmapData->iDepthBits == 8 )
|
||||
if( pstBitmapData->uiDepthBits == 1 ||
|
||||
pstBitmapData->uiDepthBits == 2 ||
|
||||
pstBitmapData->uiDepthBits == 4 ||
|
||||
pstBitmapData->uiDepthBits == 8 )
|
||||
{
|
||||
uiPixelPerByte = 8 / pstBitmapData->iDepthBits;
|
||||
uiPixelPerByte = 8 / pstBitmapData->uiDepthBits;
|
||||
uiByteColumn = uiX / uiPixelPerByte;
|
||||
pData += uiByteColumn * pstBitmapData->iHeight + uiY;
|
||||
cTemp = (*pData)>>(uiX%uiPixelPerByte*pstBitmapData->iDepthBits);
|
||||
eColor |= cTemp & ((0x1<<pstBitmapData->iDepthBits)-1);
|
||||
cTemp = (*pData)>>(uiX%uiPixelPerByte*pstBitmapData->uiDepthBits);
|
||||
eColor |= cTemp & ((0x1<<pstBitmapData->uiDepthBits)-1);
|
||||
}
|
||||
return eColor;
|
||||
}
|
||||
@ -906,19 +906,19 @@ SGUI_COLOR SGUI_Basic_BitMapScanDVPV(const SGUI_BMP_RES* pstBitmapData,SGUI_UI
|
||||
/* Initialize */
|
||||
/*----------------------------------*/
|
||||
eColor = 0;
|
||||
uiBytesPerColomn = (pstBitmapData->iDepthBits * pstBitmapData->iHeight + 7)/8;
|
||||
uiBytesPerColomn = (pstBitmapData->uiDepthBits * pstBitmapData->iHeight + 7)/8;
|
||||
pData = pstBitmapData->pData;
|
||||
/*----------------------------------*/
|
||||
/* Process */
|
||||
/*----------------------------------*/
|
||||
if( pstBitmapData->iDepthBits == 1 ||
|
||||
pstBitmapData->iDepthBits == 2 ||
|
||||
pstBitmapData->iDepthBits == 4 ||
|
||||
pstBitmapData->iDepthBits == 8 )
|
||||
if( pstBitmapData->uiDepthBits == 1 ||
|
||||
pstBitmapData->uiDepthBits == 2 ||
|
||||
pstBitmapData->uiDepthBits == 4 ||
|
||||
pstBitmapData->uiDepthBits == 8 )
|
||||
{
|
||||
pData += uiBytesPerColomn * uiX + (uiY*pstBitmapData->iDepthBits)/8;
|
||||
cTemp = (*pData) >> ((uiY*pstBitmapData->iDepthBits)%8);
|
||||
eColor = cTemp & ((0x01 << pstBitmapData->iDepthBits)-1);
|
||||
pData += uiBytesPerColomn * uiX + (uiY*pstBitmapData->uiDepthBits)/8;
|
||||
cTemp = (*pData) >> ((uiY*pstBitmapData->uiDepthBits)%8);
|
||||
eColor = cTemp & ((0x01 << pstBitmapData->uiDepthBits)-1);
|
||||
}
|
||||
return eColor;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user