Files
pixelarium/lib/imaging/PixelariumImage.hpp
T
m-aXimilian a8489292b6 Resources (#1)
* start some resource fiddling

* start some resource fiddling

* initiate a real resource manager

* fix color flicker in rendering

* delete unintended constructors

and add a convenience function to reset the render-image (from the
original image, aka. clone again)

* [OpenGL deprecation warning]

The compiler said that these functions are "deprecated". They seem to
be useless anyway...

* various improvements

* add resource enumerator and documentation

* fix constness stuff

* use existing iterator for insertion

* init unit tests

* rm bogus file

---------

Co-authored-by: m-aXimilian <keuffnermax@gmail.com>
2025-06-13 22:23:20 +00:00

42 lines
996 B
C++

#pragma once
#include <memory>
#include <opencv2/core/mat.hpp>
#include <string>
namespace pixelarium::imaging
{
class PixelariumImage
{
public:
explicit PixelariumImage(const std::string& uri);
// get back the defaults
PixelariumImage() = default;
// we cannot copy an Image since this conflicts with the _img field
PixelariumImage(const PixelariumImage& other) = delete;
PixelariumImage(PixelariumImage&& other) noexcept
: img_(std::move(other.img_)) {}
// requires a copy ctor which we don't have
PixelariumImage& operator=(const PixelariumImage& other) = delete;
PixelariumImage& operator=(PixelariumImage&& other) noexcept
{
if (this != &other)
{
img_ = std::move(other.img_);
}
return *this;
}
~PixelariumImage() = default;
const cv::Mat& GetImage() const { return *this->img_.get(); }
protected:
std::unique_ptr<cv::Mat> img_;
};
} // namespace pixelarium::imaging