c00c2c71ac
* 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
39 lines
1.2 KiB
C++
39 lines
1.2 KiB
C++
#include "PixelariumImageFactory.hpp"
|
|
|
|
#include <cctype>
|
|
#include <memory>
|
|
|
|
#include "IPixelariumImage.hpp"
|
|
#include "PixelariumCzi.hpp"
|
|
#include "PixelariumJpg.hpp"
|
|
#include "PixelariumMem.hpp"
|
|
#include "PixelariumPng.hpp"
|
|
#include "PixelariumTiff.hpp"
|
|
|
|
/*static*/ std::unique_ptr<pixelarium::imaging::IPixelariumImageCvMat>
|
|
pixelarium::imaging::PixelariumImageFactory::CreateImage(const std::string& uri, const Log& log)
|
|
{
|
|
const auto res{std::filesystem::path(uri)};
|
|
const auto target_type{ExtensionToType(res.extension().string())};
|
|
|
|
switch (target_type)
|
|
{
|
|
case ImageFileType::kUnknown:
|
|
return {};
|
|
case ImageFileType::kAbstract:
|
|
return {};
|
|
case ImageFileType::kPng:
|
|
return std::make_unique<PixelariumPng>(uri);
|
|
case ImageFileType::kJpg:
|
|
return std::make_unique<PixelariumJpg>(uri);
|
|
case ImageFileType::kCzi:
|
|
return std::make_unique<PixelariumCzi>(uri, log);
|
|
case ImageFileType::kTiff:
|
|
return std::make_unique<PixelariumTiff>(uri, log);
|
|
case ImageFileType::kMemory:
|
|
return std::make_unique<PixelariumMem>(cv::Mat(), uri, log);
|
|
default:
|
|
return {};
|
|
}
|
|
}
|