OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimAigHeader.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: ossimAigHeader.cpp 9963 2006-11-28 21:11:01Z gpotts $
10 #include <ossim/base/ossimEndian.h>
11 
13 {
14  ossimEndian endian;
15  double tempDouble;
16  ossim_uint32 tempInt;
17 
19  {
20  out.write((char*)theMagic, 8);
21  out.write((char*)theUnknownData, 8);
22  tempInt = theCellType;
23  endian.swap(tempInt);
24  out.write((char*)&tempInt, 4);
25 
26  out.write((char*)theUnknownAssortedData, 236);
27  tempDouble = thePixelSizeX;
28  endian.swap(tempDouble);
29  out.write((char*)(&tempDouble), 8);
30  tempDouble = thePixelSizeY;
31  endian.swap(tempDouble);
32  out.write((char*)(&tempDouble), 8);
33  tempDouble = 0.0;
34  endian.swap(tempDouble);
35  out.write((char*)(&tempDouble), 8);
36  out.write((char*)(&tempDouble), 8);
37 
38  tempInt = theNumberOfTilesPerRow;
39  endian.swap(tempInt);
40  out.write((char*)&tempInt, 4);
41 
42  tempInt = theNumberOfTilesPerColumn;
43  endian.swap(tempInt);
44  out.write((char*)&tempInt, 4);
45 
46  tempInt = theWidthOfTileInPixels;
47  endian.swap(tempInt);
48  out.write((char*)&tempInt, 4);
49 
50  tempInt = theUnknownValue;
51  endian.swap(tempInt);
52  out.write((char*)&tempInt, 4);
53 
54  tempInt = theHeightOfTileInPixels;
55  endian.swap(tempInt);
56  out.write((char*)&tempInt, 4);
57  }
58  else
59  {
60  out.write((char*)theMagic, 8);
61  out.write((char*)theUnknownData, 8);
62  out.write((char*)&theCellType, 4);
63  out.write((char*)theUnknownAssortedData, 236);
64  out.write((char*)(&thePixelSizeX), 8);
65  out.write((char*)(&thePixelSizeY), 8);
66  tempDouble = 0.0;
67  out.write((char*)(&tempDouble), 8);
68  out.write((char*)(&tempDouble), 8);
69  out.write((char*)&theNumberOfTilesPerRow, 4);
70  out.write((char*)&theNumberOfTilesPerColumn, 4);
71  out.write((char*)&theWidthOfTileInPixels, 4);
72  out.write((char*)&theUnknownValue, 4);
73  out.write((char*)&theHeightOfTileInPixels, 4);
74  }
75 
76  return true;
77 }
int theNumberOfTilesPerColumn
bool writeStream(std::ostream &out)
int theNumberOfTilesPerRow
unsigned int ossim_uint32
double thePixelSizeX
ossimByteOrder getSystemEndianType() const
Definition: ossimEndian.h:78
char theUnknownAssortedData[236]
double thePixelSizeY
void swap(ossim_sint8 &)
Definition: ossimEndian.h:26
char theUnknownData[8]
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
ossim_int32 theCellType