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

Used to convert from scalar type enumeration to strings and vice versa. More...

#include <ossimScalarTypeLut.h>

Inheritance diagram for ossimScalarTypeLut:
ossimLookUpTable

Public Member Functions

virtual ~ossimScalarTypeLut ()
 
ossimScalarType getScalarTypeFromString (const ossimString &s) const
 
virtual ossimKeyword getKeyword () const
 
- Public Member Functions inherited from ossimLookUpTable
 ossimLookUpTable (const std::initializer_list< ossimString > &stringInitializer)
 By default if you just give an initializer list with strings then it will assume keys 0..n-1 for each string. More...
 
virtual ~ossimLookUpTable ()
 
virtual ossimString getEntryString (ossim_int32 entry_number) const
 
virtual ossimString getTableIndexString (ossim_uint32 table_index) const
 
virtual ossimString operator[] (ossim_int32 entry_number) const
 
virtual ossimString getEntryString (const ossimKeywordlist &kwl, const char *prefix=0) const
 
virtual ossim_int32 getEntryNumber (const char *entry_string, bool case_insensitive=true) const
 
virtual ossim_int32 getEntryNumber (const ossimKeywordlist &kwl, const char *prefix=0, bool case_insensitive=true) const
 
virtual ossim_uint32 getTableSize () const
 
void dumpValues (std::ostream &out) const
 

Static Public Member Functions

static ossimScalarTypeLutinstance ()
 Returns the static instance of an ossimScalarTypeLut object. More...
 

Protected Member Functions

 ossimScalarTypeLut ()
 
- Protected Member Functions inherited from ossimLookUpTable
 ossimLookUpTable (ossim_int32 table_size)
 
 ossimLookUpTable ()
 

Static Private Attributes

static ossimScalarTypeLuttheInstance = NULL
 

Additional Inherited Members

- Public Types inherited from ossimLookUpTable
enum  { NOT_FOUND = -1 }
 
- Protected Attributes inherited from ossimLookUpTable
std::vector< ossimKeyValueMaptheTable
 

Detailed Description

Used to convert from scalar type enumeration to strings and vice versa.

See ossimConstants.h for a complete list of enumerations. This class is a singleton, only one of them so all callers must go through the instance method like: ossimScalarTypeLut::instance()->getEntryString(scalar);

Definition at line 27 of file ossimScalarTypeLut.h.

Constructor & Destructor Documentation

◆ ~ossimScalarTypeLut()

ossimScalarTypeLut::~ossimScalarTypeLut ( )
virtual

Definition at line 199 of file ossimScalarTypeLut.cpp.

References theInstance.

200 {
201  theInstance = NULL;
202 }
static ossimScalarTypeLut * theInstance

◆ ossimScalarTypeLut()

ossimScalarTypeLut::ossimScalarTypeLut ( )
protected

Definition at line 28 of file ossimScalarTypeLut.cpp.

References ossimLookUpTable::ossimKeyValueMap::init(), OSSIM_CFLOAT32, OSSIM_CFLOAT64, OSSIM_CINT16, OSSIM_CINT32, OSSIM_DOUBLE, OSSIM_FLOAT, OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT64, OSSIM_SINT8, OSSIM_SSHORT16, OSSIM_UCHAR, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT64, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, OSSIM_USHORT16, and ossimLookUpTable::theTable.

Referenced by instance().

29 {
30  //---
31  // Complete initialization of data member "theTable".
32  // Note: Scalar types defined in constants.h file.
33  //---
34  ossimKeyValueMap entry;
35  entry.init(OSSIM_SCALAR_UNKNOWN, "unknown");
36  theTable.push_back(entry);
37 
38  entry.init(OSSIM_UINT8, "ossim_uint8");
39  theTable.push_back(entry);
40 
41  entry.init(OSSIM_SINT8, "ossim_sint8");
42  theTable.push_back(entry);
43 
44  entry.init(OSSIM_UINT16, "ossim_uint16");
45  theTable.push_back(entry);
46 
47  entry.init(OSSIM_SINT16, "ossim_sint16");
48  theTable.push_back(entry);
49 
50  entry.init(OSSIM_UINT32, "ossim_uint32");
51  theTable.push_back(entry);
52 
53  entry.init(OSSIM_SINT32, "ossim_sint32");
54  theTable.push_back(entry);
55 
56  entry.init(OSSIM_UINT64, "ossim_uint64");
57  theTable.push_back(entry);
58 
59  entry.init(OSSIM_SINT64, "ossim_sint64");
60  theTable.push_back(entry);
61 
62  entry.init(OSSIM_FLOAT32, "ossim_float32");
63  theTable.push_back(entry);
64 
65  entry.init(OSSIM_FLOAT64, "ossim_float64");
66  theTable.push_back(entry);
67 
68  entry.init(OSSIM_CINT16, "ossim_cint16");
69  theTable.push_back(entry);
70 
71  entry.init(OSSIM_CINT32, "ossim_cint32");
72  theTable.push_back(entry);
73 
74  entry.init(OSSIM_CFLOAT32, "ossim_cfloat32");
75  theTable.push_back(entry);
76 
77  entry.init(OSSIM_CFLOAT64, "ossim_cfloat64");
78  theTable.push_back(entry);
79 
80  entry.init(OSSIM_UCHAR, "uchar");
81  theTable.push_back(entry);
82 
83  entry.init(OSSIM_USHORT16, "ushort16");
84  theTable.push_back(entry);
85 
86  entry.init(OSSIM_SSHORT16, "sshort16");
87  theTable.push_back(entry);
88 
89  entry.init(OSSIM_USHORT11, "ushort11");
90  theTable.push_back(entry);
91 
92  entry.init(OSSIM_USHORT12, "ushort12");
93  theTable.push_back(entry);
94 
95  entry.init(OSSIM_USHORT13, "ushort13");
96  theTable.push_back(entry);
97 
98  entry.init(OSSIM_USHORT14, "ushort14");
99  theTable.push_back(entry);
100 
101  entry.init(OSSIM_USHORT15, "ushort15");
102  theTable.push_back(entry);
103 
104  entry.init(OSSIM_FLOAT, "float");
105  theTable.push_back(entry);
106 
107  entry.init(OSSIM_NORMALIZED_FLOAT, "normalized_float");
108  theTable.push_back(entry);
109 
110  entry.init(OSSIM_NORMALIZED_DOUBLE, "normalized_double");
111  theTable.push_back(entry);
112 
113  entry.init(OSSIM_DOUBLE, "double");
114  theTable.push_back(entry);
115 
116  // Short forms:
117 
118  entry.init(OSSIM_UINT8, "U8");
119  theTable.push_back(entry);
120 
121  entry.init(OSSIM_SINT8, "S8");
122  theTable.push_back(entry);
123 
124  entry.init(OSSIM_USHORT11, "U11");
125  theTable.push_back(entry);
126 
127  entry.init(OSSIM_USHORT12, "U12");
128  theTable.push_back(entry);
129 
130  entry.init(OSSIM_USHORT13, "U13");
131  theTable.push_back(entry);
132 
133  entry.init(OSSIM_USHORT14, "U14");
134  theTable.push_back(entry);
135 
136  entry.init(OSSIM_USHORT15, "U15");
137  theTable.push_back(entry);
138 
139  entry.init(OSSIM_UINT16, "U16");
140  theTable.push_back(entry);
141 
142  entry.init(OSSIM_SINT16, "S16");
143  theTable.push_back(entry);
144 
145  entry.init(OSSIM_FLOAT32, "F32");
146  theTable.push_back(entry);
147 
148  entry.init(OSSIM_FLOAT64, "F64");
149  theTable.push_back(entry);
150 
151  entry.init(OSSIM_NORMALIZED_FLOAT, "N32");
152  theTable.push_back(entry);
153 
154  entry.init(OSSIM_NORMALIZED_DOUBLE, "N64");
155  theTable.push_back(entry);
156 
157  // Forms from old code "radiometry" key in ossimImageMetaData:
158 
159  entry.init(OSSIM_UINT8, "8-bit");
160  theTable.push_back(entry);
161 
162  entry.init(OSSIM_USHORT11, "11-bit");
163  theTable.push_back(entry);
164 
165  entry.init(OSSIM_USHORT12, "12-bit");
166  theTable.push_back(entry);
167 
168  entry.init(OSSIM_USHORT13, "13-bit");
169  theTable.push_back(entry);
170 
171  entry.init(OSSIM_USHORT14, "14-bit");
172  theTable.push_back(entry);
173 
174  entry.init(OSSIM_USHORT15, "15-bit");
175  theTable.push_back(entry);
176 
177  entry.init(OSSIM_UINT16, "16-bit unsigned");
178  theTable.push_back(entry);
179 
180  entry.init(OSSIM_SINT16, "16-bit signed");
181  theTable.push_back(entry);
182 
183  entry.init(OSSIM_UINT32, "32-bit unsigned");
184  theTable.push_back(entry);
185 
186  entry.init(OSSIM_FLOAT32, "float");
187  theTable.push_back(entry);
188 
189  entry.init(OSSIM_NORMALIZED_FLOAT, "normalized float");
190  theTable.push_back(entry);
191 
192  entry.init(OSSIM_FLOAT64, "double");
193  theTable.push_back(entry);
194 
195  entry.init(OSSIM_NORMALIZED_DOUBLE, "normalized double");
196  theTable.push_back(entry);
197 }
16 bit unsigned integer (15 bits used)
8 bit signed integer
std::vector< ossimKeyValueMap > theTable
32 bit complex floating point
64 bit floating point
16 bit unsigned integer
16 bit signed integer
16 bit unsigned integer (14 bits used)
16 bit unsigned integer (13 bits used)
32 bit floating point
32 bit unsigned integer
64 bit signed integer
32 bit signed integer
32 bit normalized floating point
16 bit complex integer
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
64 bit unsigned integer
64 bit complex floating point
8 bit unsigned integer
32 bit complex integer
32 bit floating point
16 bit unsigned iteger
64 bit floating point
16 bit signed integer
8 bit unsigned iteger
16 bit unsigned integer (12 bits used)

Member Function Documentation

◆ getKeyword()

ossimKeyword ossimScalarTypeLut::getKeyword ( ) const
virtual

Returns keyword for lookups from a Keywordlist.

Reimplemented from ossimLookUpTable.

Definition at line 217 of file ossimScalarTypeLut.cpp.

References ossimKeywordNames::SCALAR_TYPE_KW.

218 {
220 }
static const char * SCALAR_TYPE_KW

◆ getScalarTypeFromString()

ossimScalarType ossimScalarTypeLut::getScalarTypeFromString ( const ossimString s) const

Definition at line 205 of file ossimScalarTypeLut.cpp.

References ossimString::c_str(), ossimLookUpTable::getEntryNumber(), and OSSIM_SCALAR_UNKNOWN.

Referenced by ossimRectilinearDataObject::loadState(), and ossimImageMetaData::updateMetaData().

206 {
207  int scalar_type = getEntryNumber(s.c_str());
208 
209  if (scalar_type == -1)
210  {
211  return OSSIM_SCALAR_UNKNOWN;
212  }
213 
214  return static_cast<ossimScalarType>(scalar_type);
215 }
virtual ossim_int32 getEntryNumber(const char *entry_string, bool case_insensitive=true) const
ossimScalarType
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

◆ instance()

ossimScalarTypeLut * ossimScalarTypeLut::instance ( )
static

Returns the static instance of an ossimScalarTypeLut object.

Definition at line 19 of file ossimScalarTypeLut.cpp.

References ossimScalarTypeLut(), and theInstance.

Referenced by ossim_hdf5::crossesDateline(), demo1(), ossimHdf5Info::dumpNumericalTypeInfo(), ossim_hdf5::getBilinearProjection(), ossimCastTileSourceFilter::getOutputScalarTypeString(), ossimCastTileSourceFilter::getProperty(), ossimEquationCombiner::getProperty(), ossimImageHandler::getProperty(), ossimImageData::getScalarTypeAsString(), ossim_hdf5::getValidBoundingRect(), ossimChipProcTool::initialize(), ossimSrtmSupportData::loadOmd(), ossimTableRemapper::loadState(), ossimCastTileSourceFilter::loadState(), ossimRectilinearDataObject::loadState(), ossimNBandLutDataObject::loadState(), main(), ossimGeoidImage::offsetFromEllipsoid(), ossimCcfHead::print(), ossimTableRemapper::print(), ossimH5ImageDataset::print(), ossimHdf5ImageDataset::print(), ossimRectilinearDataObject::print(), ossim_hdf5::printObject(), ossimTableRemapper::saveState(), ossimCastTileSourceFilter::saveState(), ossimImageMetaData::saveState(), ossimRectilinearDataObject::saveState(), ossimEquationCombiner::saveState(), ossimNBandLutDataObject::saveState(), ossimHdf5ImageDataset::scanForValidImageRect(), ossimCastTileSourceFilter::setOutputScalarType(), ossimBandLutFilter::setOutputScalarType(), ossimCastTileSourceFilter::setProperty(), ossimEquationCombiner::setProperty(), ossimImageMetaData::updateMetaData(), and ossimImageData::write().

20 {
21  if (!theInstance)
22  {
24  }
25  return theInstance;
26 }
static ossimScalarTypeLut * theInstance

Member Data Documentation

◆ theInstance

ossimScalarTypeLut * ossimScalarTypeLut::theInstance = NULL
staticprivate

Definition at line 47 of file ossimScalarTypeLut.h.

Referenced by instance(), and ~ossimScalarTypeLut().


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