diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-04-01 08:39:18 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-01 08:39:18 +0200 |
| commit | f88f6074479c627529559f690bf836960d5a6378 (patch) | |
| tree | a1acef0bd6286f03197c0e1839e8d41ac5e5538f /dev/modules/CoreGfx/MathGfx.h | |
| parent | 6849e75f2e95e88b43e2f8804abf1b862e3981cb (diff) | |
| parent | 2a7a9825fd275d6d999b94614fe87c1d705c7f8f (diff) | |
Merge pull request #4 from amlel-el-mahrouss/dev
pr/general: mostly minor patches.
Diffstat (limited to 'dev/modules/CoreGfx/MathGfx.h')
| -rw-r--r-- | dev/modules/CoreGfx/MathGfx.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/dev/modules/CoreGfx/MathGfx.h b/dev/modules/CoreGfx/MathGfx.h new file mode 100644 index 00000000..655903e2 --- /dev/null +++ b/dev/modules/CoreGfx/MathGfx.h @@ -0,0 +1,29 @@ +/* ------------------------------------------- + + Copyright Amlal El Mahrouss. + +------------------------------------------- */ + +#pragma once + +/// @file MathMgr.h +/// @brief Linear interpolation implementation. + +namespace UI +{ +#ifdef NE_GFX_MGR_USE_DOUBLE + typedef double fb_real_t; +#else + typedef float fb_real_t; +#endif + + /// @brief Linear interpolation equation solver. + /// @param from where to start + /// @param to to which value. + /// @param stat + /// @return Linear interop value. + inline fb_real_t fb_math_lerp(fb_real_t to, fb_real_t from, fb_real_t stat) + { + return (from) + (to - from) * stat; + } +} // namespace UI
\ No newline at end of file |
