Gerneric image codec abstraction init (#6)

* remove raw pointer from resource manager

* towards generic images

* 💅 and pin libCZI module

* remove raw pointer from resource manager

* towards generic images

* fix rendering

* fix rendering

* fix unit tests

* fix pipeline

* fix gcc build

* re-enable tests

* add czi impl

* remove resource button

* refactor user code app to being a "default app"

* ui resources

* missing lib?

* init czi render support

* typos
This commit is contained in:
m-aXimilian
2025-09-22 23:13:28 +02:00
committed by Maximilian Kueffner
parent bce12b0bb4
commit 0be064bb8e
31 changed files with 670 additions and 221 deletions
+55
View File
@@ -0,0 +1,55 @@
#pragma once
#include <filesystem>
#include <functional>
#include <memory>
#include <opencv2/core/mat.hpp>
#include <optional>
#include <string>
namespace pixelarium::imaging
{
using ImageQueryFunctor = std::function<void(const std::string&, void*, int*)>;
enum class ImageFileType
{
UNKNOWN = -10,
ABSTRACT = 0,
PNG = 1,
JPG = 2,
CZI = 3,
};
/// @brief An abstract interface to define a semantic query
/// for a multi-dimensional image.
struct IImageQuery
{
virtual ~IImageQuery() = default;
};
/// @brief This aims to be a generic image abstraction
/// meant for codec specific implementation.
class IPixelariumImage
{
public:
virtual ~IPixelariumImage() = default;
// this will have to throw or something for multidimensional images
virtual std::optional<std::unique_ptr<cv::Mat>> TryGetImage() = 0;
virtual std::optional<std::unique_ptr<cv::Mat>> TryGetImage(const IImageQuery&) = 0;
virtual std::string Name() const noexcept = 0;
virtual bool Empty() const noexcept = 0;
virtual std::filesystem::path Uri() const noexcept = 0;
public:
const static ImageFileType type_{ImageFileType::ABSTRACT};
protected:
std::filesystem::path uri_;
};
} // namespace pixelarium::imaging