Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] About the OSD color table



Hi,

I'm working on a device plugin.
My hardware device supports an OSD with up to 256 colors but I have to use
an indexed palette.

I had troubles with my first piece of code. Some colors were overriding
others (red was overriding blue in my case)

So I wrote another piece of code wich shows the OSD quite well. I had to
split my big palette of 256 colors into MAXNUMWINDOWS small palettes.

Here are my little questions :

Does VDR use distincts palettes for the different windows ?
MAXNUMWINDOWS*MAXNUMCOLORS = 7*16 = 112 colors max in the vanilla VDR

Or does it use the same palette for every window ?
MAXNUMCOLORS = 16 colors max in the vanilla VDR

If someone can help me to fix this palette handling...

Thank you
Philippe

Here is the first piece of code I used to init my palette :
Splitted palette
----------snip ----------------
        const eDvbColor allColors = Window->GetColor(colorIndex);
        for (int colorIndex = 0; colorIndex <MAXNUMCOLORS;colorIndex++) {
          const eDvbColor allColors = Window->GetColor(colorIndex);
 
myDevice->SetOsdPalette(colorIndex+1+(MAXNUMCOLORS*Window->Handle())),((allC
olors >> 0x00) & 0x000000ff),((allColors >> 0x08) & 0x000000ff),((allColors
>> 0x10) & 0x000000ff),((allColors >> 0x18) & 0x000000ff));
        }
----------snip ----------------
Second piece of code (bad colors...)
----------snip ----------------
    int firstColorIndex = -1;
    int lastColorIndex = -1;
    const eDvbColor *modifiedColors = Window->NewColors(firstColorIndex,
lastColorIndex);
    if (modifiedColors)
    {
      do
      {
        for (int colorIndex = firstColorIndex ; colorIndex <= lastColorIndex
; colorIndex++, modifiedColors++)
        {
          myDevice->SetOsdPalette(colorIndex,(*modifiedColors & 0x000000ff)
>> 0x00,(*modifiedColors & 0x0000ff00) >> 0x08,(*modifiedColors &
0x00ff0000) >> 0x10,(*modifiedColors & 0xff000000) >> 0x18);
        }
      }
      while (0 != (modifiedColors = Window->NewColors(firstColorIndex,
lastColorIndex)));
    }
----------snip ----------------




-- 
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index