Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
PhosphorAnimationShaders::ShaderProfile Class Reference

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"
 

Detailed Description

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.

"Set" vs "unset" semantics

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.

Member Function Documentation

◆ effectiveEffectId()

QString PhosphorAnimationShaders::ShaderProfile::effectiveEffectId ( ) const
inline

◆ effectiveParameters()

QVariantMap PhosphorAnimationShaders::ShaderProfile::effectiveParameters ( ) const
inline

◆ fromJson()

static ShaderProfile PhosphorAnimationShaders::ShaderProfile::fromJson ( const QJsonObject &  obj)
static

◆ operator!=()

bool PhosphorAnimationShaders::ShaderProfile::operator!= ( const ShaderProfile other) const
inline

◆ operator==()

bool PhosphorAnimationShaders::ShaderProfile::operator== ( const ShaderProfile other) const

◆ overlay()

static void PhosphorAnimationShaders::ShaderProfile::overlay ( ShaderProfile dst,
const ShaderProfile src 
)
static

Overlay src onto dst: every engaged field in src replaces the corresponding field in dst.

Unset fields in src are skipped.

◆ toJson()

QJsonObject PhosphorAnimationShaders::ShaderProfile::toJson ( ) const

◆ withDefaults()

ShaderProfile PhosphorAnimationShaders::ShaderProfile::withDefaults ( ) const

Member Data Documentation

◆ effectId

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.

◆ JsonFieldEffectId

constexpr auto PhosphorAnimationShaders::ShaderProfile::JsonFieldEffectId = "effectId"
staticconstexpr

◆ JsonFieldParameters

constexpr auto PhosphorAnimationShaders::ShaderProfile::JsonFieldParameters = "parameters"
staticconstexpr

◆ parameters

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.


The documentation for this class was generated from the following file: