1 #ifndef _JPEG2000_INDEX_NODE_H_ 2 #define _JPEG2000_INDEX_NODE_H_ 70 bool GetPLTLength(
const File& file,
int ind_codestream, uint64_t *length_packet);
79 void GetOffsetPacket(
const File& file,
int ind_codestream, uint64_t length_packet);
87 bool BuildIndex(
int ind_codestream,
int max_index);
95 bool Init(
const string& path_name,
const ImageInfo& image_info);
118 typedef list<ImageIndex>::iterator
Ptr;
134 if(codestreams.size() > 0)
return codestreams.size();
135 else return hyper_links.size();
151 bool ReadLock(
const Range& range =
Range(0, 0));
158 bool ReadUnlock(
const Range& range =
Range(0, 0));
175 if(codestreams.size() > 0)
return path_name;
176 else return hyper_links[num_codestream]->path_name;
186 if(codestreams.size() > 0)
return codestreams[num_codestream].header;
187 else return hyper_links[num_codestream]->codestreams.back().header;
196 return meta_data.
meta_data[num_metadata];
215 FileSegment GetPacket(
int num_codestream,
const Packet& packet,
int *offset = NULL);
222 return coding_parameters;
231 return (num_codestream < (
int)hyper_links.size());
240 return hyper_links[num_codestream];
248 return (
int)hyper_links.size();
253 return coding_parameters;
279 out <<
"Image file name: " << info_node.
path_name << endl
282 <<
"Max resolution: ";
288 for (vector<CodestreamIndex>::const_iterator i = info_node.
codestreams.begin(); i != info_node.
codestreams.end(); i++)
289 out <<
"Codestream index: " << endl <<
"----------------- " << endl << *i << endl << endl;
291 out <<
"Packet indexes: " << endl <<
"--------------- " << endl;
294 for (
int j = 0; j < i->Size(); j++)
295 out << j <<
" - " << (*i)[j] << endl;
297 out << endl <<
"Num. Hyperlinks: " << info_node.
hyper_links.size() << endl;
299 for (vector<list<ImageIndex>::iterator>::const_iterator i = info_node.
hyper_links.begin(); i != info_node.
hyper_links.end(); i++)
300 out <<
"Hyperlinks: " << endl <<
"----------- " << endl << **i << endl <<
"----------- " << endl;
302 out << endl <<
"Meta-data: ";
305 out << endl <<
"Num. References: " << info_node.
num_references << endl;
312 TRACE(
"Destroying the image index of '" << path_name <<
"'");
int GetNumCodestreams() const
Returns the number of codestreams.
Definition: image_index.h:132
CodingParameters::Ptr coding_parameters
Image coding parameters.
Definition: image_index.h:59
string GetPathName() const
Returns the path name of the image.
Definition: image_index.h:163
static void copy(std::vector< T > &dest, const std::vector< T > &src)
Copies a vector.
Definition: base.h:30
Manages the indexing information of a repository fo images.
Definition: index_manager.h:25
vector< list< ImageIndex >::iterator > hyper_links
Image hyperlinks.
Definition: image_index.h:60
vector< int > max_resolution
Maximum resolution number.
Definition: image_index.h:54
SHARED_PTR< CodingParameters > Ptr
Pointer to an object of this class.
Definition: coding_parameters.h:97
vector< CodestreamIndex > codestreams
Image code-streams.
Definition: image_index.h:57
vector< int > last_packet
Definition: image_index.h:47
Identifies a data segment of a file.
Definition: file_segment.h:20
vector< int > last_plt
Definition: image_index.h:46
CodingParameters::Ptr GetCodingParameters() const
Returns a pointer to the coding parameters.
Definition: image_index.h:220
Contains the information of a place-holder.
Definition: place_holder.h:18
string GetPathName(int num_codestream) const
Returns the path name of a given codestream, if it is a hyperlinked codestream.
Definition: image_index.h:173
virtual ~ImageIndex()
Definition: image_index.h:310
Contains the indexing information of a JPEG2000 image.
Definition: image_info.h:24
Ptr GetHyperLink(int num_codestream) const
Returns a pointer to a hyperlink.
Definition: image_index.h:238
vector< uint64_t > last_offset_PLT
Definition: image_index.h:48
FileSegment GetMetadata(int num_metadata) const
Returns the file segment of a meta-data block.
Definition: image_index.h:194
ImageIndex & operator=(const ImageIndex &image_index)
Definition: image_index.h:256
vector< uint64_t > last_offset_packet
Definition: image_index.h:49
Represents a range of integer values, defined by two values, first and last, which are assumed to be ...
Definition: range.h:20
list< ImageIndex >::iterator Ptr
Pointer of an object of this class.
Definition: image_index.h:118
Contains classes for working with the IPC mechanisms available in Linux using the pthread library...
Definition: event.cc:7
RdWrLock::Ptr rdwr_lock
Read/write lock.
Definition: image_index.h:44
int GetNumHyperLinks() const
Returns the number of hyperlinks.
Definition: image_index.h:246
Set of classes for handling (reading and indexing) image files with the format defined in the Part 1 ...
Definition: codestream_index.h:10
string path_name
Image file name.
Definition: image_index.h:51
vector< PacketIndex > packet_indexes
Code-stream packet index.
Definition: image_index.h:56
#define TRACE(a)
Definition: trace.h:89
Metadata meta_data
Image Metadata.
Definition: image_index.h:52
int GetNumMetadatas() const
Returns the number of meta-data blocks.
Definition: image_index.h:141
ImageIndex()
Empty constructor.
Definition: image_index.h:112
bool IsHyperLinked(int num_codestream) const
Returns true if the image contains hyperlinks.
Definition: image_index.h:229
Contains the indexing information of a JPEG2000 image file that is managed by the index manager...
Definition: image_index.h:36
int num_references
Number of references.
Definition: image_index.h:53
ImageIndex(const ImageIndex &image_index)
Copy constructor.
Definition: image_index.h:124
PlaceHolder GetPlaceHolder(int num_placeholder) const
Returns the information of a place-holder.
Definition: image_index.h:203
FileSegment GetMainHeader(int num_codestream) const
Returns the file segment the main header of a given codestream.
Definition: image_index.h:184
SHARED_PTR< RdWrLock > Ptr
Pointer to a RdWrLock object.
Definition: rdwr_lock.h:27
Contains the information of a packet.
Definition: packet.h:15
ostream & operator<<(ostream &out, const Request &request)
Definition: request.cc:65