PvrTcEncoder.h 1.3 KB

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