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.

82 lines
2.9 KiB

  1. /**************************************************************************\
  2. *
  3. * Copyright (c) 1999-2000 Microsoft Corporation
  4. *
  5. * Module Name:
  6. *
  7. * Scan operations
  8. *
  9. * Abstract:
  10. *
  11. * Definitions for the ScanOperation namespace.
  12. *
  13. * Notes:
  14. *
  15. * EpAlphaBlender, EpFormatConverter, and the scan operations, all use the
  16. * idea of the "closest" canonical format to a particular format.
  17. * We define this as follows: If the format is not extended,
  18. * the closest canonical format is sRGB. Otherwise, it's sRGB64.
  19. *
  20. * Revision History:
  21. *
  22. * 01/04/2000 agodfrey
  23. * Created it.
  24. *
  25. \**************************************************************************/
  26. #include "precomp.hpp"
  27. namespace ScanOperation
  28. {
  29. /**************************************************************************\
  30. *
  31. * Operations which copy pixels, preserving the pixel format.
  32. *
  33. \**************************************************************************/
  34. ScanOpFunc CopyOps[PIXFMT_MAX] =
  35. {
  36. NULL, // PIXFMT_UNDEFINED
  37. Copy_1, // PIXFMT_1BPP_INDEXED
  38. Copy_4, // PIXFMT_4BPP_INDEXED
  39. Copy_8, // PIXFMT_8BPP_INDEXED
  40. Copy_16, // PIXFMT_16BPP_GRAYSCALE
  41. Copy_16, // PIXFMT_16BPP_RGB555
  42. Copy_16, // PIXFMT_16BPP_RGB565
  43. Copy_16, // PIXFMT_16BPP_ARGB1555
  44. Copy_24, // PIXFMT_24BPP_RGB
  45. Copy_32, // PIXFMT_32BPP_RGB
  46. Copy_32, // PIXFMT_32BPP_ARGB
  47. Copy_32, // PIXFMT_32BPP_PARGB
  48. Copy_48, // PIXFMT_48BPP_RGB
  49. Copy_64, // PIXFMT_64BPP_ARGB
  50. Copy_64, // PIXFMT_64BPP_PARGB
  51. Copy_24 // PIXFMT_24BPP_BGR
  52. };
  53. /**************************************************************************\
  54. *
  55. * Operations which convert into the closest canonical format.
  56. *
  57. \**************************************************************************/
  58. ScanOpFunc ConvertIntoCanonicalOps[PIXFMT_MAX] =
  59. {
  60. NULL, // PIXFMT_UNDEFINED
  61. Convert_1_sRGB, // PIXFMT_1BPP_INDEXED
  62. Convert_4_sRGB, // PIXFMT_4BPP_INDEXED
  63. Convert_8_sRGB, // PIXFMT_8BPP_INDEXED
  64. NULL, // !!! TODO // PIXFMT_16BPP_GRAYSCALE
  65. Convert_555_sRGB, // PIXFMT_16BPP_RGB555
  66. Convert_565_sRGB, // PIXFMT_16BPP_RGB565
  67. Convert_1555_sRGB, // PIXFMT_16BPP_ARGB1555
  68. Convert_24_sRGB, // PIXFMT_24BPP_RGB
  69. Convert_32RGB_sRGB, // PIXFMT_32BPP_RGB
  70. Copy_32, // PIXFMT_32BPP_ARGB
  71. AlphaDivide_sRGB, // PIXFMT_32BPP_PARGB
  72. Convert_48_sRGB64, // PIXFMT_48BPP_RGB
  73. Copy_64, // PIXFMT_64BPP_ARGB
  74. AlphaDivide_sRGB64, // PIXFMT_64BPP_PARGB
  75. Convert_24BGR_sRGB // PIXFMT_24BPP_BGR
  76. };
  77. };