Jump to content


Photo

VU+ Uno | picon transparency

skin uno picon transparency renderer

  • Please log in to reply
22 replies to this topic

#1 greatred

  • Senior Member
  • 268 posts

+2
Neutral

Posted 11 February 2012 - 12:39

Hello folks,

I`m having problems with displaying transparent picons on the OpenPLi image. I`ve just switched to a VU+ Uno and the problem started. Prevously I`ve not experienced any problems with the DM800 HD. First I thought that it`s the PLi-HD skin where the problem occurs (Please see the progress of the discussion), but then I found out that other skins also suffer from this misbehavior.

In order to confirm the hardware limitation mentioned by littlesat I decided to switch to VTI image for a while. Surprisingly the picons are displayed properly (you can see an Elgato-HD screenshot).
Please help with solving this issue - I suspect a difference in picon.pyo renderer. If anyone would like to reproduce the issue please let me know, from which channel you would like a picon.

Many thanks in advance for investigating this.

This is a screen of how it looks like under PLi:

This is the picon used (100x60 8Bit PNG):

This is how it looks like on VTI image:



Re: VU+ Uno | picon transparency #2 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 11 February 2012 - 13:48

What are the sizes of the picon widgets?
If the picon widget size does not match the png size, it will perform scaling.
And not all hardware supports hardware scaling + alphablending, so on a vu+ the transparent parts will not be blended properly.

Solution: make sure the picon widget size (in the skin) matches the png size, so no scaling is needed, and the alphablending will be taken care of in software instead.

Re: VU+ Uno | picon transparency #3 greatred

  • Senior Member
  • 268 posts

+2
Neutral

Posted 11 February 2012 - 13:59

OK this is clear. So every skin from OpenPLi feed has wrong size to picon widget? Even the default SD skin has a wrong widget ?

Pli-HD @OpenPLi:
<screen name="InfoBarTemplate">
	<widget source="session.CurrentService" render="Picon" position="60,635" size="100,60" alphatest="blend" backgroundColor="secondBG" transparent="1" zPosition="1">
	  <convert type="ServiceName">Reference</convert>
	</widget>

ValiHD Flex @OpenPLi:
<widget alphatest="blend" position="90,122" render="Picon" size="100,60" source="session.CurrentService" transparent="1" zPosition="1">
	  <convert type="ServiceName">Reference</convert>
	</widget>
ElgatoHD @VTI 4.2:
<widget source="session.CurrentService" render="Picon" position=" 40,35" size="100,60" zPosition="1" alphatest="on">
	  <convert type="ServiceName">Reference</convert>
	</widget>

What is this alphatest="blend" ? It looks like only this parameter is outstanding when comparing skins from OpenPLi and VTI

Edited by greatred, 11 February 2012 - 14:00.


Re: VU+ Uno | picon transparency #4 littlesat

  • PLi® Core member
  • 57,120 posts

+698
Excellent

Posted 11 February 2012 - 16:29

I hope this might help...

https://github.com/l...ff7c644beb75ab6

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: VU+ Uno | picon transparency #5 greatred

  • Senior Member
  • 268 posts

+2
Neutral

Posted 12 February 2012 - 10:43

@littlesat unfortunately no change. I tried also with alphatest="off" but there is no visible difference. Can I provide you any picon from my set and you will be able to reproduce this?

Re: VU+ Uno | picon transparency #6 greatred

  • Senior Member
  • 268 posts

+2
Neutral

Posted 12 February 2012 - 11:21

Although I own a VU+ Uno, could this topic be of any interest ? Is it possible that similar patches are applied to VTI Image, where alphatest="on" is working fine?

Re: VU+ Uno | picon transparency #7 greatred

  • Senior Member
  • 268 posts

+2
Neutral

Posted 12 February 2012 - 18:33

It looks like I`m the only person with VU+ (Uno) having this problem :wacko:
I ask someone with a VU to report here how transparent icons are displayed on skins available from OpenPLi feeds.

greetings

Re: VU+ Uno | picon transparency #8 greatred

  • Senior Member
  • 268 posts

+2
Neutral

Posted 12 February 2012 - 19:18

The problem has been discussed already here: Aanpassen skin door leek? (Magic HD skin thread)
Unfortunately the thread ends while the explanation ist provided #1851 Is the swapping of the picon renderer the ultimate solution?

Re: VU+ Uno | picon transparency #9 MiLo

  • PLi® Core member
  • 14,055 posts

+298
Excellent

Posted 12 February 2012 - 19:47

That #1851 post actually suggests that you either scale the icons to exactly 100x60 pixels, or change the skin .xml to match the picon size you're using.

The icon rendering is done in C++ code, swapping Python code won't help there.
Real musicians never die - they just decompose

Re: VU+ Uno | picon transparency #10 greatred

  • Senior Member
  • 268 posts

+2
Neutral

Posted 12 February 2012 - 19:59

hello MiLo thank you for taking part in this discussion. I`m now of the impression that we are making circles:[list]
[*]my picons are exactly 100x60 (like the one in the first post) off course the actual graphic inside is notalways filling the whole 100x60 but this is the point of a transparent picon, right?
[*]the skin.xml is using a 100x60 size for the picon widget - and this is standard for all skins as far as I know
[*]actually swapping a picon.py helped, since Im not able to attach this file here please tak a look at the syntax
[*]of course I`m loosing the recent changes for correctly displaying the picon_default.png when using a non-standard renderer
[/list]
##
from Renderer import Renderer
from enigma import ePixmap
from Tools.Directories import fileExists, SCOPE_SKIN_IMAGE, SCOPE_CURRENT_SKIN, resolveFilename
class Picon(Renderer):
searchPaths = ('/usr/share/enigma2/%s/', '/media/cf/%s/', '/media/usb/%s/', '/media/sdb1/%s/')
def __init__(self):
  Renderer.__init__(self)
  self.path = "picon"
  self.nameCache = { }
  self.pngname = ""
def applySkin(self, desktop, parent):
  attribs = [ ]
  for (attrib, value) in self.skinAttributes:
   if attrib == "path":
	self.path = value
   else:
	attribs.append((attrib,value))
  self.skinAttributes = attribs
  return Renderer.applySkin(self, desktop, parent)
GUI_WIDGET = ePixmap
def changed(self, what):
  if self.instance:
   pngname = ""
   if what[0] != self.CHANGED_CLEAR:
	sname = self.source.text
	# strip all after last :
	pos = sname.rfind(':')
	if pos != -1:
	 sname = sname[:pos].rstrip(':').replace(':','_')
	pngname = self.nameCache.get(sname, "")
	if pngname == "":
	 pngname = self.findPicon(sname)
	 if pngname != "":
	  self.nameCache[sname] = pngname
   if pngname == "": # no picon for service found
	pngname = self.nameCache.get("default", "")
	if pngname == "": # no default yet in cache..
	 pngname = self.findPicon("picon_default")
	 if pngname == "":
	  tmp = resolveFilename(SCOPE_CURRENT_SKIN, "picon_default.png")
	  if fileExists(tmp):
	   pngname = tmp
	  else:
	   pngname = resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/picon_default.png")
	 self.nameCache["default"] = pngname
   if self.pngname != pngname:
	self.instance.setPixmapFromFile(pngname)
	self.pngname = pngname
def findPicon(self, serviceName):
  for path in self.searchPaths:
   pngname = (path % self.path) + serviceName + ".png"
   if fileExists(pngname):
	return pngname
  return ""

Edited by greatred, 12 February 2012 - 20:00.


Re: VU+ Uno | picon transparency #11 littlesat

  • PLi® Core member
  • 57,120 posts

+698
Excellent

Posted 13 February 2012 - 07:53

Are your picons rendered in 32 bits...?

Edited by littlesat, 13 February 2012 - 07:53.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: VU+ Uno | picon transparency #12 greatred

  • Senior Member
  • 268 posts

+2
Neutral

Posted 13 February 2012 - 08:02

Of course they are not 32bit. Otherwise they wouldn`t be correctly disaplyed with a DM800 HD or on another image.

Re: VU+ Uno | picon transparency #13 blzr

  • PLi® Core member
  • 2,270 posts

+118
Excellent

Posted 13 February 2012 - 09:21

Of course they are not 32bit.

and you're 100% sure of that?
here's your picon properties:

Attached Files


True sarcasm doesn't need green font...

Re: VU+ Uno | picon transparency #14 greatred

  • Senior Member
  • 268 posts

+2
Neutral

Posted 13 February 2012 - 10:29

Damn that is true blzr. I`ve never thought of that. Honestly, I was always sure that my picons are 8bit otherwise they wouldn`t be displayed at all.
I will have to doublecheck that at home. Anyway how come that changing the default picon renderer to a one like mentioned in one of the previous posts, solves the problem?

Re: VU+ Uno | picon transparency #15 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 13 February 2012 - 10:52

Anyway how come that changing the default picon renderer to a one like mentioned in one of the previous posts, solves the problem?


because most other picon renderers disable scaling.
So you do not run into the limitation that scaling + alphablending might not work on your device.

Re: VU+ Uno | picon transparency #16 greatred

  • Senior Member
  • 268 posts

+2
Neutral

Posted 13 February 2012 - 11:04

So can simillar be implemented in OpenPLi? Or in other words what are disadvantages of commiting such a change?

Re: VU+ Uno | picon transparency #17 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 13 February 2012 - 11:10

the consequences are that scaling will no longer work.
So you will not be able to show smaller size picons in e.g. graphical epg, in the servicelist, larger picons in the osd, etc.

Re: VU+ Uno | picon transparency #18 greatred

  • Senior Member
  • 268 posts

+2
Neutral

Posted 13 February 2012 - 11:47

but why this picon needs to be rescaled anyway? it is 100x60, the picon widget size is 100x60 .....

Re: VU+ Uno | picon transparency #19 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 13 February 2012 - 12:45

If the size matches, indeed the scaling won't do anything.
However, as you use an alphachannel in a 32bit png, and your hardware does not support hardware alphablending, the alpha channel will not work correctly, because the e2 software alphablending fallback does not support 32bit.

Re: VU+ Uno | picon transparency #20 blzr

  • PLi® Core member
  • 2,270 posts

+118
Excellent

Posted 13 February 2012 - 12:51

and vuduo hardware supports alphablending? I thought it does not /?/
and yet this (attched above) picon is displayed correctly here my duo with OpenPLi...
True sarcasm doesn't need green font...



Also tagged with one or more of these keywords: skin, uno, picon, transparency, renderer

3 user(s) are reading this topic

0 members, 3 guests, 0 anonymous users