PVRTextureDefines.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. /*!***********************************************************************
  2. @file PVRTextureDefines.h
  3. @copyright Copyright (c) Imagination Technologies Limited.
  4. @brief Method, template and type defines for PVRTexture.
  5. *************************************************************************/
  6. #ifndef _PVRTEXTURE_DEFINES_H
  7. #define _PVRTEXTURE_DEFINES_H
  8. //To use the PVRTexLib .dll on Windows, you need to define _WINDLL_IMPORT
  9. #ifndef PVR_DLL
  10. #if defined(_WINDLL_EXPORT)
  11. #define PVR_DLL __declspec(dllexport)
  12. //Forward declaration of various classes/structs used by this library. This exports their interfaces for DLLs.
  13. struct PVR_DLL PVRTextureHeaderV3;
  14. struct PVR_DLL MetaDataBlock;
  15. template <typename KeyType, typename DataType>
  16. class PVR_DLL CPVRTMap;
  17. template<typename T>
  18. class PVR_DLL CPVRTArray;
  19. class PVR_DLL CPVRTString;
  20. #elif defined(_WINDLL_IMPORT)
  21. #define PVR_DLL __declspec(dllimport)
  22. //Forward declaration of various classes/structs used by this library. This imports their interfaces for DLLs.
  23. struct PVR_DLL PVRTextureHeaderV3;
  24. struct PVR_DLL MetaDataBlock;
  25. template <typename KeyType, typename DataType>
  26. class PVR_DLL CPVRTMap;
  27. template<typename T>
  28. class PVR_DLL CPVRTArray;
  29. class PVR_DLL CPVRTString;
  30. #else
  31. /*!***********************************************************************
  32. @def PVR_DLL
  33. @brief Required to use PVRTexLib.dll on Windows.
  34. *************************************************************************/
  35. #define PVR_DLL
  36. #endif
  37. #endif
  38. #include "PVRTTexture.h"
  39. /*!***********************************************************************
  40. @namespace pvrtexture
  41. @brief PVRTexture namespace. Contains methods and classes for PVRTexLib.
  42. *************************************************************************/
  43. namespace pvrtexture
  44. {
  45. // Type defines for standard variable sizes.
  46. typedef signed char int8; //!< Signed 8 bit integer
  47. typedef signed short int16; //!< Signed 16 bit integer
  48. typedef signed int int32; //!< Signed 32 bit integer
  49. typedef signed long long int64; //!< Signed 64 bit integer
  50. typedef unsigned char uint8; //!< Unsigned 8 bit integer
  51. typedef unsigned short uint16; //!< Unsigned 16 bit integer
  52. typedef unsigned int uint32; //!< Unsigned 32 bit integer
  53. typedef unsigned long long uint64; //!< Unsigned 64 bit integer
  54. // Texture related constants and enumerations.
  55. /*!***********************************************************************
  56. @enum ECompressorQuality
  57. @brief Quality level to compress the texture with. Currently valid with
  58. ETC and PVRTC formats.
  59. *************************************************************************/
  60. enum ECompressorQuality
  61. {
  62. ePVRTCFastest=0, //!< PVRTC fastest
  63. ePVRTCFast, //!< PVRTC fast
  64. ePVRTCNormal, //!< PVRTC normal
  65. ePVRTCHigh, //!< PVRTC high
  66. ePVRTCBest, //!< PVRTC best
  67. eNumPVRTCModes, //!< Number of PVRTC modes
  68. eETCFast=0, //!< ETC fast
  69. eETCFastPerceptual, //!< ETC fast perceptual
  70. eETCSlow, //!< ETC slow
  71. eETCSlowPerceptual, //!< ETC slow perceptual
  72. eNumETCModes, //!< Number of ETC modes
  73. eASTCVeryFast=0, //!< ASTC very fast
  74. eASTCFast, //!< ASTC fast
  75. eASTCMedium, //!< ASTC medium
  76. eASTCThorough, //!< ASTC thorough
  77. eASTCExhaustive, //!< ASTC exhaustive
  78. eNumASTCModes //!< Number of ASTC modes
  79. };
  80. /*!***********************************************************************
  81. @enum EResizeMode
  82. @brief Texture resize mode
  83. *************************************************************************/
  84. enum EResizeMode
  85. {
  86. eResizeNearest, //!< Nearest filtering
  87. eResizeLinear, //!< Linear filtering
  88. eResizeCubic, //!< Cubic filtering, uses Catmull-Rom splines.
  89. eNumResizeModes //!< Number of resize modes
  90. };
  91. /*!***********************************************************************
  92. @enum ELegacyApi
  93. @brief Legacy API enum.
  94. *************************************************************************/
  95. enum ELegacyApi
  96. {
  97. eOGLES=1, //!< OpenGL ES 1.x
  98. eOGLES2, //!< OpenGL ES 2.0
  99. eD3DM, //!< Direct 3D M
  100. eOGL, //!< Open GL
  101. eDX9, //!< DirextX 9
  102. eDX10, //!< DirectX 10
  103. eOVG, //!< Open VG
  104. eMGL, //!< MGL
  105. };
  106. // Useful macros.
  107. /*!***************************************************************************
  108. @def TEXOFFSET2D
  109. @brief 2D texture offset
  110. *****************************************************************************/
  111. #define TEXOFFSET2D(x,y,width) ( ((x)+(y)*(width)) )
  112. /*!***************************************************************************
  113. @def TEXOFFSET3D
  114. @brief 3D texture offset
  115. *****************************************************************************/
  116. #define TEXOFFSET3D(x,y,z,width,height) ( ((x)+(y)*(width)+(z)*(width)*(height)) )
  117. /*!***************************************************************************
  118. @typedef MetaDataMap
  119. @brief Useful typedef for generating maps of MetaData blocks.
  120. *****************************************************************************/
  121. typedef CPVRTMap<uint32, CPVRTMap<uint32,MetaDataBlock> > MetaDataMap;
  122. };
  123. #endif //_PVRTEXTURE_DEFINES_H