colourset.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* -----------------------------------------------------------------------------
  2. Copyright (c) 2006 Simon Brown si@sjbrown.co.uk
  3. Permission is hereby granted, free of charge, to any person obtaining
  4. a copy of this software and associated documentation files (the
  5. "Software"), to deal in the Software without restriction, including
  6. without limitation the rights to use, copy, modify, merge, publish,
  7. distribute, sublicense, and/or sell copies of the Software, and to
  8. permit persons to whom the Software is furnished to do so, subject to
  9. the following conditions:
  10. The above copyright notice and this permission notice shall be included
  11. in all copies or substantial portions of the Software.
  12. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  13. OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  14. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  15. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  16. CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  17. TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  18. SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  19. -------------------------------------------------------------------------- */
  20. #ifndef SQUISH_COLOURSET_H
  21. #define SQUISH_COLOURSET_H
  22. #include "squish.h"
  23. #include "maths.h"
  24. namespace squish {
  25. /*! @brief Represents a set of block colours
  26. */
  27. class ColourSet
  28. {
  29. public:
  30. ColourSet( u8 const* rgba, int mask, int flags );
  31. int GetCount() const { return m_count; }
  32. Vec3 const* GetPoints() const { return m_points; }
  33. float const* GetWeights() const { return m_weights; }
  34. bool IsTransparent() const { return m_transparent; }
  35. void RemapIndices( u8 const* source, u8* target ) const;
  36. private:
  37. int m_count;
  38. Vec3 m_points[16];
  39. float m_weights[16];
  40. int m_remap[16];
  41. bool m_transparent;
  42. };
  43. } // namespace sqish
  44. #endif // ndef SQUISH_COLOURSET_H