6#include <PhosphorAnimation/phosphoranimation_export.h>
140 static QMutex latchMutex;
141 static QSet<QString> reported;
142 const QMutexLocker latchLock(&latchMutex);
143 const QString key =
effectId.value_or(QString()) + QLatin1Char(
'\x1f') + *
presetId;
144 if (!reported.contains(key)) {
145 reported.insert(key);
147 "PhosphorAnimation: ShaderProfile::effectiveParameters() read on a profile whose preset is NOT "
148 "yet applied (effectId=%s presetId=%s). The preset's values are missing from the result — "
149 "flatten with withPresetsResolved() after the tree walk-up, never per node. Reported once per "
162 return presetId.value_or(QString());
187 return !(*
this == other);
Per-event shader effect selection and configuration.
Definition ShaderProfile.h:50
static constexpr auto JsonFieldEffectId
Definition ShaderProfile.h:169
QString effectivePresetId() const
As with the decoration twin's presetIdFor, the callers are tests.
Definition ShaderProfile.h:160
std::optional< QString > presetId
The preset parameters are deltas against, resolved by id from PhosphorShaders::ShaderPresetRegistry a...
Definition ShaderProfile.h:81
QString effectiveEffectId() const
Definition ShaderProfile.h:85
static ShaderProfile fromJson(const QJsonObject &obj)
std::optional< QVariantMap > parameters
Per-event parameter overrides for the shader.
Definition ShaderProfile.h:67
static constexpr auto JsonFieldPresetId
Definition ShaderProfile.h:171
bool operator==(const ShaderProfile &other) const
QVariantMap storedParameters() const
The stored parameter map, without judgement.
Definition ShaderProfile.h:97
QVariantMap effectiveParameters() const
The parameter map a CONSUMER should render.
Definition ShaderProfile.h:122
std::optional< QString > effectId
Which animation shader effect to apply.
Definition ShaderProfile.h:55
static void overlay(ShaderProfile &dst, const ShaderProfile &src)
Overlay src onto dst: every engaged field in src replaces the corresponding field in dst.
bool operator!=(const ShaderProfile &other) const
Definition ShaderProfile.h:185
QJsonObject toJson() const
ShaderProfile withDefaults() const
static constexpr auto JsonFieldParameters
Definition ShaderProfile.h:170
The one place a presetId on an assignment turns into parameters.
Definition ShaderPresetRegistry.h:51
Definition AnimationShaderContract.h:10
PHOSPHORANIMATION_EXPORT ShaderProfile withPresetsResolved(const ShaderProfile &profile, const PhosphorShaders::ShaderPresetRegistry &presets)
Flatten profile's preset reference into its parameters.
Definition ShaderProfile.h:21