OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Attributes | List of all members
ossimCodecFactory Class Reference

Codec factory. More...

#include <ossimCodecFactory.h>

Inheritance diagram for ossimCodecFactory:
ossimCodecFactoryInterface

Public Member Functions

virtual ~ossimCodecFactory ()
 virtual destructor More...
 
virtual ossimCodecBasecreateCodec (const ossimString &type) const
 createCodec takes a type and will return a new codec to encode decode image buffers More...
 
virtual ossimCodecBasecreateCodec (const ossimKeywordlist &kwl, const char *prefix=0) const
 createCodec takes a type in the keywordlist and will return a new codec to encode decode image buffers More...
 
virtual void getTypeNameList (std::vector< ossimString > &typeNames) const
 
- Public Member Functions inherited from ossimCodecFactoryInterface
 ossimCodecFactoryInterface ()
 default constructor More...
 
virtual ~ossimCodecFactoryInterface ()
 virtual destructor More...
 
virtual ossimObjectcreateObject (const ossimString &type) const
 This is a bridge to the generic factory list interface that trys to call createObject. More...
 
virtual ossimObjectcreateObject (const ossimKeywordlist &kwl, const char *prefix=0) const
 This is a bridge to the generic factory list interface that trys to call createObject. More...
 

Static Public Member Functions

static ossimCodecFactoryinstance ()
 

Private Member Functions

 ossimCodecFactory ()
 hidden from use default constructor More...
 
 ossimCodecFactory (const ossimCodecFactory &obj)
 hidden from use copy constructor More...
 
const ossimCodecFactoryoperator= (const ossimCodecFactory &rhs)
 hidden from use operator = More...
 

Static Private Attributes

static ossimCodecFactorytheInstance = 0
 The single instance of this class. More...
 

Detailed Description

Codec factory.

Definition at line 25 of file ossimCodecFactory.h.

Constructor & Destructor Documentation

◆ ~ossimCodecFactory()

ossimCodecFactory::~ossimCodecFactory ( )
virtual

virtual destructor

Definition at line 28 of file ossimCodecFactory.cpp.

29 {}

◆ ossimCodecFactory() [1/2]

ossimCodecFactory::ossimCodecFactory ( )
private

hidden from use default constructor

Definition at line 73 of file ossimCodecFactory.cpp.

Referenced by instance().

74 {}

◆ ossimCodecFactory() [2/2]

ossimCodecFactory::ossimCodecFactory ( const ossimCodecFactory obj)
private

hidden from use copy constructor

Definition at line 76 of file ossimCodecFactory.cpp.

77 {}

Member Function Documentation

◆ createCodec() [1/2]

ossimCodecBase * ossimCodecFactory::createCodec ( const ossimString type) const
virtual

createCodec takes a type and will return a new codec to encode decode image buffers

Parameters
intype. Type identifer used to allocate the proper codec.
Returns
ossimCodecBase type.

Implements ossimCodecFactoryInterface.

Definition at line 39 of file ossimCodecFactory.cpp.

References ossimString::downcase(), and ossimRefPtr< T >::release().

Referenced by createCodec().

40 {
42 
43  if((type.downcase() == "jpeg") ||
44  (type == "ossimJpegCodec"))
45  {
46  result = new ossimJpegCodec();
47  }
48 
49  return result.release();
50 }
T * release()
Definition: ossimRefPtr.h:93
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48

◆ createCodec() [2/2]

ossimCodecBase * ossimCodecFactory::createCodec ( const ossimKeywordlist kwl,
const char *  prefix = 0 
) const
virtual

createCodec takes a type in the keywordlist and will return a new codec to encode decode image buffers

Parameters
inkwl. Type identifer used to allocate the proper codec.
inprefix. prefix used to prefix keywords during the construction of the codec
Returns
ossimCodecBase type.

Implements ossimCodecFactoryInterface.

Definition at line 52 of file ossimCodecFactory.cpp.

References createCodec(), ossimString::empty(), ossimKeywordlist::find(), ossimObject::loadState(), and ossimKeywordNames::TYPE_KW.

53 {
54  ossimString type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
55  ossimCodecBase* result = 0;
56  if(!type.empty())
57  {
58  result = this->createCodec(type);
59  if(result)
60  {
61  result->loadState(kwl, prefix);
62  }
63  }
64 
65  return result;
66 }
const char * find(const char *key) const
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
static const char * TYPE_KW
virtual ossimCodecBase * createCodec(const ossimString &type) const
createCodec takes a type and will return a new codec to encode decode image buffers ...
bool empty() const
Definition: ossimString.h:411

◆ getTypeNameList()

void ossimCodecFactory::getTypeNameList ( std::vector< ossimString > &  typeNames) const
virtual

Implements ossimCodecFactoryInterface.

Definition at line 68 of file ossimCodecFactory.cpp.

69 {
70  typeNames.push_back("jpeg");
71 }

◆ instance()

ossimCodecFactory * ossimCodecFactory::instance ( )
static
Returns
instance

Definition at line 31 of file ossimCodecFactory.cpp.

References ossimCodecFactory(), and theInstance.

Referenced by ossimCodecFactoryRegistry::instance().

32 {
33  if ( !theInstance )
34  {
36  }
37  return theInstance;
38 }
static ossimCodecFactory * theInstance
The single instance of this class.
ossimCodecFactory()
hidden from use default constructor

◆ operator=()

const ossimCodecFactory & ossimCodecFactory::operator= ( const ossimCodecFactory rhs)
private

hidden from use operator =

Definition at line 79 of file ossimCodecFactory.cpp.

81 {
82  return *this;
83 }

Member Data Documentation

◆ theInstance

ossimCodecFactory * ossimCodecFactory::theInstance = 0
staticprivate

The single instance of this class.

Definition at line 70 of file ossimCodecFactory.h.

Referenced by instance().


The documentation for this class was generated from the following files: