更正字库与位图灰度位深信息使用SGUI_UINT8,并更改对应变量名为uiDepthBits

This commit is contained in:
yuanx 2021-03-30 14:40:12 +08:00
parent 5fe64fcdf6
commit e97344c5c1
4 changed files with 43 additions and 43 deletions

View File

@ -7743,7 +7743,7 @@ const SGUI_CBYTE GB2312_H12[] = {
const SGUI_FONT_RES SGUI_FONT(GB2312_FZXS12) = { const SGUI_FONT_RES SGUI_FONT(GB2312_FZXS12) = {
/*SGUI_INT iHeight*/ 12, /*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_GET_DATA fnGetBitmap*/ SGUI_Resource_GetBitmap_GB2312,
/*SGUI_FN_IF_STEP_NEXT fnStepNext*/ SGUI_TEXT_DECODER_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->fnGetPixel = SGUI_BMP_SCAN_MODE_DHPV;
pstBitmapData->iHeight = pstFontRes->iHeight; pstBitmapData->iHeight = pstFontRes->iHeight;
pstBitmapData->iDepthBits = pstFontRes->iDepthBits; pstBitmapData->uiDepthBits = pstFontRes->uiDepthBits;
uiHighByte = (uiCode & 0xFF00)>>8; uiHighByte = (uiCode & 0xFF00)>>8;
uiLowByte = uiCode & 0x00FF; uiLowByte = uiCode & 0x00FF;

View File

@ -17,7 +17,7 @@
//= Data type definition. =// //= Data type definition. =//
//=======================================================================// //=======================================================================//
typedef struct { typedef struct {
SGUI_INT8 uiDepthBits; SGUI_UINT8 uiDepthBits;
SGUI_COLOR eTextColor; SGUI_COLOR eTextColor;
SGUI_COLOR eFocusTextColor; SGUI_COLOR eFocusTextColor;
SGUI_COLOR eBackgroundColor; SGUI_COLOR eBackgroundColor;

View File

@ -42,7 +42,7 @@ static void SGUI_Resource_GetBitmap_##NAME(SGUI_BMP_RES* pBitmapData,SGUI_UINT32
if(NULL != pBitmapData) {\ if(NULL != pBitmapData) {\
pBitmapData->iHeight = SGUI_FONT_##NAME.iHeight;\ pBitmapData->iHeight = SGUI_FONT_##NAME.iHeight;\
pBitmapData->iWidth = WIDTH;\ pBitmapData->iWidth = WIDTH;\
pBitmapData->iDepthBits = SGUI_FONT_##NAME.iDepthBits;\ pBitmapData->uiDepthBits = SGUI_FONT_##NAME.uiDepthBits;\
if(!bDryRun) {\ if(!bDryRun) {\
pBitmapData->fnGetPixel = SCANMODE;\ pBitmapData->fnGetPixel = SCANMODE;\
pBitmapData->pData = DATA_##NAME + iCharIndex*BLOCKSIZE;\ pBitmapData->pData = DATA_##NAME + iCharIndex*BLOCKSIZE;\
@ -171,7 +171,7 @@ typedef struct _bmp_res
{ {
SGUI_INT iWidth; SGUI_INT iWidth;
SGUI_INT iHeight; SGUI_INT iHeight;
SGUI_INT iDepthBits; SGUI_UINT8 uiDepthBits;
SGUI_FN_IF_BMP_GET_PIXEL fnGetPixel; SGUI_FN_IF_BMP_GET_PIXEL fnGetPixel;
//SGUI_COLOR (*fnGetPixel)(const struct _bmp_res* pstBitmapData,SGUI_UINT8 uiX,SGUI_UINT8 uiY); //SGUI_COLOR (*fnGetPixel)(const struct _bmp_res* pstBitmapData,SGUI_UINT8 uiX,SGUI_UINT8 uiY);
const SGUI_BYTE* pData; const SGUI_BYTE* pData;
@ -185,7 +185,7 @@ SGUI_DEVPF_IF_DEFINE(void, SGUI_FN_IF_GET_BITMAP, (SGU
typedef struct _font_res typedef struct _font_res
{ {
SGUI_INT iHeight; SGUI_INT iHeight;
SGUI_INT iDepthBits; SGUI_UINT8 uiDepthBits;
SGUI_FN_IF_GET_BITMAP fnGetBitmap; SGUI_FN_IF_GET_BITMAP fnGetBitmap;
SGUI_FN_IF_STEP_NEXT fnStepNext; SGUI_FN_IF_STEP_NEXT fnStepNext;
}SGUI_FONT_RES; }SGUI_FONT_RES;

View File

@ -625,9 +625,9 @@ void SGUI_Basic_DrawAlphaBitMap(SGUI_SCR_DEV* pstDeviceIF, SGUI_RECT* pstDisplay
eAlpha = SGUI_Basic_BitMapScanDVPV(pstBitmapData,iBmpPixX,iBmpPixY); 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); 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) 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); SGUI_Basic_DrawPoint(pstDeviceIF,iDrawPixX,iDrawPixY,eColor);
iDrawnHeightIndex ++; iDrawnHeightIndex ++;
@ -773,19 +773,19 @@ SGUI_COLOR SGUI_Basic_BitMapScanDHPH(const SGUI_BMP_RES* pstBitmapData,SGUI_UI
/* Initialize */ /* Initialize */
/*----------------------------------*/ /*----------------------------------*/
eColor = 0; eColor = 0;
uiBytesPerRow = (pstBitmapData->iWidth * pstBitmapData->iDepthBits + 7)/8; uiBytesPerRow = (pstBitmapData->iWidth * pstBitmapData->uiDepthBits + 7)/8;
pData = pstBitmapData->pData; pData = pstBitmapData->pData;
/*----------------------------------*/ /*----------------------------------*/
/* Process */ /* Process */
/*----------------------------------*/ /*----------------------------------*/
if( pstBitmapData->iDepthBits == 1 || if( pstBitmapData->uiDepthBits == 1 ||
pstBitmapData->iDepthBits == 2 || pstBitmapData->uiDepthBits == 2 ||
pstBitmapData->iDepthBits == 4 || pstBitmapData->uiDepthBits == 4 ||
pstBitmapData->iDepthBits == 8 ) pstBitmapData->uiDepthBits == 8 )
{ {
pData += uiBytesPerRow * uiY + (uiX*pstBitmapData->iDepthBits)/8; pData += uiBytesPerRow * uiY + (uiX*pstBitmapData->uiDepthBits)/8;
cTemp = (*pData)>>((uiX*pstBitmapData->iDepthBits)%8); cTemp = (*pData)>>((uiX*pstBitmapData->uiDepthBits)%8);
eColor = cTemp & ((0x1<<pstBitmapData->iDepthBits)-1); eColor = cTemp & ((0x1<<pstBitmapData->uiDepthBits)-1);
} }
return eColor; return eColor;
} }
@ -821,16 +821,16 @@ SGUI_COLOR SGUI_Basic_BitMapScanDHPV(const SGUI_BMP_RES* pstBitmapData,SGUI_UI
/*----------------------------------*/ /*----------------------------------*/
/* Process */ /* Process */
/*----------------------------------*/ /*----------------------------------*/
if( pstBitmapData->iDepthBits == 1 || if( pstBitmapData->uiDepthBits == 1 ||
pstBitmapData->iDepthBits == 2 || pstBitmapData->uiDepthBits == 2 ||
pstBitmapData->iDepthBits == 4 || pstBitmapData->uiDepthBits == 4 ||
pstBitmapData->iDepthBits == 8 ) pstBitmapData->uiDepthBits == 8 )
{ {
uiPixelPerByte = 8 / pstBitmapData->iDepthBits; uiPixelPerByte = 8 / pstBitmapData->uiDepthBits;
uiByteRow = uiY / uiPixelPerByte; uiByteRow = uiY / uiPixelPerByte;
pData += uiByteRow * pstBitmapData->iWidth + uiX; pData += uiByteRow * pstBitmapData->iWidth + uiX;
cTemp = (*pData)>>(uiY%uiPixelPerByte*pstBitmapData->iDepthBits); cTemp = (*pData)>>(uiY%uiPixelPerByte*pstBitmapData->uiDepthBits);
eColor |= cTemp & ((0x1<<pstBitmapData->iDepthBits)-1); eColor |= cTemp & ((0x1<<pstBitmapData->uiDepthBits)-1);
} }
return eColor; return eColor;
} }
@ -866,16 +866,16 @@ SGUI_COLOR SGUI_Basic_BitMapScanDVPH(const SGUI_BMP_RES* pstBitmapData,SGUI_UI
/*----------------------------------*/ /*----------------------------------*/
/* Process */ /* Process */
/*----------------------------------*/ /*----------------------------------*/
if( pstBitmapData->iDepthBits == 1 || if( pstBitmapData->uiDepthBits == 1 ||
pstBitmapData->iDepthBits == 2 || pstBitmapData->uiDepthBits == 2 ||
pstBitmapData->iDepthBits == 4 || pstBitmapData->uiDepthBits == 4 ||
pstBitmapData->iDepthBits == 8 ) pstBitmapData->uiDepthBits == 8 )
{ {
uiPixelPerByte = 8 / pstBitmapData->iDepthBits; uiPixelPerByte = 8 / pstBitmapData->uiDepthBits;
uiByteColumn = uiX / uiPixelPerByte; uiByteColumn = uiX / uiPixelPerByte;
pData += uiByteColumn * pstBitmapData->iHeight + uiY; pData += uiByteColumn * pstBitmapData->iHeight + uiY;
cTemp = (*pData)>>(uiX%uiPixelPerByte*pstBitmapData->iDepthBits); cTemp = (*pData)>>(uiX%uiPixelPerByte*pstBitmapData->uiDepthBits);
eColor |= cTemp & ((0x1<<pstBitmapData->iDepthBits)-1); eColor |= cTemp & ((0x1<<pstBitmapData->uiDepthBits)-1);
} }
return eColor; return eColor;
} }
@ -906,19 +906,19 @@ SGUI_COLOR SGUI_Basic_BitMapScanDVPV(const SGUI_BMP_RES* pstBitmapData,SGUI_UI
/* Initialize */ /* Initialize */
/*----------------------------------*/ /*----------------------------------*/
eColor = 0; eColor = 0;
uiBytesPerColomn = (pstBitmapData->iDepthBits * pstBitmapData->iHeight + 7)/8; uiBytesPerColomn = (pstBitmapData->uiDepthBits * pstBitmapData->iHeight + 7)/8;
pData = pstBitmapData->pData; pData = pstBitmapData->pData;
/*----------------------------------*/ /*----------------------------------*/
/* Process */ /* Process */
/*----------------------------------*/ /*----------------------------------*/
if( pstBitmapData->iDepthBits == 1 || if( pstBitmapData->uiDepthBits == 1 ||
pstBitmapData->iDepthBits == 2 || pstBitmapData->uiDepthBits == 2 ||
pstBitmapData->iDepthBits == 4 || pstBitmapData->uiDepthBits == 4 ||
pstBitmapData->iDepthBits == 8 ) pstBitmapData->uiDepthBits == 8 )
{ {
pData += uiBytesPerColomn * uiX + (uiY*pstBitmapData->iDepthBits)/8; pData += uiBytesPerColomn * uiX + (uiY*pstBitmapData->uiDepthBits)/8;
cTemp = (*pData) >> ((uiY*pstBitmapData->iDepthBits)%8); cTemp = (*pData) >> ((uiY*pstBitmapData->uiDepthBits)%8);
eColor = cTemp & ((0x01 << pstBitmapData->iDepthBits)-1); eColor = cTemp & ((0x01 << pstBitmapData->uiDepthBits)-1);
} }
return eColor; return eColor;
} }