1 #ifndef _JPIP_WOI_COMPOSER_H_
2 #define _JPIP_WOI_COMPOSER_H_
67 this->coding_parameters = coding_parameters;
82 this->coding_parameters = coding_parameters;
87 min_precinct_xy = coding_parameters->GetPrecincts(current_packet.
resolution, pxy1);
88 if (min_precinct_xy.
x != 0) min_precinct_xy.
x--;
89 if (min_precinct_xy.
y != 0) min_precinct_xy.
y--;
91 max_precinct_xy = coding_parameters->GetPrecincts(current_packet.
resolution, pxy2);
92 if (max_precinct_xy.
x != 0) max_precinct_xy.
x--;
93 if (max_precinct_xy.
y != 0) max_precinct_xy.
y--;
103 pxy1 = composer.
pxy1;
104 pxy2 = composer.
pxy2;
120 return current_packet;
130 if(!more_packets)
return false;
132 if(packet) *packet = current_packet;
144 if (current_packet.
component < (coding_parameters->num_components - 1)) current_packet.
component++;
154 if (current_packet.
layer < (coding_parameters->num_layers - 1)) current_packet.
layer++;
156 more_packets =
false;
161 min_precinct_xy = coding_parameters->GetPrecincts(current_packet.
resolution, pxy1);
162 if (min_precinct_xy.
x != 0) min_precinct_xy.
x--;
163 if (min_precinct_xy.
y != 0) min_precinct_xy.
y--;
165 max_precinct_xy = coding_parameters->GetPrecincts(current_packet.
resolution, pxy2);
166 if (max_precinct_xy.
x != 0) max_precinct_xy.
x--;
167 if (max_precinct_xy.
y != 0) max_precinct_xy.
y--;
WOIComposer & operator=(const WOIComposer &composer)
Copy assignment.
Definition: woi_composer.h:101
WOIComposer()
Initializes the object.
Definition: woi_composer.h:47
SHARED_PTR< CodingParameters > Ptr
Pointer to an object of this class.
Definition: coding_parameters.h:97
Class that identifies a WOI (Window Of Interest).
Definition: woi.h:24
bool more_packets
Flag to control the last packet.
Definition: woi_composer.h:32
WOIComposer(CodingParameters::Ptr coding_parameters)
Initializes the object.
Definition: woi_composer.h:64
Point pxy2
Bottom-right corner of the WOI.
Definition: woi_composer.h:31
void Reset(const WOI &woi, CodingParameters::Ptr coding_parameters)
Resets the packets navigation and starts a new one.
Definition: woi_composer.h:77
bool GetNextPacket(Packet *packet=NULL)
Moves to the next packet of the WOI.
Definition: woi_composer.h:128
Packet current_packet
Current packet.
Definition: woi_composer.h:36
Size max_precinct_xy
Maximum precinct.
Definition: woi_composer.h:35
Represents a couple of integer values that can be used to identify a coordinate as well as a size...
Definition: point.h:18
Size size
Size of the WOI (width and height)
Definition: woi.h:27
Point pxy1
Upper-left corner of the WOI.
Definition: woi_composer.h:30
int layer
Quality layer.
Definition: packet.h:18
int y
Value Y.
Definition: point.h:22
Size min_precinct_xy
Minimum precinct.
Definition: woi_composer.h:34
int max_resolution
Maximum resolution.
Definition: woi_composer.h:33
virtual ~WOIComposer()
Definition: woi_composer.h:178
Set of classes for handling (reading and indexing) image files with the format defined in the Part 1 ...
Definition: codestream_index.h:10
Packet GetCurrentPacket() const
Returns the current packet.
Definition: woi_composer.h:118
int x
Value X.
Definition: point.h:21
int component
Component number.
Definition: packet.h:19
int resolution
Resolution level where the WOI is located (0 == the highest)
Definition: woi.h:29
By means of this class it is possible to find out the which packets of an image are associated to a W...
Definition: woi_composer.h:27
int resolution
Resolution level.
Definition: packet.h:20
CodingParameters::Ptr coding_parameters
Pointer to the associated coding parameters.
Definition: woi_composer.h:41
Point precinct_xy
Precinct coordinate.
Definition: packet.h:21
Point position
Position of the upper-left corner of the WOI.
Definition: woi.h:28
Set of classes related to the JPIP protocol, defined in the Part 9 of the JPEG2000 standard...
Definition: cache_model.h:13
Contains the information of a packet.
Definition: packet.h:15
WOIComposer(const WOIComposer &composer)
Copy constructor.
Definition: woi_composer.h:55