OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimScalarTypeLut.cpp
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: See top level LICENSE.txt file.
4 //
5 // Author: David Burken
6 //
7 // Description:
8 //
9 // Contains class definition for ossimScalarTypeLUT.
10 //
11 //*******************************************************************
12 // $Id: ossimScalarTypeLut.cpp 22072 2013-01-04 13:46:52Z dburken $
13 
15 #include <ossim/base/ossimString.h>
16 
18 
20 {
21  if (!theInstance)
22  {
24  }
25  return theInstance;
26 }
27 
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 }
198 
200 {
201  theInstance = NULL;
202 }
203 
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 }
216 
218 {
220 }
16 bit unsigned integer (15 bits used)
8 bit signed integer
std::vector< ossimKeyValueMap > theTable
void init(ossim_int32 key, const ossimString &value)
32 bit complex floating point
ossimScalarType getScalarTypeFromString(const ossimString &s) const
64 bit floating point
16 bit unsigned integer
virtual ossimKeyword getKeyword() const
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
virtual ossim_int32 getEntryNumber(const char *entry_string, bool case_insensitive=true) const
static ossimScalarTypeLut * instance()
Returns the static instance of an ossimScalarTypeLut object.
64 bit signed integer
32 bit signed integer
32 bit normalized floating point
static ossimScalarTypeLut * theInstance
ossimScalarType
16 bit complex integer
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
Used to convert from scalar type enumeration to strings and vice versa.
64 bit unsigned integer
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 const char * SCALAR_TYPE_KW
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)