forked from ossimlabs/ossim
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathImageHandlerStateFactory.cpp
More file actions
54 lines (45 loc) · 1.5 KB
/
Copy pathImageHandlerStateFactory.cpp
File metadata and controls
54 lines (45 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include <ossim/support_data/ImageHandlerStateFactory.h>
#include <ossim/base/ossimKeywordNames.h>
#include <ossim/base/ossimException.h>
#include <ossim/support_data/TiffHandlerState.h>
#include <mutex>
ossim::ImageHandlerStateFactory::ImageHandlerStateFactory()
{
}
std::shared_ptr<ossim::ImageHandlerStateFactory> ossim::ImageHandlerStateFactory::instance()
{
static std::shared_ptr<ImageHandlerStateFactory>
imageHandlerFactory = std::make_shared< ossim::ImageHandlerStateFactory >();
return imageHandlerFactory;
}
std::shared_ptr<ossim::ImageHandlerState> ossim::ImageHandlerStateFactory::createState(const ossimKeywordlist& kwl,
const ossimString& prefix)const
{
std::shared_ptr<ossim::ImageHandlerState> result;
ossimString typeValue = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
if(typeValue)
{
result = createState(typeValue);
if(result)
{
try
{
result->load(kwl, prefix);
}
catch(ossimException& e)
{
result = nullptr;
}
}
}
return result;
}
std::shared_ptr<ossim::ImageHandlerState> ossim::ImageHandlerStateFactory::createState(const ossimString& typeName)const
{
std::shared_ptr<ossim::ImageHandlerState> result;
if(typeName == ossim::TiffHandlerState::getStaticTypeName())
{
result = std::make_shared<ossim::TiffHandlerState>();
}
return result;
}