2021-06-07 21:02:42 +00:00
|
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
//
|
|
|
|
// EmulationStation Desktop Edition
|
|
|
|
// MiximageGenerator.h
|
|
|
|
//
|
|
|
|
// Generates miximages from screenshots, marquees and 3D box/cover 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
|
|
|
~MiximageGenerator();
|
|
|
|
|
|
|
|
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]);
|
|
|
|
|
|
|
|
std::string getSavePath();
|
|
|
|
|
|
|
|
FileData* mGame;
|
|
|
|
std::string& mResultMessage;
|
|
|
|
std::string mMessage;
|
|
|
|
std::promise<bool>* mMiximagePromise;
|
|
|
|
|
|
|
|
std::string mScreenshotPath;
|
|
|
|
std::string mMarqueePath;
|
|
|
|
std::string mBox3DPath;
|
|
|
|
std::string mCoverPath;
|
|
|
|
|
|
|
|
int mWidth;
|
|
|
|
int mHeight;
|
|
|
|
|
|
|
|
bool mMarquee;
|
|
|
|
bool mBox3D;
|
|
|
|
bool mCover;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // ES_APP_SCRAPERS_MIXIMAGE_GENERATOR_H
|