Add support for RealtekBridgeController

This commit is contained in:
Jerry Fan
2026-05-29 20:46:22 +08:00
committed by Adam Honse
parent 69de0b13c4
commit 8afad91b33
10 changed files with 1378 additions and 0 deletions

24
MathUtils.cpp Normal file
View File

@@ -0,0 +1,24 @@
/*---------------------------------------------------------*\
| MathUtils.cpp |
| |
| Math utility functions |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include <math.h>
#include "MathUtils.h"
int MathUtils::IntInterpolate(int y0, int y1, int x0, int x1, int x)
{
if(x1 == x0)
return y0;
if(y0 == y1)
return y0;
double t = (double)(x - x0) / (double)(x1 - x0);
double y = y0 * (1.0 - t) + y1 * t;
return (int)round(y);
}