summaryrefslogtreecommitdiff
path: root/modules/roto/roto.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@gnugeneration.com>2017-01-02 16:11:32 -0800
committerVito Caputo <vcaputo@gnugeneration.com>2017-01-02 16:11:32 -0800
commitc75fea7e1629c7a0880a92e45438630fb41d306b (patch)
treec017c86b43b480b420a52861da2199a1628b872d /modules/roto/roto.c
parent7d4b2e75627b7966eb3186b9c3a43eb3b39d6fbc (diff)
roto: add TODO comment about faster lerp_color()
Diffstat (limited to 'modules/roto/roto.c')
-rw-r--r--modules/roto/roto.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/roto/roto.c b/modules/roto/roto.c
index a7d1750..d789f85 100644
--- a/modules/roto/roto.c
+++ b/modules/roto/roto.c
@@ -26,6 +26,12 @@ typedef struct color_t {
/* linearly interpolate between two colors, alpha is fixed-point value 0-FIXED_EXP. */
static inline color_t lerp_color(color_t *a, color_t *b, int alpha)
{
+ /* TODO: This could be done without multiplies with a bit of effort,
+ * maybe a simple table mapping integer color deltas to shift values
+ * for shifting alpha which then gets simply added? A table may not even
+ * be necessary, use the order of the delta to derive how much to shift
+ * alpha?
+ */
color_t c = {
.r = a->r + FIXED_MULT(alpha, b->r - a->r),
.g = a->g + FIXED_MULT(alpha, b->g - a->g),
© All Rights Reserved