Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
AnimationShaderContract.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 fuddlesworth
2// SPDX-License-Identifier: LGPL-2.1-or-later
3
4#pragma once
5
7
8#include <QString>
9
11
171namespace AnimationShaderContract {
172
201inline constexpr const char* kITime = "iTime";
202
206inline constexpr const char* kIResolution = "iResolution";
207
213inline constexpr const char* kITimeDelta = "iTimeDelta";
214
221inline constexpr const char* kIFrame = "iFrame";
222
228inline constexpr const char* kIDate = "iDate";
229
242inline constexpr const char* kIIsReversed = "iIsReversed";
243
264inline constexpr const char* kISurfaceScreenPos = "iSurfaceScreenPos";
265
273inline constexpr const char* kIAnchorSize = "iAnchorSize";
274
290inline constexpr const char* kIAnchorPosInFbo = "iAnchorPosInFbo";
291
309inline constexpr const char* kIAnchorRectInTexture = "iAnchorRectInTexture";
310
325inline constexpr int kMaxUserTextureSlots = 3;
326
333inline constexpr const char* kIMouse = "iMouse";
334
341inline constexpr const char* kCustomParamsArray = "customParams";
342
356
362
370inline QString slotKey(int vec, char comp)
371{
373}
374
376inline QString slotKey(int slot)
377{
379}
380
404inline constexpr const char* kCustomColorsArray = "customColors";
406
414inline QString colorKey(int slot)
415{
417}
418
427
444
445} // namespace AnimationShaderContract
446
447} // namespace PhosphorAnimationShaders
448
449// The compile-time link between AnimationShaderContract::kMaxUserTextureSlots
450// and PhosphorRendering::kMaxUserTextures lives in
451// libs/phosphor-animation/src/contract_pins.cpp. It cannot live in this header
452// because translation units that only need contract definitions (notably the
453// kwin-effect, which already pulls in epoxy/gl.h via KWin) must not be forced
454// to also pull in <QtQuick/QSGTextureProvider> via ShaderNodeRhi.h — epoxy and
455// Qt's qopenglext.h declare overlapping GL function-pointer typedefs that
456// conflict when both end up in the same TU.
constexpr const char * kISurfaceScreenPos
vec4 iSurfaceScreenPos — the shader surface's position in screen coords plus the host screen dimensio...
Definition AnimationShaderContract.h:264
constexpr const char * kIAnchorPosInFbo
vec2 iAnchorPosInFbo is the anchor's top-left position inside the FBO, in logical pixels.
Definition AnimationShaderContract.h:290
constexpr const char * kIAnchorSize
vec2 iAnchorSize — captured anchor (card) pixel size in logical pixels.
Definition AnimationShaderContract.h:273
QString slotKey(int vec, char comp)
Format a customParams slot key — thin forwarder onto PhosphorShaders::CustomParams::slotKey,...
Definition AnimationShaderContract.h:370
constexpr const char * kIAnchorRectInTexture
vec4 iAnchorRectInTexture — the card's UV sub-rect within uTexture0, as (x, y, width,...
Definition AnimationShaderContract.h:309
constexpr const char * kIResolution
vec2 iResolution — surface size in logical pixels.
Definition AnimationShaderContract.h:206
constexpr const char * kCustomColorsArray
vec4 customColors[N] — per-effect declared color parameter slots.
Definition AnimationShaderContract.h:404
constexpr int kMaxCustomColors
Definition AnimationShaderContract.h:405
constexpr int kMaxUserTextureSlots
Maximum number of user-declared textures per animation effect.
Definition AnimationShaderContract.h:325
constexpr const char * kIDate
vec4 iDate — local-time (year, month, day, seconds-since-midnight).
Definition AnimationShaderContract.h:228
constexpr int kMaxParameterSlots
Number of float sub-slots (4 per vec4 × 8 vec4s = 32).
Definition AnimationShaderContract.h:361
constexpr const char * kITimeDelta
float iTimeDelta — wall-clock seconds between consecutive paint ticks that fed this transition.
Definition AnimationShaderContract.h:213
constexpr const char * kIMouse
vec4 iMouse — cursor position in shader-local pixels.
Definition AnimationShaderContract.h:333
constexpr const char * kITime
float iTime — transition progress in [0.0, 1.0].
Definition AnimationShaderContract.h:201
constexpr int kMaxCustomParams
Number of vec4 slots in the customParams array (8).
Definition AnimationShaderContract.h:355
QString colorKey(int slot)
Format a customColor slot key — thin forwarder onto PhosphorShaders::CustomColors::colorKey.
Definition AnimationShaderContract.h:414
constexpr const char * kIFrame
int iFrame — per-leg frame counter.
Definition AnimationShaderContract.h:221
constexpr const char * kCustomParamsArray
vec4 customParams[N] — per-effect declared parameter slots.
Definition AnimationShaderContract.h:341
constexpr const char * kIIsReversed
int iIsReversed — direction signal for asymmetric leg rendering.
Definition AnimationShaderContract.h:242
Definition AnimationAppRule.h:17
QString colorKey(int slot)
Format a customColor key from a 0-based slot index.
Definition CustomParamsKey.h:116
constexpr int kColorCount
Number of color slots in BaseUniforms::customColors[16].
Definition CustomParamsKey.h:110
QString slotKey(int vec, char comp)
Format a customParams slot key from explicit (vec, comp) pair.
Definition CustomParamsKey.h:53
constexpr int kVecCount
Number of vec4 slots in BaseUniforms::customParams[8].
Definition CustomParamsKey.h:40
constexpr int kFlatSlotCount
Number of float sub-slots across all vec4s (4 × kVecCount).
Definition CustomParamsKey.h:46