ifw-odp 5.0.0
Loading...
Searching...
No Matches
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
26#include "cpl_io.h"
27
28namespace ifw::odp {
29
47 class ImageCube : public odp::Error
48 {
49 public:
50
57 ImageCube();
58
68 explicit ImageCube(const ImageCube &cube);
69
77 virtual ~ImageCube();
78
85 inline constexpr cpl_size GetSize() const;
86
93 inline bool Status() const;
94
101 inline constexpr bool IsImageList() const;
102
103
110 inline cpl_imagelist *GetCplImageList() const;
111
118 void SetCplImageList(cpl_imagelist *imageList);
119
120
131 virtual void Save(const std::string filename,
132 cpl_type_bpp type_bpp=CPL_BPP_IEEE_FLOAT,
133 unsigned mode = CPL_IO_DEFAULT);
134
145 virtual void Load(const std::string filename,
146 const cpl_size extension=0,
147 cpl_type type=CPL_TYPE_FLOAT);
148
149
164 virtual void Load(const std::string filename,
165 const cpl_size llx,
166 const cpl_size lly,
167 const cpl_size urx,
168 const cpl_size ury,
169 const cpl_size extension=0,
170 cpl_type type=CPL_TYPE_FLOAT);
171
172
182 virtual void Unload();
183
184 // Routines to get the pixel value at given position
185
194 void* Get(const cpl_size pos);
195
210 void Get(const cpl_size pos, Image *img);
211
230 void Set(const Image *img, const cpl_size pos);
231
245 void Push(Image *img);
246
255 void Pop();
256
267 void Remove(const cpl_size pos);
268
282 void Retrieve(const cpl_size pos, Image *img);
283
295 bool IsUniform() const;
296
297 protected:
298 cpl_type m_cpl_type;
299 cpl_imagelist* m_cpl_imageList;
300
301
302 };
303
304}
305#include "imageCube.ipp"
306
307#endif
This class handle the errors produced by the calling of image processing routines.
Definition error.hpp:35
This class is C++ wrapper for a CPL image list object. It provides a simplified interface that allows...
Definition imageCube.hpp:48
virtual ~ImageCube()
Class destructor.
Definition imageCube.cpp:43
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:56
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:116
cpl_imagelist * m_cpl_imageList
Definition imageCube.hpp:299
bool IsUniform() const
Determine if an image list, eg. FITS cube is uniform.
Definition imageCube.cpp:203
cpl_type m_cpl_type
Definition imageCube.hpp:298
void Pop()
Remove the last image from the list.
Definition imageCube.cpp:199
constexpr bool IsImageList() const
Check is CPL image list is valid.
ImageCube()
Class constructor.
Definition imageCube.cpp:26
virtual void Unload()
Release CPL image list.
Definition imageCube.cpp:49
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:73
void Set(const Image *img, const cpl_size pos)
Insert an image into the image list at a given position.
Definition imageCube.cpp:148
void Remove(const cpl_size pos)
Remove an image from the list at specified location.
Definition imageCube.cpp:192
void Retrieve(const cpl_size pos, Image *img)
Get an image from the list at specified location.
Definition imageCube.cpp:175
void Push(Image *img)
Insert an image into the image list at the end position.
Definition imageCube.cpp:170
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:44
Error class header file.
Image class header file.
Definition array.cpp:16