ifw-odp 5.1.1
 
Loading...
Searching...
No Matches
imageWrapper.hpp
Go to the documentation of this file.
1
7
8#ifndef ODP_IMAGE_WRAPPER_HPP
9#define ODP_IMAGE_WRAPPER_HPP
10
11#ifndef __cplusplus
12#error This is a C++ include file and cannot be used from plain C
13#endif
14
15// System header files
16#include <type_traits>
17
18// Local header files
20
21
22namespace ifw::odp {
34 template <typename T>
35 class ImageWrapper: virtual public odp::Image
36 {
37
38 // Restrict the usage to the supported built-in types
39 static_assert(std::is_same<T, int>::value ||
40 std::is_same<T, float>::value ||
41 std::is_same<T, double>::value,
42 "class ImageWrapper can only be instantiated with int|float|double types");
43
44 public:
51
66 ImageWrapper(const cpl_size xsize, const cpl_size ysize);
67
80 const cpl_size llx,
81 const cpl_size lly,
82 const cpl_size urx,
83 const cpl_size ury);
84
92 virtual ~ImageWrapper();
93
98 virtual void Unload();
99
106 virtual bool IsWrapped() const;
107
112 virtual void SetWrap(bool status);
113
119 virtual void Save(const char *filename);
120
127 virtual void Save(const char *filename, cpl_type_bpp type_bpp);
128
143 virtual void Read(T *data_ptr,
144 cpl_size width,
145 cpl_size height);
146
147 private:
153 void Allocate(size_t size);
154
155 protected:
157
158
159 private:
160 bool m_wrapped;
161 };
162
163
164
165
166}
167
168#include "imageWrapper.ipp"
169#endif
170
171
172
173
174
175
176
177
178
179
180
181
182
virtual void Read(T *data_ptr, cpl_size width, cpl_size height)
Wrap data from a data buffer.
T * m_data
Object buffer to store copied or casted shared memory areas.
Definition imageWrapper.hpp:156
ImageWrapper()
Class constructor.
ImageWrapper(const ImageWrapper &image)
Copy constructor.
ImageWrapper(const cpl_size xsize, const cpl_size ysize)
Class constructor.
virtual ~ImageWrapper()
Class destructor.
virtual void Save(const char *filename, cpl_type_bpp type_bpp)
Saves image into a FITS file of a specific data type.
virtual void Unload()
Unwrap CPL image.
virtual void Save(const char *filename)
Saves image into a FITS file.
ImageWrapper(const ImageWrapper &image, const cpl_size llx, const cpl_size lly, const cpl_size urx, const cpl_size ury)
Copy constructor.
virtual void SetWrap(bool status)
Set wrapped flag.
virtual bool IsWrapped() const
Check if image was created around a pixel buffer.
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