[PATCH] __draw_transparent_text__ (osd.py)

Florent Kaisser <[email protected]>
Newsgroups gmane.comp.video.freevo.devel
Message-ID <1278288822.31816.9.camel@samia>
Hello,

Problem : The "dim text" feature slow the tv listening scroll

Why ? matrix calculation with two imbricate For loop in
__draw_transparent_text__ (osd.py)

Solution : use NumPy to acdelerate the matrix calculation

Proposed patch for osd.py :

43a44
> import numpy
1148,1149d1148
<             opaque_mod = float(1)
<             opaque_stp = opaque_mod/float(pixels)
1155,1159c1154,1158
<             for x in range(max(w-pixels, 0), w):
<                 for y in range(0, h):
<                     if alpha[x, y] != 0:
<                         alpha[x, y] = int(alpha[x, y] * opaque_mod)
<                 opaque_mod -= opaque_stp
---
>             alpha *= numpy.row_stack(
>                      [numpy.ones( (max(w-pixels, 0),h) )]
>                      + [numpy.linspace(mod,mod,num=h)
>                          for mod in numpy.linspace(1,0,num=pixels) ] )
> 

Best regards,

Florent Kaisser.


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.