ES-DE/es-app/src/MiximageGenerator.h

61 lines
1.5 KiB
C
Raw Normal View History

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.
// 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"
#include "utils/CImgUtil.h"
2021-06-07 21:02:42 +00:00
#include <FreeImage.h>
#include <future>
using namespace cimg_library;
class MiximageGenerator
{
public:
MiximageGenerator(FileData* game, std::string& resultMessage);
2021-06-07 21:02:42 +00:00
~MiximageGenerator();
void startThread(std::promise<bool>* miximagePromise);
private:
bool generateImage();
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() 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;
std::string mPhysicalMediaPath;
2021-06-07 21:02:42 +00:00
int mWidth;
int mHeight;
bool mMarquee;
bool mBox3D;
bool mCover;
bool mPhysicalMedia;
2021-06-07 21:02:42 +00:00
};
#endif // ES_APP_SCRAPERS_MIXIMAGE_GENERATOR_H