diff options
author | Juha Vehviläinen <jusu@users.sourceforge.net> | 2002-07-09 12:19:44 +0000 |
---|---|---|
committer | Juha Vehviläinen <jusu@users.sourceforge.net> | 2002-07-09 12:19:44 +0000 |
commit | 311e440f30c218015d17fb390f50829f430d5128 (patch) | |
tree | f2e4c13916e4b0fecae92e71d3ae21bdc4fe30f4 /Plugins/tools.h | |
parent | 85d5e43cd4856dd3d14fefd450a0606666b6dc80 (diff) |
PixelPack002 by Olaf Matthes
svn path=/trunk/Framestein/; revision=30
Diffstat (limited to 'Plugins/tools.h')
-rw-r--r-- | Plugins/tools.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Plugins/tools.h b/Plugins/tools.h new file mode 100644 index 0000000..272ff63 --- /dev/null +++ b/Plugins/tools.h @@ -0,0 +1,15 @@ +// +// some small helpers +// +// written by olaf.matthes@gmx.de +// + +// scale an input f that goes from il to ih to go from ol to oh +__inline long scl(long f, long il, long ih, long ol, long oh) +{ + long or = abs(oh-ol); + long ir = abs(ih-il); + float ratio = or/ir; + long steps = f-il; + return(steps*ratio+ol); +} |