summaryrefslogtreecommitdiff
path: root/quantize.c
diff options
context:
space:
mode:
authorAndreas Regel <andreas.regel@powarman.de>2004-06-13 23:00:00 +0200
committerAndreas Regel <andreas.regel@powarman.de>2004-06-13 23:00:00 +0200
commit1df133b2a0565a35c3b07e043bd04b449869a0cb (patch)
tree7e29cb4b4e7ed2143a96b06a114cf68320ca9a2e /quantize.c
parent2e17045cd1b8abe771d136cbc3a815b547d32280 (diff)
downloadvdr-plugin-osdpip-1df133b2a0565a35c3b07e043bd04b449869a0cb.tar.gz
vdr-plugin-osdpip-1df133b2a0565a35c3b07e043bd04b449869a0cb.tar.bz2
Release version 0.0.5v0.0.5
- added support for VDR version 1.3.7 and later (VDR 1.2.6 is still supported, no guarantee for 1.3.0-1.3.6) - no patching required any longer with 1.3.7 and later - fixed info window colors if palette patch is not applied (VDR up to 1.3.6, index patch must be applied) - added german translations - added finnish translations (thanks to Rolf Ahrenberg)
Diffstat (limited to 'quantize.c')
-rw-r--r--quantize.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/quantize.c b/quantize.c
index b513b4c..7b70b2e 100644
--- a/quantize.c
+++ b/quantize.c
@@ -9,8 +9,11 @@
#include <stdio.h>
#include <stdlib.h>
+
+#include <vdr/config.h>
#include "quantize.h"
+
cQuantize::cQuantize() {
}
@@ -18,8 +21,8 @@ cQuantize::~cQuantize() {
}
cQuantizeFixed::cQuantizeFixed() {
- redLevelCount = 8;
- greenLevelCount = 8;
+ redLevelCount = 7;
+ greenLevelCount = 9;
blueLevelCount = 4;
redLevels[0] = 0;
@@ -43,8 +46,13 @@ cQuantizeFixed::cQuantizeFixed() {
for (int r = 0; r < redLevelCount; r++) {
for (int g = 0; g < greenLevelCount; g++) {
for (int b = 0; b < blueLevelCount; b++) {
+#if VDRVERSNUM >= 10307
+ paletteOutput[r * greenLevelCount * blueLevelCount + g * blueLevelCount + b] =
+ (redLevels[r] << 16) | (greenLevels[g] << 8) | blueLevels[b];
+#else
paletteOutput[r * greenLevelCount * blueLevelCount + g * blueLevelCount + b] =
(blueLevels[b] << 16) | (greenLevels[g] << 8) | redLevels[r];
+#endif
}
}
}
@@ -180,6 +188,15 @@ int cQuantizeWu::Quantize(unsigned char * input, int size, int colors)
weight = Vol(&cube[k], wt);
if (weight)
{
+#if VDRVERSNUM >= 10307
+#ifdef NOINVERT
+ palette[k * 4 + 2] = (Vol(&cube[k], mb) / weight) WEIG;
+ palette[k * 4 + 0] = (Vol(&cube[k], mr) / weight) WEIG;
+#else
+ palette[k * 4 + 0] = (Vol(&cube[k], mb) / weight) WEIG;
+ palette[k * 4 + 2] = (Vol(&cube[k], mr) / weight) WEIG;
+#endif
+#else
#ifdef NOINVERT
palette[k * 4 + 2] = (Vol(&cube[k], mr) / weight) WEIG;
palette[k * 4 + 0] = (Vol(&cube[k], mb) / weight) WEIG;
@@ -187,6 +204,7 @@ int cQuantizeWu::Quantize(unsigned char * input, int size, int colors)
palette[k * 4 + 0] = (Vol(&cube[k], mr) / weight) WEIG;
palette[k * 4 + 2] = (Vol(&cube[k], mb) / weight) WEIG;
#endif
+#endif
palette[k * 4 + 1] = (Vol(&cube[k], mg) / weight) WEIG;
}
else