2017-12-31 20:33:36 +01:00
|
|
|
// Copyright 2018 Dolphin Emulator Project
|
2021-07-05 03:22:19 +02:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2017-12-31 20:33:36 +01:00
|
|
|
|
2018-07-07 00:40:15 +02:00
|
|
|
#include "DolphinQt/QtUtils/ImageConverter.h"
|
2017-12-31 20:33:36 +01:00
|
|
|
|
|
|
|
|
#include <QPixmap>
|
|
|
|
|
|
|
|
|
|
#include "UICommon/GameFile.h"
|
|
|
|
|
|
|
|
|
|
QPixmap ToQPixmap(const UICommon::GameBanner& banner)
|
|
|
|
|
{
|
2025-06-07 11:18:27 +01:00
|
|
|
const auto* ptr = reinterpret_cast<const uchar*>(banner.buffer.data());
|
|
|
|
|
QImage image(ptr, banner.width, banner.height, QImage::Format_RGBX8888);
|
|
|
|
|
return QPixmap::fromImage(std::move(image).rgbSwapped());
|
2017-12-31 20:33:36 +01:00
|
|
|
}
|