Renaming: Target_word_type->Target_type

The target type may be a floating point type. Strange to call it a "word".
This commit is contained in:
Laurent Rineau 2016-04-20 15:16:04 +02:00
parent e8bd026dd0
commit 36ee6cc30b
1 changed files with 46 additions and 46 deletions

View File

@ -185,44 +185,44 @@ public:
public: public:
template <typename Image_word_type, template <typename Image_word_type,
typename Target_word_type, typename Target_type,
typename Coord_type, typename Coord_type,
class Image_transform> class Image_transform>
Target_word_type Target_type
trilinear_interpolation(const Coord_type&x, trilinear_interpolation(const Coord_type&x,
const Coord_type&y, const Coord_type&y,
const Coord_type&z, const Coord_type&z,
const Target_word_type& value_outside = const Target_type& value_outside =
Target_word_type(), Target_type(),
Image_transform transform = Image_transform transform =
Image_transform() ) const; Image_transform() ) const;
// default Image_transform = CGAL::Identity // default Image_transform = CGAL::Identity
template <typename Image_word_type, template <typename Image_word_type,
typename Target_word_type, typename Target_type,
typename Coord_type> typename Coord_type>
Target_word_type Target_type
trilinear_interpolation(const Coord_type&x, trilinear_interpolation(const Coord_type&x,
const Coord_type&y, const Coord_type&y,
const Coord_type&z, const Coord_type&z,
const Target_word_type& value_outside = const Target_type& value_outside =
Target_word_type()) const Target_type()) const
{ {
return trilinear_interpolation< return trilinear_interpolation<
Image_word_type, Image_word_type,
Target_word_type>(x, y, z, value_outside, Target_type>(x, y, z, value_outside,
CGAL::Identity<Image_word_type>()); CGAL::Identity<Image_word_type>());
} }
template <typename Image_word_type, template <typename Image_word_type,
typename Coord_type, typename Coord_type,
typename Target_word_type> typename Target_type>
Target_word_type Target_type
labellized_trilinear_interpolation(const Coord_type&x, labellized_trilinear_interpolation(const Coord_type&x,
const Coord_type&y, const Coord_type&y,
const Coord_type&z, const Coord_type&z,
const Target_word_type& value_outside = const Target_type& value_outside =
Target_word_type()) const Target_type()) const
{ {
CGAL::ImageIO::Indicator_factory<Image_word_type> indicator_factory; CGAL::ImageIO::Indicator_factory<Image_word_type> indicator_factory;
return labellized_trilinear_interpolation<Image_word_type> return labellized_trilinear_interpolation<Image_word_type>
@ -231,27 +231,27 @@ public:
template <typename Image_word_type, template <typename Image_word_type,
typename Coord_type, typename Coord_type,
typename Target_word_type, typename Target_type,
typename Indicator_factory> typename Indicator_factory>
Target_word_type Target_type
labellized_trilinear_interpolation labellized_trilinear_interpolation
(const Coord_type&x, (const Coord_type&x,
const Coord_type&y, const Coord_type&y,
const Coord_type&z, const Coord_type&z,
const Target_word_type& value_outside, const Target_type& value_outside,
const Indicator_factory indicator_factory) const; const Indicator_factory indicator_factory) const;
}; // end Image_3 }; // end Image_3
template <typename Image_word_type, template <typename Image_word_type,
typename Target_word_type, typename Target_type,
typename Coord_type, typename Coord_type,
class Image_transform> class Image_transform>
Target_word_type Target_type
Image_3::trilinear_interpolation(const Coord_type& x, Image_3::trilinear_interpolation(const Coord_type& x,
const Coord_type& y, const Coord_type& y,
const Coord_type& z, const Coord_type& z,
const Target_word_type& value_outside, const Target_type& value_outside,
Image_transform transform) const Image_transform transform) const
{ {
// Check on double/float coordinates, because (int)-0.1 gives 0 // Check on double/float coordinates, because (int)-0.1 gives 0
@ -312,29 +312,29 @@ Image_3::trilinear_interpolation(const Coord_type& x,
Image_word_type* ptr = (Image_word_type*)image()->data; Image_word_type* ptr = (Image_word_type*)image()->data;
ptr += i1 * dimxy + j1 * dimx + k1; ptr += i1 * dimxy + j1 * dimx + k1;
const Target_word_type a = Target_word_type(transform(*ptr)); const Target_type a = Target_type(transform(*ptr));
const Target_word_type e = Target_word_type(transform(*(ptr+1))); const Target_type e = Target_type(transform(*(ptr+1)));
ptr += dimxy; // i2 * dimxy + j1 * dimx + k1; ptr += dimxy; // i2 * dimxy + j1 * dimx + k1;
const Target_word_type b = Target_word_type(transform(*ptr)); const Target_type b = Target_type(transform(*ptr));
const Target_word_type f = Target_word_type(transform(*(ptr+1))); const Target_type f = Target_type(transform(*(ptr+1)));
ptr += dimx; // i2 * dimxy + j2 * dimx + k1 ptr += dimx; // i2 * dimxy + j2 * dimx + k1
const Target_word_type c = Target_word_type(transform(*ptr)); const Target_type c = Target_type(transform(*ptr));
const Target_word_type g = Target_word_type(transform(*(ptr+1))); const Target_type g = Target_type(transform(*(ptr+1)));
ptr -= dimxy; // i1 * dimxy + j2 * dimx + k1 ptr -= dimxy; // i1 * dimxy + j2 * dimx + k1
const Target_word_type d = Target_word_type(transform(*ptr)); const Target_type d = Target_type(transform(*ptr));
const Target_word_type h = Target_word_type(transform(*(ptr+1))); const Target_type h = Target_type(transform(*(ptr+1)));
// const Target_word_type a = ((Image_word_type*)image()->data)[i1 * dimxy + j1 * dimx + k1]; // const Target_type a = ((Image_word_type*)image()->data)[i1 * dimxy + j1 * dimx + k1];
// const Target_word_type b = ((Image_word_type*)image()->data)[i2 * dimxy + j1 * dimx + k1]; // const Target_type b = ((Image_word_type*)image()->data)[i2 * dimxy + j1 * dimx + k1];
// const Target_word_type c = ((Image_word_type*)image()->data)[i2 * dimxy + j2 * dimx + k1]; // const Target_type c = ((Image_word_type*)image()->data)[i2 * dimxy + j2 * dimx + k1];
// const Target_word_type d = ((Image_word_type*)image()->data)[i1 * dimxy + j2 * dimx + k1]; // const Target_type d = ((Image_word_type*)image()->data)[i1 * dimxy + j2 * dimx + k1];
// const Target_word_type e = ((Image_word_type*)image()->data)[i1 * dimxy + j1 * dimx + k2]; // const Target_type e = ((Image_word_type*)image()->data)[i1 * dimxy + j1 * dimx + k2];
// const Target_word_type f = ((Image_word_type*)image()->data)[i2 * dimxy + j1 * dimx + k2]; // const Target_type f = ((Image_word_type*)image()->data)[i2 * dimxy + j1 * dimx + k2];
// const Target_word_type g = ((Image_word_type*)image()->data)[i2 * dimxy + j2 * dimx + k2]; // const Target_type g = ((Image_word_type*)image()->data)[i2 * dimxy + j2 * dimx + k2];
// const Target_word_type h = ((Image_word_type*)image()->data)[i1 * dimxy + j2 * dimx + k2]; // const Target_type h = ((Image_word_type*)image()->data)[i1 * dimxy + j2 * dimx + k2];
// const Target_word_type outside = Target_word_type(transform(value_outside); // const Target_type outside = Target_type(transform(value_outside);
// if(x < 0.f || // if(x < 0.f ||
// y < 0.f || // y < 0.f ||
@ -346,7 +346,7 @@ Image_3::trilinear_interpolation(const Coord_type& x,
// return outside; // return outside;
// } // }
// Target_word_type a, b, c, d, e, f, g, h; // Target_type a, b, c, d, e, f, g, h;
// if(k1 < 0) { // if(k1 < 0) {
// a = b = c = d = outside; // a = b = c = d = outside;
@ -418,12 +418,12 @@ Image_3::trilinear_interpolation(const Coord_type& x,
// } // }
// } // }
const Target_word_type di2 = i2 - lz; const Target_type di2 = i2 - lz;
const Target_word_type di1 = lz - i1; const Target_type di1 = lz - i1;
const Target_word_type dj2 = j2 - ly; const Target_type dj2 = j2 - ly;
const Target_word_type dj1 = ly - j1; const Target_type dj1 = ly - j1;
const Target_word_type dk2 = k2 - lx; const Target_type dk2 = k2 - lx;
const Target_word_type dk1 = lx - k1; const Target_type dk1 = lx - k1;
// std::cerr << di2 << " " << di1 << "\n"; // std::cerr << di2 << " " << di1 << "\n";
// std::cerr << dj2 << " " << dj1 << "\n"; // std::cerr << dj2 << " " << dj1 << "\n";
// std::cerr << dk2 << " " << dk1 << "\n"; // std::cerr << dk2 << " " << dk1 << "\n";
@ -437,14 +437,14 @@ Image_3::trilinear_interpolation(const Coord_type& x,
template <typename Image_word_type, template <typename Image_word_type,
typename Coord_type, typename Coord_type,
typename Target_word_type, typename Target_type,
typename Indicator_factory> typename Indicator_factory>
Target_word_type Target_type
Image_3::labellized_trilinear_interpolation Image_3::labellized_trilinear_interpolation
(const Coord_type& x, (const Coord_type& x,
const Coord_type& y, const Coord_type& y,
const Coord_type& z, const Coord_type& z,
const Target_word_type& value_outside, const Target_type& value_outside,
const Indicator_factory indicator_factory) const const Indicator_factory indicator_factory) const
{ {
// Check on double/float coordinates, because (int)-0.1 gives 0 // Check on double/float coordinates, because (int)-0.1 gives 0