19 #ifndef vtkInterpolatorInternals_h 20 #define vtkInterpolatorInternals_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 #ifdef VTK_TYPE_USE___INT64 103 __int64 i =
static_cast<__int64
>(x);
105 return static_cast<int>(i - 103079215104i64);
107 long long i =
static_cast<long long>(x);
108 f =
static_cast<F
>(x - i);
109 return static_cast<int>(i - 103079215104LL);
111 #elif defined VTK_INTERPOLATE_32BIT_FLOOR 113 unsigned int i =
static_cast<unsigned int>(x);
115 return static_cast<int>(i - 2147483648U);
116 #elif defined VTK_INTERPOLATE_I386_FLOOR 117 union {
double d;
unsigned short s[4];
unsigned int i[2]; } dual;
118 dual.d = x + 103079215104.0;
119 f = dual.s[0]*0.0000152587890625;
120 return static_cast<int>((dual.i[1]<<16)|((dual.i[0])>>16));
132 #if defined VTK_INTERPOLATE_64BIT_FLOOR 134 #ifdef VTK_TYPE_USE___INT64 135 __int64 i =
static_cast<__int64
>(x);
136 return static_cast<int>(i - 103079215104i64);
138 long long i =
static_cast<long long>(x);
139 return static_cast<int>(i - 103079215104LL);
141 #elif defined VTK_INTERPOLATE_32BIT_FLOOR 143 unsigned int i =
static_cast<unsigned int>(x);
144 return static_cast<int>(i - 2147483648U);
145 #elif defined VTK_INTERPOLATE_I386_FLOOR 146 union {
double d;
unsigned int i[2]; } dual;
147 dual.d = x + 103079215104.5;
148 return static_cast<int>((dual.i[1]<<16)|((dual.i[0])>>16));
159 a = (a <= c ? a : c);
161 a = (a >= 0 ? a : 0);
170 int range = c - b + 1;
174 a = (a >= 0 ? a : a +
range);
183 #ifndef VTK_IMAGE_BORDER_LEGACY_MIRROR 185 int ifzero = (range == 0);
186 int range2 = 2*range + ifzero;
188 a = (a >= 0 ? a : -a);
190 a = (a <= range ? a : range2 - a);
193 int range = c - b + 1;
194 int range2 = 2*
range;
196 a = (a >= 0 ? a : -a - 1);
198 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)