mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-09-10 12:03:18 +02:00
renderer: improve the video quality by using rendering hint
Gitlab: #390 Change-Id: Idf3ccf9ab5b29a984a36ea117e6cf495a9e80988
This commit is contained in:
parent
9a84dcd631
commit
b420ca3a20
2 changed files with 12 additions and 2 deletions
|
@ -87,7 +87,12 @@ DistantRenderer::paint(QPainter* painter)
|
||||||
{
|
{
|
||||||
lrcInstance_->renderer()->drawFrame(distantRenderId_, [this, painter](QImage* distantImage) {
|
lrcInstance_->renderer()->drawFrame(distantRenderId_, [this, painter](QImage* distantImage) {
|
||||||
if (distantImage) {
|
if (distantImage) {
|
||||||
auto scaledDistant = distantImage->scaled(size().toSize(), Qt::KeepAspectRatio);
|
painter->setRenderHint(QPainter::Antialiasing);
|
||||||
|
painter->setRenderHint(QPainter::SmoothPixmapTransform);
|
||||||
|
|
||||||
|
auto scaledDistant = distantImage->scaled(size().toSize(),
|
||||||
|
Qt::KeepAspectRatio,
|
||||||
|
Qt::SmoothTransformation);
|
||||||
auto tempScaledWidth = static_cast<int>(scaledWidth_ * 1000);
|
auto tempScaledWidth = static_cast<int>(scaledWidth_ * 1000);
|
||||||
auto tempScaledHeight = static_cast<int>(scaledHeight_ * 1000);
|
auto tempScaledHeight = static_cast<int>(scaledHeight_ * 1000);
|
||||||
auto tempXOffset = xOffset_;
|
auto tempXOffset = xOffset_;
|
||||||
|
|
|
@ -51,6 +51,9 @@ PreviewRenderer::paint(QPainter* painter)
|
||||||
lrcInstance_->renderer()
|
lrcInstance_->renderer()
|
||||||
->drawFrame(lrc::api::video::PREVIEW_RENDERER_ID, [this, painter](QImage* previewImage) {
|
->drawFrame(lrc::api::video::PREVIEW_RENDERER_ID, [this, painter](QImage* previewImage) {
|
||||||
if (previewImage) {
|
if (previewImage) {
|
||||||
|
painter->setRenderHint(QPainter::Antialiasing);
|
||||||
|
painter->setRenderHint(QPainter::SmoothPixmapTransform);
|
||||||
|
|
||||||
auto aspectRatio = static_cast<qreal>(previewImage->width())
|
auto aspectRatio = static_cast<qreal>(previewImage->width())
|
||||||
/ static_cast<qreal>(previewImage->height());
|
/ static_cast<qreal>(previewImage->height());
|
||||||
auto previewHeight = height();
|
auto previewHeight = height();
|
||||||
|
@ -69,7 +72,9 @@ PreviewRenderer::paint(QPainter* painter)
|
||||||
|
|
||||||
// If the given size is empty, this function returns a null image.
|
// If the given size is empty, this function returns a null image.
|
||||||
QImage scaledPreview;
|
QImage scaledPreview;
|
||||||
scaledPreview = previewImage->scaled(size().toSize(), Qt::KeepAspectRatio);
|
scaledPreview = previewImage->scaled(size().toSize(),
|
||||||
|
Qt::KeepAspectRatio,
|
||||||
|
Qt::SmoothTransformation);
|
||||||
painter->drawImage(QRect(0, 0, scaledPreview.width(), scaledPreview.height()),
|
painter->drawImage(QRect(0, 0, scaledPreview.width(), scaledPreview.height()),
|
||||||
scaledPreview);
|
scaledPreview);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue