// SPDX-License-Identifier: MIT // // EmulationStation Desktop Edition // MiximageGenerator.h // // Generates miximages from screenshots, marquees and 3D box/cover images. // Called from GuiScraperSearch and GuiOfflineGenerator. // #ifndef ES_APP_SCRAPERS_MIXIMAGE_GENERATOR_H #define ES_APP_SCRAPERS_MIXIMAGE_GENERATOR_H #include "FileData.h" #include "GuiComponent.h" #include "utils/CImgUtil.h" #include #include using namespace cimg_library; class MiximageGenerator { public: MiximageGenerator(FileData* game, std::string& resultMessage); ~MiximageGenerator(); void startThread(std::promise* miximagePromise); private: bool generateImage(); void calculateMarqueeSize(const unsigned int& targetWidth, const unsigned int& targetHeight, unsigned int& width, unsigned int& height); void sampleFrameColor(CImg& screenshotImage, unsigned char (&frameColor)[4]); std::string getSavePath(); FileData* mGame; std::string& mResultMessage; std::string mMessage; std::promise* 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