MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ from_lanes()

template<typename T>
T MayaFlux::ControlValue::from_lanes ( const std::array< double, k_lanes > & lanes)
inlinestaticprivatenoexcept

Definition at line 183 of file ControlValue.hpp.

184 {
185 if constexpr (is_vector<T>) {
186 T vector {};
187 for (size_t index = 0; index < glm_component_count<T>(); ++index) {
188 vector[static_cast<glm::length_t>(index)] = static_cast<float>(lanes[index]);
189 }
190 return vector;
191 } else if constexpr (is_box<T>) {
192 T box {};
193 box.min = { static_cast<float>(lanes[0]), static_cast<float>(lanes[1]), static_cast<float>(lanes[2]) };
194 box.max = { static_cast<float>(lanes[3]), static_cast<float>(lanes[4]), static_cast<float>(lanes[5]) };
195 return box;
196 } else if constexpr (std::is_enum_v<T>) {
197 return static_cast<T>(static_cast<std::underlying_type_t<T>>(lanes[0]));
198 } else if constexpr (std::same_as<T, bool>) {
199 return lanes[0] != 0.0;
200 } else {
201 return static_cast<T>(lanes[0]);
202 }
203 }
static constexpr bool is_box
static constexpr bool is_vector

References is_box, and is_vector.

Referenced by pending(), and value().

Here is the caller graph for this function: