MCPcopy Create free account
hub / github.com/DragonJoker/RenderGraph / ClearColorValue

Class ClearColorValue

include/RenderGraph/FrameGraphStructs.hpp:159–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

157 };
158
159 struct ClearColorValue
160 {
161 enum class ValueIndex
162 {
163 eFloat32,
164 eInt32,
165 eUInt32,
166 };
167
168 template< typename ValueT >
169 constexpr ClearColorValue( ValueT r, ValueT g, ValueT b, ValueT a )noexcept
170 : m_value{ std::array< ValueT, 4u >{ r, g, b, a } }
171 {
172 }
173
174 constexpr explicit ClearColorValue( std::array< float, 4u > v = { 0.0f, 0.0f, 0.0f, 0.0f } )noexcept
175 : m_value{ std::move( v ) }
176 {
177 }
178
179 constexpr explicit ClearColorValue( std::array< int32_t, 4u > v )noexcept
180 : m_value{ std::move( v ) }
181 {
182 }
183
184 constexpr explicit ClearColorValue( std::array< uint32_t, 4u > v )noexcept
185 : m_value{ std::move( v ) }
186 {
187 }
188
189 constexpr bool isFloat32()const noexcept
190 {
191 return m_value.index() == uint32_t( ValueIndex::eFloat32 );
192 }
193
194 constexpr bool isInt32()const noexcept
195 {
196 return m_value.index() == uint32_t( ValueIndex::eInt32 );
197 }
198
199 constexpr bool isUInt32()const noexcept
200 {
201 return m_value.index() == uint32_t( ValueIndex::eUInt32 );
202 }
203
204 constexpr std::array< float, 4u > const & float32()const noexcept
205 {
206 return std::get< uint32_t( ValueIndex::eFloat32 ) >( m_value );
207 }
208
209 constexpr std::array< int32_t, 4u > const & int32()const noexcept
210 {
211 return std::get< uint32_t( ValueIndex::eInt32 ) >( m_value );
212 }
213
214 constexpr std::array< uint32_t, 4u > const & uint32()const noexcept
215 {
216 return std::get< uint32_t( ValueIndex::eUInt32 ) >( m_value );

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected