function f = bicubicf(k1,k2,k3,k4,k5,k6,k7,k8,k9,k10,i1,j1)
%
% bicubicf: returns 5x5 window of fitted bicubic at pixel (i1,j1)
% On input:
%     k1,,k10: bicubic coefficients
%     i1,j1: pixel location for reconstructed bicubic
% On output:
%     f: 5x5 bicubic surface
% Call:
%     f = bicubicf(k1,k2,k3,k4,k5,k6,k7,k8,k9,k10,i1,j1)
%

for r = -2:2
  for c = -2:2
    indi = i1+r;
    indj = j1+r;
    f(r+3,c+3) = k1(indi,indj) + r*k2(indi,indj) + c*k3(indi,indj) + ...
	      r*r*k4(indi,indj) + r*c*k5(indi,indj) + c*c*k6(indi,indj) +...
              r*r*r*k7(indi,indj) + r*r*c*k8(indi,indj) + ...
              r*c*c*k9(indi,indj) + c*c*c*k10(indi,indj);
  end
end
