Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
SurfaceShaderContract.h File Reference
#include <PhosphorShaders/CustomParamsKey.h>
#include <QString>

Go to the source code of this file.

Namespaces

namespace  PhosphorSurfaceShaders
namespace  PhosphorSurfaceShaders::SurfaceShaderContract
 Cross-runtime named-uniform contract for surface shaders.

Functions

bool PhosphorSurfaceShaders::SurfaceShaderContract::isValidWrapToken (const QString &wrap)
 The accepted texture / buffer wrap vocabulary — thin forwarder onto PhosphorShaders::isValidWrapToken, the cross-library canonical predicate (see <PhosphorShaders/CustomParamsKey.h> for membership and the empty-string contract).
bool PhosphorSurfaceShaders::SurfaceShaderContract::isValidFilterToken (const QString &filter)
 The accepted buffer filter vocabulary — thin forwarder onto PhosphorShaders::isValidFilterToken (see the canonical header for the hoist rationale: hand-inlined validation sites drifted, and the animation tree had none at all, so "bufferFilter": "linaer" was accepted, silently coerced by the runtime, and re-persisted to disk).
QString PhosphorSurfaceShaders::SurfaceShaderContract::slotKey (int vec, char comp)
 Format a customParams slot key — thin forwarder onto PhosphorShaders::CustomParams::slotKey, the cross-library canonical helper.
QString PhosphorSurfaceShaders::SurfaceShaderContract::slotKey (int slot)
 Flat-slot overload: slot is 0..31 across the 8 vec4 slots.
QString PhosphorSurfaceShaders::SurfaceShaderContract::colorKey (int slot)
 Format a customColor slot key — thin forwarder onto PhosphorShaders::CustomColors::colorKey.

Variables

constexpr const char * PhosphorSurfaceShaders::SurfaceShaderContract::kUTexture0 = "uTexture0"
 sampler2D uTexture0 — the live captured surface, and on the compositor it is NOT the same texture for every pack in a chain.
constexpr const char * PhosphorSurfaceShaders::SurfaceShaderContract::kUSurfaceSize = "uSurfaceSize"
 vec2 uSurfaceSize — the size of uTexture0 in device pixels.
constexpr const char * PhosphorSurfaceShaders::SurfaceShaderContract::kUSurfaceFrameTopLeft = "uSurfaceFrameTopLeft"
 vec2 uSurfaceFrameTopLeft — the content/frame rect's top-left within uTexture0, in device pixels, measured top-down (origin at the texture's top-left, +Y down).
constexpr const char * PhosphorSurfaceShaders::SurfaceShaderContract::kUSurfaceFrameSize = "uSurfaceFrameSize"
 vec2 uSurfaceFrameSize — the content/frame rect's size within uTexture0, in device pixels.
constexpr const char * PhosphorSurfaceShaders::SurfaceShaderContract::kUSurfaceScale = "uSurfaceScale"
 float uSurfaceScale — the logical-to-device pixel scale of the output the surface is on.
constexpr const char * PhosphorSurfaceShaders::SurfaceShaderContract::kUSurfaceFocused = "uSurfaceFocused"
 float uSurfaceFocused — how focused the window owning this surface is, from 0.0 to 1.0.
constexpr const char * PhosphorSurfaceShaders::SurfaceShaderContract::kITime = "iTime"
 float iTime — continuously-increasing seconds for ANIMATED surface packs (pulsing glow, shimmer, …), the same role iTime plays in the overlay / animation categories.
constexpr const char * PhosphorSurfaceShaders::SurfaceShaderContract::kUSurfaceOpacity = "uSurfaceOpacity"
 float uSurfaceOpacity — a constant 1.0 on BOTH runtimes.
constexpr const char * PhosphorSurfaceShaders::SurfaceShaderContract::kUBackdrop = "uBackdrop"
 sampler2D uBackdrop — BOTH RUNTIMES, with different content.
constexpr const char * PhosphorSurfaceShaders::SurfaceShaderContract::kUBackdropRect = "uBackdropRect"
 vec4 uBackdropRect — a sub-rect of the bound backdrop in TOP-DOWN normalized coords (xy = min, zw = size).
constexpr const char * PhosphorSurfaceShaders::SurfaceShaderContract::kUHasBackdrop = "uHasBackdrop"
 float uHasBackdrop — 1.0 when the host bound a backdrop this frame, else 0.0.
constexpr const char * PhosphorSurfaceShaders::SurfaceShaderContract::kIMouse = "iMouse"
 vec4 iMouse — cursor position for hover-reactive packs.
constexpr const char * PhosphorSurfaceShaders::SurfaceShaderContract::kUTexture1 = "uTexture1"
 sampler2D uTexture1..3 — user-declared image textures (metadata textures: logo, mask, pattern).
constexpr const char * PhosphorSurfaceShaders::SurfaceShaderContract::kUTexture2 = "uTexture2"
constexpr const char * PhosphorSurfaceShaders::SurfaceShaderContract::kUTexture3 = "uTexture3"
constexpr const char * PhosphorSurfaceShaders::SurfaceShaderContract::kIAudioSpectrumSize = "iAudioSpectrumSize"
 int iAudioSpectrumSize — number of CAVA spectrum bars, or 0 when audio is off.
constexpr const char * PhosphorSurfaceShaders::SurfaceShaderContract::kUAudioSpectrum = "uAudioSpectrum"
 sampler2D uAudioSpectrum — the CAVA spectrum as a bars×1 texture (R = bar value in 0..1).
constexpr const char * PhosphorSurfaceShaders::SurfaceShaderContract::kCustomParamsArray = "customParams"
 vec4 customParams[N] — per-effect declared parameter slots.
constexpr const char * PhosphorSurfaceShaders::SurfaceShaderContract::kCustomColorsArray = "customColors"
 vec4 customColors[N] — per-effect declared color parameter slots.
constexpr int PhosphorSurfaceShaders::SurfaceShaderContract::kMaxCustomParams = PhosphorShaders::CustomParams::kVecCount
 Number of vec4 slots in the customParams array (8).
constexpr int PhosphorSurfaceShaders::SurfaceShaderContract::kMaxCustomColors = PhosphorShaders::CustomColors::kColorCount
 Number of customColors vec4 slots (16) — the per-color-param budget.
constexpr int PhosphorSurfaceShaders::SurfaceShaderContract::kMaxParameterSlots = PhosphorShaders::CustomParams::kFlatSlotCount
 Number of float sub-slots (4 per vec4 × 8 vec4s = 32).
constexpr int PhosphorSurfaceShaders::SurfaceShaderContract::kMaxUserTextureSlots = 3
 Maximum number of user-declared textures per surface effect.