// 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 // Disable the CImg display capabilities. #define cimg_display 0 #include "FileData.h" #include "GuiComponent.h" #include #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 cropLetterboxes(CImg& image); void cropPillarboxes(CImg& image); void removeTransparentPadding(CImg& image); void addDropShadow(CImg& image, unsigned int shadowDistance); void sampleFrameColor(CImg& screenshotImage, unsigned char (&frameColor)[4]); void convertToCImgFormat(CImg& image, std::vector imageVector); void convertFromCImgFormat(CImg image, std::vector& imageVector); 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