This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Framebuffer transparencies

Hello,

I have an application that is going to use 2 framebuffers (fb). FB0 will have a video and FB1 will be a Qt application. In one mode of operation I want the video to show with normal brightness, but the application will be displaying a top status bar that I want to be completely opaque. A second more of operation involves dimming the entire video and only display the application contents at full brightness.

I've got the second mode figured out with a combination of Alpha Blend/Transparency values with the 2 FB's. What I'm struggling with is how to accomplish the first in that I only want a small portion on top to be opaque while the rest of the FB1 is fully transparent allowing the video to show through.

The transparency keying and alpha blending stuff could use a bit more explanation and more sample code on the Wiki pages, so any thoughts/pointers would be appreciated.

~ Ashwin

  • Hi,

    What did you do to accomplish second mode. I will suggest you proceed on first mode based on that.

  • Hardik,

    I got the second mode working by playing the Alpha Blend and transparency settings for both frame buffers. But since I was dimming the entire FB0 contents (the video) and fully brightening the Qt application contents on FB1 this was OK.

    However, when I tried the same thing with the Qt application just putting out the top status bar AND the FB0 (video) being at full brightness, the FB1 alpha blend/transparency applies to the entire FB1 (not just the top status bar) and that distorts the video or makes it lighter/darker than it is based on the alpha blend/transparency settings.

    Looking at the VPSS user guide, there are few transparency/alpha blend images shown and they seem to imply that I can control the alpha blend/transparency of a certain region only? Can I set the X/Y position for the blending to take effect while leaving the rest of the FB/screen unaffected?

    ~ Ashwin

  • Ashwin Bihari said:
    However, when I tried the same thing with the Qt application just putting out the top status bar AND the FB0 (video) being at full brightness, the FB1 alpha blend/transparency applies to the entire FB1 (not just the top status bar)

    Hi,

    Problem in above is that same alpha value is applied for whole buffer so you should change the code to have alpha value of 0x00 for the buffer you want to make transparent and alpha value of 0xFF for buffer you want it to be opaque. So you should have A in ARGB laid out properly. When you enable the alpha blending you will see only that part of buffer which has A=0xFF and buffer with A=0x0 will become transparent. In case you want to see both parts of buffer you should disable alpha blending and in that case A will become dont care.

  • Hi Hardik,

    So taking what you've said so far..when I create my framebuffer parameters as defined at (http://processors.wiki.ti.com/index.php/DM814X_AM387X_VPSS_Video_Driver_User_Guide#Using_fbdev_IOCTL), what would my RGB888 key be for transparent and opaque? 0x000000 for transparent and 0xFFFFFF for transparent with a alpha blend value of 255? or 0?

    The part of the FB1 that I would like to be opaque has a background of RGB(45,45,45) and rest of the FB I can set it some other color so that I can make it completely transparent.

    So I want to set up FB1 and FB0 such that the contents of FB0 are fully visible except for the bar on top with the gray background.

    I've been tinkering with this for a little while with varying degrees of success and would appreciate specific values to enter so that I can understand how this works..

    Thanks

    ~Ashwin

  • Hi Hardik,

    Any further pointers?

    ~Ashwin

  • I figured out my problem and have gotten the transparency working. The video is showing correctly on FB0, I have my Qt application running on FB1 and is create the top bar with a rgb(45,45,45) background and then I had to create a second empty widget to cover the rest of the screen size with a background of rgb(0,0,0) and I set the transparency color key to 0x000000 and that took care of it.

    ~ Ashwin