ESA JPIP server  0.1
image_info.h
Go to the documentation of this file.
1 #ifndef _JPEG2000_IMAGE_INFO_H_
2 #define _JPEG2000_IMAGE_INFO_H_
3 
4 
5 #include <map>
6 #include "base.h"
7 #include "data/file.h"
8 #include "codestream_index.h"
9 #include "coding_parameters.h"
10 #include "meta_data.h"
11 
12 
13 namespace jpeg2000
14 {
15 
24  class ImageInfo
25  {
26  public:
28  multimap<string, int> paths;
30  vector<CodestreamIndex> codestreams;
31  vector<Metadata> meta_data_hyperlinks;
32 
37  {
38  }
39 
43  ImageInfo(const ImageInfo& info)
44  {
45  *this = info;
46  }
47 
51  const ImageInfo& operator=(const ImageInfo& info)
52  {
53  base::copy(paths, info.paths);
56  meta_data=info.meta_data;
58 
59  return *this;
60  }
61 
62  template<typename T> T& SerializeWith(T& stream)
63  {
65  }
66 
67  friend ostream& operator <<(ostream &out, const ImageInfo &info)
68  {
69  out << "Coding parameters: " << endl
70  << "---------------------- " << endl
71  << info.coding_parameters << endl << endl;
72 
73  if (info.paths.size() > 0)
74  {
75  for (multimap<string, int>::const_iterator i = info.paths.begin(); i != info.paths.end(); i++)
76  {
77  out << "Codestream index " << (*i).second + 1 << ":" << endl;
78  out << "------------------------" << endl;
79  out << "Path: " << (*i).first << endl;
80  out << info.codestreams[(*i).second] << endl << endl;
81  }
82  }
83  else
84  {
85  int ind = 0;
86  for (vector<CodestreamIndex>::const_iterator i = info.codestreams.begin(); i != info.codestreams.end(); i++, ind++)
87  {
88  out << "Codestream index " << ind << ":" << endl;
89  out << "------------------------" << endl << *i << endl << endl;
90  }
91  }
92 
93  out << endl << "Meta-data: ";
94  out << info.meta_data << endl << endl;
95 
96  out << endl << "Meta-data-hyperlinks: ";
97  for(vector<Metadata>::const_iterator i = info.meta_data_hyperlinks.begin(); i != info.meta_data_hyperlinks.end(); i++)
98  out << *i << " ";
99 
100  return out;
101  }
102 
103  virtual ~ImageInfo()
104  {
105  }
106  };
107 
108 }
109 
110 #endif /* _JPEG2000_IMAGE_INFO_H_ */
multimap< string, int > paths
Paths of the hyperlinks (if any)
Definition: image_info.h:28
static void copy(std::vector< T > &dest, const std::vector< T > &src)
Copies a vector.
Definition: base.h:30
ImageInfo(const ImageInfo &info)
Copy constructor.
Definition: image_info.h:43
vector< CodestreamIndex > codestreams
Codestreams information.
Definition: image_info.h:30
Metadata meta_data
Meta-data information.
Definition: image_info.h:27
Contains the indexing information of a JPEG2000 image.
Definition: image_info.h:24
CodingParameters coding_parameters
Coding parameters.
Definition: image_info.h:29
Contains the coding parameters of a JPEG2000 image codestream.
Definition: coding_parameters.h:23
ImageInfo()
Empty constructor.
Definition: image_info.h:36
vector< Metadata > meta_data_hyperlinks
Meta-data of the hyperlinks.
Definition: image_info.h:31
virtual ~ImageInfo()
Definition: image_info.h:103
Contains the indexing information associated to the meta-data of a JPEG2000 image file...
Definition: meta_data.h:21
friend ostream & operator<<(ostream &out, const ImageInfo &info)
Definition: image_info.h:67
const ImageInfo & operator=(const ImageInfo &info)
Copy assignment.
Definition: image_info.h:51
T & SerializeWith(T &stream)
Definition: image_info.h:62