2
0

PvrTcEncoder.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //============================================================================
  2. #pragma once
  3. #include "ColorRgba.h"
  4. #include "AlphaBitmap.h"
  5. #include "RgbBitmap.h"
  6. #include "RgbaBitmap.h"
  7. //============================================================================
  8. namespace Javelin
  9. {
  10. //============================================================================
  11. class AlphaBitmap;
  12. class RgbBitmap;
  13. class RgbaBitmap;
  14. class PvrTcEncoder
  15. {
  16. public:
  17. // Result must be large enough for bitmap.GetArea()/4 bytes
  18. static void EncodeAlpha2Bpp(void* result, const AlphaBitmap& bitmap);
  19. // Result must be large enough for bitmap.GetArea()/2 bytes
  20. static void EncodeAlpha4Bpp(void* result, const AlphaBitmap& bitmap);
  21. // Result must be large enough for bitmap.GetArea()/2 bytes
  22. static void EncodeRgb4Bpp(void* result, const RgbBitmap& bitmap);
  23. // Result must be large enough for bitmap.GetArea()/2 bytes
  24. static void EncodeRgb4Bpp(void* result, const RgbaBitmap& bitmap);
  25. // Result must be large enough for bitmap.GetArea()/2 bytes
  26. static void EncodeRgba4Bpp(void* result, const RgbaBitmap& bitmap);
  27. private:
  28. static unsigned GetMortonNumber(int x, int y);
  29. };
  30. //============================================================================
  31. }
  32. //============================================================================