OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimMrSidPluginInit.cpp
Go to the documentation of this file.
1 //----------------------------------------------------------------------------
2 //
3 // License: See top level LICENSE.txt file
4 //
5 // Author: Mingjie Su
6 //
7 // Description: OSSIM MrSID plugin initialization
8 // code.
9 //
10 //----------------------------------------------------------------------------
11 // $Id: ossimMrSidPluginInit.cpp 899 2010-05-17 21:00:26Z david.burken $
12 
18 
21 
22 static void setMrSidDescription(ossimString& description)
23 {
24 #ifdef OSSIM_ENABLE_MRSID_WRITE
25  description = "MrSid reader / writer plugin\n\n";
26 #else
27  description = "MrSid reader plugin\n\n";
28 #endif
29 }
30 
31 extern "C"
32 {
35  std::vector<ossimString> theMrSidObjList;
36 
37  const char* getMrSidDescription()
38  {
39  return theMrSidDescription.c_str();
40  }
41 
43  {
44  return (int)theMrSidObjList.size();
45  }
46 
47  const char* getMrSidClassName(int idx)
48  {
49  if(idx < (int)theMrSidObjList.size())
50  {
51  return theMrSidObjList[idx].c_str();
52  }
53  return (const char*)0;
54  }
55 
56  /* Note symbols need to be exported on windoze... */
58  ossimSharedObjectInfo** info)
59  {
63 
64  *info = &myMrSidInfo;
65 
66  /* Register the readers... */
68  registerFactory(ossimMrSidReaderFactory::instance(), false);
70 
71 #ifdef OSSIM_ENABLE_MRSID_WRITE
72  /* Register the writers... */
74  registerFactory(ossimMrSidWriterFactory::instance());
75  ossimMrSidWriterFactory::instance()->getTypeNameList(theMrSidObjList);
76 #endif
77 
78  setMrSidDescription(theMrSidDescription);
79 
80  }
81 
82  /* Note symbols need to be exported on windoze... */
84  {
86  unregisterFactory(ossimMrSidReaderFactory::instance());
87 
88 #ifdef OSSIM_ENABLE_MRSID_WRITE
90  unregisterFactory(ossimMrSidWriterFactory::instance());
91 #endif
92  }
93 }
std::vector< ossimString > theMrSidObjList
ossimSharedObjectInfo myMrSidInfo
static ossimImageWriterFactoryRegistry * instance()
ossimSharedLibraryGetNumberOfClassNamesPtr getNumberOfClassNames
OSSIM_PLUGINS_DLL void ossimSharedLibraryInitialize(ossimSharedObjectInfo **info)
int getMrSidNumberOfClassNames()
OSSIM_PLUGINS_DLL void ossimSharedLibraryFinalize()
ossimSharedLibraryGetDescriptionPtr getDescription
#define OSSIM_PLUGINS_DLL
ossimSharedLibraryGetClassNamesPtr getClassName
const char * getMrSidDescription()
ossimString theMrSidDescription
virtual void getTypeNameList(std::vector< ossimString > &typeList) const
Adds ossimMrSidWriter to the typeList.
const char * getMrSidClassName(int idx)
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
static ossimImageHandlerRegistry * instance()
static ossimMrSidReaderFactory * instance()
static method to return instance (the only one) of this class.