| 1 | // Copyright 2018 Dolphin Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | |
| 4 | #include "DolphinQt/QtUtils/ImageConverter.h" |
| 5 | |
| 6 | #include <QPixmap> |
| 7 | |
| 8 | #include "UICommon/GameFile.h" |
| 9 | |
| 10 | QPixmap ToQPixmap(const UICommon::GameBanner& banner) |
| 11 | { |
| 12 | const auto* ptr = reinterpret_cast<const uchar*>(banner.buffer.data()); |
| 13 | QImage image(ptr, banner.width, banner.height, QImage::Format_RGBX8888); |
| 14 | return QPixmap::fromImage(std::move(image).rgbSwapped()); |
| 15 | } |