ifw-odp 5.1.1
 
Loading...
Searching...
No Matches
mask.hpp
Go to the documentation of this file.
1
7
8#ifndef ODP_MASK_HPP
9#define ODP_MASK_HPP
10
11#ifndef __cplusplus
12#error This is a C++ include file and cannot be used from plain C
13#endif
14
15#include <iostream>
16#include "cpl_mask.h"
18
19namespace ifw::odp {
20
21 // forward declaration
22 class Image;
23
24
36 class Mask: virtual public odp::Error
37 {
38 public:
45 Mask();
46
55 explicit Mask(cpl_size width, cpl_size height);
56
64 explicit Mask(const Mask &mask);
65
78 explicit Mask(const Mask &mask,
79 const cpl_size llx,
80 const cpl_size lly,
81 const cpl_size urx,
82 const cpl_size ury);
83
95 explicit Mask(const Image &image);
96
106 explicit Mask(const Image &image, double lo_cut, double hi_cut);
107
114 virtual ~Mask();
115
121 inline bool IsMask() const;
122
130 void GetMaskPtr(void **data_ptr) const;
131
137 inline void* GetMaskPtr() const;
138
144 inline cpl_mask* GetCplMask() const;
145
152 inline void SetCplMask(cpl_mask *mask);
153
160 inline cpl_size GetWidth() const;
161
168 inline cpl_size GetHeight() const;
169
181 void Get(cpl_size width,
182 cpl_size height,
183 bool *value) const;
184
196 bool Get(cpl_size width,
197 cpl_size height) const;
198
210 void Set(cpl_size row,
211 cpl_size col,
212 bool value);
213
220 Mask& operator=(const Mask&) ;
221
228 bool operator==(const Mask&) const;
229
236 bool operator!=(const Mask&) const;
237
238 friend std::ostream& operator<<(std::ostream &os, const Mask &mask);
239
240 private:
248 void Delete();
249
250 protected:
251 cpl_mask* m_cpl_mask;
252
253 };
254}
255
256#include "mask.ipp"
257
258#endif
259
260
261
262
263
264
265
266
This class handle the errors produced by the calling of image processing routines.
Definition error.hpp:34
This class is C++ wrapper for a CPL image object. It provides a simplified interface that allows to c...
Definition image.hpp:41
bool IsMask() const
Check is CPL mask is not null.
void SetCplMask(cpl_mask *mask)
Set CPL mask.
cpl_size GetHeight() const
Get mask height.
bool operator==(const Mask &) const
Overload operator==.
Definition mask.cpp:177
cpl_mask * m_cpl_mask
Definition mask.hpp:251
bool operator!=(const Mask &) const
Overload operator !=.
Definition mask.cpp:204
void Set(cpl_size row, cpl_size col, bool value)
Set an element value in the mask.
Definition mask.cpp:146
cpl_mask * GetCplMask() const
Get CPL mask pointer.
cpl_size GetWidth() const
Get mask width.
Mask & operator=(const Mask &)
Overload operator=.
Definition mask.cpp:164
void Get(cpl_size width, cpl_size height, bool *value) const
Get value of an element in the mask.
Definition mask.cpp:116
friend std::ostream & operator<<(std::ostream &os, const Mask &mask)
Mask()
Class constructor.
Definition mask.cpp:23
virtual ~Mask()
Class destructor.
Definition mask.cpp:103
void * GetMaskPtr() const
Get pointer to mask data.
Array class source file.
Definition array.cpp:14