MythTV  master
mythpainter.cpp
Go to the documentation of this file.
1 #include <algorithm>
2 #include <complex>
3 #include <cstdint>
4 
5 // QT headers
6 #include <QRect>
7 #include <QPainter>
8 #include <QPainterPath>
9 
10 // libmythbase headers
11 #include "libmythbase/compat.h"
14 
15 // libmythui headers
16 #include "mythfontproperties.h"
17 #include "mythimage.h"
18 #include "mythuianimation.h" // UIEffects
19 
20 // Own header
21 #include "mythpainter.h"
22 
24 {
25  SetMaximumCacheSizes(64, 48);
26 }
27 
29 {
30  ExpireImages(0);
31 
32  QMutexLocker locker(&m_allocationLock);
33 
34  if (!m_allocatedImages.isEmpty())
35  {
36  LOG(VB_GENERAL, LOG_WARNING,
37  QString("MythPainter: %1 images not yet de-allocated.")
38  .arg(m_allocatedImages.size()));
39  }
40 
41  for (auto *image : qAsConst(m_allocatedImages))
42  image->SetParent(nullptr);
43  m_allocatedImages.clear();
44 }
45 
46 void MythPainter::SetClipRect(const QRect /*clipRect*/)
47 {
48 }
49 
50 void MythPainter::SetClipRegion(const QRegion & /*clipRegion*/)
51 {
52 }
53 
54 void MythPainter::Clear(QPaintDevice */*device*/, const QRegion &/*region*/)
55 {
56 }
57 
58 void MythPainter::DrawImage(int x, int y, MythImage *im, int alpha)
59 {
60  if (!im)
61  {
62  LOG(VB_GENERAL, LOG_ERR,
63  "Null image pointer passed to MythPainter::DrawImage()");
64  return;
65  }
66  QRect dest = QRect(x, y, im->width(), im->height());
67  QRect src = im->rect();
68  DrawImage(dest, im, src, alpha);
69 }
70 
71 void MythPainter::DrawImage(const QPoint topLeft, MythImage *im, int alpha)
72 {
73  DrawImage(topLeft.x(), topLeft.y(), im, alpha);
74 }
75 
76 void MythPainter::DrawText(const QRect r, const QString &msg,
77  int flags, const MythFontProperties &font,
78  int alpha, const QRect boundRect)
79 {
80  MythImage *im = GetImageFromString(msg, flags, r, font);
81  if (!im)
82  return;
83 
84  QRect destRect(boundRect);
85  QRect srcRect(0,0,r.width(),r.height());
86  if (!boundRect.isEmpty() && boundRect != r)
87  {
88  int x = 0;
89  int y = 0;
90  int width = boundRect.width();
91  int height = boundRect.height();
92 
93  if (boundRect.x() > r.x())
94  {
95  x = boundRect.x()-r.x();
96  }
97  else if (r.x() > boundRect.x())
98  {
99  destRect.setX(r.x());
100  width = (boundRect.x() + boundRect.width()) - r.x();
101  }
102 
103  if (boundRect.y() > r.y())
104  {
105  y = boundRect.y()-r.y();
106  }
107  else if (r.y() > boundRect.y())
108  {
109  destRect.setY(r.y());
110  height = (boundRect.y() + boundRect.height()) - r.y();
111  }
112 
113  if (width <= 0 || height <= 0)
114  return;
115 
116  srcRect.setRect(x,y,width,height);
117  }
118 
119  DrawImage(destRect, im, srcRect, alpha);
120  im->DecrRef();
121 }
122 
123 void MythPainter::DrawTextLayout(const QRect canvasRect,
124  const LayoutVector & layouts,
125  const FormatVector & formats,
126  const MythFontProperties & font, int alpha,
127  const QRect destRect)
128 {
129  if (canvasRect.isNull())
130  return;
131 
132  QRect canvas(canvasRect);
133  QRect dest(destRect);
134 
135  MythImage *im = GetImageFromTextLayout(layouts, formats, font,
136  canvas, dest);
137  if (!im)
138  {
139  LOG(VB_GENERAL, LOG_ERR, QString("MythPainter::DrawTextLayout: "
140  "Unable to create image."));
141  return;
142  }
143  if (im->isNull())
144  {
145  LOG(VB_GENERAL, LOG_DEBUG, QString("MythPainter::DrawTextLayout: "
146  "Rendered image is null."));
147  im->DecrRef();
148  return;
149  }
150 
151  QRect srcRect(0, 0, dest.width(), dest.height());
152  DrawImage(dest, im, srcRect, alpha);
153 
154  im->DecrRef();
155 }
156 
157 void MythPainter::DrawRect(const QRect area, const QBrush &fillBrush,
158  const QPen &linePen, int alpha)
159 {
160  MythImage *im = GetImageFromRect(area, 0, 0, fillBrush, linePen);
161  if (im)
162  {
163  DrawImage(area.x(), area.y(), im, alpha);
164  im->DecrRef();
165  }
166 }
167 
168 void MythPainter::DrawRoundRect(const QRect area, int cornerRadius,
169  const QBrush &fillBrush, const QPen &linePen,
170  int alpha)
171 {
172  MythImage *im = GetImageFromRect(area, cornerRadius, 0, fillBrush, linePen);
173  if (im)
174  {
175  DrawImage(area.x(), area.y(), im, alpha);
176  im->DecrRef();
177  }
178 }
179 
180 void MythPainter::DrawEllipse(const QRect area, const QBrush &fillBrush,
181  const QPen &linePen, int alpha)
182 {
183  MythImage *im = GetImageFromRect(area, 0, 1, fillBrush, linePen);
184  if (im)
185  {
186  DrawImage(area.x(), area.y(), im, alpha);
187  im->DecrRef();
188  }
189 }
190 
191 void MythPainter::DrawTextPriv(MythImage *im, const QString &msg, int flags,
192  const QRect r, const MythFontProperties &font)
193 {
194  if (!im)
195  return;
196 
197  QColor outlineColor;
198  int outlineSize = 0;
199  int outlineAlpha = 255;
200  if (font.hasOutline())
201  font.GetOutline(outlineColor, outlineSize, outlineAlpha);
202 
203  QPoint shadowOffset(0, 0);
204  QColor shadowColor;
205  int shadowAlpha = 255;
206  if (font.hasShadow())
207  font.GetShadow(shadowOffset, shadowColor, shadowAlpha);
208 
209  QFontMetrics fm(font.face());
210  int totalHeight = fm.height() + outlineSize +
211  std::max(outlineSize, std::abs(shadowOffset.y()));
212 
213  // initialPaddingX is the number of pixels from the left of the
214  // input QRect to the left of the actual text. It is always 0
215  // because we don't add padding to the text rectangle.
216  int initialPaddingX = 0;
217 
218  // initialPaddingY is the number of pixels from the top of the
219  // input QRect to the top of the actual text. It may be nonzero
220  // because of extra vertical padding.
221  int initialPaddingY = (r.height() - totalHeight) / 2;
222  // Hack. Normally we vertically center the text due to some
223  // (solvable) issues in the SubtitleScreen code - the text rect
224  // and the background rect are both created with PAD_WIDTH extra
225  // padding, and to honor Qt::AlignTop, the text rect needs to be
226  // without padding. This doesn't work for Qt::TextWordWrap, since
227  // the first line will be vertically centered with subsequence
228  // lines below. So if Qt::TextWordWrap is set, we do top
229  // alignment.
230  if (flags & Qt::TextWordWrap)
231  initialPaddingY = 0;
232 
233  // textOffsetX is the number of pixels from r.left() to the left
234  // edge of the core text. This assumes that flags contains
235  // Qt::AlignLeft.
236  int textOffsetX =
237  initialPaddingX + std::max(outlineSize, -shadowOffset.x());
238 
239  // textOffsetY is the number of pixels from r.top() to the top
240  // edge of the core text. This assumes that flags contains
241  // Qt::AlignTop.
242  int textOffsetY =
243  initialPaddingY + std::max(outlineSize, -shadowOffset.y());
244 
245  QImage pm(r.size(), QImage::Format_ARGB32);
246  QColor fillcolor = font.color();
247  if (font.hasOutline())
248  fillcolor = outlineColor;
249  fillcolor.setAlpha(0);
250  pm.fill(fillcolor.rgba());
251 
252  QPainter tmp(&pm);
253  QFont tmpfont = font.face();
254 #if QT_VERSION < QT_VERSION_CHECK(5,15,0)
255  tmpfont.setStyleStrategy(QFont::OpenGLCompatible);
256 #endif
257  tmp.setFont(tmpfont);
258 
259  QPainterPath path;
260  if (font.hasOutline())
261  path.addText(0, 0, tmpfont, msg);
262 
263  if (font.hasShadow())
264  {
265  QRect a = QRect(0, 0, r.width(), r.height());
266  a.translate(shadowOffset.x() + textOffsetX,
267  shadowOffset.y() + textOffsetY);
268 
269  shadowColor.setAlpha(shadowAlpha);
270  tmp.setPen(shadowColor);
271  tmp.drawText(a, flags, msg);
272  }
273 
274  if (font.hasOutline())
275  {
276  // QPainter::drawText() treats the Y coordinate as the top of
277  // the text (when Qt::AlignTop is used). However,
278  // QPainterPath::addText() treats the Y coordinate as the base
279  // line of the text. To translate from the top to the base
280  // line, we need to add QFontMetrics::ascent().
281  int adjX = 0;
282  int adjY = fm.ascent();
283 
284  outlineColor.setAlpha(outlineAlpha);
285  tmp.setPen(outlineColor);
286 
287  path.translate(adjX + textOffsetX, adjY + textOffsetY);
288  QPen pen = tmp.pen();
289  pen.setWidth(outlineSize * 2 + 1);
290  pen.setCapStyle(Qt::RoundCap);
291  pen.setJoinStyle(Qt::RoundJoin);
292  tmp.setPen(pen);
293  tmp.drawPath(path);
294 
295  path.translate(outlineSize, outlineSize);
296  }
297 
298  tmp.setPen(QPen(font.GetBrush(), 0));
299  tmp.setBrush(font.GetBrush());
300  tmp.drawText(textOffsetX, textOffsetY, r.width(), r.height(),
301  flags, msg);
302  tmp.end();
303  im->Assign(pm);
304 }
305 
306 void MythPainter::DrawRectPriv(MythImage *im, const QRect area, int radius,
307  int ellipse,
308  const QBrush &fillBrush, const QPen &linePen)
309 {
310  if (!im)
311  return;
312 
313  QImage image(QSize(area.width(), area.height()), QImage::Format_ARGB32);
314  image.fill(0x00000000);
315  QPainter painter(&image);
316  painter.setRenderHint(QPainter::Antialiasing);
317  painter.setPen(linePen);
318  painter.setBrush(fillBrush);
319 
320  if ((area.width() / 2) < radius)
321  radius = area.width() / 2;
322 
323  if ((area.height() / 2) < radius)
324  radius = area.height() / 2;
325 
326  int lineWidth = linePen.width();
327  QRect r(lineWidth, lineWidth,
328  area.width() - (lineWidth * 2), area.height() - (lineWidth * 2));
329 
330  if (ellipse)
331  painter.drawEllipse(r);
332  else if (radius == 0)
333  painter.drawRect(r);
334  else
335  painter.drawRoundedRect(r, (qreal)radius, qreal(radius));
336 
337  painter.end();
338  im->Assign(image);
339 }
340 
342  int flags, const QRect r,
343  const MythFontProperties &font)
344 {
345  QString incoming = font.GetHash() + QString::number(r.width()) +
346  QString::number(r.height()) +
347  QString::number(flags) +
348  QString::number(font.color().rgba()) + msg;
349 
350  MythImage *im = nullptr;
351  if (m_stringToImageMap.contains(incoming))
352  {
353  m_stringExpireList.remove(incoming);
354  m_stringExpireList.push_back(incoming);
355  im = m_stringToImageMap[incoming];
356  if (im)
357  im->IncrRef();
358  }
359  else
360  {
361  im = GetFormatImage();
362  im->SetFileName(QString("GetImageFromString: %1").arg(msg));
363  DrawTextPriv(im, msg, flags, r, font);
364 
365  im->IncrRef();
366  m_softwareCacheSize += im->GetSize();
367  m_stringToImageMap[incoming] = im;
368  m_stringExpireList.push_back(incoming);
370  }
371  return im;
372 }
373 
375  const FormatVector &formats,
376  const MythFontProperties &font,
377  QRect &canvas, QRect &dest)
378 {
379  QString incoming = QString::number(canvas.x()) +
380  QString::number(canvas.y()) +
381  QString::number(canvas.width()) +
382  QString::number(canvas.height()) +
383  QString::number(dest.width()) +
384  QString::number(dest.height()) +
385  font.GetHash();
386 
387  for (auto *layout : qAsConst(layouts))
388  incoming += layout->text();
389 
390  MythImage *im = nullptr;
391  if (m_stringToImageMap.contains(incoming))
392  {
393  m_stringExpireList.remove(incoming);
394  m_stringExpireList.push_back(incoming);
395  im = m_stringToImageMap[incoming];
396  if (im)
397  im->IncrRef();
398  }
399  else
400  {
401  im = GetFormatImage();
402  im->SetFileName("GetImageFromTextLayout");
403 
404  QImage pm(canvas.size(), QImage::Format_ARGB32_Premultiplied);
405  pm.fill(0);
406 
407  QPainter painter(&pm);
408  if (!painter.isActive())
409  {
410  LOG(VB_GENERAL, LOG_ERR, "MythPainter::GetImageFromTextLayout: "
411  "Invalid canvas.");
412  return im;
413  }
414 
415  QRect clip;
416  clip.setSize(canvas.size());
417 
418  QFont tmpfont = font.face();
419 #if QT_VERSION < QT_VERSION_CHECK(5,15,0)
420  tmpfont.setStyleStrategy(QFont::OpenGLCompatible);
421 #endif
422  painter.setFont(tmpfont);
423  painter.setRenderHint(QPainter::Antialiasing);
424 
425  if (font.hasShadow())
426  {
427  QRect shadowRect;
428  QPoint shadowOffset;
429  QColor shadowColor;
430  int shadowAlpha = 255;
431 
432  font.GetShadow(shadowOffset, shadowColor, shadowAlpha);
433  shadowColor.setAlpha(shadowAlpha);
434 
435  MythPoint shadow(shadowOffset);
436  shadow.NormPoint(); // scale it to screen resolution
437 
438  shadowRect = canvas;
439  shadowRect.translate(shadow.x(), shadow.y());
440 
441  painter.setPen(shadowColor);
442  for (auto *layout : qAsConst(layouts))
443  layout->draw(&painter, shadowRect.topLeft(), formats, clip);
444  }
445 
446  painter.setPen(QPen(font.GetBrush(), 0));
447  for (auto *layout : qAsConst(layouts))
448  {
449  layout->draw(&painter, canvas.topLeft(),
450  layout->formats(), clip);
451  }
452  painter.end();
453 
454  pm.setOffset(canvas.topLeft());
455  im->Assign(pm.copy(0, 0, dest.width(), dest.height()));
456 
457  im->IncrRef();
458  m_softwareCacheSize += im->GetSize();
459  m_stringToImageMap[incoming] = im;
460  m_stringExpireList.push_back(incoming);
462  }
463  return im;
464 }
465 
466 MythImage* MythPainter::GetImageFromRect(const QRect area, int radius,
467  int ellipse,
468  const QBrush &fillBrush,
469  const QPen &linePen)
470 {
471  if (area.width() <= 0 || area.height() <= 0)
472  return nullptr;
473 
474  uint64_t hash1 = ((0xfff & (uint64_t)area.width())) +
475  ((0xfff & (uint64_t)area.height()) << 12) +
476  ((0xff & (uint64_t)fillBrush.style()) << 24) +
477  ((0xff & (uint64_t)linePen.width()) << 32) +
478  ((0xff & (uint64_t)radius) << 40) +
479  ((0xff & (uint64_t)linePen.style()) << 48) +
480  ((0xff & (uint64_t)ellipse) << 56);
481  uint64_t hash2 = ((0xffffffff & (uint64_t)linePen.color().rgba())) +
482  ((0xffffffff & (uint64_t)fillBrush.color().rgba()) << 32);
483 
484  QString incoming("R");
485  if (fillBrush.style() == Qt::LinearGradientPattern && fillBrush.gradient())
486  {
487  // The Q*Gradient classes are not polymorohic, and therefore
488  // dynamic_cast can't be used here.
489  // NOLINTNEXTLINE(cppcoreguidelines-pro-type-static-cast-downcast)
490  const auto *gradient = static_cast<const QLinearGradient*>(fillBrush.gradient());
491  if (gradient)
492  {
493  incoming = QString::number(
494  ((0xfff & (uint64_t)gradient->start().x())) +
495  ((0xfff & (uint64_t)gradient->start().y()) << 12) +
496  ((0xfff & (uint64_t)gradient->finalStop().x()) << 24) +
497  ((0xfff & (uint64_t)gradient->finalStop().y()) << 36));
498  QGradientStops stops = gradient->stops();
499  for (const auto & stop : qAsConst(stops))
500  {
501  incoming += QString::number(
502  ((0xfff * (uint64_t)(stop.first * 100))) +
503  ((uint64_t)stop.second.rgba() << 12));
504  }
505  }
506  }
507 
508  incoming += QString::number(hash1) + QString::number(hash2);
509 
510  MythImage *im = nullptr;
511  if (m_stringToImageMap.contains(incoming))
512  {
513  m_stringExpireList.remove(incoming);
514  m_stringExpireList.push_back(incoming);
515  im = m_stringToImageMap[incoming];
516  if (im)
517  im->IncrRef();
518  }
519  else
520  {
521  im = GetFormatImage();
522  im->SetFileName("GetImageFromRect");
523  DrawRectPriv(im, area, radius, ellipse, fillBrush, linePen);
524 
525  im->IncrRef();
526  m_softwareCacheSize += im->GetSize();
527  m_stringToImageMap[incoming] = im;
528  m_stringExpireList.push_back(incoming);
530  }
531  return im;
532 }
533 
535 {
536  QMutexLocker locker(&m_allocationLock);
537  MythImage *result = GetFormatImagePriv();
538  result->SetFileName("GetFormatImage");
539  m_allocatedImages.insert(result);
540  return result;
541 }
542 
544 {
545  QMutexLocker locker(&m_allocationLock);
547  m_allocatedImages.remove(im);
548 }
549 
551 {
552  if (im && !im->GetParent())
553  {
554  QMutexLocker locker(&m_allocationLock);
555  m_allocatedImages.insert(im);
556  im->SetParent(this);
557  }
558 }
559 
560 void MythPainter::ExpireImages(int64_t max)
561 {
562  bool recompute = false;
563  while (!m_stringExpireList.empty())
564  {
565  if (m_softwareCacheSize < max)
566  break;
567 
568  QString oldmsg = m_stringExpireList.front();
569  m_stringExpireList.pop_front();
570 
571  QMap<QString, MythImage*>::iterator it =
572  m_stringToImageMap.find(oldmsg);
573  if (it == m_stringToImageMap.end())
574  {
575  recompute = true;
576  continue;
577  }
578  MythImage *oldim = *it;
579  it = m_stringToImageMap.erase(it);
580 
581  if (oldim)
582  {
583  m_softwareCacheSize -= oldim->GetSize();
584  if (m_softwareCacheSize < 0)
585  {
587  recompute = true;
588  }
589  oldim->DecrRef();
590  }
591  }
592  if (recompute)
593  {
595  for (auto *img : qAsConst(m_stringToImageMap))
596  m_softwareCacheSize += img->GetSize();
597  }
598 }
599 
600 // the following assume graphics hardware operates natively at 32bpp
601 void MythPainter::SetMaximumCacheSizes(int hardware, int software)
602 {
603  static constexpr int64_t kOneMeg = 1LL * 1024 * 1024;
604  m_maxHardwareCacheSize = kOneMeg * hardware;
605  m_maxSoftwareCacheSize = kOneMeg * software;
606 
607  bool err = false;
608  if (m_maxHardwareCacheSize < 0)
609  {
611  err = true;
612  }
613  if (m_maxSoftwareCacheSize < 0)
614  {
615  m_maxSoftwareCacheSize = kOneMeg * 48;
616  err = true;
617  }
618 
619  LOG((err) ? VB_GENERAL : VB_GUI, (err) ? LOG_ERR : LOG_INFO,
620  QString("MythPainter cache sizes: Hardware %1MB, Software %2MB")
621  .arg(m_maxHardwareCacheSize / kOneMeg)
622  .arg(m_maxSoftwareCacheSize / kOneMeg));
623 }
MythPainter::m_allocatedImages
QSet< MythImage * > m_allocatedImages
Definition: mythpainter.h:144
FormatVector
QVector< QTextLayout::FormatRange > FormatVector
Definition: mythpainter.h:31
build_compdb.dest
dest
Definition: build_compdb.py:9
MythPainter::m_allocationLock
QMutex m_allocationLock
Definition: mythpainter.h:143
MythPainter::m_stringExpireList
std::list< QString > m_stringExpireList
Definition: mythpainter.h:147
MythPainter::SetMaximumCacheSizes
void SetMaximumCacheSizes(int hardware, int software)
Definition: mythpainter.cpp:601
MythPainter::GetFormatImage
MythImage * GetFormatImage()
Returns a blank reference counted image in the format required for the Draw functions for this painte...
Definition: mythpainter.cpp:534
MythPainter::DrawTextPriv
static void DrawTextPriv(MythImage *im, const QString &msg, int flags, QRect r, const MythFontProperties &font)
Definition: mythpainter.cpp:191
MythPainter::GetImageFromRect
MythImage * GetImageFromRect(QRect area, int radius, int ellipse, const QBrush &fillBrush, const QPen &linePen)
Definition: mythpainter.cpp:466
MythFontProperties::GetHash
QString GetHash(void) const
Definition: mythfontproperties.h:35
MythPainter::DrawRectPriv
static void DrawRectPriv(MythImage *im, QRect area, int radius, int ellipse, const QBrush &fillBrush, const QPen &linePen)
Definition: mythpainter.cpp:306
MythFontProperties::face
QFont face(void) const
Definition: mythfontproperties.cpp:40
MythPainter::SetClipRegion
virtual void SetClipRegion(const QRegion &clipRegion)
Definition: mythpainter.cpp:50
MythFontProperties::hasShadow
bool hasShadow(void) const
Definition: mythfontproperties.h:29
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
MythPainter::DrawRect
virtual void DrawRect(QRect area, const QBrush &fillBrush, const QPen &linePen, int alpha)
Definition: mythpainter.cpp:157
MythPainter::m_maxHardwareCacheSize
int m_maxHardwareCacheSize
Definition: mythpainter.h:137
MythPainter::m_softwareCacheSize
int64_t m_softwareCacheSize
Definition: mythpainter.h:140
MythImage::SetFileName
void SetFileName(QString fname)
Definition: mythimage.h:90
MythPainter::m_stringToImageMap
QMap< QString, MythImage * > m_stringToImageMap
Definition: mythpainter.h:146
MythPainter::DrawTextLayout
virtual void DrawTextLayout(QRect canvasRect, const LayoutVector &layouts, const FormatVector &formats, const MythFontProperties &font, int alpha, QRect destRect)
Definition: mythpainter.cpp:123
MythPainter::ExpireImages
void ExpireImages(int64_t max=0)
Definition: mythpainter.cpp:560
MythPainter::Clear
virtual void Clear(QPaintDevice *device, const QRegion &region)
Definition: mythpainter.cpp:54
MythPainter::DeleteFormatImage
void DeleteFormatImage(MythImage *im)
Definition: mythpainter.cpp:543
MythPainter::DeleteFormatImagePriv
virtual void DeleteFormatImagePriv(MythImage *im)=0
tmp
static guint32 * tmp
Definition: goom_core.cpp:26
MythFontProperties::hasOutline
bool hasOutline(void) const
Definition: mythfontproperties.h:32
MythPainter::GetImageFromTextLayout
MythImage * GetImageFromTextLayout(const LayoutVector &layouts, const FormatVector &formats, const MythFontProperties &font, QRect &canvas, QRect &dest)
Definition: mythpainter.cpp:374
MythPainter::MythPainter
MythPainter()
Definition: mythpainter.cpp:23
MythPainter::GetImageFromString
MythImage * GetImageFromString(const QString &msg, int flags, QRect r, const MythFontProperties &font)
Definition: mythpainter.cpp:341
mythfontproperties.h
mythlogging.h
MythPainter::GetFormatImagePriv
virtual MythImage * GetFormatImagePriv(void)=0
Creates a reference counted image, call DecrRef() to delete.
compat.h
MythFontProperties
Definition: mythfontproperties.h:13
formats
const std::array< const std::string, 8 > formats
Definition: vbilut.cpp:189
MythFontProperties::GetBrush
QBrush GetBrush(void) const
Definition: mythfontproperties.h:27
MythFontProperties::color
QColor color(void) const
Definition: mythfontproperties.h:26
MythImage::DecrRef
int DecrRef(void) override
Decrements reference count and deletes on 0.
Definition: mythimage.cpp:52
MythFontProperties::GetOutline
void GetOutline(QColor &color, int &size, int &alpha) const
Definition: mythfontproperties.cpp:82
MythPainter::DrawImage
virtual void DrawImage(QRect dest, MythImage *im, QRect src, int alpha)=0
mythpainter.h
MythPoint::NormPoint
void NormPoint(void)
Definition: mythrect.cpp:471
MythFontProperties::GetShadow
void GetShadow(QPoint &offset, QColor &color, int &alpha) const
Definition: mythfontproperties.cpp:75
MythImage::IncrRef
int IncrRef(void) override
Increments reference count.
Definition: mythimage.cpp:44
MythImage::SetParent
void SetParent(MythPainter *parent)
Definition: mythimage.h:45
mythimage.h
MythImage::GetSize
int64_t GetSize(void)
Definition: mythimage.h:69
mythcorecontext.h
LayoutVector
QVector< QTextLayout * > LayoutVector
Definition: mythpainter.h:30
MythImage
Definition: mythimage.h:36
MythPainter::DrawText
virtual void DrawText(QRect r, const QString &msg, int flags, const MythFontProperties &font, int alpha, QRect boundRect)
Definition: mythpainter.cpp:76
MythImage::GetParent
MythPainter * GetParent(void)
Definition: mythimage.h:44
MythPainter::SetClipRect
virtual void SetClipRect(QRect clipRect)
Definition: mythpainter.cpp:46
mythuianimation.h
MythPainter::Teardown
virtual void Teardown(void)
Definition: mythpainter.cpp:28
MythImage::Assign
void Assign(const QImage &img)
Definition: mythimage.cpp:77
MythPainter::DrawEllipse
virtual void DrawEllipse(QRect area, const QBrush &fillBrush, const QPen &linePen, int alpha)
Definition: mythpainter.cpp:180
MythPainter::CheckFormatImage
void CheckFormatImage(MythImage *im)
Definition: mythpainter.cpp:550
MythPainter::DrawRoundRect
virtual void DrawRoundRect(QRect area, int cornerRadius, const QBrush &fillBrush, const QPen &linePen, int alpha)
Definition: mythpainter.cpp:168
MythPoint
Wrapper around QPoint allowing us to handle percentage and other relative values for positioning in m...
Definition: mythrect.h:88
MythPainter::m_maxSoftwareCacheSize
int64_t m_maxSoftwareCacheSize
Definition: mythpainter.h:141