Per-event shader effect selection and configuration. More...
#include <phosphor-animation/include/PhosphorAnimation/ShaderProfile.h>
Public Member Functions | |
| QString | effectiveEffectId () const |
| QVariantMap | effectiveParameters () const |
| ShaderProfile | withDefaults () const |
| QJsonObject | toJson () const |
| bool | operator== (const ShaderProfile &other) const |
| bool | operator!= (const ShaderProfile &other) const |
Static Public Member Functions | |
| static ShaderProfile | fromJson (const QJsonObject &obj) |
| static void | overlay (ShaderProfile &dst, const ShaderProfile &src) |
Overlay src onto dst: every engaged field in src replaces the corresponding field in dst. | |
Public Attributes | |
| std::optional< QString > | effectId |
| Which animation shader effect to apply. | |
| std::optional< QVariantMap > | parameters |
| Per-event parameter overrides for the shader. | |
Static Public Attributes | |
| static constexpr auto | JsonFieldEffectId = "effectId" |
| static constexpr auto | JsonFieldParameters = "parameters" |
Per-event shader effect selection and configuration.
Parallel to PhosphorAnimation::Profile which configures motion (curve, duration, stagger), ShaderProfile configures visual effect (which shader, with what parameters). Both use the same dot-path event namespace (window.open, editor.snapIn, etc.) but are resolved through separate trees so the two concerns evolve independently.
Same contract as Profile: std::optional fields distinguish "inherit
from parent" (nullopt) from "I explicitly chose this value" (engaged). A leaf with effectId = "dissolve" wins over a category that says effectId = "slide". A leaf with effectId = std::nullopt inherits whatever the category or baseline says.
An explicitly-empty effectId (engaged optional containing empty string) means "no shader effect for this event" — the event animates with motion only, no transition shader. This lets a child disable a parent's shader without disabling the parent's motion profile.
|
inline |
|
inline |
|
static |
|
inline |
| bool PhosphorAnimationShaders::ShaderProfile::operator== | ( | const ShaderProfile & | other | ) | const |
|
static |
Overlay src onto dst: every engaged field in src replaces the corresponding field in dst.
Unset fields in src are skipped.
| QJsonObject PhosphorAnimationShaders::ShaderProfile::toJson | ( | ) | const |
| ShaderProfile PhosphorAnimationShaders::ShaderProfile::withDefaults | ( | ) | const |
| std::optional<QString> PhosphorAnimationShaders::ShaderProfile::effectId |
Which animation shader effect to apply.
Resolved by id from AnimationShaderRegistry. std::nullopt = inherit. Empty string = explicitly no effect.
|
staticconstexpr |
|
staticconstexpr |
| std::optional<QVariantMap> PhosphorAnimationShaders::ShaderProfile::parameters |
Per-event parameter overrides for the shader.
Keys are parameter ids declared in the effect's AnimationShaderEffect::parameters. std::nullopt = inherit. Engaged-but-empty map = explicitly use all defaults.