summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt/QtUtils/ImageConverter.cpp
blob: 4d00d82c15b5363cf1b9227580e9d7337451d5cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Copyright 2018 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later

#include "DolphinQt/QtUtils/ImageConverter.h"

#include <QPixmap>

#include "UICommon/GameFile.h"

QPixmap ToQPixmap(const UICommon::GameBanner& banner)
{
  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());
}