47 std::string class_name;
52 class_name =
"Cpeak_interpP";
56 virtual void sub_pixel(CImg<T> &img)
59 std::vector<T> cur, prev, next;
64 for (
int i=0; i<this->m_pos.size(); i++)
66 cur[i] = this->m_pos[i];
67 prev[i] = this->m_pos[i];
68 next[i] = this->m_pos[i];
72 for (
int i=0; i<this->m_pos.size(); i++)
75 if (cur[i]>0 and cur[i]<dim(img,i)-1)
81 this->interp(img(cur[0],cur[1],cur[2]), img(prev[0],prev[1],prev[2]), img(next[0],next[1],next[2]), this->m_pos[i]);
93 int dim(CImg<T> &img,
const int &i)
98 case 0:
return img.width();
break;
99 case 1:
return img.height();
break;
100 case 2:
return img.depth();
break;
101 case 3:
return img.spectrum();
break;
104 std::cerr<<class_name<<
"::"<<__func__<<
": error: id="<<i<<
" is unknown as CImg dimensions\n"<<std::flush;
Definition: Cpeak_interpP.h:42
Definition: Cpeak_interp.h:43