MythTV  master
mythpainter_qimage.h
Go to the documentation of this file.
1 #ifndef MYTHPAINTER_QIMAGE_H_
2 #define MYTHPAINTER_QIMAGE_H_
3 
4 // C++ includes
5 #include <list>
6 
7 // Qt includes
8 #include <QMap>
9 
10 // MythTV includes
11 #include "mythpainter.h"
12 #include "mythimage.h"
13 #include "compat.h"
14 
15 class QPainter;
16 
18 {
19  public:
22 
23  QString GetName(void) override // MythPainter
24  { return QString("QImage"); }
25  bool SupportsAnimation(void) override // MythPainter
26  { return false; }
27  bool SupportsAlpha(void) override // MythPainter
28  { return true; }
29  bool SupportsClipping(void) override // MythPainter
30  { return true; }
31 
32  void Begin(QPaintDevice *parent) override; // MythPainter
33  void End() override; // MythPainter
34 
35  void SetClipRect(const QRect &clipRect) override; // MythPainter
36  void SetClipRegion(const QRegion &region) override; // MythPainter
37  void Clear(QPaintDevice *device, const QRegion &region) override; // MythPainter
38 
39  void DrawImage(const QRect &r, MythImage *im, const QRect &src,
40  int alpha) override; // MythPainter
41  void DrawText(const QRect &r, const QString &msg, int flags,
42  const MythFontProperties &font, int alpha,
43  const QRect &boundRect) override; // MythPainter
44  void DrawRect(const QRect &area, const QBrush &fillBrush,
45  const QPen &linePen, int alpha) override; // MythPainter
46  void DrawRoundRect(const QRect &area, int cornerRadius,
47  const QBrush &fillBrush, const QPen &linePen,
48  int alpha) override; // MythPainter
49  void DrawEllipse(const QRect &area, const QBrush &fillBrush,
50  const QPen &linePen, int alpha) override; // MythPainter
51 
52  protected:
53  MythImage* GetFormatImagePriv(void) override // MythPainter
54  { return new MythImage(this); }
55  void DeleteFormatImagePriv(MythImage */*im*/) override {} // MythPainter
56 
57  void CheckPaintMode(const QRect &area);
58 
59  QPainter *m_painter {nullptr};
60  QRegion m_clipRegion;
61  QRegion m_paintedRegion;
62  bool m_copy {false};
63 };
64 
65 #endif
66 
QString GetName(void) override
bool SupportsAnimation(void) override
virtual void DrawEllipse(const QRect &area, const QBrush &fillBrush, const QPen &linePen, int alpha)
virtual void DrawRoundRect(const QRect &area, int cornerRadius, const QBrush &fillBrush, const QPen &linePen, int alpha)
unsigned char r
Definition: ParseText.cpp:329
void DeleteFormatImagePriv(MythImage *) override
virtual void End()
Definition: mythpainter.h:51
virtual void SetClipRegion(const QRegion &clipRegion)
Definition: mythpainter.cpp:52
virtual void DrawRect(const QRect &area, const QBrush &fillBrush, const QPen &linePen, int alpha)
MythImage * GetFormatImagePriv(void) override
Creates a reference counted image, call DecrRef() to delete.
virtual void Clear(QPaintDevice *device, const QRegion &region)
Definition: mythpainter.cpp:56
virtual void DrawText(const QRect &r, const QString &msg, int flags, const MythFontProperties &font, int alpha, const QRect &boundRect)
Definition: mythpainter.cpp:78
virtual void DrawImage(const QRect &dest, MythImage *im, const QRect &src, int alpha)=0
#define MUI_PUBLIC
Definition: mythuiexp.h:9
bool SupportsAlpha(void) override
bool SupportsClipping(void) override
virtual void Begin(QPaintDevice *parent)
Definition: mythpainter.h:50
virtual void SetClipRect(const QRect &clipRect)
Definition: mythpainter.cpp:48