Kevin Trogant
ffbe68606b
First (sort-of) working version of a pinhole camera model. Improvement idea: - Stretch result image to the whole size
15 lines
302 B
C
15 lines
302 B
C
#include <defocus/base.h>
|
|
|
|
#include <math.h>
|
|
|
|
df_color df_lerp_color(df_color a, df_color b, double t)
|
|
{
|
|
df_color r;
|
|
for (int i = 0; i < 4; ++i) {
|
|
double af = (double)a.e[i];
|
|
double bf = (double)b.e[i];
|
|
r.e[i] = (uint8_t)floor(af + (bf - af) * t);
|
|
}
|
|
return r;
|
|
}
|