3#include <QCryptographicHash>
44 int AlphaMod, QRect ClipRect)
47 area.translate(XOffset, YOffset);
54 if (Element.tagName() ==
"vertexsource")
58 else if (Element.tagName() ==
"fragmentsource")
97 LOG(VB_GENERAL, LOG_WARNING,
"Failed to retrieve vertex source code for procedural texture");
100 LOG(VB_GENERAL, LOG_WARNING,
"Failed to retrieve fragment source code for procedural texture");
104 QCryptographicHash::Md5);
111 if (!f.open(QFile::ReadOnly | QFile::Text))
113 LOG(VB_GENERAL, LOG_WARNING,
"Failed to load source code for procedural texture from " +
filename);
118 QString program = in.readAll();
119 return std::make_shared<QByteArray>(program.toLatin1().constData());
virtual void DrawProcedural(QRect, int, const ProcSource &, const ProcSource &, const QString &)
virtual void SetClipRect(QRect clipRect)
void Pulse() override
Pulse is called 70 times a second to trigger a single frame of an animation.
MythUIProcedural(MythUIType *Parent, const QString &Name)
A procedural texture class.
void Finalize(void) override
Perform any post-xml parsing initialisation tasks.
void CopyFrom(MythUIType *Base) override
Copy this widgets state from another.
void CreateCopy(MythUIType *Parent) override
Copy the state of this widget to the one given, it must be of the same type.
static ShaderSource LoadShaderSource(const QString &filename)
ShaderSource m_fragmentSource
ShaderSource m_vertexSource
void DrawSelf(MythPainter *Painter, int XOffset, int YOffset, int AlphaMod, QRect ClipRect) override
bool ParseElement(const QString &FileName, QDomElement &Element, bool ShowWarnings) override
Parse the xml definition of this widget setting the state of the object accordingly.
The base class on which all widgets and screens are based.
virtual void CopyFrom(MythUIType *base)
Copy this widgets state from another.
virtual void Pulse(void)
Pulse is called 70 times a second to trigger a single frame of an animation.
virtual MythRect GetArea(void) const
If the object has a minimum area defined, return it, other wise return the default area.
virtual bool ParseElement(const QString &filename, QDomElement &element, bool showWarnings)
Parse the xml definition of this widget setting the state of the object accordingly.
static QString parseText(QDomElement &element)
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
MythUIHelper * GetMythUI()
std::shared_ptr< QByteArray > ShaderSource