21 #ifndef IMG_ALG_FILL_HH
22 #define IMG_ALG_FILL_HH
28 namespace ost {
namespace img {
namespace alg {
38 #pragma GCC diagnostic push
39 #pragma GCC diagnostic ignored "-Wunused-function"
45 #pragma GCC diagnostic pop
56 explicit FillFnc(
Real f) {set_rval(f);}
57 explicit FillFnc(
const Complex& f) {set_cval(f);}
59 void SetFillValue(
Real f) {set_rval(f);}
60 void SetFillValue(
const Complex& f) {set_cval(f);}
62 template <
typename T,
class D>
63 void VisitState(ImageStateImpl<T,D>& isi)
const {
64 for(T* p = isi.Data().GetData(); p<isi.Data().GetEnd();++p) {
69 set_val<T>(*p,r_fv_,c_fv_);
73 static String GetAlgorithmName() {
return "Fill";}
79 void set_rval(
Real f) {r_fv_=f; c_fv_=Val2Val<Real,Complex>(f);}
in-place modifying image state const visitor plus ip algorithm
std::complex< Real > Complex
ImageStateConstModIPAlgorithm< FillFnc > Fill
Real Val2Val< Complex, Real >(const Complex &c)