Files
pixelarium/lib/imaging/PixelariumImage.cpp
T

19 lines
458 B
C++
Raw Normal View History

2025-06-13 22:23:20 +00:00
#include "PixelariumImage.hpp"
2025-03-14 19:32:40 +01:00
#include <filesystem>
2025-05-23 15:15:01 +02:00
#include <format>
#include <memory>
2025-03-14 19:32:40 +01:00
#include <opencv2/imgcodecs.hpp>
#include <stdexcept>
2025-06-13 22:23:20 +00:00
pixelarium::imaging::PixelariumImage::PixelariumImage(const std::string& uri)
2025-03-14 19:32:40 +01:00
{
if (!std::filesystem::exists(uri))
{
2025-05-23 15:15:01 +02:00
throw std::runtime_error(std::format("File not {} found", uri));
2025-03-14 19:32:40 +01:00
}
2025-09-13 14:49:59 +02:00
this->uri_ = std::filesystem::path(uri);
2025-06-13 22:23:20 +00:00
this->img_ = std::make_unique<cv::Mat>(cv::imread(uri));
}