Files
pixelarium/lib/imaging/Image.hpp
T

31 lines
728 B
C++
Raw Normal View History

2025-03-14 19:32:40 +01:00
#pragma once
#include <memory>
#include <opencv2/core/mat.hpp>
#include <string>
namespace pixelarium::imaging
{
class Image
{
public:
explicit Image(const std::string& uri);
// get back the defaults
Image() = default;
2025-05-23 15:15:01 +02:00
// we cannot copy an Image since this conflicts with the _img field
Image(const Image& other) = delete;
2025-03-14 19:32:40 +01:00
Image(Image&& other) noexcept = default;
2025-05-23 15:15:01 +02:00
// requires a copy ctor which we don't have
Image& operator=(const Image& other) = delete;
2025-03-14 19:32:40 +01:00
Image& operator=(Image&& other) noexcept = default;
~Image() = default;
2025-05-23 15:15:01 +02:00
const cv::Mat& GetImage() const { return *this->_img.get(); }
2025-03-14 19:32:40 +01:00
private:
2025-05-23 15:15:01 +02:00
std::unique_ptr<cv::Mat> _img;
2025-03-14 19:32:40 +01:00
};
} // namespace pixelarium::imaging