#ifndef CF80473A_40DD_43E5_B0D7_73F2205E9DF6 #define CF80473A_40DD_43E5_B0D7_73F2205E9DF6 /* ******************************************************************************* * INCLUDE ******************************************************************************* */ #include "Color.h" #include "GeometryTypes.h" #include #include #include FT_FREETYPE_H #include #include using namespace cimg_library; namespace Video { namespace Core { /* ******************************************************************************* * CLASS DECLARE ******************************************************************************* */ class Image: public CImg { public: using Ptr = Poco::SharedPtr; using CImg::CImg; void drawText(const std::string& text, const std::string& font, int size, Color foreColor, Color bgColor); void drawRectangle(const Rect& rect, Color& color, int border = 0); void drawImage(int x, int y, Ptr pImage); void getPixel(int x, int y, Color& color); void forceAlpha(uint8_t alpha); static void computeStringSize(const std::string& text, const std::string& font, int fontsz, Size& size); protected: static int computeStringBBox(std::wstring text, FT_Face face, FT_BBox& bbox); static void convertText(const std::string& from, std::wstring& to); static void runOnFreeType(const std::string& font, int size, std::function func); private: bool _forceAlphaEnabled = false; uint8_t _forceAlphaValue; }; } } #endif