ifw-odp 5.1.1
 
Loading...
Searching...
No Matches
imageCube.hpp
Go to the documentation of this file.
1
7
8#ifndef ODP_IMAGE_CUBE_HPP
9#define ODP_IMAGE_CUBE_HPP
10
11
12#ifndef __cplusplus
13#error This is a C++ include file and cannot be used from plain C
14#endif
15
16// System header files
17#include <iostream>
18
19// CPL header files
20#include "cpl_imagelist.h"
21
22// Local header files
25#include "cpl_io.h"
26
27namespace ifw::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
193 void* Get(const cpl_size pos);
194
209 void Get(const cpl_size pos, Image *img);
210
229 void Set(const Image *img, const cpl_size pos);
230
244 void Push(Image *img);
245
254 void Pop();
255
266 void Remove(const cpl_size pos);
267
281 void Retrieve(const cpl_size pos, Image *img);
282
294 bool IsUniform() const;
295
296 protected:
297 cpl_type m_cpl_type;
298 cpl_imagelist* m_cpl_imageList;
299
300
301 };
302
303}
304#include "imageCube.ipp"
305
306#endif
307
308
309
310
311
312
313
314
This class handle the errors produced by the calling of image processing routines.
Definition error.hpp:34
virtual ~ImageCube()
Class destructor.
Definition imageCube.cpp:41
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:54
cpl_imagelist * GetCplImageList() const
Get CPL image list.
void SetCplImageList(cpl_imagelist *imageList)
Set CPL image list.
void * Get(const cpl_size pos)
Get an image from the image list at a given position.
Definition imageCube.cpp:114
cpl_imagelist * m_cpl_imageList
Definition imageCube.hpp:298
bool IsUniform() const
Determine if an image list, eg. FITS cube is uniform.
Definition imageCube.cpp:201
cpl_type m_cpl_type
Definition imageCube.hpp:297
void Pop()
Remove the last image from the list.
Definition imageCube.cpp:197
constexpr bool IsImageList() const
Check is CPL image list is valid.
ImageCube()
Class constructor.
Definition imageCube.cpp:24
virtual void Unload()
Release CPL image list.
Definition imageCube.cpp:47
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:71
void Set(const Image *img, const cpl_size pos)
Insert an image into the image list at a given position.
Definition imageCube.cpp:146
void Remove(const cpl_size pos)
Remove an image from the list at specified location.
Definition imageCube.cpp:190
void Retrieve(const cpl_size pos, Image *img)
Get an image from the list at specified location.
Definition imageCube.cpp:173
void Push(Image *img)
Insert an image into the image list at the end position.
Definition imageCube.cpp:168
constexpr cpl_size GetSize() const
Get image list size.
bool Status() const
Get image status.
This class is C++ wrapper for a CPL image object. It provides a simplified interface that allows to c...
Definition image.hpp:41
Array class source file.
Definition array.cpp:14