OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimKakaduCodecFactory.cpp
Go to the documentation of this file.
1 //----------------------------------------------------------------------------
2 //
3 // License: LGPL
4 //
5 // See LICENSE.txt file in the top level directory for more details.
6 //
7 // Author: David Burken
8 //
9 // Description: Factory class definition for codec(encoder/decoder).
10 //
11 //----------------------------------------------------------------------------
12 // $Id$
13 
17 #include <ossim/base/ossimRefPtr.h>
18 #include <ossim/base/ossimString.h>
19 
20 #include "ossimKakaduJ2kCodec.h"
21 
22 #include <string>
23 
25 
26 static const std::string TYPE_KW = "type";
27 
29 {}
30 
32 {
33  if ( !theInstance )
34  {
36  }
37  return theInstance;
38 }
40 {
42 
43  if((type.downcase() == "c8") )
44  {
45  result = new ossimKakaduJ2kCodec();
46  }
47 
48  return result.release();
49 }
50 
52 {
53  ossimString type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
54  ossimCodecBase* result = 0;
55  if(!type.empty())
56  {
57  result = this->createCodec(type);
58  if(result)
59  {
60  result->loadState(kwl, prefix);
61  }
62  }
63 
64  return result;
65 }
66 
67 void ossimKakaduCodecFactory::getTypeNameList(std::vector<ossimString>& typeNames)const
68 {
69  typeNames.push_back("C8");
70 }
71 
73 {}
74 
76 {}
77 
79  const ossimKakaduCodecFactory& /* rhs */)
80 {
81  return *this;
82 }
Represents serializable keyword/value map.
const char * find(const char *key) const
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
const ossimKakaduCodecFactory & operator=(const ossimKakaduCodecFactory &rhs)
hidden from use operator =
static const char * TYPE_KW
T * release()
Definition: ossimRefPtr.h:93
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48
virtual void getTypeNameList(std::vector< ossimString > &typeNames) const
virtual ossimCodecBase * createCodec(const ossimString &type) const
createCodec takes a type and will return a new codec to encode decode image buffers ...
static ossimKakaduCodecFactory * theInstance
The single instance of this class.
ossimKakaduCodecFactory()
hidden from use default constructor
bool empty() const
Definition: ossimString.h:411
virtual ~ossimKakaduCodecFactory()
virtual destructor
static ossimKakaduCodecFactory * instance()