The issue in short 所以我一直工作在3D软件渲染,需要一个双线性插值方法。我正在使用一个3字节的BGR栅格来获得速度,我无法弄清楚我的代码在功能上与我直接访问图像本身的工作不同。结果之前,我会先编写代码。 float lerp(float x1, float x2, float a) {
return x1 * (1 - a) + x2 * a;
}
基本线性插值
我有以下的结构存储在矢量的后续位置添加元素的每个字节: struct StashVector {
int size; // Size of each space
int next; // Next empty space
// Dynamically allocated array of bytes:
std :: vector<char> stora