summaryrefslogtreecommitdiff
path: root/spuencoder.c
diff options
context:
space:
mode:
authorChristian Gmeiner <christian.gmeiner@gmail.com>2009-09-29 17:16:23 +0200
committerChristian Gmeiner <christian.gmeiner@gmail.com>2009-09-29 17:16:23 +0200
commit635ca78b8455523c99408ec68684dbed70f40164 (patch)
tree85786622adc7f82e6a8c6d1fd0ed06d885263930 /spuencoder.c
parent1a5716247511dabfabb5056c2c8f25b334b0b3da (diff)
downloadvdr-plugin-dxr3-635ca78b8455523c99408ec68684dbed70f40164.tar.gz
vdr-plugin-dxr3-635ca78b8455523c99408ec68684dbed70f40164.tar.bz2
add construct to work with more then 4 colors
Diffstat (limited to 'spuencoder.c')
-rw-r--r--spuencoder.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/spuencoder.c b/spuencoder.c
index 7c1125c..a3b3395 100644
--- a/spuencoder.c
+++ b/spuencoder.c
@@ -93,15 +93,21 @@ void cSpuEncoder::encode(cBitmap *bmap, int top, int left)
// generate and upload color palette
generateColorPalette();
- // add one region
- cSpuRegion *reg = new cSpuRegion(0);
-
- for (int i = 0; i < numColors; i++) {
- reg->addIndex(bitmap->Index(colors[i]));
+ // if the bitmap uses only 4 colors, we can
+ // simply define a region, else we need to
+ // calculate the reginos and do some remapping.
+ if (numColors <= 4) {
+ // add one region
+ cSpuRegion *reg = new cSpuRegion(0);
+
+ for (int i = 0; i < numColors; i++) {
+ reg->addIndex(bitmap->Index(colors[i]));
+ }
+ regions.push_back(reg);
+ } else {
+ calculateRegions();
}
- regions.push_back(reg);
-
dsyslog("[dxr3-spuencoder] rle data");
// encode whole bitmap with rle and store top and bottom lines
@@ -324,6 +330,10 @@ void cSpuEncoder::clearRegions()
regions.clear();
}
+void cSpuEncoder::calculateRegions()
+{
+}
+
void cSpuEncoder::rle4colors()
{
int len;