diff options
| author | Joel Klinghed <the_jk@spawned.biz> | 2026-01-02 22:42:31 +0100 |
|---|---|---|
| committer | Joel Klinghed <the_jk@spawned.biz> | 2026-01-02 22:42:31 +0100 |
| commit | 6ed8f5151719fbc14ec0ac6d28a346d1f74cf2ca (patch) | |
| tree | ebe7588e89e1aa2ae5376acf85f3a3a7b2ec7e10 /src/image_processor.hh | |
Diffstat (limited to 'src/image_processor.hh')
| -rw-r--r-- | src/image_processor.hh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/image_processor.hh b/src/image_processor.hh new file mode 100644 index 0000000..551ac4f --- /dev/null +++ b/src/image_processor.hh @@ -0,0 +1,29 @@ +#ifndef IMAGE_PROCESSOR_HH +#define IMAGE_PROCESSOR_HH + +#include "colour.hh" +#include "image_loader.hh" +#include "io.hh" +#include "spawner.hh" + +#include <filesystem> +#include <memory> +#include <optional> + +namespace image_processor { + +[[nodiscard]] +std::expected<Size, ImageLoadError> peek(Process& process, + std::filesystem::path const& path); + +[[nodiscard]] +std::expected<std::unique_ptr<Image>, ImageLoadError> load( + Process& process, std::filesystem::path const& path, Image::Format format, + uint32_t max_width = 0, uint32_t max_height = 0, + std::optional<Colour> background = std::nullopt); + +int run(std::unique_ptr<io::Reader> reader, std::unique_ptr<io::Writer> writer); + +} // namespace image_processor + +#endif // IMAGE_PROCESSOR_HH |
