ifw-odp  2.0.0-alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
imageCube.hpp
Go to the documentation of this file.
1 
9 #ifndef ODP_IMAGE_CUBE_HPP
10 #define ODP_IMAGE_CUBE_HPP
11 
12 
13 #ifndef __cplusplus
14 #error This is a C++ include file and cannot be used from plain C
15 #endif
16 
17 // System header files
18 #include <iostream>
19 
20 // CPL header files
21 #include "cpl_imagelist.h"
22 
23 // Local header files
24 #include "cppcpl/error.hpp"
25 #include "cppcpl/image.hpp"
26 
27 namespace odp {
28 
46  class ImageCube : public odp::Error
47  {
48  public:
49 
56  ImageCube();
57 
67  explicit ImageCube(const ImageCube &cube);
68 
76  virtual ~ImageCube();
77 
84  inline constexpr cpl_size GetSize() const;
85 
92  inline bool Status() const;
93 
100  inline constexpr bool IsImageList() const;
101 
102 
109  inline cpl_imagelist *GetCplImageList() const;
110 
117  void SetCplImageList(cpl_imagelist *imageList);
118 
119 
130  virtual void Save(const std::string filename,
131  cpl_type_bpp type_bpp=CPL_BPP_IEEE_FLOAT,
132  unsigned mode = CPL_IO_DEFAULT);
133 
144  virtual void Load(const std::string filename,
145  const cpl_size extension=0,
146  cpl_type type=CPL_TYPE_FLOAT);
147 
148 
163  virtual void Load(const std::string filename,
164  const cpl_size llx,
165  const cpl_size lly,
166  const cpl_size urx,
167  const cpl_size ury,
168  const cpl_size extension=0,
169  cpl_type type=CPL_TYPE_FLOAT);
170 
171 
181  virtual void Unload();
182 
183  // Routines to get the pixel value at given position
184 
199  void Get(const cpl_size pos, Image *img);
200 
219  void Set(const Image *img, const cpl_size pos);
220 
234  void Push(Image *img);
235 
244  void Pop();
245 
256  void Remove(const cpl_size pos);
257 
271  void Retrieve(const cpl_size pos, Image *img);
272 
284  bool IsUniform() const;
285 
286  protected:
287  cpl_type m_cpl_type;
288  cpl_imagelist* m_cpl_imageList;
289 
290 
291  };
292 
293 }
294 #include "imageCube.ipp"
295 
296 #endif
cpl_type m_cpl_type
Definition: imageCube.hpp:287
This class is C++ wrapper for a CPL image object. It provides a simplified interface that allows to c...
Definition: image.hpp:43
void Push(Image *img)
Insert an image into the image list at the end position.
Definition: imageCube.cpp:165
void Set(const Image *img, const cpl_size pos)
Insert an image into the image list at a given position.
Definition: imageCube.cpp:140
This class handle the errors produced by the calling of image processing routines.
Definition: error.hpp:34
cpl_imagelist * GetCplImageList() const
Get CPL image list.
void Remove(const cpl_size pos)
Remove an image from the list at specified location.
Definition: imageCube.cpp:190
cpl_imagelist * m_cpl_imageList
Definition: imageCube.hpp:288
This class is C++ wrapper for a CPL image list object. It provides a simplified interface that allows...
Definition: imageCube.hpp:46
virtual void Save(const std::string filename, cpl_type_bpp type_bpp=CPL_BPP_IEEE_FLOAT, unsigned mode=CPL_IO_DEFAULT)
Save CPL image list into a FITS file (cube).
Definition: imageCube.cpp:59
virtual void Unload()
Release CPL image list.
Definition: imageCube.cpp:52
void Get(const cpl_size pos, Image *img)
Get an image from the image list at a given position.
Definition: imageCube.cpp:122
virtual void Load(const std::string filename, const cpl_size extension=0, cpl_type type=CPL_TYPE_FLOAT)
Load CPL image from a FITS file.
Definition: imageCube.cpp:77
constexpr cpl_size GetSize() const
Get image list size.
Error class header file.
bool Status() const
Get image status.
constexpr bool IsImageList() const
Check is CPL image list is valid.
virtual ~ImageCube()
Class destructor.
Definition: imageCube.cpp:46
void SetCplImageList(cpl_imagelist *imageList)
Set CPL image list.
bool IsUniform() const
Determine if an image list, eg. FITS cube is uniform.
Definition: imageCube.cpp:201
ImageCube()
Class constructor.
Definition: imageCube.cpp:28
void Retrieve(const cpl_size pos, Image *img)
Get an image from the list at specified location.
Definition: imageCube.cpp:170
void Pop()
Remove the last image from the list.
Definition: imageCube.cpp:197
Image class header file.