EtcBlock4x4Encoding_RG11.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. * Copyright 2015 The Etc2Comp Authors.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #pragma once
  17. #include "EtcBlock4x4Encoding_RGB8.h"
  18. #include "EtcBlock4x4Encoding_R11.h"
  19. namespace Etc
  20. {
  21. class Block4x4EncodingBits_RG11;
  22. // ################################################################################
  23. // Block4x4Encoding_RG11
  24. // ################################################################################
  25. class Block4x4Encoding_RG11 : public Block4x4Encoding_R11
  26. {
  27. float m_fGrnBase;
  28. float m_fGrnMultiplier;
  29. float m_fGrnBlockError;
  30. unsigned int m_auiGrnSelectors[PIXELS];
  31. unsigned int m_uiGrnModifierTableIndex;
  32. public:
  33. Block4x4Encoding_RG11(void);
  34. virtual ~Block4x4Encoding_RG11(void);
  35. virtual void InitFromSource(Block4x4 *a_pblockParent,
  36. ColorFloatRGBA *a_pafrgbaSource,
  37. unsigned char *a_paucEncodingBits, ErrorMetric a_errormetric);
  38. virtual void InitFromEncodingBits(Block4x4 *a_pblockParent,
  39. unsigned char *a_paucEncodingBits,
  40. ColorFloatRGBA *a_pafrgbaSource,
  41. ErrorMetric a_errormetric);
  42. virtual void PerformIteration(float a_fEffort);
  43. virtual void SetEncodingBits(void);
  44. Block4x4EncodingBits_RG11 *m_pencodingbitsRG11;
  45. void CalculateG11(unsigned int a_uiSelectorsUsed, float a_fBaseRadius, float a_fMultiplierRadius);
  46. inline float GetGrnBase(void) const
  47. {
  48. return m_fGrnBase;
  49. }
  50. inline float GetGrnMultiplier(void) const
  51. {
  52. return m_fGrnMultiplier;
  53. }
  54. inline int GetGrnTableIndex(void) const
  55. {
  56. return m_uiGrnModifierTableIndex;
  57. }
  58. inline const unsigned int * GetGrnSelectors(void) const
  59. {
  60. return m_auiGrnSelectors;
  61. }
  62. };
  63. // ----------------------------------------------------------------------------------------------------
  64. //
  65. } // namespace Etc