Counter Strike : Global Offensive Source Code
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.

92 lines
2.5 KiB

  1. /*
  2. * Copyright (c) 1997-8 S3 Inc. All Rights Reserved.
  3. *
  4. * Module Name: s3_intrf.h
  5. *
  6. * Purpose: Constant, structure, and prototype definitions for S3TC
  7. * interface to DX surface
  8. *
  9. * Author: Dan Hung, Martin Hoffesommer
  10. *
  11. * Revision History:
  12. * version Beta 1.00.00-98-03-26
  13. */
  14. // Highlevel interface
  15. #ifndef NVTC_H
  16. #define NVTC_H
  17. #if defined( _WIN32 ) && !defined( _X360 )
  18. #if _MSC_VER >= 1400
  19. // This assumes that src\public is somewhere on the path
  20. // ddraw.h doesn't actually live in the system headers in VS2005.
  21. #include "..\dx9sdk\include\ddraw.h"
  22. #else
  23. #include <ddraw.h>
  24. #endif
  25. #endif
  26. // RGB encoding types
  27. #define S3TC_ENCODE_RGB_FULL 0x0
  28. #define S3TC_ENCODE_RGB_COLOR_KEY 0x1
  29. #define S3TC_ENCODE_RGB_ALPHA_COMPARE 0x2
  30. #define _S3TC_ENCODE_RGB_MASK 0xff
  31. // alpha encoding types
  32. #define S3TC_ENCODE_ALPHA_NONE 0x000
  33. #define S3TC_ENCODE_ALPHA_EXPLICIT 0x100
  34. #define S3TC_ENCODE_ALPHA_INTERPOLATED 0x200
  35. #define _S3TC_ENCODE_ALPHA_MASK 0xff00
  36. #if defined( _WIN32 ) && !defined( _X360 )
  37. // common encoding types
  38. //@@@TBD
  39. // error codes
  40. #define ERROR_ABORTED -1
  41. // Progress Callback for S3TCencode
  42. typedef BOOL (* LP_S3TC_PROGRESS_CALLBACK)(float fProgress, LPVOID lpUser1, LPVOID lpUser2);
  43. // set alpha reference value for alpha compare encoding
  44. void S3TCsetAlphaReference(int nRef);
  45. // determine number of bytes needed to compress given source image
  46. unsigned int S3TCgetEncodeSize(DDSURFACEDESC *lpDesc, // [in]
  47. unsigned int dwEncodeType // [in]
  48. );
  49. // encode (compress) given source image to given destination surface
  50. void S3TCencode(DDSURFACEDESC *lpSrc, // [in]
  51. PALETTEENTRY *lpPal, // [in], may be NULL
  52. DDSURFACEDESC *lpDest, // [out]
  53. void *lpDestBuf, // [in]
  54. unsigned int dwEncodeType, // [in]
  55. float *weight // [in]
  56. );
  57. int S3TCencodeEx(DDSURFACEDESC *lpSrc, // [in]
  58. PALETTEENTRY *lpPal, // [in], may be NULL
  59. DDSURFACEDESC *lpDest, // [out]
  60. void *lpDestBuf, // [in]
  61. unsigned int dwEncodeType, // [in]
  62. float *weight, // [in]
  63. LP_S3TC_PROGRESS_CALLBACK lpS3TCProgressProc, // [in], may be NULL
  64. LPVOID lpArg1, // in
  65. LPVOID lpArg2 // in
  66. );
  67. // determine number of bytes needed do decompress given compressed image
  68. unsigned int S3TCgetDecodeSize(DDSURFACEDESC *lpDesc);
  69. // decode (decompress) to ARGB8888
  70. void S3TCdecode(DDSURFACEDESC *lpSrc, // [in]
  71. DDSURFACEDESC *lpDest, // [out]
  72. void *lpDestBuf // [in]
  73. );
  74. #endif // _WIN32
  75. #endif // NVTC_H