📄 gdidrv16b.c
字号:
}
else if( bEraseBack )
{
*lpDest = clBack;
}
lpDest++;
bitMask >>= 1;
}
lpDestStart += lpData->lpDestImage->bmWidthBytes;
// lpMaskStart += lpData->lpMaskImage->bmWidthBytes;
lpMaskStart += lpData->lpSrcImage->bmWidthBytes;
}
return TRUE;
}
*/
// *****************************************************************
//声明:static BOOL __BltFillTransparentPattern( _LPBLKBITBLT lpData )
//参数:
// IN lpData - _BLKBITBLT结构指针
//返回值:
// 返回TRUE
//功能描述:
// 用纯色输出透明位模(当位模bit为1时,输出;否则不输出)
//引用:
//
// *****************************************************************
static BOOL __BltFillTransparentPattern( _LPBLKBITBLT lpData )
{
LPWORD lpDestStart, lpDest;
LPCBYTE lpPattern;
WORD clrFore;
int widthBytes;
int i, j, n, rows, cols, shift;
BYTE mask, bitMask;
//目标开始地址
lpDestStart = (LPWORD)(lpData->lpDestImage->bmBits + lpData->lprcDest->top * lpData->lpDestImage->bmWidthBytes) + lpData->lprcDest->left;
lpPattern = lpData->lpBrush->pattern;
rows = lpData->lprcDest->bottom - lpData->lprcDest->top;
cols = lpData->lprcDest->right - lpData->lprcDest->left;
shift = lpData->lprcMask->left & 0x07;
clrFore = (WORD)lpData->lpBrush->color;
n = lpData->lprcDest->top;
//扫描行字节数
widthBytes = lpData->lpDestImage->bmWidthBytes;
//对每一行进行操作
for( i = 0; i < rows; i++ )
{
mask = *(lpPattern+(n&0x07));
n++;
bitMask = 0x80 >> shift;
lpDest = lpDestStart;
for( j = 0; j < cols; j++ )
{
if( bitMask == 0 )
{
bitMask = 0x80;
}
if( mask & bitMask )
{
*lpDest = (WORD)clrFore;
}
lpDest++;
bitMask >>= 1;
}
lpDestStart = (LPWORD)((LPBYTE)lpDestStart + widthBytes);
}
return TRUE;
}
#undef FUNCTION
#undef BLT_ROP
#define FUNCTION __TextSrcCopy1601
#define BLT_ROP( bDst, bSrc ) ( (bSrc) )
//#include <16bpp\textblt.h>
#include "textblt.h"
#undef FUNCTION
#undef BLT_ROP
#define FUNCTION __TextNotSrcCopy1601
#define BLT_ROP( bDst, bSrc ) ( ~(bSrc) )
//#include <16bpp\textblt.h>
#include "textblt.h"
#undef FUNCTION
#undef BLT_ROP
#define FUNCTION __TextSrcInvert1601
#define BLT_ROP( bDst, bSrc ) ( (bDst) ^ (bSrc) )
//#include <16bpp\textblt.h>
#include "textblt.h"
#undef FUNCTION
#undef BLT_ROP
#define FUNCTION __TextSrcAnd1601
#define BLT_ROP( bDst, bSrc ) ( (bDst) & (bSrc) )
//#include <16bpp\textblt.h>
#include "textblt.h"
#undef FUNCTION
#undef BLT_ROP
#define FUNCTION __TextTransparentBlt1601
#define BLT_ROP( bDst, bSrc ) ( (bSrc) )
//#include <16bpp\txttpblt.h>
#include "txttpblt.h"
#undef FUNCTION
#undef BLT_ROP
#define FUNCTION __BltFillPattern
#define BLT_ROP( bDst, bSrc ) ( (bSrc) )
//#include <16bpp\bltfpat.h>
#include "bltfpat.h"
#undef FUNCTION
#undef BLT_ROP
#define FUNCTION __BltPatInvertPattern
#define BLT_ROP( bDst, bSrc ) ( (bDst) ^ (bSrc) )
//#include <16bpp\bltfpat.h>
#include "bltfpat.h"
#undef FUNCTION
#undef BLT_ROP
#define FUNCTION __BltMergeCopy
#define BLT_ROP( bSrc, bBrush ) ( (bSrc) & (bBrush) )
#include "bltmpat.h"
//#undef FUNCTION
//#undef BLT_ROP
//#define FUNCTION __BltSrcCopyMono
//#define BLT_ROP( bDst, bSrc ) ( (bSrc) )
//#include <bltcpy1.h>
#undef FUNCTION
#undef BLT_ROP
#define FUNCTION __BltSrcCopy
#define BLT_ROP( bDst, bSrc ) ( (bSrc) )
//#include <16bpp\bltcpy.h>
#ifdef ARM_CPU
#define FAST_OP
#endif
#include "bltcpy.h"
#undef FAST_OP
#undef FUNCTION
#undef BLT_ROP
#define FUNCTION __BltSrcAnd1616
#define BLT_ROP( bDst, bSrc ) ( (bDst) & (bSrc) )
//#include <16bpp\bltcpy.h>
#include "bltcpy.h"
#undef FUNCTION
#undef BLT_ROP
#define FUNCTION __BltNotSrcCopy1616
#define BLT_ROP( bDst, bSrc ) ( ~(bSrc) )
//#include <16bpp\bltcpy.h>
#include "bltcpy.h"
#undef FUNCTION
#undef BLT_ROP
#define FUNCTION __BltSrcInvert1616
#define BLT_ROP( bDst, bSrc ) ( (bDst) ^ (bSrc) )
//#include <16bpp\bltcpy.h>
#include "bltcpy.h"
#undef FUNCTION
#undef BLT_ROP
#define FUNCTION __BltSrcPaint
#define BLT_ROP( bDst, bSrc ) ( (bDst) | (bSrc) )
//#include <16bpp\bltcpy.h>
#include "bltcpy.h"
#undef FUNCTION
#undef BLT_ROP
#define FUNCTION __BltMergePaint
#define BLT_ROP( bDst, bSrc ) ( (bDst) | (~(bSrc)) )
#include "bltcpy.h"
#undef FUNCTION
#undef BLT_ROP
#define FUNCTION __BltFillSolid
#define BLT_ROP( bDst, bColor ) ( (bColor) )
//#include <16bpp\bltfill.h>
#include "bltfill.h"
#undef FUNCTION
#undef BLT_ROP
#define FUNCTION __BltPatInvertSolid
#define BLT_ROP( bDst, bSrc ) ( (bDst) ^ (bSrc) )
//#include <16bpp\bltfill.h>
#include "bltfill.h"
#undef FUNCTION
#undef BLT_ROP
#define FUNCTION __BltDstInvert
#define BLT_ROP( bDst, bSrc ) (~(bDst))
//#include <16bpp\bltfill.h>
#include "bltfill.h"
// *****************************************************************
//声明:static BOOL _BlkBitTransparentBlt( _LPBLKBITBLT lpData )
//参数:
// IN lpData - _BLKBITBLT结构指针
//返回值:
// 返回TRUE
//功能描述:
// 透明输出位模(当位模bit为1时,输出;否则不输出)
//引用:
//
// *****************************************************************
static BOOL _BlkBitTransparentBlt( _LPBLKBITBLT lpData )
{
if( lpData->lpBrush )
return __BltFillTransparentPattern( lpData );
else if( lpData->lpSrcImage->bmBitsPixel == 1 )
{
return __TextTransparentBlt1601( lpData );
}
return FALSE;
}
//#undef FUNCTION
//#undef SRC_ROP
//#define SRC_ROP( bSrc ) ((bSrc))
//#define FUNCTION __BltMaskSrcCopy
//#include <8bpp\bltmask.h>
#undef FUNCTION
#undef MASK_BLT_ROP
#define MASK_BLT_ROP( bDest, bSrc, bMask ) ( (bMask) ? (bSrc) : ( (bSrc) ^ (bDest) ) )
#define FUNCTION __BltMaskSrcCopySrcInvert
//#include <16bpp\bltmask.h>
#include "bltmask.h"
//#undef FUNCTION
//#undef MASK_BLT_ROP
//#define MASK_BLT_ROP( bDest, bSrc, bMask ) ( (bMask) ? (bDest) : (bSrc) )
//#define FUNCTION __BltInvertMaskSrcCopy
//#include <16bpp\bltmask.h>
//#undef FUNCTION
//#undef SRC_ROP
//#define SRC_ROP( bSrc ) ((bSrc))
//#define FUNCTION __BltMaskSrcBit1Copy
//#include <8bpp\bltmask1.h>
#undef FUNCTION
#undef MASK_BLT_ROP
#define MASK_BLT_ROP( bDest, bSrc, bMask ) ((bMask) ? (bSrc) : ( (bSrc) ^ (bDest) ) )
#define FUNCTION __BltMaskBit1SrcCopySrcInvert
//#include <16bpp\bltmask1.h>
#include "bltmask1.h"
//#undef FUNCTION
//#undef MASK_BLT_ROP
//#define MASK_BLT_ROP( bDest, bSrc, bMask ) ( (bMask) ? (bDest) : (bSrc))
//#define FUNCTION __BltInvertMaskSrcBit1Copy
//#include <16bpp\bltmask1.h>
#undef FUNCTION
#undef MASK_BLT_ROP
#define MASK_BLT_ROP( bDest, bSrc, bMask ) ( (bMask) ? (bSrc) : (bDest) )
#define FUNCTION __BltMaskSrcCopyDestCopy
//#include <16bpp\bltmask.h>
#include "bltmask.h"
#undef FUNCTION
#undef MASK_BLT_ROP
#define MASK_BLT_ROP( bDest, bSrc, bMask ) ( (bMask) ? (bSrc) : (bDest) )
#define FUNCTION __BltMaskBit1SrcCopyDestCopy
//#include <16bpp\bltmask1.h>
#include "bltmask1.h"
// *****************************************************************
//声明:static BOOL _BlkBitMaskBlt( _LPBLKBITBLT lpData )
//参数:
// IN lpData - _BLKBITBLT结构指针
//返回值:
// 成功TRUE
//功能描述:
// 带屏蔽位的位块传送
//引用:
//
// *****************************************************************
static BOOL _BlkBitMaskBlt( _LPBLKBITBLT lpData )
{
if( lpData->lpMaskImage->bmBitsPixel == 1 )
{
if( lpData->dwRop == MAKEROP4(SRCCOPY, SRCINVERT) )
{
if( lpData->lpSrcImage->bmPlanes == 1 && lpData->lpSrcImage->bmBitsPixel == 1 )
{
return __BltMaskBit1SrcCopySrcInvert( lpData );
}
if( lpData->lpSrcImage->bmPlanes == 1 && lpData->lpSrcImage->bmBitsPixel == 16 )
return __BltMaskSrcCopySrcInvert( lpData );
}
else if( lpData->dwRop == MAKEROP4(SRCCOPY, 0) )
{
if( lpData->lpSrcImage->bmPlanes == 1 && lpData->lpSrcImage->bmBitsPixel == 16 )
return __BltMaskSrcCopyDestCopy( lpData );
if( lpData->lpSrcImage->bmPlanes == 1 && lpData->lpSrcImage->bmBitsPixel == 1 )
return __BltMaskBit1SrcCopyDestCopy( lpData );
}
/*
else if( lpData->dwRop == 1000 )
{
if( lpData->lpSrcImage->bmPlanes == 1 && lpData->lpSrcImage->bmBitsPixel == 1 )
{
return __BltInvertMaskSrcBit1Copy( lpData );
}
if( lpData->lpSrcImage->bmPlanes == 1 && lpData->lpSrcImage->bmBitsPixel == 16 )
return __BltInvertMaskSrcCopy( lpData );
}
*/
}
return FALSE;
}
// *****************************************************************
//声明:static BOOL _BlkBitBlt( _LPBLKBITBLT lpData )
//参数:
// IN lpData - _BLKBITBLT结构指针
//返回值:
// 成功TRUE
//功能描述:
// 位块传送
//引用:
//
// *****************************************************************
static BOOL _BlkBitBlt( _LPBLKBITBLT lpData )
{
switch( lpData->dwRop )
{
case SRCCOPY:
if( lpData->lpSrcImage->bmBitsPixel == 1 ) // mono bitmap
{
return __TextSrcCopy1601( lpData );
}
else if( lpData->lpSrcImage->bmBitsPixel == 16 )
return __BltSrcCopy( lpData );
case SRCAND:
if( lpData->lpSrcImage->bmBitsPixel == 1 ) // mono bitmap
{
return __TextSrcAnd1601( lpData );
}
else if( lpData->lpSrcImage->bmBitsPixel == 16 )
return __BltSrcAnd1616( lpData );
case SRCINVERT:
if( lpData->lpSrcImage->bmBitsPixel == 1 ) // mono bitmap
{
return __TextSrcInvert1601( lpData );
}
else if( lpData->lpSrcImage->bmBitsPixel == 16 )
return __BltSrcInvert1616( lpData );
case SRCPAINT:
return __BltSrcPaint( lpData );
case PATCOPY:
if( lpData->lpBrush == 0 )
{
return __BltFillSolid( lpData );
}
else
{
if( lpData->lpBrush->style == BS_SOLID )
{
lpData->solidColor = lpData->lpBrush->color;
return __BltFillSolid( lpData );
}
else
return __BltFillPattern( lpData );
}
case BLACKNESS:
lpData->solidColor = CL_BLACK;
return __BltFillSolid( lpData );
case WHITENESS:
lpData->solidColor = CL_WHITE;
return __BltFillSolid( lpData );
case PATINVERT:
if( lpData->lpBrush == 0 )
return __BltPatInvertSolid( lpData );
else
return __BltPatInvertPattern( lpData );
case DSTINVERT:
return __BltDstInvert( lpData );
case NOTSRCCOPY:
if( lpData->lpSrcImage->bmBitsPixel == 1 ) // mono bitmap
{
return __TextNotSrcCopy1601( lpData );
}
else if( lpData->lpSrcImage->bmBitsPixel == 16 )
return __BltNotSrcCopy1616( lpData );
case MERGECOPY:
if( lpData->lpBrush &&
lpData->lpSrcImage &&
lpData->lpSrcImage->bmBitsPixel == 16 )
{
return __BltMergeCopy( lpData );
}
case MERGEPAINT:
if( lpData->lpSrcImage )
return __BltMergePaint( lpData );
}
return FALSE;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -