2021-06-07 21:02:42 +00:00
|
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
//
|
|
|
|
// EmulationStation Desktop Edition
|
|
|
|
// MiximageGenerator.h
|
|
|
|
//
|
2021-11-09 22:00:16 +00:00
|
|
|
// Generates miximages from screenshots, marquees, 3D boxes/covers and physical media images.
|
2021-06-08 20:25:53 +00:00
|
|
|
// Called from GuiScraperSearch and GuiOfflineGenerator.
|
2021-06-07 21:02:42 +00:00
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef ES_APP_SCRAPERS_MIXIMAGE_GENERATOR_H
|
|
|
|
#define ES_APP_SCRAPERS_MIXIMAGE_GENERATOR_H
|
|
|
|
|
|
|
|
#include "FileData.h"
|
|
|
|
#include "GuiComponent.h"
|
2021-07-07 18:03:42 +00:00
|
|
|
#include "utils/CImgUtil.h"
|
2021-06-07 21:02:42 +00:00
|
|
|
|
|
|
|
#include <FreeImage.h>
|
|
|
|
#include <future>
|
|
|
|
|
|
|
|
using namespace cimg_library;
|
|
|
|
|
|
|
|
class MiximageGenerator
|
|
|
|
{
|
|
|
|
public:
|
2021-06-08 20:25:53 +00:00
|
|
|
MiximageGenerator(FileData* game, std::string& resultMessage);
|
2021-06-07 21:02:42 +00:00
|
|
|
|
|
|
|
void startThread(std::promise<bool>* miximagePromise);
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool generateImage();
|
2021-07-07 18:03:42 +00:00
|
|
|
void calculateMarqueeSize(const unsigned int& targetWidth,
|
|
|
|
const unsigned int& targetHeight,
|
|
|
|
unsigned int& width,
|
|
|
|
unsigned int& height);
|
2021-06-07 21:02:42 +00:00
|
|
|
void sampleFrameColor(CImg<unsigned char>& screenshotImage, unsigned char (&frameColor)[4]);
|
|
|
|
|
2021-10-30 17:01:58 +00:00
|
|
|
std::string getSavePath() const;
|
2021-06-07 21:02:42 +00:00
|
|
|
|
|
|
|
FileData* mGame;
|
|
|
|
std::string& mResultMessage;
|
|
|
|
std::string mMessage;
|
|
|
|
std::promise<bool>* mMiximagePromise;
|
|
|
|
|
|
|
|
std::string mScreenshotPath;
|
|
|
|
std::string mMarqueePath;
|
|
|
|
std::string mBox3DPath;
|
|
|
|
std::string mCoverPath;
|
2021-10-30 17:01:58 +00:00
|
|
|
std::string mPhysicalMediaPath;
|
2021-06-07 21:02:42 +00:00
|
|
|
|
|
|
|
int mWidth;
|
|
|
|
int mHeight;
|
|
|
|
|
|
|
|
bool mMarquee;
|
|
|
|
bool mBox3D;
|
|
|
|
bool mCover;
|
2021-10-30 17:01:58 +00:00
|
|
|
bool mPhysicalMedia;
|
2021-06-07 21:02:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // ES_APP_SCRAPERS_MIXIMAGE_GENERATOR_H
|