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
ossimPngCodecFactory Class Reference

Codec factory. More...

#include <ossimPngCodecFactory.h>

Inheritance diagram for ossimPngCodecFactory:
ossimCodecFactoryInterface

Public Member Functions

virtual ~ossimPngCodecFactory ()
 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 ossimPngCodecFactoryinstance ()
 

Private Member Functions

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

Static Private Attributes

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

Detailed Description

Codec factory.

Definition at line 24 of file ossimPngCodecFactory.h.

Constructor & Destructor Documentation

◆ ~ossimPngCodecFactory()

ossimPngCodecFactory::~ossimPngCodecFactory ( )
virtual

virtual destructor

Definition at line 29 of file ossimPngCodecFactory.cpp.

30 {}

◆ ossimPngCodecFactory() [1/2]

ossimPngCodecFactory::ossimPngCodecFactory ( )
private

hidden from use default constructor

Definition at line 83 of file ossimPngCodecFactory.cpp.

Referenced by instance().

84 {}

◆ ossimPngCodecFactory() [2/2]

ossimPngCodecFactory::ossimPngCodecFactory ( const ossimPngCodecFactory obj)
private

hidden from use copy constructor

Definition at line 86 of file ossimPngCodecFactory.cpp.

87 {}

Member Function Documentation

◆ createCodec() [1/2]

ossimCodecBase * ossimPngCodecFactory::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 40 of file ossimPngCodecFactory.cpp.

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

Referenced by createCodec().

41 {
43  ossimString tempType = type.downcase();
44  if(tempType == "png")
45  {
46  result = new ossimPngCodec();
47  }
48  else if(tempType == "pnga")
49  {
50  result = new ossimPngCodec(true);
51  }
52  else if(tempType == "ossimPngCodec")
53  {
54  result = new ossimPngCodec();
55  }
56 
57  return result.release();
58 }
T * release()
Definition: ossimRefPtr.h:93
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48

◆ createCodec() [2/2]

ossimCodecBase * ossimPngCodecFactory::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 60 of file ossimPngCodecFactory.cpp.

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

61 {
62  ossimString type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
63  ossimCodecBase* result = 0;
64  if(!type.empty())
65  {
66  result = this->createCodec(type);
67  if(result)
68  {
69  result->loadState(kwl, prefix);
70  }
71  }
72 
73  return result;
74 }
const char * find(const char *key) const
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
static const char * TYPE_KW
bool empty() const
Definition: ossimString.h:411
virtual ossimCodecBase * createCodec(const ossimString &type) const
createCodec takes a type and will return a new codec to encode decode image buffers ...

◆ getTypeNameList()

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

Implements ossimCodecFactoryInterface.

Definition at line 76 of file ossimPngCodecFactory.cpp.

77 {
78  typeNames.push_back("png");
79  typeNames.push_back("pnga");
80  typeNames.push_back("ossimPngCodec");
81 }

◆ instance()

ossimPngCodecFactory * ossimPngCodecFactory::instance ( )
static
Returns
instance

Definition at line 32 of file ossimPngCodecFactory.cpp.

References m_instance, and ossimPngCodecFactory().

Referenced by ossimSharedLibraryFinalize().

33 {
34  if ( !m_instance )
35  {
37  }
38  return m_instance;
39 }
ossimPngCodecFactory()
hidden from use default constructor
static ossimPngCodecFactory * m_instance
The single instance of this class.

◆ operator=()

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

hidden from use operator =

Definition at line 89 of file ossimPngCodecFactory.cpp.

91 {
92  return *this;
93 }

Member Data Documentation

◆ m_instance

ossimPngCodecFactory * ossimPngCodecFactory::m_instance = 0
staticprivate

The single instance of this class.

Definition at line 69 of file ossimPngCodecFactory.h.

Referenced by instance().


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