summaryrefslogtreecommitdiff
path: root/osd.c
diff options
context:
space:
mode:
Diffstat (limited to 'osd.c')
-rw-r--r--osd.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/osd.c b/osd.c
index 84c5a278..2edf4fae 100644
--- a/osd.c
+++ b/osd.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: osd.c 2.29 2012/05/17 13:29:19 kls Exp $
+ * $Id: osd.c 2.30 2012/06/02 10:42:23 kls Exp $
*/
#include "osd.h"
@@ -40,6 +40,16 @@ tColor HsvToColor(double H, double S, double V)
}
}
+tColor RgbShade(tColor Color, double Factor)
+{
+ double f = fabs(constrain(Factor, -1.0, 1.0));
+ double w = Factor > 0 ? f * 0xFF : 0;
+ return (Color & 0xFF000000) |
+ (min(0xFF, int((1 - f) * ((Color >> 16) & 0xFF) + w + 0.5)) << 16) |
+ (min(0xFF, int((1 - f) * ((Color >> 8) & 0xFF) + w + 0.5)) << 8) |
+ (min(0xFF, int((1 - f) * ( Color & 0xFF) + w + 0.5)) );
+}
+
#define USE_ALPHA_LUT
#ifdef USE_ALPHA_LUT
// Alpha blending with lookup table (by Reinhard Nissl <rnissl@gmx.de>)