PVRTexLib.h 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. /******************************************************************************
  2. @File PVRTexLib.h
  3. @Title Console Log
  4. @Version @Version Name : etc_conversion.cpp
  5. @Copyright Copyright (C) Imagination Technologies Limited.
  6. @Platform ANSI
  7. @Description Texture processing utility class.
  8. ******************************************************************************/
  9. #ifndef PVRTEXLIB_H
  10. #define PVRTEXLIB_H
  11. /*****************************************************************************
  12. * Includes
  13. *****************************************************************************/
  14. #include "PVRTexLibGlobals.h"
  15. #include "PVRException.h"
  16. #include "CPVRTextureData.h"
  17. #include "CPVRTextureHeader.h"
  18. #include "CPVRTexture.h"
  19. namespace pvrtexlib
  20. {
  21. #ifdef __APPLE__
  22. /* The classes below are exported */
  23. #pragma GCC visibility push(default)
  24. #endif
  25. class PVR_DLL PVRTextureUtilities
  26. {
  27. public:
  28. PVRTextureUtilities();
  29. ~PVRTextureUtilities();
  30. /*******************************************************************************
  31. * Function Name : CompressPVR
  32. * In/Outputs
  33. : sCompressedTexture : Output CPVRTexture
  34. : sDecompressedTexture : Input CPVRTexture needs to be in a standard format
  35. : nMode : Parameter value for specific image compressor - eg ETC
  36. * Description : Takes a CPVRTexture in one of the standard formats
  37. * : and compresses to the pixel type specified in the destination
  38. * : PVRTexture. nMode specifies the quality mode.
  39. *******************************************************************************/
  40. void CompressPVR( CPVRTexture& sDecompressedTexture,
  41. CPVRTexture& sCompressedTexture, const int nMode=0);
  42. /*******************************************************************************
  43. * Function Name : CompressPVR
  44. * In/Outputs
  45. : sDecompressedHeader : Input CPVRTexture needs to be in a standard format
  46. : sDecompressedData : Input CPVRTexture needs to be in a standard format
  47. : sCompressedHeader : Output CPVRTextureHeader with output format set
  48. : sCompressedData : Output CPVRTextureData
  49. : nMode : Parameter value for specific image compressor - i.e. ETC
  50. * Description : Takes a CPVRTextureHeader/CPVRTextureData pair in one of the
  51. * : standard formats
  52. * : and compresses to the pixel type specified in the destination
  53. * : CPVRTextureHeader, the data goes in the destination CPVRTextureData.
  54. * : nMode specifies the quality mode.
  55. *******************************************************************************/
  56. void CompressPVR( CPVRTextureHeader &sDecompressedHeader,
  57. CPVRTextureData &sDecompressedData,
  58. CPVRTextureHeader &sCompHeader,
  59. CPVRTextureData &sCompData,
  60. const int nMode=0);
  61. /*******************************************************************************
  62. * Function Name : DecompressPVR
  63. * In/Outputs
  64. : sCompressedTexture : Input CPVRTexture
  65. : sDecompressedTexture : Output CPVRTexture will be in a standard format
  66. * Description : Takes a CPVRTexture and decompresses it into a
  67. * : standard format.
  68. *******************************************************************************/
  69. void DecompressPVR(CPVRTexture& sCompressedTexture,
  70. CPVRTexture& sDecompressedTexture,
  71. const int nMode=0);
  72. /*******************************************************************************
  73. * Function Name : DecompressPVR
  74. * In/Outputs
  75. : sCompressedHeader : Input CPVRTextureHeader
  76. : sCompressedData : Input CPVRTextureData
  77. : sDecompressedHeader : Output CPVRTextureHeader will be in a standard format
  78. : sDecompressedData : Output CPVRTextureData will be in a standard format
  79. * Description : Takes a CPVRTextureHeader/Data pair and decompresses it into a
  80. * : standard format.
  81. *******************************************************************************/
  82. void DecompressPVR( CPVRTextureHeader & sCompressedHeader,
  83. const CPVRTextureData & sCompressedData,
  84. CPVRTextureHeader & sDecompressedHeader,
  85. CPVRTextureData & sDecompressedData,
  86. const int nMode=0);
  87. /*******************************************************************************
  88. * Function Name : ProcessRawPVR
  89. * In/Outputs
  90. : sInputTexture : Input CPVRTexture needs to be in a standard format
  91. : sOutputTexture : Output CPVRTexture will be in a standard format (not necessarily the same)
  92. * Description : Takes a CPVRTexture and processes it according to the differences in the passed
  93. * : output CPVRTexture and the passed parameters. Requires the input texture
  94. * : to be in a standard format.
  95. *******************************************************************************/
  96. bool ProcessRawPVR( CPVRTexture& sInputTexture,
  97. CPVRTextureHeader& sProcessHeader,
  98. const bool bDoBleeding=false,
  99. const float fBleedRed=0.0f,
  100. const float fBleedGreen=0.0f,
  101. const float fBleedBlue=0.0f,
  102. const bool bPremultAlpha=false,
  103. E_RESIZE_MODE eResizeMode=eRESIZE_BICUBIC );
  104. /*******************************************************************************
  105. * Function Name : ProcessRawPVR
  106. * In/Outputs
  107. : sInputTexture : Input CPVRTexture needs to be in a standard format.
  108. : sOutputTexture : Output CPVRTexture
  109. * Description : Takes a CPVRTexture and decompresses it into one of the standard
  110. * : data formats.
  111. *******************************************************************************/
  112. bool ProcessRawPVR( CPVRTextureHeader& sInputHeader,
  113. CPVRTextureData& sInputData,
  114. CPVRTextureHeader& sProcessHeader,
  115. const bool bDoBleeding=false,
  116. const float fBleedRed=0.0f,
  117. const float fBleedGreen=0.0f,
  118. const float fBleedBlue=0.0f,
  119. const bool bPremultAlpha=false,
  120. E_RESIZE_MODE eResizeMode=eRESIZE_BICUBIC );
  121. /******************************************************************************
  122. * Function Name: getPVRTexLibVersion
  123. * Description : Returns the current version of the PVRTexLib
  124. *****************************************************************************/
  125. void getPVRTexLibVersion(unsigned int& iMajor, unsigned int& iMinor);
  126. private:
  127. /******************************************************************************
  128. * Internal variables
  129. *****************************************************************************/
  130. void *m_pInputHeader, *m_pOutputHeader;
  131. int m_iMode;
  132. void *m_pParams;
  133. void **m_mapPixelFormats;
  134. void *m_pConsoleLog;
  135. };
  136. #ifdef __APPLE__
  137. #pragma GCC visibility pop
  138. #endif
  139. }
  140. #endif
  141. /*****************************************************************************
  142. End of file (pvr_utils.h)
  143. *****************************************************************************/