19 #ifndef vtkImageInterpolatorInternals_h
20 #define vtkImageInterpolatorInternals_h
57 static int Floor(
double x, F &f);
60 static int Round(
double x);
63 static int Clamp(
int a,
int b,
int c);
64 static int Wrap(
int a,
int b,
int c);
65 static int Mirror(
int a,
int b,
int c);
81 #if defined ia64 || defined __ia64__ || defined _M_IA64
82 #define VTK_INTERPOLATE_64BIT_FLOOR
83 #elif defined __ppc64__ || defined __x86_64__ || defined _M_X64
84 #define VTK_INTERPOLATE_64BIT_FLOOR
85 #elif defined __ppc__ || defined sparc || defined mips
86 #define VTK_INTERPOLATE_32BIT_FLOOR
87 #elif defined i386 || defined _M_IX86
88 #define VTK_INTERPOLATE_I386_FLOOR
95 #define VTK_INTERPOLATE_FLOOR_TOL 7.62939453125e-06
100 #if defined VTK_INTERPOLATE_64BIT_FLOOR
102 long long i =
static_cast<long long>(x);
103 f =
static_cast<F
>(x - i);
104 return static_cast<int>(i - 103079215104LL);
105 #elif defined VTK_INTERPOLATE_32BIT_FLOOR
107 unsigned int i =
static_cast<unsigned int>(x);
109 return static_cast<int>(i - 2147483648U);
110 #elif defined VTK_INTERPOLATE_I386_FLOOR
111 union {
double d;
unsigned short s[4];
unsigned int i[2]; } dual;
112 dual.d = x + 103079215104.0;
113 f = dual.s[0]*0.0000152587890625;
114 return static_cast<int>((dual.i[1]<<16)|((dual.i[0])>>16));
126 #if defined VTK_INTERPOLATE_64BIT_FLOOR
128 long long i =
static_cast<long long>(x);
129 return static_cast<int>(i - 103079215104LL);
130 #elif defined VTK_INTERPOLATE_32BIT_FLOOR
132 unsigned int i =
static_cast<unsigned int>(x);
133 return static_cast<int>(i - 2147483648U);
134 #elif defined VTK_INTERPOLATE_I386_FLOOR
135 union {
double d;
unsigned int i[2]; } dual;
136 dual.d = x + 103079215104.5;
137 return static_cast<int>((dual.i[1]<<16)|((dual.i[0])>>16));
148 a = (a <= c ? a : c);
150 a = (a >= 0 ? a : 0);
159 int range = c - b + 1;
163 a = (a >= 0 ? a : a +
range);
172 #ifndef VTK_IMAGE_BORDER_LEGACY_MIRROR
174 int ifzero = (range == 0);
175 int range2 = 2*range + ifzero;
177 a = (a >= 0 ? a : -a);
179 a = (a <= range ? a : range2 - a);
182 int range = c - b + 1;
183 int range2 = 2*
range;
185 a = (a >= 0 ? a : -a - 1);
187 a = (a < range ? a : range2 - a - 1);
static int Round(double x)
static int Mirror(int a, int b, int c)
static int Clamp(int a, int b, int c)
static int Wrap(int a, int b, int c)
static int Floor(double x)
static int Floor(double x, F &f)
#define VTK_INTERPOLATE_FLOOR_TOL
vtkInterpolationWeights(const vtkInterpolationInfo &info)