Cuberite
A lightweight, fast and extensible game server for Minecraft
LinearInterpolation.h
Go to the documentation of this file.
1 
2 // LinearInterpolation.h
3 
4 // Declares methods for linear interpolation over 1D, 2D and 3D arrays
5 
6 
7 
8 
9 
10 #pragma once
11 
12 
13 
14 
15 
16 // 2D and 3D Interpolation is optimized by precalculating the ratios into static-sized arrays
17 // These arrays enforce a max size of the dest array, but the limits are settable here:
18 const int MAX_INTERPOL_SIZEX = 256;
19 const int MAX_INTERPOL_SIZEY = 512;
20 const int MAX_INTERPOL_SIZEZ = 256;
21 
22 
23 
24 
25 
28  float * a_Src,
29  int a_SrcSizeX,
30  float * a_Dst,
31  int a_DstSizeX
32 );
33 
34 
35 
36 
37 
40  float * a_Src,
41  int a_SrcSizeX, int a_SrcSizeY,
42  float * a_Dst,
43  int a_DstSizeX, int a_DstSizeY
44 );
45 
46 
47 
48 
49 
52  float * a_Src,
53  int a_SrcSizeX, int a_SrcSizeY, int a_SrcSizeZ,
54  float * a_Dst,
55  int a_DstSizeX, int a_DstSizeY, int a_DstSizeZ
56 );
57 
58 
59 
60 
const int MAX_INTERPOL_SIZEZ
Maximum Z-size of the interpolated array.
const int MAX_INTERPOL_SIZEY
Maximum Y-size of the interpolated array.
void LinearInterpolate2DArray(float *a_Src, int a_SrcSizeX, int a_SrcSizeY, float *a_Dst, int a_DstSizeX, int a_DstSizeY)
Puts linearly interpolated values from one array into another array.
const int MAX_INTERPOL_SIZEX
Maximum X-size of the interpolated array.
void LinearInterpolate3DArray(float *a_Src, int a_SrcSizeX, int a_SrcSizeY, int a_SrcSizeZ, float *a_Dst, int a_DstSizeX, int a_DstSizeY, int a_DstSizeZ)
Puts linearly interpolated values from one array into another array.
void LinearInterpolate1DArray(float *a_Src, int a_SrcSizeX, float *a_Dst, int a_DstSizeX)
Puts linearly interpolated values from one array into another array.