Team Fortress 2 Source Code as on 22/4/2020
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.

87 lines
2.4 KiB

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