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
@@ -0,0 +1,43 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "ILog.hpp"
|
||||
#include "IPixelariumImage.hpp"
|
||||
|
||||
namespace pixelarium::imaging
|
||||
{
|
||||
constexpr pixelarium::imaging::ImageFileType ExtensionToType(const std::string& extension)
|
||||
{
|
||||
std::string lower_ext{extension};
|
||||
std::ranges::transform(extension, lower_ext.begin(), [](const char c) -> char { return std::tolower(c); });
|
||||
|
||||
if (lower_ext == ".jpg" || lower_ext == ".jpeg")
|
||||
{
|
||||
return pixelarium::imaging::ImageFileType::kJpg;
|
||||
}
|
||||
if (lower_ext == ".png")
|
||||
{
|
||||
return pixelarium::imaging::ImageFileType::kPng;
|
||||
}
|
||||
if (lower_ext == ".czi")
|
||||
{
|
||||
return pixelarium::imaging::ImageFileType::kCzi;
|
||||
}
|
||||
if (lower_ext == ".tiff" || lower_ext == ".tif")
|
||||
{
|
||||
return pixelarium::imaging::ImageFileType::kTiff;
|
||||
}
|
||||
|
||||
return pixelarium::imaging::ImageFileType::kUnknown;
|
||||
}
|
||||
|
||||
/// @brief Factory for instantiating implementations of IPixelariumImage based on the given file type.
|
||||
class PixelariumImageFactory
|
||||
{
|
||||
using Log = utils::log::ILog;
|
||||
|
||||
public:
|
||||
static std::unique_ptr<IPixelariumImageCvMat> CreateImage(const std::string& uri, const Log& log);
|
||||
};
|
||||
} // namespace pixelarium::imaging
|
||||
Reference in New Issue
Block a user