53 const auto shape = array.
shape();
54 double x = std::max(0.0,std::min(shape.w-1.,p[0]));
55 double y = std::max(0.0,std::min(shape.h-1.,p[1]));
57 int i = std::min(x,shape.w-2.);
58 int j = std::min(y,shape.h-2.);
61 for(
int dim : DIMS2 ) {
64 for(
int jj=0; jj<6; ++jj ) {
66 for(
int ii=0; ii<6; ++ii ) v[ii] = array(shape.clamp(i+ii-2,j+jj-2))[dim];
70 }
else if( order == 4 ) {
72 for(
int jj=0; jj<4; ++jj ) {
74 for(
int ii=0; ii<4; ++ii ) hv[ii] = array(shape.clamp(i+ii-1,j+jj-1))[dim];
79 printf(
"Unsupported order (order=%d)\n", order );
99 const auto shape = array.
shape();
100 double x = std::max(0.0,std::min(shape.w-1.,p[0]));
101 double y = std::max(0.0,std::min(shape.h-1.,p[1]));
103 int i = std::min(x,shape.w-2.);
104 int j = std::min(y,shape.h-2.);
108 for(
int jj=0; jj<6; ++jj ) {
110 for(
int ii=0; ii<6; ++ii ) v[ii] = array(shape.clamp(i+ii-2,j+jj-2));
114 }
else if( order == 4 ) {
116 for(
int jj=0; jj<4; ++jj ) {
118 for(
int ii=0; ii<4; ++ii ) v[ii] = array(shape.clamp(i+ii-1,j+jj-1));
123 printf(
"Unsupported order (order=%d)\n", order );