build system and module refactoring + simple histogram scratch (#20)
* 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:
committed by
Maximilian Kueffner
parent
b37814204f
commit
c00c2c71ac
@@ -3,11 +3,11 @@
|
||||
#include <format>
|
||||
#include <memory>
|
||||
|
||||
#include "IPixelariumImage.hpp"
|
||||
#include "IPixelariumImageView.hpp"
|
||||
#include "PixelariumImageFactory.hpp"
|
||||
#include "PixelariumImageViewCzi.hpp"
|
||||
#include "PixelariumImageViewDefault.hpp"
|
||||
#include "imaging/IPixelariumImage.hpp"
|
||||
#include "imaging/PixelariumImageFactory.hpp"
|
||||
|
||||
/// @brief Creates a PixelariumImageView from a resource image.
|
||||
/// @param image_id The ID of the image resource to render.
|
||||
@@ -19,7 +19,7 @@ std::unique_ptr<pixelarium::application::IPixelariumImageView> pixelarium::appli
|
||||
using ImageType = imaging::ImageFileType;
|
||||
auto res{this->image_pool_.GetResource(image_id)};
|
||||
|
||||
auto img{res.lock()};
|
||||
const auto img{res.lock()};
|
||||
|
||||
if (img == nullptr)
|
||||
{
|
||||
@@ -48,11 +48,26 @@ std::unique_ptr<pixelarium::application::IPixelariumImageView> pixelarium::appli
|
||||
case ImageType::kMemory:
|
||||
log_.Info(std::format("{}: Creating a Default View", __PRETTY_FUNCTION__));
|
||||
// beware: here we copy the actual image resource over to the new image
|
||||
return std::make_unique<PixelariumImageViewDefault>(img);
|
||||
try
|
||||
{
|
||||
auto view{std::make_unique<PixelariumImageViewDefault>(img)};
|
||||
return view;
|
||||
}
|
||||
catch (const std::exception& ex)
|
||||
{
|
||||
log_.Error(std::format("{}: Creating view failed: {}", __PRETTY_FUNCTION__, ex.what()));
|
||||
}
|
||||
case ImageType::kCzi:
|
||||
log_.Info(std::format("{}: Creating a CZI View", __PRETTY_FUNCTION__));
|
||||
// beware: here we copy the actual image resource over to the new image
|
||||
return std::make_unique<PixelariumImageViewCzi>(img, log_);
|
||||
try
|
||||
{
|
||||
auto view{std::make_unique<PixelariumImageViewCzi>(img, log_)};
|
||||
return view;
|
||||
}
|
||||
catch (const std::exception& ex)
|
||||
{
|
||||
log_.Error(std::format("{}: Creating view failed: {}", __PRETTY_FUNCTION__, ex.what()));
|
||||
}
|
||||
default:
|
||||
return {};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user