Initial image implementation

This commit is contained in:
2025-12-15 16:22:01 +02:00
parent af9ebe5fe8
commit c626578557
6 changed files with 168 additions and 5 deletions

View File

@@ -52,6 +52,20 @@ NLOHMANN_JSON_SERIALIZE_ENUM(TextFit,
{FIT_AUTO, "auto"},
})
enum ImageResize
{
RESIZE_NONE,
RESIZE_FIT,
RESIZE_STRETCH
};
NLOHMANN_JSON_SERIALIZE_ENUM(ImageResize,
{
{RESIZE_NONE, "none"},
{RESIZE_FIT, "fit"},
{RESIZE_STRETCH, "stretch"},
})
// Call this before everything
// Prints its messages
bool init_sdl();
@@ -86,5 +100,6 @@ void json_extract(const nlohmann::json& j, const std::string& key, VerticalAlign
void json_extract(const nlohmann::json& j, const std::string& key, TextFit& out);
void json_extract(const nlohmann::json& j, const std::string& key, SDL_Color& out);
void json_extract(const nlohmann::json& j, const std::string& key, Uint8& out);
void json_extract(const nlohmann::json& j, const std::string& key, ImageResize& out);
#endif // SDL_HELPERS_H_