d71f4168fb
* logger business * code review * rm c-style array * extract image rendering to view * missing view files * init view abstractions * leverage concepts and provide a templateized Enumerate function * RVO * get rid of some warnings * logger business * code review * rm c-style array * extract image rendering to view * missing view files * init view abstractions * leverage concepts and provide a templateized Enumerate function * RVO * get rid of some warnings * logger business * code review * rm c-style array * init view abstractions * leverage concepts and provide a templateized Enumerate function * RVO * get rid of some warnings * logger business * code review * rm c-style array * init view abstractions * leverage concepts and provide a templateized Enumerate function * RVO * get rid of some warnings * Factor out AppGLFW base class The intention here is to get rid of scaffolding in the consumer application class and allow to focus on the "important bits". * Some cleanup * dump unnecessary dependency * link stuff where needed & use only what's needed * remove deprecation warnings * add gallery toggle * make some includes private * add presets * remove dir locals, use presets instead `projectile-configure-project' in conjunction with CMakePresets.json will allow to configure the project. `projectile-compile-project' does sth similar for the compile command. This is equivalent to something like ~cmake --preset clang-debug && cmake --build build --preset clang-debug~ * use presets in pipeline --------- Co-authored-by: m-aXimilian <keuffnermax@gmail.com>
46 lines
1.0 KiB
C++
46 lines
1.0 KiB
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;
|
|
PixelariumImage(const PixelariumImage& other)
|
|
{
|
|
// be ware!!
|
|
// we make a copy of the image data here!
|
|
img_ = std::make_unique<cv::Mat>(*other.img_);
|
|
};
|
|
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
|