6#include <PhosphorShaders/phosphorshaders_export.h>
143 return !
id.isEmpty() &&
shaderUrl.isValid();
156 : m_info(std::move(
info))
159 [[nodiscard]] QString
id()
const override
261 Q_INVOKABLE QVariantMap
presetParams(
const QString& shaderId,
const QString& presetName)
const;
342 bool validateParameterValue(
const ParameterInfo& param,
const QVariant& value)
const;
343 QVariantMap shaderInfoToVariantMap(
const ShaderInfo& info)
const;
344 QVariantMap parameterInfoToVariantMap(
const ParameterInfo& param)
const;
357 std::unique_ptr<PhosphorRegistry::MetadataPackLoader<ShaderPack>> m_loader;
359 static std::unique_ptr<IWallpaperProvider> s_wallpaperProvider;
360 static QString s_cachedWallpaperPath;
370 static bool s_wallpaperPathResolved;
371 static qint64 s_wallpaperPathResolvedAtMs;
372 static QImage s_cachedWallpaperImage;
373 static qint64 s_cachedWallpaperMtime;
374 static QMutex s_wallpaperCacheMutex;
380 struct WallpaperCropEntry
387 static constexpr int CropCacheCapacity = 8;
388 static std::array<WallpaperCropEntry, CropCacheCapacity> s_cachedWallpaperCrops;
389 static int s_cachedWallpaperCropNextSlot;
Definition IFactoryBase.h:27
Abstract wallpaper provider interface.
Definition IWallpaperProvider.h:17
QString displayName() const override
Definition ShaderRegistry.h:163
QString id() const override
Definition ShaderRegistry.h:159
ShaderPack(ShaderInfo info)
Definition ShaderRegistry.h:155
const ShaderInfo & info() const
Definition ShaderRegistry.h:167
ShaderRegistry(QObject *parent=nullptr)
QVariantMap shaderInfo(const QString &id) const
void reportShaderBakeFinished(const QString &shaderId, bool success, const QString &error)
void shaderCompilationStarted(const QString &shaderId)
QStringList shaderPresetNames(const QString &shaderId) const
void setUserPath(const QString &path)
static QImage loadWallpaperImage(const QRect &subGeom, const QRect &physGeom)
Return the wallpaper image cropped to the portion that a sub-region (subGeom) occupies on a physical ...
QVariantMap translateParamsToUniforms(const QString &shaderId, const QVariantMap &storedParams) const
QList< ShaderInfo > availableShaders() const
~ShaderRegistry() override
static QString paramPreamble(const ShaderInfo &info)
Build the generated #define p_<id> <glsl-accessor> preamble (T1.1) for info's declared parameters,...
static ShaderInfo parsePackMetadata(const QString &packDir, QString *error=nullptr, bool validateSchema=true)
Parse a pack directory's metadata.json into a ShaderInfo using the SAME parser the live registry uses...
ShaderInfo shader(const QString &id) const
static QString wallpaperPath()
static QImage loadWallpaperImage()
QVariantList availableShadersVariant() const
static void invalidateWallpaperCache()
void shaderCompilationFinished(const QString &shaderId, bool success, const QString &error)
QVariantList shaderPresetsVariant(const QString &shaderId) const
static QString noneShaderUuid()
bool shadersEnabled() const
Always true — once a ShaderRegistry is constructed, shader discovery and metadata are functional (the...
Definition ShaderRegistry.h:273
QVariantMap validateAndCoerceParams(const QString &id, const QVariantMap ¶ms) const
QVariantMap defaultParams(const QString &id) const
void addSearchPaths(const QStringList &paths, PhosphorFsLoader::LiveReload liveReload=PhosphorFsLoader::LiveReload::On, PhosphorFsLoader::RegistrationOrder order=PhosphorFsLoader::RegistrationOrder::LowestPriorityFirst)
bool validateParams(const QString &id, const QVariantMap ¶ms) const
static bool isNoneShader(const QString &id)
void reportShaderBakeStarted(const QString &shaderId)
void addSearchPath(const QString &path, PhosphorFsLoader::LiveReload liveReload=PhosphorFsLoader::LiveReload::On)
static std::optional< QRectF > wallpaperSliceNormalized(QSize wpSize, const QRect &physGeom, const QRect &subGeom)
The same placement as computeWallpaperCropRect, but NORMALIZED and UNCLAMPED: the slice of the wallpa...
QStringList searchPaths() const
QUrl shaderUrl(const QString &id) const
static QRect computeWallpaperCropRect(QSize wpSize, const QRect &physGeom, const QRect &subGeom)
Pure geometry helper: compute the pixel rect inside a wallpaper of size wpSize that corresponds to su...
QVariantMap presetParams(const QString &shaderId, const QString &presetName) const
RegistrationOrder
Caller's declared priority direction for registerDirectories / setDirectories input.
Definition WatchedDirectorySet.h:64
@ LowestPriorityFirst
[sys-lowest, ..., sys-highest, user] — the canonical strategy view.
Definition WatchedDirectorySet.h:69
LiveReload
Opt-in policy for directory watching.
Definition WatchedDirectorySet.h:40
@ On
Definition WatchedDirectorySet.h:42
Definition ShaderProfile.h:21
Definition ShaderRegistry.h:72
QString group
Definition ShaderRegistry.h:75
QVariant maxValue
Definition ShaderRegistry.h:80
QString uniformName() const
Convert slot to uniform name (e.g., slot 0 → "customParams1_x").
QVariant defaultValue
Definition ShaderRegistry.h:78
QString wrap
Definition ShaderRegistry.h:82
QVariant minValue
Definition ShaderRegistry.h:79
QString id
Definition ShaderRegistry.h:73
int slot
Definition ShaderRegistry.h:77
QString name
Definition ShaderRegistry.h:74
QString type
"float", "color", "int", "bool", "image"
Definition ShaderRegistry.h:76
QString unit
Unit the value is expressed in.
Definition ShaderRegistry.h:90
bool useZoneColor
Hint: consumer may bind to app-specific color.
Definition ShaderRegistry.h:81
Definition ShaderRegistry.h:97
QString vertexShaderPath
Definition ShaderRegistry.h:105
bool useWallpaper
Definition ShaderRegistry.h:118
bool useDepthBuffer
Definition ShaderRegistry.h:130
QString bufferFilter
Definition ShaderRegistry.h:128
QString id
Definition ShaderRegistry.h:98
qreal bufferScale
Definition ShaderRegistry.h:120
QString sourcePath
Definition ShaderRegistry.h:104
bool isUserShader
Definition ShaderRegistry.h:116
bool isValid() const
Definition ShaderRegistry.h:132
QString author
Definition ShaderRegistry.h:101
QMap< QString, QVariantMap > presets
Definition ShaderRegistry.h:115
QString bufferWrap
Definition ShaderRegistry.h:126
QString category
Definition ShaderRegistry.h:113
bool bufferFeedback
Definition ShaderRegistry.h:119
QList< ParameterInfo > parameters
Definition ShaderRegistry.h:114
QUrl shaderUrl
Definition ShaderRegistry.h:103
QString name
Definition ShaderRegistry.h:99
QString previewPath
Definition ShaderRegistry.h:112
QStringList bufferFilters
Definition ShaderRegistry.h:129
QString description
Definition ShaderRegistry.h:100
bool isMultipass
Definition ShaderRegistry.h:117
QString version
Definition ShaderRegistry.h:102
QStringList bufferShaderPaths
Definition ShaderRegistry.h:111
QString packDir
Absolute pack directory (where metadata.json lives).
Definition ShaderRegistry.h:110
QStringList bufferWraps
Definition ShaderRegistry.h:127
bool halfFloatBuffers
Buffer-pass texel format: RGBA16F when true (default — safe for HDR, signed data, and feedback accumu...
Definition ShaderRegistry.h:125