9 #ifndef DOXYGEN_SHOULD_SKIP_THIS 14 template <
typename T,
int dim>
class Image;
15 template <
typename T>
class PixelTraits;
19 template <
typename T,
int dim,
typename U>
inline typename PixelTraits<T>::template CastPixel<U>::value_type interpolate(
const Image<T,dim> &I, FVector<U,dim> x)
21 for (
int i=0;i<dim;i++) {
22 if (x[i]<0) x[i] = U(0);
23 else if (x[i] > I.size(i)-1) x[i] = U(I.size(i)-1);
28 for (
int i=0;i<dim;i++) {
33 typedef typename PixelTraits<T>::template CastPixel<U>::value_type return_type;
34 return_type val(U(0));
35 for (CoordsIterator<dim> p(c,c+Coords<dim>(1)) ; p != CoordsIterator<dim>() ; ++p) {
37 for (
int i=0;i<dim;i++)
38 f*=((*p)[i]==c[i])?(U(1)-a[i]):a[i];
41 val=val+return_type(I(*p))*f;
Imagine++ namespace.
Definition: Array.h:7