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

◆ dual_field()

template<typename Lambda >
auto MayaFlux::Kinesis::dual_field ( std::string  name,
Lambda &&  fn,
std::string_view  text 
)

Build a DualField from a lambda and its stringified text.

Parameters
nameName the emitted GLSL function will carry.
fnThe lambda itself, compiled by the host.
textThe same lambda stringified, parsed into GLSL.

Domain and range are deduced from the lambda's call operator, so the returned type follows the authored signature rather than being spelled at the call site. Prefer MF_FIELD: this function cannot check that fn and text correspond, and passing a mismatched pair produces a field whose halves disagree silently.

Definition at line 140 of file DualField.hpp.

141{
143 using D = typename Sig::domain;
144 using R = typename Sig::range;
145
146 return DualField<D, R> {
147 .cpu = Tendency<D, R> { .fn = std::forward<Lambda>(fn) },
148 .source = FieldSource::parse(std::move(name), text),
149 };
150}
std::string name
Definition VKDevice.cpp:143
One authored expression carried as both a host callable and shader text.
Definition DualField.hpp:69
std::function< R(const D &)> fn
Definition Tendency.hpp:23
Typed, composable, stateless callable from domain D to range R.
Definition Tendency.hpp:22
Extracts domain and range types from a non-generic lambda.
Definition DualField.hpp:23

References MayaFlux::Kinesis::DualField< D, R >::cpu, MayaFlux::Kinesis::Tendency< D, R >::fn, name, and MayaFlux::Kinesis::FieldSource::parse().

+ Here is the call graph for this function: