From: Romain D. <do...@ir...> - 2001-07-13 14:10:34
Attachments:
fbvid.h
|
Hello, Here's a third draft of a possible interface for overlay support in fbdev. I added a stride parameter suggested by Gerd Knorr, and a way to specify a color or alpha key for overlay clipping/ blending. If someone is interested, I have a small app that use the interface to put a JPG as video overlay on the console. I have a question on the subject of alpha: how is fbcon and the driver supposed to deal with the alpha channel ? Is the _clear function supposed to clear the alpha channel or to left it alone ? What about the _putc, do they set the alpha at a specific value (foreground and background), or should they left the alpha alone ? Same question for invert, too :-) All this in case an app want to put some alpha to clip an overlay... TIA -- DOLBEAU Romain | l'histoire est entierement vraie, puisque ENS Cachan / Ker Lann | je l'ai imaginee d'un bout a l'autre do...@ir... | -- Boris Vian |
From: Sven <lu...@dp...> - 2001-07-16 15:11:08
|
On Fri, Jul 13, 2001 at 04:10:28PM +0200, Romain Dolbeau wrote: > Hello, > > Here's a third draft of a possible interface for overlay support > in fbdev. I added a stride parameter suggested by Gerd Knorr, > and a way to specify a color or alpha key for overlay clipping/ > blending. If someone is interested, I have a small app > that use the interface to put a JPG as video overlay > on the console. > > I have a question on the subject of alpha: how is fbcon > and the driver supposed to deal with the alpha channel ? > Is the _clear function supposed to clear the alpha channel > or to left it alone ? What about the _putc, do they set > the alpha at a specific value (foreground and background), > or should they left the alpha alone ? Same question for invert, > too :-) have we functionality to do rectangle lists, as X does ? Could this be usefull ? You need something similar if you want to add clipping support to video overlay. Well at least for complexe clipping, i guess that for most fb apps, you would clipp out only a rectangular region, and nothing more complex. That said, this is how most Xv driver handle this (well at least the glint/permedia3 one, but i inspired myself from the mga one). We either do opaque or alpha blended i(if supported) overlay. in the opaque case, if the hardware supports it, we can do clipping. Clipping is currently done by writting a value to the alpha channel for each pixel that will show (or not show) the overlay. Then we can do alpha keyed overlay on them. Cards that don't support alpha keyed overlay or in mode without alpha channel (depth 8, 16 or 24) you have to choose a color and use color keyed overlay. In the case of alpha blending, we can provide a alpha blend value (prefereably an 8 bit one, since that is what permedia3 supports, altough it really uses only the top 2 bits) and the overlay is blended. In this case it is not really necessary to do clipping, altough some cards support per pixel bledning using the alpha channel. Friendly, Sven Luther |
From: <dol...@cl...> - 2001-07-16 16:17:58
|
> have we functionality to do rectangle lists, as X does ? No, the only hardware accel in 2.2/2.4 is character drawing and rectangle erase (in character unit). > Could this be usefull ? Not for fbcon, maybe for other app. > You need something similar if you want to add clipping support to video > overlay. Well at least for complexe clipping, i guess that for most fb > apps, you would clipp out only a rectangular region, and nothing more > complex. Not if you rely on the app to properly fill the main screen with either an alpha or a color key. it's done only once in a while, so doing it by software shouldn't be too much of a problem. The problem is when fbcon step on your toes by cleaning the alpha channel... > Clipping is currently done by writting a value to the alpha channel for > each pixel that will show (or not show) the overlay. Then we can do alpha > keyed overlay on them. YOu can do the same in FB, only the app mustr handle it. It ain't difficult : the app must mmap() the whole FB area anyway, and the GET_VARINFO IOCTL give the size & offset of the alpha channel. You just have to fill it by software. my pm3fb_setoverlay do that and it works fine, even if the initial filling of the alpha channel is slow. But after that, as long as noone touch your alpha channel, you only need to fill the offscreen buffer. -- DOLBEAU Romain | ENS Cachan / Ker Lann | l'histoire est entierement vraie, puisque Thesard IRISA / CAPS | je l'ai imaginee d'un bout a l'autre dol...@cl... | -- Boris Vian |
From: Gerd K. <kr...@by...> - 2001-07-16 17:20:34
|
> have we functionality to do rectangle lists, as X does ? Do we need that functionality? > Could this be usefull ? Don't think so, setting alpha bleeding / chroma keying is all we need to have in the kernel. > Clipping is currently done by writting a value to the alpha channel > for each pixel that will show (or not show) the overlay. Then we can > do alpha keyed overlay on them. Cards that don't support alpha keyed > overlay or in mode without alpha channel (depth 8, 16 or 24) you have > to choose a color and use color keyed overlay. You don't need kernel support for this. The fb apps (unlike X11 apps) have direct access to the framebuffer memory. They can simply fill some screen area with the chroma key color. I can't see any need for passing around clip lists. Gerd -- Damn lot people confuse usability and eye-candy. |