6#include <PhosphorShaders/phosphorshaders_export.h>
26class IWallpaperProvider;
70 bool useZoneColor =
false;
92 bool isUserShader =
false;
93 bool isMultipass =
false;
94 bool useWallpaper =
false;
95 bool bufferFeedback =
false;
96 qreal bufferScale = 1.0;
97 QString bufferWrap = QStringLiteral(
"clamp");
99 QString bufferFilter = QStringLiteral(
"linear");
101 bool useDepthBuffer =
false;
105 return !
id.isEmpty() && (isNoneShader(
id) || shaderUrl.isValid());
130 Q_INVOKABLE QVariantMap
presetParams(
const QString& shaderId,
const QString& presetName)
const;
193 bool validateParameterValue(
const ParameterInfo& param,
const QVariant& value)
const;
194 QVariantMap shaderInfoToVariantMap(
const ShaderInfo& info)
const;
195 QVariantMap parameterInfoToVariantMap(
const ParameterInfo& param)
const;
204 static std::unique_ptr<PhosphorFsLoader::IScanStrategy> buildScanStrategy(
ShaderRegistry* self);
213 static std::unique_ptr<IWallpaperProvider> s_wallpaperProvider;
214 static QString s_cachedWallpaperPath;
215 static QImage s_cachedWallpaperImage;
216 static qint64 s_cachedWallpaperMtime;
217 static QMutex s_wallpaperCacheMutex;
223 struct WallpaperCropEntry
230 static constexpr int CropCacheCapacity = 8;
231 static std::array<WallpaperCropEntry, CropCacheCapacity> s_cachedWallpaperCrops;
232 static int s_cachedWallpaperCropNextSlot;
Registry of available shader effects.
Definition ShaderRegistry.h:56
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
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
ShaderInfo shader(const QString &id) const
static QString wallpaperPath()
static QImage loadWallpaperImage()
QVariantList availableShadersVariant() const
void onUserPathChanged(const QString &path) override
Hook invoked from setUserPath when the path actually changes.
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:142
QVariantMap validateAndCoerceParams(const QString &id, const QVariantMap ¶ms) const
QVariantMap defaultParams(const QString &id) const
bool validateParams(const QString &id, const QVariantMap ¶ms) const
static bool isNoneShader(const QString &id)
void reportShaderBakeStarted(const QString &shaderId)
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
Definition ShaderEffect.h:28
Definition ShaderRegistry.h:61
QString group
Definition ShaderRegistry.h:64
QVariant maxValue
Definition ShaderRegistry.h:69
QString uniformName() const
Convert slot to uniform name (e.g., slot 0 → "customParams1_x")
QVariant defaultValue
Definition ShaderRegistry.h:67
QString wrap
Definition ShaderRegistry.h:71
QVariant minValue
Definition ShaderRegistry.h:68
QString id
Definition ShaderRegistry.h:62
QString name
Definition ShaderRegistry.h:63
QString type
"float", "color", "int", "bool", "image"
Definition ShaderRegistry.h:65
Definition ShaderRegistry.h:78
QString vertexShaderPath
Definition ShaderRegistry.h:86
QString id
Definition ShaderRegistry.h:79
QString sourcePath
Definition ShaderRegistry.h:85
bool isValid() const
Definition ShaderRegistry.h:103
QString author
Definition ShaderRegistry.h:82
QMap< QString, QVariantMap > presets
Definition ShaderRegistry.h:91
QString category
Definition ShaderRegistry.h:89
QList< ParameterInfo > parameters
Definition ShaderRegistry.h:90
QUrl shaderUrl
Definition ShaderRegistry.h:84
QString name
Definition ShaderRegistry.h:80
QString previewPath
Definition ShaderRegistry.h:88
QStringList bufferFilters
Definition ShaderRegistry.h:100
QString description
Definition ShaderRegistry.h:81
QString version
Definition ShaderRegistry.h:83
QStringList bufferShaderPaths
Definition ShaderRegistry.h:87
QStringList bufferWraps
Definition ShaderRegistry.h:98