OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
RadarSatRecordHeader.cpp
Go to the documentation of this file.
1 //----------------------------------------------------------------------------
2 //
3 // "Copyright Centre National d'Etudes Spatiales"
4 //
5 // License: LGPL
6 //
7 // See LICENSE.txt file in the top level directory for more details.
8 //
9 //----------------------------------------------------------------------------
10 // $Id$
11 
13 
14 namespace ossimplugins
15 {
17 {
18 }
19 
21 {
22 }
23 
25 {
26  os<<"record_sequence_number:"<<data._rec_seq<<std::endl;
27  os<<"first_record_sub-type:"<<(int)data._rec_sub1<<std::endl;
28  os<<"record_type_code:"<<(int)data._rec_type<<std::endl;
29  os<<"second_record_sub-type:"<<(int)data._rec_sub2<<std::endl;
30  os<<"third_record_sub-type:"<<(int)data._rec_sub3<<std::endl;
31  os<<"length:"<<data._length<<std::endl;
32  return os;
33 }
34 
36 {
37  is.read((char*)&(data._rec_seq),4);
38  data.SwitchEndian(data._rec_seq);
39  is.read((char*)&(data._rec_sub1),1);
40  is.read((char*)&(data._rec_type),1);
41  is.read((char*)&(data._rec_sub2),1);
42  is.read((char*)&(data._rec_sub3),1);
43  is.read((char*)&(data._length),4);
44  data.SwitchEndian(data._length);
45  return is;
46 }
47 
49  _rec_seq(rhs._rec_seq),
50  _rec_sub1(rhs._rec_sub1),
51  _rec_type(rhs._rec_type),
52  _rec_sub2(rhs._rec_sub2),
53  _rec_sub3(rhs._rec_sub3)
54 {
55 }
56 
58 {
59  _rec_seq=rhs._rec_seq;
60  _rec_sub1=rhs._rec_sub1;
61  _rec_type=rhs._rec_type;
62  _rec_sub2=rhs._rec_sub2;
63  _rec_sub3=rhs._rec_sub3;
64  return *this;
65 }
66 
68 {
69  char buffer[4];
70  char res[4];
71 
72  memcpy(buffer,&value,4);
73  res[0] = buffer[3];
74  res[1] = buffer[2];
75  res[2] = buffer[1];
76  res[3] = buffer[0];
77 
78  memcpy(&value,res,4);
79 }
80 }
void SwitchEndian(int &value)
This function switches the LSB value and the MSB value of the parameter.
unsigned char _rec_sub3
Third record sub-type code.
unsigned char _rec_sub1
First record sub-type code.
std::ostream & operator<<(std::ostream &os, const AlosPalsarData &data)
unsigned char _rec_sub2
Second record sub-type code.
std::istream & operator>>(std::istream &is, AlosPalsarData &data)
std::basic_istream< char > istream
Base class for char input streams.
Definition: ossimIosFwd.h:20
int _length
Length of this record (in bytes)
This class is able to read a record header.
int _rec_seq
Record sequence number.
unsigned char _rec_type
Record type code.
RadarSatRecordHeader & operator=(const RadarSatRecordHeader &rhs)
Copy operator.
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23