OSSIM - Open Source Software Image Map
Version 1.9.0 (20180803)
src
support_data
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 $
9
#include <
ossim/support_data/ossimAigHeader.h
>
10
#include <
ossim/base/ossimEndian.h
>
11
12
bool
ossimAigHeader::writeStream
(
std::ostream
& out)
13
{
14
ossimEndian
endian;
15
double
tempDouble;
16
ossim_uint32
tempInt;
17
18
if
(endian.
getSystemEndianType
() ==
OSSIM_LITTLE_ENDIAN
)
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
}
ossimAigHeader::theUnknownValue
int theUnknownValue
Definition:
ossimAigHeader.h:105
ossimAigHeader::theNumberOfTilesPerColumn
int theNumberOfTilesPerColumn
Definition:
ossimAigHeader.h:97
ossimAigHeader::writeStream
bool writeStream(std::ostream &out)
Definition:
ossimAigHeader.cpp:12
ossimEndian
Definition:
ossimEndian.h:18
ossimAigHeader::theNumberOfTilesPerRow
int theNumberOfTilesPerRow
Definition:
ossimAigHeader.h:92
ossim_uint32
unsigned int ossim_uint32
Definition:
ossimConstants.h:235
ossimAigHeader::theWidthOfTileInPixels
int theWidthOfTileInPixels
Definition:
ossimAigHeader.h:103
ossimAigHeader::theHeightOfTileInPixels
int theHeightOfTileInPixels
Definition:
ossimAigHeader.h:111
ossimAigHeader::thePixelSizeX
double thePixelSizeX
Definition:
ossimAigHeader.h:79
ossimEndian::getSystemEndianType
ossimByteOrder getSystemEndianType() const
Definition:
ossimEndian.h:78
ossimEndian.h
ossimAigHeader::theUnknownAssortedData
char theUnknownAssortedData[236]
Definition:
ossimAigHeader.h:73
ossimAigHeader::thePixelSizeY
double thePixelSizeY
Definition:
ossimAigHeader.h:85
ossimAigHeader.h
ossimAigHeader::theMagic
char theMagic[8]
Definition:
ossimAigHeader.h:65
ossimEndian::swap
void swap(ossim_sint8 &)
Definition:
ossimEndian.h:26
OSSIM_LITTLE_ENDIAN
Definition:
ossimConstants.h:427
ossimAigHeader::theUnknownData
char theUnknownData[8]
Definition:
ossimAigHeader.h:66
ossim::ostream
std::basic_ostream< char > ostream
Base class for char output streams.
Definition:
ossimIosFwd.h:23
ossimAigHeader::theCellType
ossim_int32 theCellType
Definition:
ossimAigHeader.h:71
Generated on Fri Aug 3 2018 08:46:45 for OSSIM - Open Source Software Image Map by
1.8.14