OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimCommon.h
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: MIT
4 //
5 // See LICENSE.txt file in the top level directory for more details.
6 //
7 // Author: Garrett Potts, with some additions and modifciations by
8 // Patrick Melody
9 //
10 // Description: Common file for utility functions.
11 //
12 //*************************************************************************
13 // $Id: ossimCommon.h 23131 2015-02-06 13:35:55Z gpotts $
14 #ifndef ossimCommon_HEADER
15 #define ossimCommon_HEADER 1
16 
17 
18 // XXX nullify these for now, but eventually replace with a #include
19 #define ossimREQUIRE(expr)
20 #define ossimENSURE(expr)
21 #define ossimCHECK(expr)
22 #define ossimSTATIC_CHECK(expr,msg)
23 
25 #include <ossim/base/ossimString.h>
26 #include <cfloat>
27 #include <cmath>
28 #include <istream>
29 #include <sstream>
30 #include <string>
31 #include <vector>
32 #include <iostream>
33 #include <algorithm>
34 #include <iterator>
35 
36 class ossimIpt;
37 class ossimIrect;
38 class ossimDpt;
39 class ossimGpt;
40 namespace NEWMAT
41 {
42  class Matrix;
43 }
44 
45 namespace ossim
46 {
48  OSSIM_DLL bool isWhiteSpace(int c);
49  template<class T>
50 /* inline bool almostEqual(T x, T y, T tolerence = std::numeric_limits<T>::epsilon()) */
51 /* // are x and y within tolerance distance of each other? */
52 /* { return std::abs(x - y) <= tolerence; } */
53  inline bool almostEqual(T x, T y, T tolerance = FLT_EPSILON)
54  // are x and y within tolerance distance of each other?
55  { return std::fabs(x - y) <= tolerance; }
56 
57  template <class T>
58  inline bool inInterval(T x, T a, T b)
59  // is x in the closed interval [a,b]?
60  { return x >= a && x <= b; }
61 
62  template <class T>
63  inline bool inOpenInterval(T x, T a, T b)
64  // is x in the open interval (a,b)?
65  { return x > a && x < b; }
66 
67 
77 #if defined(WIN32) || defined(_MSC_VER) && !defined(__CYGWIN__) && !defined(__MWERKS__)
78  inline bool isnan(const float& v) { return _isnan(v); }
79  inline bool isnan(const double& v) { return _isnan(v); }
80 #elif defined(sun) || defined(__sun)
81 # if defined(__SVR4) || defined(__svr4__)
82 /* Solaris */
83  inline bool isnan(const float& v) { return ( ::isnan(v) ); }
84  inline bool isnan(const double& v) { return ( ::isnan(v) ); }
85 # else
86 /* SunOS */
87  inline bool isnan(const float& v) { return ( ::isnan(v) ); }
88  inline bool isnan(const double& v) { return ( ::isnan(v) ); }
89 # endif
90 #else
91  inline bool isnan(const float& v) { return ( std::isnan(v) ); }
92  inline bool isnan(const double& v) { return ( std::isnan(v) ); }
93 #endif
94 
95 /* #if defined(WIN32) || defined(_MSC_VER) && !defined(__CYGWIN__) && !defined(__MWERKS__) */
96 /* inline bool isnan(const float& v) { return _isnan(v); } */
97 /* inline bool isnan(const double& v) { return _isnan(v); } */
98 /* #else */
99 /* inline bool isnan(const float& v) { return ( std::isnan(v) ); } */
100 /* inline bool isnan(const double& v) { return ( std::isnan(v) ); } */
101 /* #endif */
102 
105  {
106  public:
107  union
108  {
111  } bits;
112  IntFloatBitCoercion(ossim_int64 x) { bits.intname = x; }
113  IntFloatBitCoercion(ossim_float64 x) { bits.floatname = x; }
114  };
115 
120  extern OSSIM_DLL_DATA(const IntFloatBitCoercion) nanValue;
121 
135  inline double nan() { return nanValue.bits.floatname; }
136 
137  template <class T>
138  inline T abs(const T& value)
139  {
140  if(value < 0)
141  {
142  return -value;
143  }
144  return value;
145  }
146  template <class S, class T>
147  inline T lerp(S x, T begin, T end)
148  // linear interpolation from begin to end by x
149  { return x*(end - begin) + begin; }
150 
151  template <class T>
152  inline T inverseLerp(T x, T begin, T end)
153  // inverse of lerp: if lerp(z,begin,end) = x, then inverseLerp(x,begin,end) = z.
154  // when begin=end, inverseLerp is underconstrained, so we define it to be 0.
155  { return begin == end ? (ossim::isnan(x) ? x : T(0)) : (x - begin)/(end - begin); }
156 
157  template <class S, class T>
158  T quaderp(S x, T begin, T middle, T end)
159  // quadratic interpolation through begin,middle,end by x
160  {
161  // newton interpolation
162  const T a1 = S(2)*(middle - begin);
163  const T a2 = S(2)*(end - middle) - a1;
164  return x*((x - S(0.5))*a2 + a1) + begin;
165  }
166 
167  template <class T>
168  inline T clamp(T x, T a, T b)
169  // clamp x to [a, b]
170  {
171  ossimREQUIRE(a <= b); // input must make sense, disallow nans
172 
173  if (ossim::isnan(x)) return x;
174  if (x < a) return a;
175  if (b < x) return b;
176  return x;
177  }
178 
179  template <class T>
180  T wrap(T x, T a, T b)
181  // wrap x modularly into [a,b)
182  {
183  ossimREQUIRE(a <= b); // input must make sense, disallow nans
184 
185  if (a == b && !ossim::isnan(x))
186  return a;
187  else {
188  T z = x < a ? b : a;
189  return std::fmod(x - z, b - a) + z;
190  }
191  }
192 
193  // XXX to Garrett from PJM:
194  // min and max routines. std::min/max do not in fact correctly handle nan.
195  // this is troublesome, i think my code always was asserting no nans before values got
196  // through std::min/std::max. i agree with you that if any of the input is nan,
197  // then the result should be nan, but the STL doesn't really consider the possibility
198  // that inputs to min/max have a "strange" ordering to them. we could overload
199  // std::min/max to do this behavior but that's evil. for all my whining, i think
200  // we should have ossim::max/max that do the right thing wrt nan. however:
201  // if we "correctly" handle nans like this, does that subtly break any existing code?
202  template <class T>
203  inline T min(T a, T b)
204  // min of a,b; nan if either a or b are nan
205  {
206  return (a < b) ? a : b;
207  }
208 
209  template <>
211  {
212  if (ossim::isnan(a)||ossim::isnan(b))
213  {
214  return ossim::nan();
215  }
216  else
217  {
218  return (a < b) ? a : b;
219  }
220  }
221 
222  template <>
224  {
225  if (ossim::isnan(a)||ossim::isnan(b))
226  {
227  return ossim::nan();
228  }
229  else
230  {
231  return (a < b) ? a : b;
232  }
233  }
234 
235  template <class T>
236  inline T max(T a, T b)
237  // max of a,b; nan if either a or b are nan
238  {
239  return (a < b) ? b : a;
240  }
241  template <>
243  {
244  if (ossim::isnan(b))
245  return b;
246  else
247  return (a < b) ? b : a;
248  }
249  template <>
251  {
252  if (ossim::isnan(b))
253  return b;
254  else
255  return (a < b) ? b : a;
256  }
257  inline double radiansToDegrees(double x) { return x*DEG_PER_RAD;}
258  inline double degreesToRadians(double x) { return x*RAD_PER_DEG;}
259  inline double cosd(double x) { return std::cos(x*RAD_PER_DEG); }
260  inline double sind(double x) { return std::sin(x*RAD_PER_DEG); }
261  inline double tand(double x) { return std::tan(x*RAD_PER_DEG); }
262  // trig fncs with parameter in degrees
263 
264  inline double acosd(double x) { return DEG_PER_RAD*std::acos(x); }
265  inline double asind(double x) { return DEG_PER_RAD*std::asin(x); }
266  inline double atand(double x) { return DEG_PER_RAD*std::atan(x); }
267  inline double atan2d(double y, double x) { return DEG_PER_RAD*std::atan2(y,x); }
268  // trig fncs with result in degrees
269 
270  template <class IntType>
271  IntType gcd(IntType n, IntType m)
272  // greatest common divisor of two ints
273  // NB: We use n and m as temporaries in this function, so there is no value
274  // in using const IntType& as we would only need to make a copy anyway...
275  {
276  IntType zero(0); // Avoid repeated construction
277 
278  // This is abs() - given the existence of broken compilers with Koenig
279  // lookup issues and other problems, I code this explicitly. (Remember,
280  // IntType may be a user-defined type).
281  if (n < zero)
282  n = -n;
283  if (m < zero)
284  m = -m;
285 
286  // As n and m are now positive, we can be sure that %= returns a
287  // positive value (the standard guarantees this for built-in types,
288  // and we require it of user-defined types).
289  for (;;) {
290  if (m == zero)
291  return n;
292  n %= m;
293  if (n == zero)
294  return m;
295  m %= n;
296  }
297  }
298 
299  template <>
300  inline int gcd<int>(int n, int m)
301  // greatest common divisor specialize for int.
302  // XXX this is the old gcd, the above code is the old ossimGcd().
303  // i made this a specialization of the template above,
304  // is this really necessary or more efficient, or can we safely delete this specialization?
305  // i don't know why this fnc must be decled inline, otherwise there's a compile error.
306  // the simple test case doesn't have this problem.
307  {
308  if (m == 0)
309  return n;
310  else
311  return gcd(m, n % m); // gcc can optimize tail calls right?
312  }
313 
314  template <class IntType>
315  IntType lcm(IntType n, IntType m)
316  // least common multiple
317  // NB: We use n and m as temporaries in this function, so there is no value
318  // in using const IntType& as we would only need to make a copy anyway...
319  {
320  IntType zero(0); // Avoid repeated construction
321 
322  if (n == zero || m == zero) {
323  return zero;
324  } else {
325  n /= gcd(n, m);
326  n *= m;
327  if (n < zero)
328  n = -n;
329  return n;
330  }
331  }
332 
333  template<class T>
334  inline T square(T x)
335  { return x*x; }
336 
337  // identical to copysign() but usable in templates
338  template <class T>
339  inline T sgn(T x)
340  // signum function, returns 0, 1, -1, or nan
341  {
342  const T table[] = {T(0), T(1), T(-1)};
343  return table[((x < T(0)) << 1) | (x > T(0))];
344  }
345  template <>
347  // signum function, returns 0, 1, -1, or nan
348  {
349  const ossim_float32 table[] = {ossim_float32(0), ossim_float32(1), ossim_float32(-1)};
350  return ossim::isnan(x) ? x : table[((x < ossim_float32(0)) << 1) | (x > ossim_float32(0))];
351  }
352  template <>
354  // signum function, returns 0, 1, -1, or nan
355  {
356  const ossim_float64 table[] = {ossim_float64(0), ossim_float64(1), ossim_float64(-1)};
357  return ossim::isnan(x) ? x : table[((x < ossim_float64(0)) << 1) | (x > ossim_float64(0))];
358  }
359 
360  template <class R, class F>
361  inline R round(F x)
362  // correctly round a float, and cast to desired type R
363  {
364  R result = static_cast<R>((x < F(0)) ? std::ceil(x - F(0.5)) : std::floor(x + F(0.5)));
365 
366  ossimENSURE(ossim::isnan(x) == ossim::isnan(result)); // if x is nan, R must be a float type
367  return result;
368 
369  // XXX is this better than use of ceil/floor?: return static_cast<long long>((x < T(0)) ? x - T(0.5) : x + T(0.5));
370  }
371 
372  inline double ft2mtrs(double feet) { return (feet * MTRS_PER_FT); }
373  inline double usft2mtrs(double feet) { return (feet * US_METERS_PER_FT); }
374  inline double mtrs2ft(double meters) { return (meters / MTRS_PER_FT); }
375  inline double mtrs2usft(double meters) { return (meters / US_METERS_PER_FT); }
376  // Common conversion functions
377 
378  template <class T>
379  std::pair<T, T> quadraticRoots(T a, T b, T c)
380  // evaluates quadradic formula (positive sqrt is first)
381  {
382  // XXX could suffer from catastrophic cancellation,
383  // see David Goldberg's "What Every Computer Scientist Should Know About Floating-Point Arithmetic"
384  T s = std::sqrt(b*b - T(4)*a*c);
385  T twoA = T(2)*a;
386  return std::pair<T, T>((-b + s)/twoA, (-b - s)/twoA);
387  }
388 
389  template <class T>
390  inline void memClear(T& var, int z = 0)
391  // zero out a variable's memory (for a given value of zero)
392  { memset(&var, z, sizeof(T)); }
393 
394  template <class T>
395  inline void memClear(T* var)
396  // prevent user from accidentally passing in a pointer to his struct
397  { ossimSTATIC_CHECK(false, YOU_PROBABLY_WANT_TO_MEMCLEAR_WHAT_THE_POINTER_POINTS_TO_NOT_THE_POINTER_ITSELF); }
398 
400  // test endianness of current machine
401 
402  // values for various scalar types
403  OSSIM_DLL double defaultMin(ossimScalarType scalarType);
404  OSSIM_DLL double defaultMax(ossimScalarType scalarType);
405  OSSIM_DLL double defaultNull(ossimScalarType scalarType);
407 
409  OSSIM_DLL bool isSigned(ossimScalarType scalarType);
410 
420 
430 
431  OSSIM_DLL void defaultTileSize(ossimIpt& tileSize);
432 
433  OSSIM_DLL std::string convertHtmlSpecialCharactersToNormalCharacter(const std::string& src);
434 
436  OSSIM_DLL bool matrixToHpr( ossim_float64 hpr[3],
437  const NEWMAT::Matrix& rotation );
438 
440  OSSIM_DLL bool matrixToHpr( ossim_float64 hpr[3],
441  const NEWMAT::Matrix& lsrMatrix,
442  const NEWMAT::Matrix& rotationalMatrix);
443 
444  OSSIM_DLL void lexQuotedTokens(const std::string& str,
445  ossim_uint32 start,
446  const char* whitespace,
447  const char* quotes,
448  std::vector<std::string>& tokens, bool& unbalancedQuotes);
455  OSSIM_DLL void toStringList(ossimString& resultStringOfPoints,
456  const std::vector<ossimDpt>& pointList,
457  char separator=' ');
458  OSSIM_DLL void toStringList(ossimString& resultStringOfPoints,
459  const std::vector<ossimIpt>& pointList,
460  char separator = ' ');
461  OSSIM_DLL void toStringList(ossimString& resultStringOfPoints,
462  const std::vector<ossimGpt>& pointList,
463  char seaprator = ' ');
464 
469  OSSIM_DLL void toVector(std::vector<ossimDpt>& result,
470  const ossimString& stringOfPoints);
471  OSSIM_DLL void toVector(std::vector<ossimIpt>& result,
472  const ossimString& stringOfPoints);
473  OSSIM_DLL void toVector(std::vector<ossimGpt>& result,
474  const ossimString& stringOfPoints);
475 
483  template <class T>
485  const std::vector<T>& valuesList)
486  {
487  std::ostringstream out;
488 
489  if(!valuesList.empty())
490  {
491  ossim_uint32 idx = 0;
492  ossim_uint32 size = (ossim_uint32) (valuesList.size()-1);
493  for(idx = 0; idx < size; ++idx)
494  {
495  out << valuesList[idx] << ",";
496  }
497  out << valuesList[size];
498  }
499 
500  result = "("+out.str()+")";
501  }
502 
512  template <>
514  const std::vector<ossim_uint8>& valuesList);
515  template <>
517  const std::vector<ossim_float64>& valuesList);
518  template <>
520  const std::vector<ossim_float32>& valuesList);
521  template <>
523  const std::vector<ossimString>& valuesList);
524 
533  OSSIM_DLL bool extractSimpleValues(std::vector<ossimString>& values,
534  const ossimString& stringOfPoints);
535 
536 
537  template <class T> bool toSimpleVector(std::vector<T>& result, const ossimString& stringOfPoints)
538  {
539  std::istringstream in(stringOfPoints);
540  ossim::skipws(in);
541  bool returnValue = true;
542  char c = in.get();
543  ossimString value = "";
544  if(c == '(')
545  {
546  c = (char)in.get();
547  while( (c!=')') && (c!= '\n') && (in.good()) )
548  {
549  if(c!= ',')
550  {
551  value += ossimString(c);
552  }
553  else
554  {
555  result.push_back(static_cast<T>(value.toDouble()));
556  value = "";
557  }
558  c = in.get();
559  }
560  }
561  if(c!= ')')
562  {
563  returnValue = false;
564  }
565  else
566  {
567  if(!value.empty())
568  {
569  result.push_back(static_cast<T>(value.toDouble()));
570  }
571  }
572 
573  return returnValue;
574  }
575 
580  OSSIM_DLL bool toSimpleVector(std::vector<ossim_uint32>& result,
581  const ossimString& stringOfPoints);
586  OSSIM_DLL bool toSimpleVector(std::vector<ossim_int32>& result,
587  const ossimString& stringOfPoints);
592  OSSIM_DLL bool toSimpleVector(std::vector<ossim_uint16>& result,
593  const ossimString& stringOfPoints);
598  OSSIM_DLL bool toSimpleVector(std::vector<ossim_int16>& result,
599  const ossimString& stringOfPoints);
604  OSSIM_DLL bool toSimpleVector(std::vector<ossim_uint8>& result,
605  const ossimString& stringOfPoints);
610  OSSIM_DLL bool toSimpleVector(std::vector<ossim_int8>& result,
611  const ossimString& stringOfPoints);
612 
617  OSSIM_DLL bool toSimpleVector(std::vector<ossimString>& result,
618  const ossimString& stringOfStrings);
619 
620  // lex str into tokens starting at position start using whitespace
621  // chars as delimiters and quotes[0] and quotes[1] as the opening
622  // and closing quotation chars (for quoting tokens containing whitespace).
623  // unbalancedQuotes is true iff it aborted when detecting unbalanced quoting.
624  // REQUIRE(whitespace != NULL);
625  // REQUIRE(quotes != NULL);
626  // REQUIRE(tokens != NULL);
627  // REQUIRE(unbalancedQuotes != NULL);
628 
639 
656  OSSIM_DLL void getFormattedTime( const std::string& format,
657  bool gmtFlag,
658  std::string& result );
659 
672 
685 
686 } // End: namespace ossim
687 
688 
689 #endif /* #ifndef ossimCommon_HEADER */
IntFloatBitCoercion(ossim_float64 x)
Definition: ossimCommon.h:113
ossim_uint32 x
double asind(double x)
Definition: ossimCommon.h:265
OSSIM_DLL ossim_uint32 computeLevels(const ossimIrect &rect)
Computes the number of decimation levels to get to the overview stop dimension.
OSSIM_DLL ossim_int64 getTime()
Gets the current time.
ossim_float64 max< ossim_float64 >(ossim_float64 a, ossim_float64 b)
Definition: ossimCommon.h:250
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
Definition: ossimIosFwd.h:35
T max(T a, T b)
Definition: ossimCommon.h:236
T sgn(T x)
Definition: ossimCommon.h:339
T clamp(T x, T a, T b)
Definition: ossimCommon.h:168
#define DEG_PER_RAD
ossim_uint32 y
OSSIM_DLL void toStringList(ossimString &resultStringOfPoints, const std::vector< ossimDpt > &pointList, char separator=' ')
Will take a vector of ossimDpt and convert to a string list separated by spaces For example: (45...
float ossim_float32
std::pair< T, T > quadraticRoots(T a, T b, T c)
Definition: ossimCommon.h:379
bool almostEqual(T x, T y, T tolerance=FLT_EPSILON)
Definition: ossimCommon.h:53
T inverseLerp(T x, T begin, T end)
Definition: ossimCommon.h:152
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135
This code was derived from https://gist.github.com/mshockwave.
Definition: Barrier.h:8
bool inOpenInterval(T x, T a, T b)
Definition: ossimCommon.h:63
T wrap(T x, T a, T b)
Definition: ossimCommon.h:180
T abs(const T &value)
Definition: ossimCommon.h:138
OSSIM_DLL void defaultTileSize(ossimIpt &tileSize)
void toSimpleStringList(ossimString &result, const std::vector< T > &valuesList)
This will output a vector of values inst a string.
Definition: ossimCommon.h:484
double acosd(double x)
Definition: ossimCommon.h:264
OSSIM_DLL ossimByteOrder byteOrder()
Definition: ossimCommon.cpp:54
ossim_float32 sgn< ossim_float32 >(ossim_float32 x)
Definition: ossimCommon.h:346
OSSIM_DLL ossim_uint32 getActualBitsPerPixel(ossimScalarType scalarType)
Get actual bits per pixel for a given scalar type.
T square(T x)
Definition: ossimCommon.h:334
double sind(double x)
Definition: ossimCommon.h:260
R round(F x)
Definition: ossimCommon.h:361
OSSIM_DLL bool extractSimpleValues(std::vector< ossimString > &values, const ossimString &stringOfPoints)
Generic function to extract a list of values into a vector of string where the string of points is of...
ossim_float32 min< ossim_float32 >(ossim_float32 a, ossim_float32 b)
Definition: ossimCommon.h:210
bool isnan(const double &v)
Definition: ossimCommon.h:92
OSSIM_DLL ossim_uint32 getNumberOfThreads()
Get the number threads to use from ossimPreferences or ossim::Thread.
OSSIM_DLL std::string convertHtmlSpecialCharactersToNormalCharacter(const std::string &src)
bool inInterval(T x, T a, T b)
Definition: ossimCommon.h:58
bool toSimpleVector(std::vector< T > &result, const ossimString &stringOfPoints)
Definition: ossimCommon.h:537
double tand(double x)
Definition: ossimCommon.h:261
double radiansToDegrees(double x)
Definition: ossimCommon.h:257
void push_back(char c)
Equivalent to insert(end(), c).
Definition: ossimString.h:905
double ossim_float64
#define ossimSTATIC_CHECK(expr, msg)
Definition: ossimCommon.h:22
#define US_METERS_PER_FT
OSSIM_DLL double defaultMin(ossimScalarType scalarType)
Definition: ossimCommon.cpp:73
OSSIM_DLL bool isSigned(ossimScalarType scalarType)
OSSIM_DLL std::istream & skipws(std::istream &in)
Definition: ossimCommon.cpp:38
IntFloatBitCoercion(ossim_int64 x)
Definition: ossimCommon.h:112
OSSIM_DLL void toVector(std::vector< ossimDpt > &result, const ossimString &stringOfPoints)
Will take a string list separated by spaces and convert to a vector of ossimDpts. ...
yy_size_t size
#define ossimENSURE(expr)
Definition: ossimCommon.h:20
double degreesToRadians(double x)
Definition: ossimCommon.h:258
OSSIM_DLL void getFormattedTime(const std::string &format, bool gmtFlag, std::string &result)
Gets the current time.
os2<< "> n<< " > nendobj n
#define FLT_EPSILON
OSSIM_DLL double defaultNull(ossimScalarType scalarType)
T quaderp(S x, T begin, T middle, T end)
Definition: ossimCommon.h:158
unsigned int ossim_uint32
void memClear(T &var, int z=0)
Definition: ossimCommon.h:390
double toDouble() const
double atan2d(double y, double x)
Definition: ossimCommon.h:267
OSSIM_DLL bool matrixToHpr(ossim_float64 hpr[3], const NEWMAT::Matrix &rotation)
Heading pitch roll extraction from a matrix.
OSSIM_DLL ossim_uint32 scalarSizeInBytes(ossimScalarType scalarType)
ossimByteOrder
T min(T a, T b)
Definition: ossimCommon.h:203
Class lets us see bit patterns of floats.
Definition: ossimCommon.h:104
Definition: newmat.h:543
double cosd(double x)
Definition: ossimCommon.h:259
OSSIM_DLL void lexQuotedTokens(const std::string &str, ossim_uint32 start, const char *whitespace, const char *quotes, std::vector< std::string > &tokens, bool &unbalancedQuotes)
double ft2mtrs(double feet)
Definition: ossimCommon.h:372
ossimScalarType
OSSIM_DLL ossim_uint32 getBitsPerPixel(ossimScalarType scalarType)
Get bits per pixel for a given scalar type.
#define MTRS_PER_FT
std::basic_istream< char > istream
Base class for char input streams.
Definition: ossimIosFwd.h:20
T lerp(S x, T begin, T end)
Definition: ossimCommon.h:147
OSSIM_DLL double defaultMax(ossimScalarType scalarType)
double usft2mtrs(double feet)
Definition: ossimCommon.h:373
#define OSSIM_DLL
IntType lcm(IntType n, IntType m)
Definition: ossimCommon.h:315
double atand(double x)
Definition: ossimCommon.h:266
int gcd< int >(int n, int m)
Definition: ossimCommon.h:300
long long ossim_int64
bool empty() const
Definition: ossimString.h:411
#define ossimREQUIRE(expr)
Definition: ossimCommon.h:19
double mtrs2usft(double meters)
Definition: ossimCommon.h:375
std::basic_istringstream< char > istringstream
Class for char input memory streams.
Definition: ossimIosFwd.h:32
double mtrs2ft(double meters)
Definition: ossimCommon.h:374
OSSIM_DLL bool isWhiteSpace(int c)
Definition: ossimCommon.cpp:49
OSSIM_DLL_DATA(const IntFloatBitCoercion) nanValue
Declaration of nan part of nan() declared here for inline ossim::nan().
#define RAD_PER_DEG
ossim_float32 max< ossim_float32 >(ossim_float32 a, ossim_float32 b)
Definition: ossimCommon.h:242
bool isnan(const float &v)
isnan Test for floating point Not A Number (NAN) value.
Definition: ossimCommon.h:91
IntType gcd(IntType n, IntType m)
Definition: ossimCommon.h:271
ossim_float64 min< ossim_float64 >(ossim_float64 a, ossim_float64 b)
Definition: ossimCommon.h:223