File: math.cpp

package info (click to toggle)
olive-editor 20181223-2
  • links: PTS
  • area: main
  • in suites: buster
  • size: 2,844 kB
  • sloc: cpp: 20,147; xml: 315; ansic: 16; makefile: 11
file content (15 lines) | stat: -rw-r--r-- 316 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include "math.h"

#include <QtMath>

int lerp(int a, int b, double t) {
    return qRound(((1.0 - t) * a) + (t * b));
}

float float_lerp(float a, float b, float t) {
    return ((1.0F - t) * a) + (t * b);
}

double double_lerp(double a, double b, double t) {
    return ((1.0 - t) * a) + (t * b);
}