3#pragma warning(disable:4711)
6#define FASTCALL __fastcall
13#ifdef _OPTIMIZE_DIBLIB
15#pragma optimize("g", on)
17#pragma GCC optimize("O3")
29#define _DibXlate(pBltData, ulColor) (pBltData->pfnXlate(pBltData->pxlo, ulColor))
31#define __PASTE_(s1,s2) s1##s2
32#define __PASTE(s1,s2) __PASTE_(s1,s2)
34#define __DIB_FUNCTION_NAME_SRCDST2(name, src_bpp, dst_bpp) Dib_ ## name ## _S ## src_bpp ## _D ## dst_bpp
35#define __DIB_FUNCTION_NAME_SRCDST(name, src_bpp, dst_bpp) __DIB_FUNCTION_NAME_SRCDST2(name, src_bpp, dst_bpp)
37#define __DIB_FUNCTION_NAME_DST2(name, dst_bpp) Dib_ ## name ## _D ## dst_bpp
38#define __DIB_FUNCTION_NAME_DST(name, src_bpp, dst_bpp) __DIB_FUNCTION_NAME_DST2(name, dst_bpp)
39#define __DIB_FUNCTION_NAME_SRCDSTEQ(name, src_bpp, dst_bpp) __PASTE(__DIB_FUNCTION_NAME_SRCDST2(name, src_bpp, dst_bpp), _EqSurf)
40#define __DIB_FUNCTION_NAME_SRCDSTEQL2R(name, src_bpp, dst_bpp) __PASTE(__DIB_FUNCTION_NAME_SRCDST2(name, src_bpp, dst_bpp), _EqSurfL2R)
41#define __DIB_FUNCTION_NAME_SRCDSTEQR2L(name, src_bpp, dst_bpp) __PASTE(__DIB_FUNCTION_NAME_SRCDST2(name, src_bpp, dst_bpp), _EqSurfR2L)
43#define _ReadPixel_1(pjSource, jShift) (((*(pjSource)) >> (jShift)) & 1)
44#define _WritePixel_1(pjDest, jShift, ulColor) (void)(*(pjDest) = (UCHAR)((*(pjDest) & ~(1<<(jShift))) | ((ulColor)<<(jShift))))
45#define _NextPixel_1(ppj, pjShift) (void)(((*(pjShift))--), (*(pjShift) &= 7), (*(ppj) += (*(pjShift) == 7)))
46#define _NextPixelR2L_1(ppj, pjShift) (void)(((*(pjShift))++), (*(pjShift) &= 7), (*(ppj) -= (*(pjShift) == 0)))
48#define _CALCSHIFT_1(pShift, x) (void)(*(pShift) = (7 - ((x) & 7)))
50#define _ReadPixel_4(pjSource, jShift) (((*(pjSource)) >> (jShift)) & 15)
51#define _WritePixel_4(pjDest, jShift, ulColor) (void)(*(pjDest) = (UCHAR)((*(pjDest) & ~(15<<(jShift))) | ((ulColor)<<(jShift))))
52#define _NextPixel_4(ppj, pjShift) (void)((*(ppj) += (*(pjShift) & 1)), (*(pjShift)) -= 4, *(pjShift) &= 7)
53#define _NextPixelR2L_4(ppj, pjShift) (void)((*(pjShift)) -= 4, *(pjShift) &= 7, (*(ppj) -= (*(pjShift) & 1)))
55#define _CALCSHIFT_4(pShift, x) (void)(*(pShift) = ajShift4[(x) & 1])
57#define _ReadPixel_8(pjSource, x) (*(UCHAR*)(pjSource))
58#define _WritePixel_8(pjDest, x, ulColor) (void)(*(UCHAR*)(pjDest) = (UCHAR)(ulColor))
59#define _NextPixel_8(ppj, pjShift) (void)(*(ppj) += 1)
60#define _NextPixelR2L_8(ppj, pjShift) (void)(*(ppj) -= 1)
62#define _CALCSHIFT_8(pShift, x)
64#define _ReadPixel_16(pjSource, x) (*(USHORT*)(pjSource))
65#define _WritePixel_16(pjDest, x, ulColor) (void)(*(USHORT*)(pjDest) = (USHORT)(ulColor))
66#define _NextPixel_16(ppj, pjShift) (void)(*(ppj) += 2)
67#define _NextPixelR2L_16(ppj, pjShift) (void)(*(ppj) -= 2)
69#define _CALCSHIFT_16(pShift, x)
71#define _ReadPixel_24(pjSource, x) ((pjSource)[0] | ((pjSource)[1] << 8) | ((pjSource)[2] << 16))
72#define _WritePixel_24(pjDest, x, ulColor) (void)(((pjDest)[0] = ((ulColor)&0xFF)),((pjDest)[1] = (((ulColor)>>8)&0xFF)),((pjDest)[2] = (((ulColor)>>16)&0xFF)))
73#define _NextPixel_24(ppj, pjShift) (void)(*(ppj) += 3)
74#define _NextPixelR2L_24(ppj, pjShift) (void)(*(ppj) -= 3)
76#define _CALCSHIFT_24(pShift, x)
78#define _ReadPixel_32(pjSource, x) (*(ULONG*)(pjSource))
79#define _WritePixel_32(pjDest, x, ulColor) (void)(*(ULONG*)(pjDest) = (ulColor))
80#define _NextPixel_32(ppj, pjShift) (void)(*(ppj) += 4)
81#define _NextPixelR2L_32(ppj, pjShift) (void)(*(ppj) -= 4)
83#define _CALCSHIFT_32(pShift, x)
ULONG(FASTCALL * PFN_XLATE)(XLATEOBJ *pxlo, ULONG ulColor)
_In_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ * pxlo