ESA JPIP server  0.1
packet.h
Go to the documentation of this file.
1 #ifndef _JPEG2000_PACKET_H_
2 #define _JPEG2000_PACKET_H_
3 
4 
5 #include "point.h"
6 
7 
8 namespace jpeg2000
9 {
10 
15  class Packet
16  {
17  public:
18  int layer;
19  int component;
20  int resolution;
22 
23 
28  {
29  layer = resolution = component = 0;
30  }
31 
36  {
37  this->layer = layer;
38  this->resolution = resolution;
39  this->component = component;
40  this->precinct_xy = precinct_xy;
41  }
42 
46  Packet(const Packet& packet)
47  {
48  *this = packet;
49  }
50 
54  const Packet& operator=(const Packet& packet)
55  {
56  layer = packet.layer;
57  component = packet.component;
58  resolution = packet.resolution;
59  precinct_xy = packet.precinct_xy;
60 
61  return *this;
62  }
63 
64  friend ostream& operator <<(ostream &out, const Packet &packet)
65  {
66  out << packet.layer << "\t" << packet.resolution << "\t" << packet.component << "\t"
67  << packet.precinct_xy.y << "\t" << packet.precinct_xy.x;
68 
69  return out;
70  }
71 
72  virtual ~Packet()
73  {
74  }
75  };
76 
77 }
78 
79 #endif /* _JPEG2000_PACKET_H_ */
Packet(int layer, int resolution, int component, Point precinct_xy)
Initializes the object.
Definition: packet.h:35
virtual ~Packet()
Definition: packet.h:72
Packet(const Packet &packet)
Copy constructor.
Definition: packet.h:46
friend ostream & operator<<(ostream &out, const Packet &packet)
Definition: packet.h:64
Represents a couple of integer values that can be used to identify a coordinate as well as a size...
Definition: point.h:18
int layer
Quality layer.
Definition: packet.h:18
int y
Value Y.
Definition: point.h:22
Packet()
Initializes the object to zero.
Definition: packet.h:27
int x
Value X.
Definition: point.h:21
int component
Component number.
Definition: packet.h:19
int resolution
Resolution level.
Definition: packet.h:20
const Packet & operator=(const Packet &packet)
Copy assignment.
Definition: packet.h:54
Point precinct_xy
Precinct coordinate.
Definition: packet.h:21
Contains the information of a packet.
Definition: packet.h:15