1 #ifndef _JPEG2000_CODING_PARAMETERS_H_
2 #define _JPEG2000_CODING_PARAMETERS_H_
64 (c * precinct_point.
x * precinct_point.
y) + (py * precinct_point.
x) + px;
79 (c * precinct_point.
x * precinct_point.
y) + (py * precinct_point.
x) + px;
97 typedef SHARED_PTR<CodingParameters>
Ptr;
136 size = cod_params.
size;
149 return (stream & size & num_levels & num_layers & progression & num_components & precinct_size);
154 out <<
"Progression: " <<
160 <<
"Size: " << params.
size << endl <<
"Num. of levels: " << params.
num_levels << endl
161 <<
"Num. of layers: " << params.
num_layers << endl
162 <<
"Num. of components: " << params.
num_components << endl <<
"Precinct size: { ";
188 ceil(ceil((
double)point.
x / (1L << (num_levels - r))) / (
double)precinct_size[r].x),
189 ceil(ceil((
double)point.
y / (1L << (num_levels - r))) / (
double)precinct_size[r].y)
200 if(total_precincts.size() == 0)
213 ERROR(
"Progression (" << progression <<
") not supported");
225 if(total_precincts.size() == 0)
230 return (packet.
component + (s * num_components));
int num_layers
Number of quality layers.
Definition: coding_parameters.h:85
static void copy(std::vector< T > &dest, const std::vector< T > &src)
Copies a vector.
Definition: base.h:30
RPCL.
Definition: coding_parameters.h:107
Point Size
It is a synonymous of the class Point.
Definition: point.h:247
SHARED_PTR< CodingParameters > Ptr
Pointer to an object of this class.
Definition: coding_parameters.h:97
LRCP.
Definition: coding_parameters.h:105
int progression
Progression order.
Definition: coding_parameters.h:86
friend ostream & operator<<(ostream &out, const CodingParameters ¶ms)
Definition: coding_parameters.h:152
#define ERROR(a)
Definition: trace.h:79
int num_levels
Number of resolution levels.
Definition: coding_parameters.h:84
Size size
Image size.
Definition: coding_parameters.h:83
int GetRoundUpResolution(const Size &res_size, Size *res_image_size)
Returns the resolution level according to the given size and the round-up round policy.
Definition: coding_parameters.cc:58
CPRL.
Definition: coding_parameters.h:109
vector< int > total_precincts
Contains the number of precincts of each resolution level.
Definition: coding_parameters.h:30
int GetRoundDownResolution(const Size &res_size, Size *res_image_size)
Returns the resolution level according to the given size and the round-down round policy...
Definition: coding_parameters.cc:80
int GetClosestResolution(const Size &res_size, Size *res_image_size)
Returns the resolution level according to the given size and the closest round policy.
Definition: coding_parameters.cc:23
Size GetPrecincts(int r, const Size &point)
Returns a precinct coordinate adjusted to a given resolution level.
Definition: coding_parameters.h:185
int GetPrecinctDataBinId(const Packet &packet)
Returns the data-bin identifier associated to the given packet.
Definition: coding_parameters.h:223
Contains the coding parameters of a JPEG2000 image codestream.
Definition: coding_parameters.h:23
virtual ~CodingParameters()
Definition: coding_parameters.h:261
Represents a couple of integer values that can be used to identify a coordinate as well as a size...
Definition: point.h:18
int GetProgressionIndexRLCP(int l, int r, int c, int px, int py)
Returns the index of a packet according to the RLCP progression.
Definition: coding_parameters.h:60
int layer
Quality layer.
Definition: packet.h:18
int y
Value Y.
Definition: point.h:22
int GetProgressionIndexLRCP(int l, int r, int c, int px, int py)
Returns the index of a packet according to the LRCP progression.
Definition: coding_parameters.h:75
Set of classes for handling (reading and indexing) image files with the format defined in the Part 1 ...
Definition: codestream_index.h:10
int GetProgressionIndexRPCL(int l, int r, int c, int px, int py)
Returns the index of a packet according to the RPCL progression.
Definition: coding_parameters.h:45
int x
Value X.
Definition: point.h:21
int component
Component number.
Definition: packet.h:19
RLCP.
Definition: coding_parameters.h:106
const CodingParameters & operator=(const CodingParameters &cod_params)
Copy assignment.
Definition: coding_parameters.h:134
int resolution
Resolution level.
Definition: packet.h:20
int num_components
Number of components.
Definition: coding_parameters.h:87
CodingParameters()
Initializes the object.
Definition: coding_parameters.h:115
CodingParameters(const CodingParameters &cod_params)
Copy constructor.
Definition: coding_parameters.h:126
Point precinct_xy
Precinct coordinate.
Definition: packet.h:21
PCRL.
Definition: coding_parameters.h:108
void FillTotalPrecinctsVector()
Fills the vector total_precincts.
Definition: coding_parameters.cc:7
bool IsResolutionProgression() const
Returns true if the progression is RLCP or RPCL.
Definition: coding_parameters.h:175
vector< Size > precinct_size
Precinct sizes of each resolution level.
Definition: coding_parameters.h:92
T & SerializeWith(T &stream)
Definition: coding_parameters.h:147
Contains the information of a packet.
Definition: packet.h:15
int GetProgressionIndex(const Packet &packet)
Returns the index of a packet according to the progression order.
Definition: coding_parameters.h:198