Atlas Game Manager
A game manager for f95 and dlsite written in c++
Loading...
Searching...
No Matches
import.hpp
Go to the documentation of this file.
1//
2// Created by kj16609 on 9/22/23.
3//
4
5#pragma once
6#ifndef ATLASGAMEMANAGER_IMPORT_HPP
7#define ATLASGAMEMANAGER_IMPORT_HPP
8
9#include <QByteArray>
10#include <QFuture>
11#include <QNetworkAccessManager>
12#include <QNetworkReply>
13#include <QPixmap>
14
15#include <filesystem>
16
17#include "core/Types.hpp"
19
20namespace atlas::images
21{
22
23
29 void saveImage( const QByteArray& byteArray, const std::filesystem::path& dest );
30
31 [[nodiscard]] std::filesystem::path importImage( const std::filesystem::path& path, const RecordID game_id );
32
33 [[nodiscard]] std::filesystem::path importPixmap( const QPixmap pixmap, const RecordID game_id );
34
35 [[nodiscard]] inline std::filesystem::path importPixmap( const QPixmap pixmap, const atlas::records::Game game )
36 {
37 return importPixmap( pixmap, game.id() );
38 }
39
40 namespace async
41 {
42 [[nodiscard]] QFuture< std::filesystem::path > importImageFromURL( const QString url, const RecordID game_id );
43
46 importImage( const std::filesystem::path& path, const RecordID game_id );
47
48 [[nodiscard]] QFuture< std::filesystem::path > importPixmap( const QPixmap pixmap, const RecordID game_id );
49
50 } // namespace async
51} // namespace atlas::images
52
53#endif //ATLASGAMEMANAGER_IMPORT_HPP
std::uint32_t RecordID
Definition Types.hpp:11
Definition Game.hpp:17
Definition Game.hpp:34
RecordID id() const
Returns the record id for this game.
Definition Game.hpp:65
QFuture< std::filesystem::path > importImage(const std::filesystem::path &path, const RecordID game_id)
Stores the image located at path in the data folder.
Definition import.cpp:149
QFuture< std::filesystem::path > importPixmap(const QPixmap pixmap, const RecordID game_id)
QFuture< std::filesystem::path > importImageFromURL(const QString url, const RecordID record_id)
Definition import.cpp:142
Definition blurhash.cpp:16
std::filesystem::path importPixmap(const QPixmap pixmap, const RecordID game_id)
Definition import.cpp:96
void saveImage(const QByteArray &byteArray, const std::filesystem::path &dest)
Definition import.cpp:23
std::filesystem::path importImage(const std::filesystem::path &path, const RecordID game_id)
Definition import.cpp:53