Debian Codegraph @

third_party/etc2comp/EtcLib/EtcCodec/EtcBlock4x4Encoding_RG11.h

raw
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
17 #pragma once
18
19 #include "EtcBlock4x4Encoding_RGB8.h"
20 #include "EtcBlock4x4Encoding_R11.h"
21
22 namespace Etc
23 {
24 class Block4x4EncodingBits_RG11;
25
26 // ################################################################################
27 // Block4x4Encoding_RG11
28 // ################################################################################
29
30 class Block4x4Encoding_RG11 : public Block4x4Encoding_R11
31 {
32 float m_fGrnBase;
33 float m_fGrnMultiplier;
34 float m_fGrnBlockError;
35 unsigned int m_auiGrnSelectors[PIXELS];
36 unsigned int m_uiGrnModifierTableIndex;
37 public:
38
39 Block4x4Encoding_RG11(void);
40 virtual ~Block4x4Encoding_RG11(void);
41
42 virtual void InitFromSource(Block4x4 *a_pblockParent,
43 ColorFloatRGBA *a_pafrgbaSource,
44
45 unsigned char *a_paucEncodingBits, ErrorMetric a_errormetric);
46
47 virtual void InitFromEncodingBits(Block4x4 *a_pblockParent,
48 unsigned char *a_paucEncodingBits,
49 ColorFloatRGBA *a_pafrgbaSource,
50
51 ErrorMetric a_errormetric);
52
53 virtual void PerformIteration(float a_fEffort);
54
55 virtual void SetEncodingBits(void);
56
57 Block4x4EncodingBits_RG11 *m_pencodingbitsRG11;
58
59 void CalculateG11(unsigned int a_uiSelectorsUsed, float a_fBaseRadius, float a_fMultiplierRadius);
60
61 inline float GetGrnBase(void) const
62 {
63 return m_fGrnBase;
64 }
65
66 inline float GetGrnMultiplier(void) const
67 {
68 return m_fGrnMultiplier;
69 }
70
71 inline int GetGrnTableIndex(void) const
72 {
73 return m_uiGrnModifierTableIndex;
74 }
75
76 inline const unsigned int * GetGrnSelectors(void) const
77 {
78 return m_auiGrnSelectors;
79 }
80
81 };
82
83 // ----------------------------------------------------------------------------------------------------
84 //
85
86 } // namespace Etc