diff options
Diffstat (limited to 'spuencoder.c')
-rw-r--r-- | spuencoder.c | 24 |
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; |