235d00192a
* get rid of optional<ptr> -> double indirection * more optional cleanup * fix * add more render pixel type options * towards different views * missing virtual declaration of ShowImage * fix runtime * init image view factory * fix build Render Image close button re-enable add readme init documentation use awesomeDoxygen ci build docs install doxygen id token permission add pages write permission
37 lines
995 B
C++
37 lines
995 B
C++
#include "PixelariumImageFactory.hpp"
|
|
|
|
#include <algorithm>
|
|
#include <cctype>
|
|
#include <memory>
|
|
|
|
#include "impl/PixelariumCzi.hpp"
|
|
#include "impl/PixelariumJpg.hpp"
|
|
#include "impl/PixelariumPng.hpp"
|
|
|
|
|
|
/*static*/ std::unique_ptr<pixelarium::imaging::IPixelariumImage>
|
|
pixelarium::imaging::PixelariumImageFactory::CreateImage(const std::string& uri)
|
|
{
|
|
const auto res{std::filesystem::path(uri)};
|
|
const auto target_type{ExtensionToType(res.extension().string())};
|
|
|
|
switch (target_type)
|
|
{
|
|
case ImageFileType::UNKNOWN:
|
|
return {};
|
|
break;
|
|
case ImageFileType::ABSTRACT:
|
|
return {};
|
|
break;
|
|
case ImageFileType::PNG:
|
|
return std::make_unique<PixelariumPng>(uri);
|
|
break;
|
|
case ImageFileType::JPG:
|
|
return std::make_unique<PixelariumJpg>(uri);
|
|
break;
|
|
case ImageFileType::CZI:
|
|
return std::make_unique<PixelariumCzi>(uri);
|
|
break;
|
|
}
|
|
}
|