From ca6ef58b1ee8521e4b940ee4883dee714960e413 Mon Sep 17 00:00:00 2001 From: LogicParrot Date: Fri, 5 Feb 2016 23:45:45 +0200 Subject: Bulk clearing of whitespace --- src/LinearInterpolation.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/LinearInterpolation.cpp') diff --git a/src/LinearInterpolation.cpp b/src/LinearInterpolation.cpp index 38404147f..f0465385d 100644 --- a/src/LinearInterpolation.cpp +++ b/src/LinearInterpolation.cpp @@ -23,8 +23,8 @@ public: // DoTest1(); DoTest2(); } - - + + void DoTest1(void) { float In[8] = {0, 1, 2, 3, 1, 2, 2, 2}; @@ -34,8 +34,8 @@ public: LinearInterpolate3DArray(In, 2, 2, 2, Out, 3, 3, 3); LOGD("Out[0]: %f", Out[0]); } - - + + void DoTest2(void) { float In[3 * 3 * 3]; @@ -94,7 +94,7 @@ void LinearInterpolate2DArray( ASSERT(a_DstSizeX < MAX_INTERPOL_SIZEX); ASSERT(a_DstSizeY > 0); ASSERT(a_DstSizeY < MAX_INTERPOL_SIZEY); - + // Calculate interpolation ratios and src indices along each axis: float RatioX[MAX_INTERPOL_SIZEX]; float RatioY[MAX_INTERPOL_SIZEY]; @@ -110,7 +110,7 @@ void LinearInterpolate2DArray( SrcIdxY[y] = y * (a_SrcSizeY - 1) / (a_DstSizeY - 1); RatioY[y] = (static_cast(y * (a_SrcSizeY - 1)) / (a_DstSizeY - 1)) - SrcIdxY[y]; } - + // Special values at the ends. Notice especially the last indices being (size - 2) with ratio set to 1, to avoid index overflow: SrcIdxX[0] = 0; RatioX[0] = 0; @@ -120,7 +120,7 @@ void LinearInterpolate2DArray( RatioX[a_DstSizeX - 1] = 1; SrcIdxY[a_DstSizeY - 1] = a_SrcSizeY - 2; RatioY[a_DstSizeY - 1] = 1; - + // Output all the dst array values using the indices and ratios: int idx = 0; for (int y = 0; y < a_DstSizeY; y++) @@ -135,11 +135,11 @@ void LinearInterpolate2DArray( float HiXLoY = a_Src[SrcIdxX[x] + 1 + idxLoY]; float LoXHiY = a_Src[SrcIdxX[x] + idxHiY]; float HiXHiY = a_Src[SrcIdxX[x] + 1 + idxHiY]; - + // Linear interpolation along the X axis: float InterpXLoY = LoXLoY + (HiXLoY - LoXLoY) * RatioX[x]; float InterpXHiY = LoXHiY + (HiXHiY - LoXHiY) * RatioX[x]; - + // Linear interpolation along the Y axis: a_Dst[idx] = InterpXLoY + (InterpXHiY - InterpXLoY) * ry; idx += 1; @@ -235,7 +235,7 @@ void LinearInterpolate3DArray( // Linear interpolation along the Y axis: float LoXInYInZ = LoXLoYInZ + (LoXHiYInZ - LoXLoYInZ) * ry; float HiXInYInZ = HiXLoYInZ + (HiXHiYInZ - HiXLoYInZ) * ry; - + // Linear interpolation along the X axis: a_Dst[idx] = LoXInYInZ + (HiXInYInZ - LoXInYInZ) * RatioX[x]; idx += 1; -- cgit v1.2.3