Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

162 lines
5.9 KiB

  1. #ifndef _Blt_h
  2. #define _Blt_h
  3. // File: Blt.h
  4. // Author: Michael Marr (mikemarr)
  5. //
  6. // Description:
  7. // These are all of the blt routines that are available. It is assumed
  8. // that clipping and parameter checking has already occurred.
  9. //
  10. // History:
  11. // -@- 09/23/97 (mikemarr) copied to DXCConv from d2d\mmimage
  12. // -@- 10/28/97 (mikemarr) added colorfill routines
  13. // -@- 10/28/97 (mikemarr) added HasPixelFn/ColorFillFn arrays
  14. #ifndef _PixInfo_h
  15. #include "PixInfo.h"
  16. #endif
  17. typedef HRESULT (*ColorFillFn)(BYTE *pDstPixels, DWORD nDstPitch,
  18. DWORD nWidth, DWORD nHeight, DWORD dwColor);
  19. HRESULT ColorFill8( BYTE *pDstPixels, DWORD nDstPitch,
  20. DWORD nWidth, DWORD nHeight, DWORD dwColor);
  21. HRESULT ColorFill16( BYTE *pDstPixels, DWORD nDstPitch,
  22. DWORD nWidth, DWORD nHeight, DWORD dwColor);
  23. HRESULT ColorFill24( BYTE *pDstPixels, DWORD nDstPitch,
  24. DWORD nWidth, DWORD nHeight, DWORD dwColor);
  25. HRESULT ColorFill32( BYTE *pDstPixels, DWORD nDstPitch,
  26. DWORD nWidth, DWORD nHeight, DWORD dwColor);
  27. extern ColorFillFn g_rgColorFillFn[5];
  28. typedef HRESULT (*HasPixelFn)(const BYTE *pSrcPixels, DWORD nSrcPitch, DWORD dwPixel,
  29. DWORD nSrcWidth, DWORD nHeight, BOOL *pb);
  30. HRESULT HasPixel8( const BYTE *pSrcPixels, DWORD nSrcPitch, DWORD dwPixel,
  31. DWORD nSrcWidth, DWORD nHeight, BOOL *pb);
  32. HRESULT HasPixel16( const BYTE *pSrcPixels, DWORD nSrcPitch, DWORD dwPixel,
  33. DWORD nSrcWidth, DWORD nHeight, BOOL *pb);
  34. HRESULT HasPixel24( const BYTE *pSrcPixels, DWORD nSrcPitch, DWORD dwPixel,
  35. DWORD nSrcWidth, DWORD nHeight, BOOL *pb);
  36. HRESULT HasPixel32( const BYTE *pSrcPixels, DWORD nSrcPitch, DWORD dwPixel,
  37. DWORD nSrcWidth, DWORD nHeight, BOOL *pb);
  38. extern HasPixelFn g_rgHasPixelFn[5];
  39. //
  40. // Regular Image Bltting
  41. //
  42. // Notes:
  43. // Notice we can do subrectangle bltting by adjusting the src & dst
  44. // pixel pointers before calling these routines.
  45. // straight Blts
  46. HRESULT BltFast( const BYTE *pSrcPixels, DWORD nSrcPitch,
  47. BYTE *pDstPixels, DWORD nDstPitch,
  48. DWORD nSrcWidth, DWORD nHeight);
  49. HRESULT BltFastMirrorY( const BYTE *pSrcPixels, DWORD nSrcPitch,
  50. BYTE *pDstPixels, DWORD nDstPitch,
  51. DWORD nSrcWidth, DWORD nHeight);
  52. HRESULT BltFastRGBToRGB(const BYTE *pSrcPixels, DWORD nSrcPitch,
  53. BYTE *pDstPixels, DWORD nDstPitch,
  54. DWORD nWidth, DWORD nHeight,
  55. const CPixelInfo &pixiSrc, const CPixelInfo &pixiDst);
  56. HRESULT BltFast24To16( const BYTE *pSrcPixels, DWORD nSrcPitch,
  57. BYTE *pDstPixels, DWORD nDstPitch,
  58. DWORD nWidth, DWORD nHeight,
  59. const CPixelInfo &pixiSrc, const CPixelInfo &pixiDst);
  60. HRESULT BltFast32To32( const BYTE *pSrcPixels, DWORD nSrcPitch,
  61. BYTE *pDstPixels, DWORD nDstPitch,
  62. DWORD nWidth, DWORD nHeight,
  63. const CPixelInfo &pixiSrc, const CPixelInfo &pixiDst);
  64. HRESULT BltFast24To32( const BYTE *pSrcPixels, DWORD nSrcPitch,
  65. BYTE *pDstPixels, DWORD nDstPitch,
  66. DWORD nWidth, DWORD nHeight,
  67. const CPixelInfo &pixiSrc, const CPixelInfo &pixiDst);
  68. HRESULT BltFast8To4( const BYTE *pSrcPixels, DWORD nSrcPitch,
  69. BYTE *pDstPixels, DWORD nDstPitch,
  70. DWORD nWidth, DWORD nHeight, DWORD nOffset);
  71. HRESULT BltFast8To2( const BYTE *pSrcPixels, DWORD nSrcPitch,
  72. BYTE *pDstPixels, DWORD nDstPitch,
  73. DWORD nWidth, DWORD nHeight, DWORD nOffset);
  74. HRESULT BltFast8To1( const BYTE *pSrcPixels, long nSrcPitch,
  75. BYTE *pDstPixels, long nDstPitch,
  76. DWORD nWidth, DWORD nHeight, DWORD nOffset);
  77. // color key blt
  78. HRESULT BltFast8CK( const BYTE *pSrcPixels, DWORD nSrcPitch,
  79. BYTE *pDstPixels, DWORD nDstPitch,
  80. DWORD nSrcWidth, DWORD nHeight, DWORD dwTrans);
  81. // translation Blts
  82. HRESULT BltFast8To8T( const BYTE *pSrcPixels, long nSrcPitch,
  83. BYTE *pDstPixels, long nDstPitch,
  84. DWORD nWidth, DWORD nHeight,
  85. const BYTE *pIndexMap);
  86. HRESULT BltFast8To16T( const BYTE *pSrcPixels, long nSrcPitch,
  87. BYTE *pDstPixels, long nDstPitch,
  88. DWORD nWidth, DWORD nHeight,
  89. const BYTE *pIndexMap);
  90. HRESULT BltFast8To24T( const BYTE *pSrcPixels, long nSrcPitch,
  91. BYTE *pDstPixels, long nDstPitch,
  92. DWORD nWidth, DWORD nHeight,
  93. const BYTE *pIndexMap);
  94. HRESULT BltFast8To32T( const BYTE *pSrcPixels, long nSrcPitch,
  95. BYTE *pDstPixels, long nDstPitch,
  96. DWORD nWidth, DWORD nHeight,
  97. const BYTE *pIndexMap);
  98. //
  99. // RLE Bltting
  100. // Notes:
  101. // RLE is assumed to encode transparency as the zeroth index.
  102. //
  103. // straight Blts
  104. HRESULT BltFastRLE8(DWORD nXPos, DWORD nYPos,
  105. const BYTE *pSrcPixels, long nSrcPitch,
  106. BYTE *pDstPixels, long nDstPitch,
  107. const LPRECT prSrcRect);
  108. // translation Blts
  109. HRESULT BltFastRLE8To8T(DWORD nXPos, DWORD nYPos,
  110. const BYTE *pSrcPixels, long nSrcPitch,
  111. BYTE *pDstPixels, long nDstPitch,
  112. const LPRECT prSrcRect, const BYTE *pIndexMap);
  113. HRESULT BltFastRLE8To16T(DWORD nXPos, DWORD nYPos,
  114. const BYTE *pSrcPixels, long nSrcPitch,
  115. BYTE *pDstPixels, long nDstPitch,
  116. const LPRECT prSrcRect, const BYTE *pIndexMap);
  117. HRESULT BltFastRLE8To24T(DWORD nXPos, DWORD nYPos,
  118. const BYTE *pSrcPixels, long nSrcPitch,
  119. BYTE *pDstPixels, long nDstPitch,
  120. const LPRECT prSrcRect, const BYTE *pIndexMap);
  121. HRESULT BltFastRLE8To32T(DWORD nXPos, DWORD nYPos,
  122. const BYTE *pSrcPixels, long nSrcPitch,
  123. BYTE *pDstPixels, long nDstPitch,
  124. const LPRECT prSrcRect, const BYTE *pIndexMap);
  125. // Function: WriteXBitRow
  126. // These functions pack bytes into bit streams. Buffers with
  127. // a bit count <= sizeof(unsigned char) are passed as a buffer
  128. // of unsigned char's, buffers with a bit count <= sizeof(unsigned
  129. // short) are passed as unsigned short, etc.
  130. //void *Write4BitRow(void *pDst, const void *pSrc, unsigned int cCount);
  131. //void *Write2BitRow(void *pDst, const void *pSrc, unsigned int cCount);
  132. //void *Write1BitRow(void *pDst, const void *pSrc, unsigned int cCount);
  133. #endif