pvrtc.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. /******************************************************************************
  2. @File pvrtc.h
  3. @Title
  4. @Version
  5. @Copyright Copyright (C) Imagination Technologies Limited.
  6. @Platform ANSI
  7. @Description header for memtools.c (AMTC related file)
  8. ******************************************************************************/
  9. #ifndef PVRTCLIB_H
  10. #define PVRTCLIB_H
  11. #include <stdio.h>
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. /******************************************************************************/
  16. /*
  17. // Function: pvrtc_compress
  18. //
  19. // Description: Given raw, packed 32 bit ARBG data,
  20. // this routine generates the compress format as used by PowerVR MBX.
  21. //
  22. // Inputs: InputArrayRGBA Input data as a packed array of bytes (8A 8R 8G 8B)
  23. //
  24. // OutputMemory Supplied memory for storage of resulting compress data.
  25. //
  26. // nWidth
  27. // nHeight Texture dimensions: Power of 2 square textures currently
  28. // supported. Sizes are limited to 8x8 through to 2048x2048,
  29. // 16x8 through 2048x2048 for 2 bpp cases.
  30. // bMipMap Generate all mipmap levels. Recommended for rendering speed &
  31. // quality
  32. // bAlphaOn Is alpha data supplied? If not, assumed Alpha == 0xFF
  33. //
  34. // bAssumeTiles The texture wrap around the edges.
  35. //
  36. // bUse2bitFormat 2bit per pixel format. Otherwise 4bit per pixel format.
  37. */
  38. /******************************************************************************/
  39. int pvrtc_compress( void* InputArrayARGB,
  40. void* OutputMemory,
  41. int nWidth,
  42. int nHeight,
  43. int bMipMap,
  44. int bAlphaOn,
  45. int bAssumeTiles,
  46. int bUse2bitFormat);
  47. /******************************************************************************/
  48. /*
  49. // Function: pvrtc_decompress
  50. //
  51. // Description: Given an array of pixels compressed using PVR tetxure compression
  52. // generates the raw 32-bit ARGB (8A8R8G8B) array.
  53. //
  54. // Inputs:
  55. // InputMemory Supplied data of stored compressed pixels.
  56. //
  57. // OutputArrayARGB Output data as a packed array of bytes (8R 8G 8B 8A)
  58. //
  59. // nWidth
  60. // nHeight Texture dimensions: Power of 2 sizes currently
  61. // supported, and these are limited to 8x8 through to
  62. // 2048x2048. 16x8 through 2048x2048 for 2 bpp cases.
  63. // nMipMapLevel Level to be decompressed
  64. //
  65. // bAssumeTiles The texture wrap around the edges.
  66. //
  67. // bUse2bitFormat 2bit per pixel format. Otherwise 4bit per pixel.
  68. */
  69. /******************************************************************************/
  70. int pvrtc_decompress( void* OutputArrayARGB,
  71. void* InputMemory,
  72. int nWidth,
  73. int nHeight,
  74. int nMipmapLevel,
  75. int nAssumeTiles,
  76. int nCompressionMode);
  77. /*************************************************************************
  78. // The PVRTC file size.
  79. // Use it for quering the final size after compression.
  80. // nWidth Current testure width
  81. // nHeight Current testure height
  82. // bMipMap Mipmap is used
  83. // bUse2bitFormat 2bit per pixel format. Otherwise 4bit per pixel.
  84. **************************************************************************/
  85. int pvrtc_size( int nWidth,
  86. int nHeight,
  87. int bMipMap,
  88. int bUse2bitFormat
  89. );
  90. /******************************************************************************/
  91. /*
  92. // Function: pvrtc_getversion
  93. //
  94. // Description: Returns the version of PVRTC.
  95. //
  96. */
  97. /******************************************************************************/
  98. void pvrtc_get_version(unsigned int *uMayor, unsigned int *uMinor, unsigned int *uInternal, unsigned int *uBuild);
  99. /************************************************************************
  100. // pvrtc_info_output.
  101. // default output = NULL (no output)
  102. // Other values are stdout, stderr or a file created by the user
  103. *************************************************************************/
  104. void pvrtc_info_output(FILE *DebugOutput);
  105. #ifdef __cplusplus
  106. }
  107. #endif
  108. #endif /* PVRTCLIB_H */
  109. /*
  110. // END OF FILE
  111. */