Olive
math.h
Go to the documentation of this file.
1 /***
2 
3  Olive - Non-Linear Video Editor
4  Copyright (C) 2019 Olive Team
5 
6  This program is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 
19 ***/
20 
21 #ifndef MATH_H
22 #define MATH_H
23 
24 int lerp(int a, int b, double t);
25 float float_lerp(float a, float b, float t);
26 double double_lerp(double a, double b, double t);
27 double quad_from_t(double a, double b, double c, double t);
28 double quad_t_from_x(double x, double a, double b, double c);
29 double cubic_from_t(double a, double b, double c, double d, double t);
30 double cubic_t_from_x(double x_target, double a, double b, double c, double d);
31 double solveCubicBezier(double p0, double p1, double p2, double p3, double x);
32 
33 // decibel conversion functions
34 double amplitude_to_db(double amplitude);
35 double db_to_amplitude(double db);
36 
37 #endif // MATH_H
int lerp(int a, int b, double t)
Definition: math.cpp:28
double cubic_from_t(double a, double b, double c, double d, double t)
Definition: math.cpp:49
double quad_from_t(double a, double b, double c, double t)
Definition: math.cpp:40
float float_lerp(float a, float b, float t)
Definition: math.cpp:32
double double_lerp(double a, double b, double t)
Definition: math.cpp:36
double quad_t_from_x(double x, double a, double b, double c)
Definition: math.cpp:44
double db_to_amplitude(double db)
Definition: math.cpp:80
double solveCubicBezier(double p0, double p1, double p2, double p3, double x)
double cubic_t_from_x(double x_target, double a, double b, double c, double d)
Definition: math.cpp:53
double amplitude_to_db(double amplitude)
Definition: math.cpp:76