OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Public Attributes | Friends | List of all members
ossimAigHeader Class Reference

#include <ossimAigHeader.h>

Public Member Functions

 ossimAigHeader ()
 
void reset ()
 
bool writeStream (std::ostream &out)
 
void setFloatCoverage ()
 
void setIntCoverage ()
 

Public Attributes

char theMagic [8]
 
char theUnknownData [8]
 
ossim_int32 theCellType
 
char theUnknownAssortedData [236]
 
double thePixelSizeX
 
double thePixelSizeY
 
double theUnknownGeoReferencingValues [2]
 
int theNumberOfTilesPerRow
 
int theNumberOfTilesPerColumn
 
int theWidthOfTileInPixels
 
int theUnknownValue
 
int theHeightOfTileInPixels
 

Friends

std::ostream & operator<< (std::ostream &out, const ossimAigHeader &header)
 

Detailed Description

Definition at line 16 of file ossimAigHeader.h.

Constructor & Destructor Documentation

◆ ossimAigHeader()

ossimAigHeader::ossimAigHeader ( )
inline

Definition at line 32 of file ossimAigHeader.h.

References reset().

33  {
34  reset();
35  }

Member Function Documentation

◆ reset()

void ossimAigHeader::reset ( void  )
inline

Definition at line 37 of file ossimAigHeader.h.

References setIntCoverage(), theHeightOfTileInPixels, theMagic, theNumberOfTilesPerColumn, theNumberOfTilesPerRow, thePixelSizeX, thePixelSizeY, theUnknownAssortedData, theUnknownData, theUnknownGeoReferencingValues, theUnknownValue, and theWidthOfTileInPixels.

Referenced by ossimAigHeader().

38  {
39  memset(theMagic, '\0', 8);
40  strcpy(theMagic, "GRID1.2");
41  memset(theUnknownData, '\0', 8);
43  memset(theUnknownAssortedData, '\0', 236);
44  thePixelSizeX = 1.0;
45  thePixelSizeY = 1.0;
51  theUnknownValue = 1;
53  }
int theNumberOfTilesPerColumn
void setIntCoverage()
int theNumberOfTilesPerRow
double theUnknownGeoReferencingValues[2]
double thePixelSizeX
char theUnknownAssortedData[236]
double thePixelSizeY
char theUnknownData[8]

◆ setFloatCoverage()

void ossimAigHeader::setFloatCoverage ( )
inline

Definition at line 57 of file ossimAigHeader.h.

References theCellType.

Referenced by ossimArcInfoGridWriter::writeBinaryAigHeader().

58  {
59  theCellType = 2;
60  }
ossim_int32 theCellType

◆ setIntCoverage()

void ossimAigHeader::setIntCoverage ( )
inline

Definition at line 61 of file ossimAigHeader.h.

References theCellType.

Referenced by reset().

62  {
63  theCellType = 1;
64  }
ossim_int32 theCellType

◆ writeStream()

bool ossimAigHeader::writeStream ( std::ostream &  out)

Definition at line 12 of file ossimAigHeader.cpp.

References ossimEndian::getSystemEndianType(), OSSIM_LITTLE_ENDIAN, ossimEndian::swap(), theCellType, theHeightOfTileInPixels, theMagic, theNumberOfTilesPerColumn, theNumberOfTilesPerRow, thePixelSizeX, thePixelSizeY, theUnknownAssortedData, theUnknownData, theUnknownValue, and theWidthOfTileInPixels.

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
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]
ossim_int32 theCellType

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const ossimAigHeader header 
)
friend

Definition at line 19 of file ossimAigHeader.h.

20  {
21  out << "Magic number: " << header.theMagic << std::endl
22  << "Coverage: " << (header.theCellType==1?"Integer":"float") << std::endl
23  << "Pixel size x: " << header.thePixelSizeX << std::endl
24  << "Pixel size y: " << header.thePixelSizeY << std::endl
25  << "Tiles per row: " << header.theNumberOfTilesPerRow << std::endl
26  << "Tiles per col: " << header.theNumberOfTilesPerColumn << std::endl
27  << "Tile width: " << header.theWidthOfTileInPixels << std::endl
28  << "Tile height: " << header.theHeightOfTileInPixels;
29 
30  return out;
31  }
int theNumberOfTilesPerColumn
int theNumberOfTilesPerRow
double thePixelSizeX
double thePixelSizeY
ossim_int32 theCellType

Member Data Documentation

◆ theCellType

ossim_int32 ossimAigHeader::theCellType

1 means int cover and 2 means float cover

Definition at line 71 of file ossimAigHeader.h.

Referenced by setFloatCoverage(), setIntCoverage(), and writeStream().

◆ theHeightOfTileInPixels

int ossimAigHeader::theHeightOfTileInPixels

Numer of pixels high the tile is. Usually the value is 4

Definition at line 111 of file ossimAigHeader.h.

Referenced by reset(), ossimArcInfoGridWriter::writeBinaryAigHeader(), and writeStream().

◆ theMagic

char ossimAigHeader::theMagic[8]

Definition at line 65 of file ossimAigHeader.h.

Referenced by reset(), and writeStream().

◆ theNumberOfTilesPerColumn

int ossimAigHeader::theNumberOfTilesPerColumn

This is the height of the file in tiles..

Definition at line 97 of file ossimAigHeader.h.

Referenced by reset(), ossimArcInfoGridWriter::writeBinaryAigHeader(), and writeStream().

◆ theNumberOfTilesPerRow

int ossimAigHeader::theNumberOfTilesPerRow

This is the width of the file in tiles..

Definition at line 92 of file ossimAigHeader.h.

Referenced by reset(), ossimArcInfoGridWriter::writeBinaryAigHeader(), and writeStream().

◆ thePixelSizeX

double ossimAigHeader::thePixelSizeX

Holds the width of the pixel in geo referenced coordinate. It's 1 otherwise

Definition at line 79 of file ossimAigHeader.h.

Referenced by reset(), and writeStream().

◆ thePixelSizeY

double ossimAigHeader::thePixelSizeY

Holds the height of the pixel in geo referenced coordinate. It's 1 otherwise

Definition at line 85 of file ossimAigHeader.h.

Referenced by reset(), and writeStream().

◆ theUnknownAssortedData

char ossimAigHeader::theUnknownAssortedData[236]

Definition at line 73 of file ossimAigHeader.h.

Referenced by reset(), and writeStream().

◆ theUnknownData

char ossimAigHeader::theUnknownData[8]

Definition at line 66 of file ossimAigHeader.h.

Referenced by reset(), and writeStream().

◆ theUnknownGeoReferencingValues

double ossimAigHeader::theUnknownGeoReferencingValues[2]

Definition at line 87 of file ossimAigHeader.h.

Referenced by reset().

◆ theUnknownValue

int ossimAigHeader::theUnknownValue

Definition at line 105 of file ossimAigHeader.h.

Referenced by reset(), and writeStream().

◆ theWidthOfTileInPixels

int ossimAigHeader::theWidthOfTileInPixels

Numer of pixels wide the tile is. Usually the value is 256

Definition at line 103 of file ossimAigHeader.h.

Referenced by reset(), ossimArcInfoGridWriter::writeBinaryAigHeader(), and writeStream().


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