* Moviebrowser: disabled 'pseudo' transparency for display screenshot

- Global setting for picture / icon transparency can be made
  in framebuffer constuctor
- Default is old standard (transparency when Black Content)
- Individual transparency with CFrameBuffer::SetTransparent()

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2155 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
micha-bbg
2012-03-19 21:40:03 +00:00
parent cfa58da3c6
commit 5fee27085d
5 changed files with 46 additions and 30 deletions

View File

@@ -179,6 +179,10 @@ CFrameBuffer::CFrameBuffer()
backgroundFilename = "";
fd = 0;
tty = 0;
m_transparent_default = CFrameBuffer::TM_BLACK; // TM_BLACK: Transparency when black content ('pseudo' transparency)
// TM_NONE: No 'pseudo' transparency
// TM_INI: Transparency depends on g_settings.infobar_alpha ???
m_transparent = m_transparent_default;
//FIXME: test
memset(red, 0, 256*sizeof(__u16));
memset(green, 0, 256*sizeof(__u16));
@@ -292,6 +296,7 @@ printf("smem_start %x\n", smem_start);
paletteSet();
useBackground(false);
m_transparent = m_transparent_default;
#if 0
if ((tty=open("/dev/vc/0", O_RDWR))<0) {
perror("open (tty)");
@@ -1627,27 +1632,36 @@ void * CFrameBuffer::int_convertRGB2FB(unsigned char *rgbbuff, unsigned long x,
unsigned long count = x * y;
fbbuff = (unsigned int *) cs_malloc_uncached(count * sizeof(unsigned int));
if(fbbuff == NULL)
{
if(fbbuff == NULL) {
printf("convertRGB2FB%s: Error: cs_malloc_uncached\n", ((alpha) ? " (Alpha)" : ""));
return NULL;
}
if (alpha)
{
if (alpha) {
for(i = 0; i < count ; i++)
fbbuff[i] = ((rgbbuff[i*4+3] << 24) & 0xFF000000) |
((rgbbuff[i*4] << 16) & 0x00FF0000) |
((rgbbuff[i*4+1] << 8) & 0x0000FF00) |
((rgbbuff[i*4+2]) & 0x000000FF);
}else
{
for(i = 0; i < count ; i++)
{
transp = 0;
if(rgbbuff[i*3] || rgbbuff[i*3+1] || rgbbuff[i*3+2])
transp = 0xFF;
fbbuff[i] = (transp << 24) | ((rgbbuff[i*3] << 16) & 0xFF0000) | ((rgbbuff[i*3+1] << 8) & 0xFF00) | (rgbbuff[i*3+2] & 0xFF);
} else {
switch (m_transparent) {
case CFrameBuffer::TM_BLACK:
for(i = 0; i < count ; i++) {
transp = 0;
if(rgbbuff[i*3] || rgbbuff[i*3+1] || rgbbuff[i*3+2])
transp = 0xFF;
fbbuff[i] = (transp << 24) | ((rgbbuff[i*3] << 16) & 0xFF0000) | ((rgbbuff[i*3+1] << 8) & 0xFF00) | (rgbbuff[i*3+2] & 0xFF);
}
break;
case CFrameBuffer::TM_INI:
for(i = 0; i < count ; i++)
fbbuff[i] = (transp << 24) | ((rgbbuff[i*3] << 16) & 0xFF0000) | ((rgbbuff[i*3+1] << 8) & 0xFF00) | (rgbbuff[i*3+2] & 0xFF);
break;
case CFrameBuffer::TM_NONE:
default:
for(i = 0; i < count ; i++)
fbbuff[i] = 0xFF000000 | ((rgbbuff[i*3] << 16) & 0xFF0000) | ((rgbbuff[i*3+1] << 8) & 0xFF00) | (rgbbuff[i*3+2] & 0xFF);
break;
}
}
return (void *) fbbuff;