mirror of https://github.com/CGAL/cgal
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:
parent
e8bd026dd0
commit
36ee6cc30b
|
|
@ -185,44 +185,44 @@ public:
|
|||
|
||||
public:
|
||||
template <typename Image_word_type,
|
||||
typename Target_word_type,
|
||||
typename Target_type,
|
||||
typename Coord_type,
|
||||
class Image_transform>
|
||||
Target_word_type
|
||||
Target_type
|
||||
trilinear_interpolation(const Coord_type&x,
|
||||
const Coord_type&y,
|
||||
const Coord_type&z,
|
||||
const Target_word_type& value_outside =
|
||||
Target_word_type(),
|
||||
const Target_type& value_outside =
|
||||
Target_type(),
|
||||
Image_transform transform =
|
||||
Image_transform() ) const;
|
||||
|
||||
// default Image_transform = CGAL::Identity
|
||||
template <typename Image_word_type,
|
||||
typename Target_word_type,
|
||||
typename Target_type,
|
||||
typename Coord_type>
|
||||
Target_word_type
|
||||
Target_type
|
||||
trilinear_interpolation(const Coord_type&x,
|
||||
const Coord_type&y,
|
||||
const Coord_type&z,
|
||||
const Target_word_type& value_outside =
|
||||
Target_word_type()) const
|
||||
const Target_type& value_outside =
|
||||
Target_type()) const
|
||||
{
|
||||
return trilinear_interpolation<
|
||||
Image_word_type,
|
||||
Target_word_type>(x, y, z, value_outside,
|
||||
Target_type>(x, y, z, value_outside,
|
||||
CGAL::Identity<Image_word_type>());
|
||||
}
|
||||
|
||||
template <typename Image_word_type,
|
||||
typename Coord_type,
|
||||
typename Target_word_type>
|
||||
Target_word_type
|
||||
typename Target_type>
|
||||
Target_type
|
||||
labellized_trilinear_interpolation(const Coord_type&x,
|
||||
const Coord_type&y,
|
||||
const Coord_type&z,
|
||||
const Target_word_type& value_outside =
|
||||
Target_word_type()) const
|
||||
const Target_type& value_outside =
|
||||
Target_type()) const
|
||||
{
|
||||
CGAL::ImageIO::Indicator_factory<Image_word_type> indicator_factory;
|
||||
return labellized_trilinear_interpolation<Image_word_type>
|
||||
|
|
@ -231,27 +231,27 @@ public:
|
|||
|
||||
template <typename Image_word_type,
|
||||
typename Coord_type,
|
||||
typename Target_word_type,
|
||||
typename Target_type,
|
||||
typename Indicator_factory>
|
||||
Target_word_type
|
||||
Target_type
|
||||
labellized_trilinear_interpolation
|
||||
(const Coord_type&x,
|
||||
const Coord_type&y,
|
||||
const Coord_type&z,
|
||||
const Target_word_type& value_outside,
|
||||
const Target_type& value_outside,
|
||||
const Indicator_factory indicator_factory) const;
|
||||
|
||||
}; // end Image_3
|
||||
|
||||
template <typename Image_word_type,
|
||||
typename Target_word_type,
|
||||
typename Target_type,
|
||||
typename Coord_type,
|
||||
class Image_transform>
|
||||
Target_word_type
|
||||
Target_type
|
||||
Image_3::trilinear_interpolation(const Coord_type& x,
|
||||
const Coord_type& y,
|
||||
const Coord_type& z,
|
||||
const Target_word_type& value_outside,
|
||||
const Target_type& value_outside,
|
||||
Image_transform transform) const
|
||||
{
|
||||
// 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;
|
||||
ptr += i1 * dimxy + j1 * dimx + k1;
|
||||
const Target_word_type a = Target_word_type(transform(*ptr));
|
||||
const Target_word_type e = Target_word_type(transform(*(ptr+1)));
|
||||
const Target_type a = Target_type(transform(*ptr));
|
||||
const Target_type e = Target_type(transform(*(ptr+1)));
|
||||
ptr += dimxy; // i2 * dimxy + j1 * dimx + k1;
|
||||
const Target_word_type b = Target_word_type(transform(*ptr));
|
||||
const Target_word_type f = Target_word_type(transform(*(ptr+1)));
|
||||
const Target_type b = Target_type(transform(*ptr));
|
||||
const Target_type f = Target_type(transform(*(ptr+1)));
|
||||
ptr += dimx; // i2 * dimxy + j2 * dimx + k1
|
||||
const Target_word_type c = Target_word_type(transform(*ptr));
|
||||
const Target_word_type g = Target_word_type(transform(*(ptr+1)));
|
||||
const Target_type c = Target_type(transform(*ptr));
|
||||
const Target_type g = Target_type(transform(*(ptr+1)));
|
||||
ptr -= dimxy; // i1 * dimxy + j2 * dimx + k1
|
||||
const Target_word_type d = Target_word_type(transform(*ptr));
|
||||
const Target_word_type h = Target_word_type(transform(*(ptr+1)));
|
||||
const Target_type d = Target_type(transform(*ptr));
|
||||
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_word_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_word_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_word_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_word_type h = ((Image_word_type*)image()->data)[i1 * dimxy + j2 * dimx + k2];
|
||||
// const Target_type a = ((Image_word_type*)image()->data)[i1 * dimxy + j1 * dimx + k1];
|
||||
// const Target_type b = ((Image_word_type*)image()->data)[i2 * dimxy + j1 * dimx + k1];
|
||||
// const Target_type c = ((Image_word_type*)image()->data)[i2 * dimxy + j2 * dimx + k1];
|
||||
// const Target_type d = ((Image_word_type*)image()->data)[i1 * dimxy + j2 * dimx + k1];
|
||||
// const Target_type e = ((Image_word_type*)image()->data)[i1 * dimxy + j1 * dimx + k2];
|
||||
// const Target_type f = ((Image_word_type*)image()->data)[i2 * dimxy + j1 * dimx + k2];
|
||||
// const Target_type g = ((Image_word_type*)image()->data)[i2 * 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 ||
|
||||
// y < 0.f ||
|
||||
|
|
@ -346,7 +346,7 @@ Image_3::trilinear_interpolation(const Coord_type& x,
|
|||
// 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) {
|
||||
// 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_word_type di1 = lz - i1;
|
||||
const Target_word_type dj2 = j2 - ly;
|
||||
const Target_word_type dj1 = ly - j1;
|
||||
const Target_word_type dk2 = k2 - lx;
|
||||
const Target_word_type dk1 = lx - k1;
|
||||
const Target_type di2 = i2 - lz;
|
||||
const Target_type di1 = lz - i1;
|
||||
const Target_type dj2 = j2 - ly;
|
||||
const Target_type dj1 = ly - j1;
|
||||
const Target_type dk2 = k2 - lx;
|
||||
const Target_type dk1 = lx - k1;
|
||||
// std::cerr << di2 << " " << di1 << "\n";
|
||||
// std::cerr << dj2 << " " << dj1 << "\n";
|
||||
// std::cerr << dk2 << " " << dk1 << "\n";
|
||||
|
|
@ -437,14 +437,14 @@ Image_3::trilinear_interpolation(const Coord_type& x,
|
|||
|
||||
template <typename Image_word_type,
|
||||
typename Coord_type,
|
||||
typename Target_word_type,
|
||||
typename Target_type,
|
||||
typename Indicator_factory>
|
||||
Target_word_type
|
||||
Target_type
|
||||
Image_3::labellized_trilinear_interpolation
|
||||
(const Coord_type& x,
|
||||
const Coord_type& y,
|
||||
const Coord_type& z,
|
||||
const Target_word_type& value_outside,
|
||||
const Target_type& value_outside,
|
||||
const Indicator_factory indicator_factory) const
|
||||
{
|
||||
// Check on double/float coordinates, because (int)-0.1 gives 0
|
||||
|
|
|
|||
Loading…
Reference in New Issue