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

◆ extract_projected_composite_double()

template<typename ValueT , typename T >
requires (detail::is_composite_operation_data_v<T> && ArithmeticData<ValueT> && Kakshya::DataVariantElement<ValueT>)
static std::optional< CompositeFieldDoubleData > MayaFlux::Yantra::OperationHelper::extract_projected_composite_double ( const T &  compute_data,
std::string_view  field_name 
)
inlinestatic

Extract one compatible numeric field for double-based operations.

Template Parameters
ValueTExact field type in the Composite layout.
Returns
Owning values, presence, projected dimensions, and source schema.

Definition at line 141 of file OperationHelper.hpp.

143 {
144 auto projection = project_composite_field<ValueT>(compute_data, field_name);
145 if (!projection)
146 return std::nullopt;
147
148 const auto& values = std::get<std::vector<ValueT>>(projection->values);
149 CompositeFieldDoubleData result;
150 result.values.reserve(values.size());
151 for (const auto value : values)
152 result.values.push_back(static_cast<double>(value));
153 result.presence = std::get<std::vector<uint8_t>>(std::move(projection->presence));
154 result.dimensions = std::move(projection->dimensions);
155 result.modality = projection->modality;
156 result.source_structure = get_structure_info(compute_data);
157 result.field_name = field_name;
158 return result;
159 }
glm::vec3 value
std::vector< std::byte > values
Definition VDBWriter.cpp:26
static DataStructureInfo get_structure_info(const T &compute_data)
Populate DataStructureInfo from a Datum without extracting spans.

References value, values, and MayaFlux::Yantra::CompositeFieldDoubleData::values.