build system and module refactoring + simple histogram scratch (#20)
MegaLinter / MegaLinter (push) Has been cancelled
CI Workflow / build-ubuntu (push) Has been cancelled
CI Workflow / build-windows (push) Has been cancelled
CI Workflow / generate-docs (push) Has been cancelled

* scratch adding histogram to image views

Histograms should come from some sort of histogram service. This is
currently just a POC.

* custom logger implementation w/o spdlog

* missing cmake file

* fix tests

* use operator<< over direct stream exposure

* rm print header

* add threading test + refactor towards interface libraries

omits the need for =target_include_directories= calls /everywhere/

* rm print header

* rm constexpr

* templated thread_pool

* fix doxyfile

* default enable doc building

* czi reader refactor

* rm erroneous include expression

* clang-format

* single lib include with PUBLIC visibility

* compile imgui stdlib

* clang format

* documentation update

centralize `LogLevelToString` to `ILog.hpp`

update docs and examples
This commit is contained in:
m-aXimilian
2026-02-08 12:09:02 +01:00
committed by Maximilian Kueffner
parent b37814204f
commit c00c2c71ac
60 changed files with 797 additions and 416 deletions
@@ -0,0 +1,75 @@
#pragma once
#include <memory>
#include <mutex>
#include <unordered_map>
#include <unordered_set>
#include "ILog.hpp"
#include "IPixelariumImageView.hpp"
#include "ImageViewFactory.hpp"
#include "resource.hpp"
// This is intended as an additional abstraction
// aggregating views that should be rendered (or not)
namespace pixelarium::application
{
/// @brief Instead of directly using the view, we
/// proxy it through a wrapper. This allows for arbitrary additional data
/// to be added in future
struct RenderImageStateWrapper
{
std::unique_ptr<IPixelariumImageView> view;
const bool* show_state;
};
/// @brief Manage instances of IPixelariumImageView.
///
/// This class is used to keep track of what must be rendered.
/// It manages a set of IPixelariumImageView instances that can be traversed
/// via its Enumerate() function.
/// Views that shall not be rendered anymore should be marked for deletion
/// with MarkForDeletion()
class RenderImageManager
{
using Pool = resources::ImageResourcePool;
public:
explicit RenderImageManager(Pool& pool, const utils::log::ILog& log)
: view_factory_(std::make_unique<ImageViewFactory>(pool, log)), log_(log)
{
}
void Clear() noexcept;
void Add(resources::ResourceKey key) noexcept;
bool Remove(resources::ResourceKey key) noexcept;
// can't be const because func mutates the state
template <typename Callable>
requires std::invocable<Callable, resources::ResourceKey, RenderImageStateWrapper&>
void Enumerate(Callable&& func)
{
for (auto& [key, val] : this->render_image_map_)
{
if (val.view != nullptr)
{
func(key, val);
}
}
}
void MarkForDeletion(resources::ResourceKey key);
void UpdateCollection();
private:
std::unordered_map<resources::ResourceKey, RenderImageStateWrapper> render_image_map_;
std::unique_ptr<ImageViewFactory> view_factory_;
std::mutex mut_;
std::unordered_set<resources::ResourceKey> keys_to_delete_;
std::unordered_set<resources::ResourceKey> failed_keys_cache_;
const utils::log::ILog& log_;
};
} // namespace pixelarium::application