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.

131 lines
5.0 KiB

  1. /******************************Module*Header*******************************\
  2. *
  3. * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  4. * !! !!
  5. * !! WARNING: NOT DDK SAMPLE CODE !!
  6. * !! !!
  7. * !! This source code is provided for completeness only and should not be !!
  8. * !! used as sample code for display driver development. Only those sources !!
  9. * !! marked as sample code for a given driver component should be used for !!
  10. * !! development purposes. !!
  11. * !! !!
  12. * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  13. *
  14. * Module Name: surf_fmt.h
  15. *
  16. * Content:
  17. *
  18. * Copyright (c) 1994-1999 3Dlabs Inc. Ltd. All rights reserved.
  19. * Copyright (c) 1995-2003 Microsoft Corporation. All rights reserved.
  20. \*****************************************************************************/
  21. #ifndef __SURF_FMAT
  22. #define __SURF_FMAT
  23. #define LOG_2_32 5
  24. #define LOG_2_16 4
  25. #define LOG_2_8 3
  26. #define LOG_2_4 2
  27. #define LOG_2_2 1
  28. #define LOG_2_1 0
  29. typedef enum tagTextureColorComponents
  30. {
  31. RGB_COMPONENTS = 2,
  32. RGBA_COMPONENTS = 3,
  33. COMPONENTS_DONT_CARE = 100
  34. } TextureColorComponents;
  35. typedef enum tagSurfDeviceFormat
  36. {
  37. SURF_8888 = 0,
  38. SURF_5551_FRONT = 1,
  39. SURF_4444 = 2,
  40. SURF_4444_FRONT = 3,
  41. SURF_4444_BACK = 4,
  42. SURF_332_FRONT = 5,
  43. SURF_332_BACK = 6,
  44. SURF_121_FRONT = 7,
  45. SURF_121_BACK = 8,
  46. SURF_2321_FRONT = 9,
  47. SURF_2321_BACK = 10,
  48. SURF_232_FRONTOFF = 11,
  49. SURF_232_BACKOFF = 12,
  50. SURF_5551_BACK = 13,
  51. SURF_CI8 = 14,
  52. SURF_CI4 = 15,
  53. SURF_565_FRONT = 16,
  54. SURF_565_BACK = 17,
  55. SURF_YUV444 = 18,
  56. SURF_YUV422 = 19,
  57. // NB: These surface formats are needed for the luminance
  58. // texturemap formats. Note that you should never load the below
  59. // values into the blitter's, etc. because the texture filter unit
  60. // is the only one that knows about these formats. This is why the
  61. // formats start at 100
  62. SURF_L8 = 100,
  63. SURF_A8L8 = 101,
  64. SURF_A4L4 = 102,
  65. SURF_A8 = 103,
  66. // More fantasy formats. This time they are for Mediamatics playback
  67. SURF_MVCA = 104,
  68. SURF_MVSU = 105,
  69. SURF_MVSB = 106,
  70. SURF_FORMAT_INVALID = 0xFFFFFFFF
  71. } SurfDeviceFormat;
  72. typedef enum tagSurfFilterDeviceFormat
  73. {
  74. SURF_FILTER_A4L4 = 0,
  75. SURF_FILTER_L8 = 1,
  76. SURF_FILTER_I8 = 2,
  77. SURF_FILTER_A8 = 3,
  78. SURF_FILTER_332 = 4,
  79. SURF_FILTER_A8L8 = 5,
  80. SURF_FILTER_5551 = 6,
  81. SURF_FILTER_565 = 7,
  82. SURF_FILTER_4444 = 8,
  83. SURF_FILTER_888 = 9,
  84. SURF_FILTER_8888_OR_YUV = 10,
  85. SURF_FILTER_INVALID = 0xFFFFFFFF
  86. } SurfFilterDeviceFormat;
  87. typedef enum tagSurfDitherDeviceFormat
  88. {
  89. SURF_DITHER_8888 = P3RX_DITHERMODE_COLORFORMAT_8888,
  90. SURF_DITHER_4444 = P3RX_DITHERMODE_COLORFORMAT_4444,
  91. SURF_DITHER_5551 = P3RX_DITHERMODE_COLORFORMAT_5551,
  92. SURF_DITHER_565 = P3RX_DITHERMODE_COLORFORMAT_565,
  93. SURF_DITHER_332 = P3RX_DITHERMODE_COLORFORMAT_332,
  94. SURF_DITHER_I8 = P3RX_DITHERMODE_COLORFORMAT_CI,
  95. SURF_DITHER_INVALID = 0xFFFFFFFF
  96. } SurfDitherDeviceFormat;
  97. // A structure representing a particular surface format to use.
  98. typedef const struct tagSURF_FORMAT
  99. {
  100. SurfDeviceFormat DeviceFormat; // The number in the manual for this format
  101. DWORD dwBitsPerPixel; // The bits per pixel
  102. DWORD dwChipPixelSize; // The pixel size register on the chip
  103. TextureColorComponents ColorComponents; // The number of color components for this format
  104. DWORD dwLogPixelDepth; // The log of the pixel depth (log2(16), etc)
  105. DWORD dwRedMask; // The Red Mask
  106. DWORD dwGreenMask; // The Green Mask
  107. DWORD dwBlueMask; // The Blue Mask
  108. DWORD dwAlphaMask; // The Alpha Mask
  109. BOOL bAlpha; // Are we using the alpha in this format?
  110. SurfFilterDeviceFormat FilterFormat; // For feeding the P3RX filter unit.
  111. SurfDitherDeviceFormat DitherFormat; // For feeding the P3RX dither unit.
  112. char *pszStringFormat; // Human-readable string for debugging.
  113. } P3_SURF_FORMAT;
  114. #define SURFFORMAT_FORMAT_BITS(pSurfFormat) (((DWORD)(pSurfFormat)->DeviceFormat) & 0xF)
  115. #define SURFFORMAT_FORMATEXTENSION_BITS(pSurfFormat) (((DWORD)(pSurfFormat)->DeviceFormat & 0x10) >> 4)
  116. #define SURFFORMAT_PIXELSIZE(pSurfFormat) ((pSurfFormat)->dwChipPixelSize)
  117. #define MAX_SURFACE_FORMATS 50
  118. #endif // __SURF_FMAT