Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QVideoTextureHelper::SubtitleLayout Struct Reference

#include <qvideotexturehelper_p.h>

+ Collaboration diagram for QVideoTextureHelper::SubtitleLayout:

Public Member Functions

bool update (const QSize &frameSize, QString text)
 
void draw (QPainter *painter, const QPointF &translate) const
 
QImage toImage () const
 

Public Attributes

QSize videoSize
 
QRectF bounds
 
QTextLayout layout
 

Detailed Description

Definition at line 78 of file qvideotexturehelper_p.h.

Member Function Documentation

◆ draw()

void QVideoTextureHelper::SubtitleLayout::draw ( QPainter * painter,
const QPointF & translate ) const

◆ toImage()

QImage QVideoTextureHelper::SubtitleLayout::toImage ( ) const

Definition at line 826 of file qvideotexturehelper.cpp.

References Qt::black, bounds, QTextLayout::draw(), QImage::Format_RGBA8888_Premultiplied, layout, painter, QColor::setAlpha(), QString::size(), QRectF::size(), QTextLayout::FormatRange::start, QTextLayout::text(), QRectF::topLeft(), QPainter::translate(), and Qt::white.

Referenced by QVideoWindowPrivate::updateSubtitle().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

bool QVideoTextureHelper::SubtitleLayout::update ( const QSize & frameSize,
QString text )

Definition at line 752 of file qvideotexturehelper.cpp.

References Qt::AlignCenter, QTextLayout::beginLayout(), bounds, QTextLayout::createLine(), QTextLayout::endLayout(), font, frameSize(), QSize::height(), QString::isEmpty(), layout, line, qMax(), QString::replace(), QTextLayout::setFont(), QFont::setPointSize(), QTextLayout::setPosition(), QTextLayout::setText(), QTextLayout::setTextOption(), QTextOption::setUseDesignMetrics(), text, QTextLayout::text(), videoSize, and QSize::width().

Referenced by QVideoWindowPrivate::updateSubtitle().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ bounds

QRectF QVideoTextureHelper::SubtitleLayout::bounds

◆ layout

QTextLayout QVideoTextureHelper::SubtitleLayout::layout

Definition at line 82 of file qvideotexturehelper_p.h.

Referenced by draw(), toImage(), and update().

◆ videoSize

QSize QVideoTextureHelper::SubtitleLayout::videoSize

Definition at line 80 of file qvideotexturehelper_p.h.

Referenced by QVideoWindowPrivate::render(), and update().


The documentation for this struct was generated from the following files: