mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-01 18:01:06 +02:00
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
Origin commit data
------------------
Branch: ni/coolstream
Commit: 5fee27085d
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2012-03-19 (Mon, 19 Mar 2012)
Origin message was:
------------------
* 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 was generated by Migit
This commit is contained in:
@@ -179,6 +179,10 @@ CFrameBuffer::CFrameBuffer()
|
|||||||
backgroundFilename = "";
|
backgroundFilename = "";
|
||||||
fd = 0;
|
fd = 0;
|
||||||
tty = 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
|
//FIXME: test
|
||||||
memset(red, 0, 256*sizeof(__u16));
|
memset(red, 0, 256*sizeof(__u16));
|
||||||
memset(green, 0, 256*sizeof(__u16));
|
memset(green, 0, 256*sizeof(__u16));
|
||||||
@@ -292,6 +296,7 @@ printf("smem_start %x\n", smem_start);
|
|||||||
paletteSet();
|
paletteSet();
|
||||||
|
|
||||||
useBackground(false);
|
useBackground(false);
|
||||||
|
m_transparent = m_transparent_default;
|
||||||
#if 0
|
#if 0
|
||||||
if ((tty=open("/dev/vc/0", O_RDWR))<0) {
|
if ((tty=open("/dev/vc/0", O_RDWR))<0) {
|
||||||
perror("open (tty)");
|
perror("open (tty)");
|
||||||
@@ -1627,28 +1632,37 @@ void * CFrameBuffer::int_convertRGB2FB(unsigned char *rgbbuff, unsigned long x,
|
|||||||
unsigned long count = x * y;
|
unsigned long count = x * y;
|
||||||
|
|
||||||
fbbuff = (unsigned int *) cs_malloc_uncached(count * sizeof(unsigned int));
|
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)" : ""));
|
printf("convertRGB2FB%s: Error: cs_malloc_uncached\n", ((alpha) ? " (Alpha)" : ""));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (alpha)
|
if (alpha) {
|
||||||
{
|
|
||||||
for(i = 0; i < count ; i++)
|
for(i = 0; i < count ; i++)
|
||||||
fbbuff[i] = ((rgbbuff[i*4+3] << 24) & 0xFF000000) |
|
fbbuff[i] = ((rgbbuff[i*4+3] << 24) & 0xFF000000) |
|
||||||
((rgbbuff[i*4] << 16) & 0x00FF0000) |
|
((rgbbuff[i*4] << 16) & 0x00FF0000) |
|
||||||
((rgbbuff[i*4+1] << 8) & 0x0000FF00) |
|
((rgbbuff[i*4+1] << 8) & 0x0000FF00) |
|
||||||
((rgbbuff[i*4+2]) & 0x000000FF);
|
((rgbbuff[i*4+2]) & 0x000000FF);
|
||||||
}else
|
} else {
|
||||||
{
|
switch (m_transparent) {
|
||||||
for(i = 0; i < count ; i++)
|
case CFrameBuffer::TM_BLACK:
|
||||||
{
|
for(i = 0; i < count ; i++) {
|
||||||
transp = 0;
|
transp = 0;
|
||||||
if(rgbbuff[i*3] || rgbbuff[i*3+1] || rgbbuff[i*3+2])
|
if(rgbbuff[i*3] || rgbbuff[i*3+1] || rgbbuff[i*3+2])
|
||||||
transp = 0xFF;
|
transp = 0xFF;
|
||||||
fbbuff[i] = (transp << 24) | ((rgbbuff[i*3] << 16) & 0xFF0000) | ((rgbbuff[i*3+1] << 8) & 0xFF00) | (rgbbuff[i*3+2] & 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;
|
return (void *) fbbuff;
|
||||||
}
|
}
|
||||||
|
@@ -114,6 +114,7 @@ class CFrameBuffer
|
|||||||
std::map<std::string, rawIcon> icon_cache;
|
std::map<std::string, rawIcon> icon_cache;
|
||||||
int cache_size;
|
int cache_size;
|
||||||
void * int_convertRGB2FB(unsigned char *rgbbuff, unsigned long x, unsigned long y, int transp, bool alpha);
|
void * int_convertRGB2FB(unsigned char *rgbbuff, unsigned long x, unsigned long y, int transp, bool alpha);
|
||||||
|
int m_transparent_default, m_transparent;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
fb_pixel_t realcolor[256];
|
fb_pixel_t realcolor[256];
|
||||||
@@ -222,7 +223,16 @@ class CFrameBuffer
|
|||||||
void blit2FB(void *fbbuff, uint32_t width, uint32_t height, uint32_t xoff, uint32_t yoff, uint32_t xp = 0, uint32_t yp = 0, bool transp = false);
|
void blit2FB(void *fbbuff, uint32_t width, uint32_t height, uint32_t xoff, uint32_t yoff, uint32_t xp = 0, uint32_t yp = 0, bool transp = false);
|
||||||
bool blitToPrimary(unsigned int * data, int dx, int dy, int sw, int sh);
|
bool blitToPrimary(unsigned int * data, int dx, int dy, int sw, int sh);
|
||||||
void paintMuteIcon(bool paint, int ax, int ay, int dx, int dy, bool paintFrame=true);
|
void paintMuteIcon(bool paint, int ax, int ay, int dx, int dy, bool paintFrame=true);
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
TM_EMPTY = 0,
|
||||||
|
TM_NONE = 1,
|
||||||
|
TM_BLACK = 2,
|
||||||
|
TM_INI = 3
|
||||||
|
};
|
||||||
|
void SetTransparent(int t){ m_transparent = t; }
|
||||||
|
void SetTransparentDefault(){ m_transparent = m_transparent_default; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -547,25 +547,19 @@ void CPictureViewer::rescaleImageDimensions(int *width, int *height, const int m
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CPictureViewer::DisplayImage (const std::string & name, int posx, int posy, int width, int height)
|
bool CPictureViewer::DisplayImage(const std::string & name, int posx, int posy, int width, int height, int transp)
|
||||||
{
|
{
|
||||||
return int_DisplayImage(name, posx, posy, width, height, false);
|
CFrameBuffer* frameBuffer = CFrameBuffer::getInstance();
|
||||||
}
|
if (transp > CFrameBuffer::TM_EMPTY)
|
||||||
|
frameBuffer->SetTransparent(transp);
|
||||||
|
|
||||||
bool CPictureViewer::DisplayImage(const std::string & name, int posx, int posy, int width, int height, const fb_pixel_t colBg)
|
|
||||||
{
|
|
||||||
return int_DisplayImage(name, posx, posy, width, height, true, colBg);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CPictureViewer::int_DisplayImage(const std::string & name, int posx, int posy, int width, int height, bool paintBg, const fb_pixel_t colBg)
|
|
||||||
{
|
|
||||||
/* TODO: cache or check for same */
|
/* TODO: cache or check for same */
|
||||||
fb_pixel_t * data = getImage(name, width, height);
|
fb_pixel_t * data = getImage(name, width, height);
|
||||||
|
|
||||||
|
if (transp > CFrameBuffer::TM_EMPTY)
|
||||||
|
frameBuffer->SetTransparentDefault();
|
||||||
|
|
||||||
if(data) {
|
if(data) {
|
||||||
CFrameBuffer* frameBuffer = CFrameBuffer::getInstance();
|
|
||||||
if (paintBg)
|
|
||||||
frameBuffer->paintBoxRel(posx, posy, width, height, colBg);
|
|
||||||
frameBuffer->blit2FB(data, width, height, posx, posy);
|
frameBuffer->blit2FB(data, width, height, posx, posy);
|
||||||
cs_free_uncached(data);
|
cs_free_uncached(data);
|
||||||
return true;
|
return true;
|
||||||
|
@@ -63,8 +63,7 @@ class CPictureViewer
|
|||||||
void Cleanup();
|
void Cleanup();
|
||||||
void SetVisible(int startx, int endx, int starty, int endy);
|
void SetVisible(int startx, int endx, int starty, int endy);
|
||||||
static double m_aspect_ratio_correction;
|
static double m_aspect_ratio_correction;
|
||||||
bool DisplayImage (const std::string & name, int posx, int posy, int width, int height);
|
bool DisplayImage (const std::string & name, int posx, int posy, int width, int height, int transp=CFrameBuffer::TM_EMPTY);
|
||||||
bool DisplayImage (const std::string & name, int posx, int posy, int width, int height, const fb_pixel_t colBg);
|
|
||||||
bool DisplayLogo (uint64_t channel_id, int posx, int posy, int width, int height);
|
bool DisplayLogo (uint64_t channel_id, int posx, int posy, int width, int height);
|
||||||
bool GetLogoName(uint64_t channel_id, std::string ChanName, std::string & name, int *width = NULL, int *height = NULL);
|
bool GetLogoName(uint64_t channel_id, std::string ChanName, std::string & name, int *width = NULL, int *height = NULL);
|
||||||
fb_pixel_t * getImage (const std::string & name, int width, int height);
|
fb_pixel_t * getImage (const std::string & name, int width, int height);
|
||||||
@@ -112,7 +111,6 @@ class CPictureViewer
|
|||||||
void add_format(int (*picsize)(const char *,int *,int*,int,int),int (*picread)(const char *,unsigned char **,int*,int*), int (*id)(const char*));
|
void add_format(int (*picsize)(const char *,int *,int*,int,int),int (*picread)(const char *,unsigned char **,int*,int*), int (*id)(const char*));
|
||||||
unsigned char * int_Resize(unsigned char *orgin, int ox, int oy, int dx, int dy, ScalingMode type, unsigned char * dst, bool alpha);
|
unsigned char * int_Resize(unsigned char *orgin, int ox, int oy, int dx, int dy, ScalingMode type, unsigned char * dst, bool alpha);
|
||||||
fb_pixel_t * int_getImage(const std::string & name, int *width, int *height, bool GetImage);
|
fb_pixel_t * int_getImage(const std::string & name, int *width, int *height, bool GetImage);
|
||||||
bool int_DisplayImage (const std::string & name, int posx, int posy, int width, int height, bool paintBg, const fb_pixel_t colBg=0);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1253,7 +1253,7 @@ void CMovieBrowser::refreshMovieInfo(void)
|
|||||||
g_PicViewer->rescaleImageDimensions(&flogo_w, &flogo_h, picw-2, pich-2);
|
g_PicViewer->rescaleImageDimensions(&flogo_w, &flogo_h, picw-2, pich-2);
|
||||||
lx = m_cBoxFrameInfo.iX+m_cBoxFrameInfo.iWidth - flogo_w -14;
|
lx = m_cBoxFrameInfo.iX+m_cBoxFrameInfo.iWidth - flogo_w -14;
|
||||||
ly = m_cBoxFrameInfo.iY - 1 + (m_cBoxFrameInfo.iHeight-flogo_h)/2;
|
ly = m_cBoxFrameInfo.iY - 1 + (m_cBoxFrameInfo.iHeight-flogo_h)/2;
|
||||||
g_PicViewer->DisplayImage(fname, lx+2, ly+1, flogo_w, flogo_h);
|
g_PicViewer->DisplayImage(fname, lx+2, ly+1, flogo_w, flogo_h, CFrameBuffer::TM_NONE);
|
||||||
m_pcWindow->paintVLineRel(lx, ly, flogo_h+1, COL_WHITE);
|
m_pcWindow->paintVLineRel(lx, ly, flogo_h+1, COL_WHITE);
|
||||||
m_pcWindow->paintVLineRel(lx+flogo_w+2, ly, flogo_h+2, COL_WHITE);
|
m_pcWindow->paintVLineRel(lx+flogo_w+2, ly, flogo_h+2, COL_WHITE);
|
||||||
m_pcWindow->paintHLineRel(lx, flogo_w+2, ly, COL_WHITE);
|
m_pcWindow->paintHLineRel(lx, flogo_w+2, ly, COL_WHITE);
|
||||||
|
Reference in New Issue
Block a user