15using cimg_library::CImg;
16using cimg_library::CImgException;
18std::expected<std::unique_ptr<Png>, std::string>
PngImporterImpl::Read(
const std::filesystem::path &path)
const {
19 CImg<std::uint8_t> image{};
20 const auto path_c_str = path.c_str();
22 image.assign(path_c_str);
23 return std::make_unique<PngImpl>(image);
24 }
catch (
const CImgException &e) {
25 return std::unexpected{e.what()};
std::expected< std::unique_ptr< Png >, std::string > Read(const std::filesystem::path &path) const override
Imports a Png at a given path from the filesystem.