ESA JPIP server  0.1
jpeg2000::ImageIndex Class Reference

Contains the indexing information of a JPEG2000 image file that is managed by the index manager. More...

#include <image_index.h>

Collaboration diagram for jpeg2000::ImageIndex:

Public Types

typedef list< ImageIndex >::iterator Ptr
 Pointer of an object of this class. More...
 

Public Member Functions

 ImageIndex (const ImageIndex &image_index)
 Copy constructor. More...
 
int GetNumCodestreams () const
 Returns the number of codestreams. More...
 
int GetNumMetadatas () const
 Returns the number of meta-data blocks. More...
 
bool ReadLock (const Range &range=Range(0, 0))
 Gets the lock for reading, for a specific range of codestreams. More...
 
bool ReadUnlock (const Range &range=Range(0, 0))
 Releases the lock for reading, for a specific range of codestreams. More...
 
string GetPathName () const
 Returns the path name of the image. More...
 
string GetPathName (int num_codestream) const
 Returns the path name of a given codestream, if it is a hyperlinked codestream. More...
 
FileSegment GetMainHeader (int num_codestream) const
 Returns the file segment the main header of a given codestream. More...
 
FileSegment GetMetadata (int num_metadata) const
 Returns the file segment of a meta-data block. More...
 
PlaceHolder GetPlaceHolder (int num_placeholder) const
 Returns the information of a place-holder. More...
 
FileSegment GetPacket (int num_codestream, const Packet &packet, int *offset=NULL)
 Returns the file segment of a packet. More...
 
CodingParameters::Ptr GetCodingParameters () const
 Returns a pointer to the coding parameters. More...
 
bool IsHyperLinked (int num_codestream) const
 Returns true if the image contains hyperlinks. More...
 
Ptr GetHyperLink (int num_codestream) const
 Returns a pointer to a hyperlink. More...
 
int GetNumHyperLinks () const
 Returns the number of hyperlinks. More...
 
 operator CodingParameters::Ptr () const
 
ImageIndexoperator= (const ImageIndex &image_index)
 
virtual ~ImageIndex ()
 

Private Member Functions

bool GetPLTLength (const File &file, int ind_codestream, uint64_t *length_packet)
 Gets the packet lengths from a PLT marker. More...
 
void GetOffsetPacket (const File &file, int ind_codestream, uint64_t length_packet)
 Gets the packet offsets. More...
 
bool BuildIndex (int ind_codestream, int max_index)
 Builds the required index for the required resolution levels. More...
 
bool Init (const string &path_name, const ImageInfo &image_info)
 Initializes the object. More...
 
bool Init (const string &path_name, CodingParameters::Ptr coding_parameters, const ImageInfo &image_info, int index)
 Initializes the object. More...
 
 ImageIndex ()
 Empty constructor. More...
 

Private Attributes

RdWrLock::Ptr rdwr_lock
 Read/write lock. More...
 
vector< int > last_plt
 
vector< int > last_packet
 
vector< uint64_t > last_offset_PLT
 
vector< uint64_t > last_offset_packet
 
string path_name
 Image file name. More...
 
Metadata meta_data
 Image Metadata. More...
 
int num_references
 Number of references. More...
 
vector< int > max_resolution
 Maximum resolution number. More...
 
vector< PacketIndexpacket_indexes
 Code-stream packet index. More...
 
vector< CodestreamIndexcodestreams
 Image code-streams. More...
 
CodingParameters::Ptr coding_parameters
 Image coding parameters. More...
 
vector< list< ImageIndex >::iterator > hyper_links
 Image hyperlinks. More...
 

Friends

class IndexManager
 
ostream & operator<< (ostream &out, const ImageIndex &info_node)
 

Detailed Description

Contains the indexing information of a JPEG2000 image file that is managed by the index manager.

This class can be printed.

Maintains a read/write lock for controlling the multi-thread access to the indexing information. For instance, by default all the threads usually want to read the information. The packet index built on demand, so only when a thread wants to create a new level of the packet index, it needs to write.

See also
IndexManager

Member Typedef Documentation

typedef list<ImageIndex>::iterator jpeg2000::ImageIndex::Ptr

Pointer of an object of this class.

Constructor & Destructor Documentation

jpeg2000::ImageIndex::ImageIndex ( )
inlineprivate

Empty constructor.

Only the index manager can use this constructor.

jpeg2000::ImageIndex::ImageIndex ( const ImageIndex image_index)
inline

Copy constructor.

virtual jpeg2000::ImageIndex::~ImageIndex ( )
inlinevirtual

Member Function Documentation

bool jpeg2000::ImageIndex::BuildIndex ( int  ind_codestream,
int  max_index 
)
private

Builds the required index for the required resolution levels.

Parameters
ind_codestreamCodestream index.
max_indexMaximum resolution level.
Returns
true if successful

Here is the call graph for this function:

Here is the caller graph for this function:

CodingParameters::Ptr jpeg2000::ImageIndex::GetCodingParameters ( ) const
inline

Returns a pointer to the coding parameters.

Ptr jpeg2000::ImageIndex::GetHyperLink ( int  num_codestream) const
inline

Returns a pointer to a hyperlink.

Parameters
num_codestreamNumber of the hyperlink (codestream).
FileSegment jpeg2000::ImageIndex::GetMainHeader ( int  num_codestream) const
inline

Returns the file segment the main header of a given codestream.

Parameters
num_codestreamCodestream number
FileSegment jpeg2000::ImageIndex::GetMetadata ( int  num_metadata) const
inline

Returns the file segment of a meta-data block.

Parameters
num_metadataMeta-data number.
int jpeg2000::ImageIndex::GetNumCodestreams ( ) const
inline

Returns the number of codestreams.

int jpeg2000::ImageIndex::GetNumHyperLinks ( ) const
inline

Returns the number of hyperlinks.

int jpeg2000::ImageIndex::GetNumMetadatas ( ) const
inline

Returns the number of meta-data blocks.

void jpeg2000::ImageIndex::GetOffsetPacket ( const File file,
int  ind_codestream,
uint64_t  length_packet 
)
private

Gets the packet offsets.

Parameters
fileFile where to read the data from.
ind_codestreamCodestream index.
length_packetPacket length.
Returns
true if successful.

Here is the caller graph for this function:

FileSegment jpeg2000::ImageIndex::GetPacket ( int  num_codestream,
const Packet packet,
int *  offset = NULL 
)

Returns the file segment of a packet.

Parameters
num_codestreamCodestream number.
packetPacket information.
offsetIf it is not NULL receives the offset of the packet.

Here is the call graph for this function:

string jpeg2000::ImageIndex::GetPathName ( ) const
inline

Returns the path name of the image.

string jpeg2000::ImageIndex::GetPathName ( int  num_codestream) const
inline

Returns the path name of a given codestream, if it is a hyperlinked codestream.

Parameters
num_codestreamCodestream number.
PlaceHolder jpeg2000::ImageIndex::GetPlaceHolder ( int  num_placeholder) const
inline

Returns the information of a place-holder.

Parameters
num_placeholderPlace-holder number.
bool jpeg2000::ImageIndex::GetPLTLength ( const File file,
int  ind_codestream,
uint64_t *  length_packet 
)
private

Gets the packet lengths from a PLT marker.

Parameters
fileFile where to read the data from.
ind_codestreamCodestream index.
length_packetIt is returned the length of the packet.
Returns
true if successful.

Here is the call graph for this function:

Here is the caller graph for this function:

bool jpeg2000::ImageIndex::Init ( const string &  path_name,
const ImageInfo image_info 
)
private

Initializes the object.

Parameters
path_namePath name of the image.
image_infoIndexing image information.
Returns
true if successful

Here is the call graph for this function:

Here is the caller graph for this function:

bool jpeg2000::ImageIndex::Init ( const string &  path_name,
CodingParameters::Ptr  coding_parameters,
const ImageInfo image_info,
int  index 
)
private

Initializes the object.

Parameters
path_namePath name of the image.
coding_parametersCoding parameters.
image_infoIndexing image information.
indexImage index.
Returns
true if successful
bool jpeg2000::ImageIndex::IsHyperLinked ( int  num_codestream) const
inline

Returns true if the image contains hyperlinks.

jpeg2000::ImageIndex::operator CodingParameters::Ptr ( ) const
inline
ImageIndex& jpeg2000::ImageIndex::operator= ( const ImageIndex image_index)
inline

Here is the call graph for this function:

bool jpeg2000::ImageIndex::ReadLock ( const Range range = Range(0, 0))

Gets the lock for reading, for a specific range of codestreams.

Returns
true if successful
bool jpeg2000::ImageIndex::ReadUnlock ( const Range range = Range(0, 0))

Releases the lock for reading, for a specific range of codestreams.

Returns
true if successful

Friends And Related Function Documentation

friend class IndexManager
friend
ostream& operator<< ( ostream &  out,
const ImageIndex info_node 
)
friend

Member Data Documentation

vector<CodestreamIndex> jpeg2000::ImageIndex::codestreams
private

Image code-streams.

CodingParameters::Ptr jpeg2000::ImageIndex::coding_parameters
private

Image coding parameters.

vector<list<ImageIndex>::iterator> jpeg2000::ImageIndex::hyper_links
private

Image hyperlinks.

vector<uint64_t> jpeg2000::ImageIndex::last_offset_packet
private
vector<uint64_t> jpeg2000::ImageIndex::last_offset_PLT
private
vector<int> jpeg2000::ImageIndex::last_packet
private
vector<int> jpeg2000::ImageIndex::last_plt
private
vector<int> jpeg2000::ImageIndex::max_resolution
private

Maximum resolution number.

Metadata jpeg2000::ImageIndex::meta_data
private

Image Metadata.

int jpeg2000::ImageIndex::num_references
private

Number of references.

vector<PacketIndex> jpeg2000::ImageIndex::packet_indexes
private

Code-stream packet index.

string jpeg2000::ImageIndex::path_name
private

Image file name.

RdWrLock::Ptr jpeg2000::ImageIndex::rdwr_lock
private

Read/write lock.


The documentation for this class was generated from the following files: