OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimAigStatistics.cpp
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: See top level LICENSE.txt file.
4 //
5 // Author: Garrett Potts (gpotts@imagelinks.com)
6 //
7 //*******************************************************************
8 // $Id: ossimAigStatistics.cpp 9963 2006-11-28 21:11:01Z gpotts $
9 
10 #include <ostream>
11 #include <ossim/base/ossimEndian.h>
13 
15  :theMin(0.0),
16  theMax(0.0),
17  theMean(0.0),
18  theStandardDev(0.0)
19 {
20 }
21 
23 {
24  theMin = 0.0;
25  theMax = 0.0;
26  theMean = 0.0;
27  theStandardDev = 0.0;
28 }
29 
31 {
32  ossimEndian endian;
33  double tempDouble;
34 
36  {
37  tempDouble = theMin;
38  endian.swap(tempDouble);
39  out.write((char*)(&tempDouble), 8);
40 
41  tempDouble = theMax;
42  endian.swap(tempDouble);
43  out.write((char*)(&tempDouble), 8);
44 
45  tempDouble = theMean;
46  endian.swap(tempDouble);
47  out.write((char*)(&tempDouble), 8);
48 
49  tempDouble = theStandardDev;
50  endian.swap(tempDouble);
51  out.write((char*)(&tempDouble), 8);
52  }
53  else
54  {
55  out.write((char*)(&theMin), 8);
56  out.write((char*)(&theMax), 8);
57  out.write((char*)(&theMean), 8);
58  out.write((char*)(&theStandardDev), 8);
59  }
60 
61  return true;
62 }
ossimByteOrder getSystemEndianType() const
Definition: ossimEndian.h:78
bool writeStream(std::ostream &out)
void swap(ossim_sint8 &)
Definition: ossimEndian.h:26
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23