Save thumbnails next to infinipaint savefile

This commit is contained in:
Yousef Khadadeh 2026-04-28 17:07:28 +03:00
parent 962665ffd4
commit c9c61a8b68
10 changed files with 281 additions and 215 deletions

29
src/WorldScreenshot.hpp Normal file
View file

@ -0,0 +1,29 @@
#pragma once
#include <filesystem>
#include "CoordSpaceHelper.hpp"
#include <Helpers/SCollision.hpp>
struct WorldScreenshotInfo {
enum class ScreenshotType : size_t {
JPG,
PNG,
WEBP,
SVG
};
std::filesystem::path filePath;
ScreenshotType type;
Vector2i imageSizePixels;
CoordSpaceHelper cameraCoords;
SCollision::AABB<float> imageBounds;
bool transparentBackground;
bool displayGrid;
};
NLOHMANN_JSON_SERIALIZE_ENUM(WorldScreenshotInfo::ScreenshotType, {
{WorldScreenshotInfo::ScreenshotType::JPG, "jpg"},
{WorldScreenshotInfo::ScreenshotType::PNG, "png"},
{WorldScreenshotInfo::ScreenshotType::WEBP, "webp"},
{WorldScreenshotInfo::ScreenshotType::SVG, "svg"}
})
void world_take_screenshot(const std::shared_ptr<World>& w, const WorldScreenshotInfo& info);