[MPlayer-dev-eng] Draw Alpha
Ivan Kalvatchev
iive at yahoo.com
Wed Nov 28 20:17:16 CET 2001
--- Arpi <arpi at thot.banki.hu> wrote:
> Hi,
>
> > Few days ago i sow coments about drawing subtitles
> for
> > DVD. I sow the equation that is used for
> computing, i
> > sow that some changes are made. I didn't mind it,
> but
> > later I realize that the formula is wrong. I
> couldn't
> > find the fix and today i chaked the source. This
> is
> > form osd_template.c:
> >
> >
>
if(srca[x])dstbase[x]=((dstbase[x]*srca[x])>>8)+src[x];
> > or in float:
> > dst=src*alpha+osd;
> >
> > The right formula is:
> > dst=src*alpha+osd*(1.0-alpha);
>
> not really.
> in theory, the equeation is what you wrote above.
> but in mplayer, osd/font pixel colors shouldn't be
> multiplied.
> so, alpha value in mplayer means how decrease
> background (image)
> brightness and when it's done, it overlay with
> font/osd pixels by
> adding them. this is why osd pixel color + alpha
> pixel value <=255
> limitation. and it also speeds up rendering a lot.
>
> read my mail about this topic before telling here
> bad things.
> we aren't in opengl world, we are in maximum-speed
> world now.
> and here 0 means no osd/font rendering, 1 mean
> rendering over
> black (full opacity) ... 255 means rendering over
> the image (full
> transparency).
>
sorry for disturbance, i think that i get it. You meen
that as osd*(1.0-alpha); doesn't depend on src it is
precalculated and osd is not simple gray image.
__________________________________________________
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1
More information about the MPlayer-dev-eng
mailing list