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

#include <ossimAigDataFileHeader.h>

Public Member Functions

 ossimAigDataFileHeader ()
 
void reset ()
 
bool writeStream (std::ostream &out) const
 

Public Attributes

ossim_uint8 theMagicNumber [8]
 
ossim_uint8 theZeroFill1 [16]
 
ossim_int32 theFileSize
 
ossim_uint8 theZeroFill2 [72]
 
ossim_int16 theTileSize
 
ossim_uint8 theTileType
 
ossim_uint8 theMinSize
 
ossim_int32 theMin
 

Detailed Description

Definition at line 15 of file ossimAigDataFileHeader.h.

Constructor & Destructor Documentation

◆ ossimAigDataFileHeader()

ossimAigDataFileHeader::ossimAigDataFileHeader ( )
inline

Definition at line 18 of file ossimAigDataFileHeader.h.

References reset().

19  {
20  reset();
21  }

Member Function Documentation

◆ reset()

void ossimAigDataFileHeader::reset ( void  )
inline

Definition at line 23 of file ossimAigDataFileHeader.h.

References theFileSize, theMagicNumber, theZeroFill1, and theZeroFill2.

Referenced by ossimAigDataFileHeader().

24  {
25  theMagicNumber[0] = 0x00;
26  theMagicNumber[1] = 0x00;
27  theMagicNumber[2] = 0x27;
28  theMagicNumber[3] = 0x0A;
29  theMagicNumber[4] = 0xFF;
30  theMagicNumber[5] = 0xFF;
31  theMagicNumber[6] = 0xFC;
32  theMagicNumber[7] = 0x14;
33  memset((char*)theZeroFill1,
34  0x00,
35  16);
36  memset((char*)theZeroFill2,
37  0x00,
38  72);
39  theFileSize = 50;
40  }

◆ writeStream()

bool ossimAigDataFileHeader::writeStream ( std::ostream &  out) const

Definition at line 12 of file ossimAigDataFileHeader.cpp.

References ossimEndian::getSystemEndianType(), OSSIM_LITTLE_ENDIAN, ossimEndian::swap(), theFileSize, theMagicNumber, theZeroFill1, and theZeroFill2.

Referenced by ossimArcInfoGridWriter::writeFile().

13 {
14  ossimEndian endian;
15  ossim_uint32 tempInt;
16 
18  {
19  out.write((char*)theMagicNumber, 8);
20  out.write((char*)theZeroFill1, 16);
21  tempInt = theFileSize;
22  endian.swap(tempInt);
23  out.write((char*)(&tempInt), 4);
24  out.write((char*)theZeroFill2, 72);
25  }
26  else
27  {
28  out.write((char*)theMagicNumber, 8);
29  out.write((char*)theZeroFill1, 16);
30  out.write((char*)(&theFileSize), 8);
31  out.write((char*)theZeroFill2, 72);
32  }
33 
34  return out.good();
35 }
unsigned int ossim_uint32
ossimByteOrder getSystemEndianType() const
Definition: ossimEndian.h:78
void swap(ossim_sint8 &)
Definition: ossimEndian.h:26

Member Data Documentation

◆ theFileSize

ossim_int32 ossimAigDataFileHeader::theFileSize

The size of this file in number of shorts.

Definition at line 48 of file ossimAigDataFileHeader.h.

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

◆ theMagicNumber

ossim_uint8 ossimAigDataFileHeader::theMagicNumber[8]

Definition at line 43 of file ossimAigDataFileHeader.h.

Referenced by reset(), and writeStream().

◆ theMin

ossim_int32 ossimAigDataFileHeader::theMin

Definition at line 162 of file ossimAigDataFileHeader.h.

◆ theMinSize

ossim_uint8 ossimAigDataFileHeader::theMinSize

Number of bytes following to form the minimum value for the tile (integer coverages only). This describes the size of the next field

Definition at line 160 of file ossimAigDataFileHeader.h.

◆ theTileSize

ossim_int16 ossimAigDataFileHeader::theTileSize

Size of this tiles data measured in shorts. This matches the size in the index file, and does not include the tile size itself. The next tile starts 2*n+2 bytes after the start of this tile, where n is the value of this field.

Definition at line 64 of file ossimAigDataFileHeader.h.

Referenced by ossimArcInfoGridWriter::writeFile().

◆ theTileType

ossim_uint8 ossimAigDataFileHeader::theTileType

Tile type code indicating the organization of the following data (integer coverages only).

theTileType = 0x00 (constant block) All pixels take the value of the RMin. Data is ignored. It appears there is sometimes a bit of meaningless data (up to four bytes) in the block.

theTileType = 0x01 (raw 1bit data)

theTileType = 0x04 (raw 4bit data) One full tiles worth of data pixel values follows the RMin field, with 4 bits per pixel. The high order four bits of a byte comes before the low order four bits. theTileType = 0x08 (raw byte data) One full tiles worth of data pixel values (one byte per pixel) follows the RMin field. theTileType = 0x10 (raw 16bit data) One full tiles worth of data pixel values follows the RMin field, with 16 bits per pixel (MSB). theTileType = 0xCF (16 bit literal runs/nodata runs) The data is organized in a series of runs. Each run starts with a marker which should be interpreted as: Marker < 128: The marker is followed by Marker pixels of literal data with two MSB bytes per pixel. Marker > 127: The marker indicates that 256-Marker pixels of no data pixels should be put into the output stream. No data (other than the next marker) follows this marker. theTileType = 0xD7 (literal runs/nodata runs) The data is organized in a series of runs. Each run starts with a marker which should be interpreted as: Marker < 128: The marker is followed by Marker pixels of literal data with one byte per pixel. Marker > 127: The marker indicates that 256-Marker pixels of no data pixels should be put into the output stream. No data (other than the next marker) follows this marker. theTileType = 0xDF (RMin runs/nodata runs) The data is organized in a series of runs. Each run starts with a marker which should be interpreted as: Marker < 128: The marker is followed by Marker pixels of literal data with one byte per pixel. Marker > 127: The marker indicates that 256-Marker pixels of no data pixels should be put into the output stream. No data (other than the next marker) follows this marker. This is similar to 0xD7, except that the data size is zero bytes instead of 1, so only RMin values are inserted into the output stream. theTileType = 0xE0 (run length encoded 32bit) The data is organized in a series of runs. Each run starts with a marker which should be interpreted as a count. The four bytes following the count should be interpreted as an MSB Int32 value. They indicate that count pixels of value should be inserted into the output stream. theTileType = 0xF0 (run length encoded 16bit) The data is organized in a series of runs. Each run starts with a marker which should be interpreted as a count. The two bytes following the count should be interpreted as an MSB Int16 value. They indicate that count pixels of value should be inserted into the output stream. theTileType = 0xFC/0xF8 (run length encoded 8bit) The data is organized in a series of runs. Each run starts with a marker which should be interpreted as a count. The following byte is the value. They indicate that count pixels of value should be inserted into the output stream. The intepretation is the same for 0xFC, and 0xF8. I believe that 0xFC has a lower dynamic (2bit) range than 0xF8 (4 or 8 bit). theTileType = 0xFF (unknown) I have yet to deduce how this is organized, though it seems to be used for data with one bit of dynamic range. and presumably uses some sort of run length encoding. But it's operation is not obvious despite many hours, productions of hundreds of test files, and attempts to develop a dictionary of binary strings for different run values.

Definition at line 152 of file ossimAigDataFileHeader.h.

◆ theZeroFill1

ossim_uint8 ossimAigDataFileHeader::theZeroFill1[16]

Definition at line 44 of file ossimAigDataFileHeader.h.

Referenced by reset(), and writeStream().

◆ theZeroFill2

ossim_uint8 ossimAigDataFileHeader::theZeroFill2[72]

Definition at line 49 of file ossimAigDataFileHeader.h.

Referenced by reset(), and writeStream().


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