Qt 6.x
The Qt SDK
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

Definition at line 793 of file qvideotexturehelper.cpp.

References Qt::black, bounds, QPainter::CompositionMode_SourceOver, QTextLayout::draw(), QPainter::drawRect(), layout, Qt::NoPen, painter, QPainter::restore(), QPainter::save(), QColor::setAlpha(), QPainter::setBrush(), QPainter::setCompositionMode(), QPainter::setPen(), QString::size(), QTextLayout::text(), QPainter::translate(), translate(), and Qt::white.

+ Here is the call graph for this function:

◆ toImage()

QImage QVideoTextureHelper::SubtitleLayout::toImage ( ) const

Definition at line 813 of file qvideotexturehelper.cpp.

References Qt::black, bounds, QTextLayout::draw(), QImage::Format_RGBA8888_Premultiplied, layout, painter, QColor::setAlpha(), QString::size(), QRectF::size(), QTextLayout::text(), QRectF::topLeft(), QSizeF::toSize(), 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 739 of file qvideotexturehelper.cpp.

References Qt::AlignCenter, QTextLayout::beginLayout(), bounds, QTextLayout::createLine(), QTextLayout::endLayout(), font, frameSize(), QSize::height(), QString::isEmpty(), layout, line, QChar::LineSeparator, qMax(), QString::replace(), QTextLayout::setFont(), QFont::setPointSize(), QTextLayout::setPosition(), QTextLayout::setText(), QTextLayout::setTextOption(), 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: