OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimRpfMaskSubheader.cpp
Go to the documentation of this file.
4 #include <cmath>
5 
7  const ossimRpfMaskSubheader& data)
8 {
9  data.print(out);
10  return out;
11 }
12 
14  :theSubframeSequenceRecordLength(0),
15  theTransparencySequenceRecordLength(0),
16  theTransparentOutputPixelCodeLength(0),
17  theOutputPixelCodeBitString(0),
18  theNumberOfBytes(0)
19 {
20  clearFields();
21 }
22 
24 {
26  {
29  }
30 }
31 
34 {
35  if(in)
36  {
37  clearFields();
38 
39  in.read((char*)&theSubframeSequenceRecordLength, 2);
40  in.read((char*)&theTransparencySequenceRecordLength, 2);
41  in.read((char*)&theTransparentOutputPixelCodeLength, 2);
42  ossimEndian anEndian;
43 
44  if(anEndian.getSystemEndianType() != byteOrder)
45  {
49 
50  }
52  {
54  theOutputPixelCodeBitString = new unsigned char[theNumberOfBytes];
56  }
57  }
58  else
59  {
61  }
62 
64 }
65 
67 {
68  out << "theSubframeSequenceRecordLength: "
70  << "\ntheTransparencySequenceRecordLength: "
72  << "\ntheTransparentOutputPixelCodeLength: "
74  << "\ntheNumberOfBytes: "
76  << "\ntheOutputPixelCodeBitString: ";
77 
78  // display the pixel code as a bit pattern.
79  for(long index = theNumberOfBytes-1;
80  index >=0;
81  --index)
82  {
83  unsigned long temp = theOutputPixelCodeBitString[index];
84  out << ((temp>>7)&1)
85  << ((temp>>6)&1)
86  << ((temp>>5)&1)
87  << ((temp>>4)&1)
88  << ((temp>>3)&1)
89  << ((temp>>2)&1)
90  << ((temp>>1)&1)
91  << (temp&1);
92  }
93  out << std::endl;
94 }
95 
97 {
101  theNumberOfBytes = 0;
102 
104  {
105  delete [] theOutputPixelCodeBitString;
107  }
108 }
ossim_int32 ossimErrorCode
unsigned short theTransparentOutputPixelCodeLength
static const ossimErrorCode OSSIM_OK
OSSIM_DLL ossimByteOrder byteOrder()
Definition: ossimCommon.cpp:54
static const ossimErrorCode OSSIM_ERROR
ossimErrorCode parseStream(std::istream &in, ossimByteOrder byteOrder)
unsigned short theSubframeSequenceRecordLength
std::ostream & operator<<(std::ostream &out, const ossimRpfMaskSubheader &data)
unsigned char * theOutputPixelCodeBitString
ossimByteOrder
ossimByteOrder getSystemEndianType() const
Definition: ossimEndian.h:78
std::basic_istream< char > istream
Base class for char input streams.
Definition: ossimIosFwd.h:20
void print(std::ostream &out) const
void swap(ossim_sint8 &)
Definition: ossimEndian.h:26
unsigned short theTransparencySequenceRecordLength
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23