OSSIM - Open Source Software Image Map
Version 1.9.0 (20180803)
src
support_data
ossimRpfCompressionSectionSubheader.cpp
Go to the documentation of this file.
1
#include <
ossim/support_data/ossimRpfCompressionSectionSubheader.h
>
2
#include <
ossim/base/ossimEndian.h
>
3
#include <
ossim/base/ossimErrorCodes.h
>
4
#include <
ossim/base/ossimIoStream.h
>
5
6
ossimRpfCompressionSectionSubheader::ossimRpfCompressionSectionSubheader
()
7
{
8
clearFields
();
9
}
10
11
std::ostream
&
operator<<
(
std::ostream
& out,
12
const
ossimRpfCompressionSectionSubheader
& data)
13
{
14
data.
print
(out);
15
16
return
out;
17
}
18
19
ossimErrorCode
ossimRpfCompressionSectionSubheader::parseStream
(
ossim::istream
& in,
20
ossimByteOrder
byteOrder
)
21
{
22
if
(in)
23
{
24
theStartOffset
= in.tellg();
25
26
in.read((
char
*)&
theCompressionAlgorithmId
, 2);
27
in.read((
char
*)&
theNumberOfCompressionLookupOffsetRecords
, 2);
28
in.read((
char
*)&
theNumberOfCompressionParameterOffsetRecords
, 2);
29
30
theEndOffset
= in.tellg();
31
32
ossimEndian
anEndian;
33
34
if
(anEndian.
getSystemEndianType
() !=
byteOrder
)
35
{
36
anEndian.
swap
(
theCompressionAlgorithmId
);
37
anEndian.
swap
(
theNumberOfCompressionLookupOffsetRecords
);
38
anEndian.
swap
(
theNumberOfCompressionParameterOffsetRecords
);
39
}
40
}
41
else
42
{
43
return
ossimErrorCodes::OSSIM_ERROR
;
44
}
45
46
return
ossimErrorCodes::OSSIM_OK
;
47
}
48
49
void
ossimRpfCompressionSectionSubheader::print
(
std::ostream
& out)
const
50
{
51
out <<
"theCompressionAlgorithmId: "
<<
theCompressionAlgorithmId
52
<<
"\ntheNumberOfCompressionLookupOffsetRecords: "
<<
theNumberOfCompressionLookupOffsetRecords
53
<<
"\ntheNumberOfCompressionParameterOffsetRecords: "
<<
theNumberOfCompressionParameterOffsetRecords
;
54
}
55
56
void
ossimRpfCompressionSectionSubheader::clearFields
()
57
{
58
theStartOffset
= 0;
59
theEndOffset
= 0;
60
theCompressionAlgorithmId
= 0;
61
theNumberOfCompressionLookupOffsetRecords
= 0;
62
theNumberOfCompressionParameterOffsetRecords
= 0;
63
}
ossimErrorCode
ossim_int32 ossimErrorCode
Definition:
ossimConstants.h:246
ossimRpfCompressionSectionSubheader::ossimRpfCompressionSectionSubheader
ossimRpfCompressionSectionSubheader()
Definition:
ossimRpfCompressionSectionSubheader.cpp:6
ossimRpfCompressionSectionSubheader::theCompressionAlgorithmId
unsigned short theCompressionAlgorithmId
Definition:
ossimRpfCompressionSectionSubheader.h:54
ossimRpfCompressionSectionSubheader::theNumberOfCompressionParameterOffsetRecords
unsigned short theNumberOfCompressionParameterOffsetRecords
Definition:
ossimRpfCompressionSectionSubheader.h:58
ossimErrorCodes::OSSIM_OK
static const ossimErrorCode OSSIM_OK
Definition:
ossimErrorCodes.h:50
ossimRpfCompressionSectionSubheader::theStartOffset
unsigned long theStartOffset
Definition:
ossimRpfCompressionSectionSubheader.h:41
ossimRpfCompressionSectionSubheader
Definition:
ossimRpfCompressionSectionSubheader.h:8
ossim::byteOrder
OSSIM_DLL ossimByteOrder byteOrder()
Definition:
ossimCommon.cpp:54
ossimRpfCompressionSectionSubheader::print
void print(std::ostream &out) const
Definition:
ossimRpfCompressionSectionSubheader.cpp:49
ossimErrorCodes::OSSIM_ERROR
static const ossimErrorCode OSSIM_ERROR
Definition:
ossimErrorCodes.h:53
ossimRpfCompressionSectionSubheader::clearFields
void clearFields()
Definition:
ossimRpfCompressionSectionSubheader.cpp:56
ossimErrorCodes.h
ossimEndian
Definition:
ossimEndian.h:18
ossimIoStream.h
ossimRpfCompressionSectionSubheader::parseStream
ossimErrorCode parseStream(ossim::istream &in, ossimByteOrder byteOrder)
Definition:
ossimRpfCompressionSectionSubheader.cpp:19
operator<<
std::ostream & operator<<(std::ostream &out, const ossimRpfCompressionSectionSubheader &data)
Definition:
ossimRpfCompressionSectionSubheader.cpp:11
ossimByteOrder
ossimByteOrder
Definition:
ossimConstants.h:425
ossimRpfCompressionSectionSubheader::theNumberOfCompressionLookupOffsetRecords
unsigned short theNumberOfCompressionLookupOffsetRecords
Definition:
ossimRpfCompressionSectionSubheader.h:56
ossimEndian::getSystemEndianType
ossimByteOrder getSystemEndianType() const
Definition:
ossimEndian.h:78
ossimEndian.h
ossim::istream
std::basic_istream< char > istream
Base class for char input streams.
Definition:
ossimIosFwd.h:20
ossimRpfCompressionSectionSubheader::theEndOffset
unsigned long theEndOffset
Definition:
ossimRpfCompressionSectionSubheader.h:47
ossimRpfCompressionSectionSubheader.h
ossimEndian::swap
void swap(ossim_sint8 &)
Definition:
ossimEndian.h:26
ossim::ostream
std::basic_ostream< char > ostream
Base class for char output streams.
Definition:
ossimIosFwd.h:23
Generated on Fri Aug 3 2018 08:46:53 for OSSIM - Open Source Software Image Map by
1.8.14