fix typo, fix gamma test screen
authorFelix Domke <tmbinc@elitedvb.net>
Fri, 25 Jan 2008 01:16:35 +0000 (01:16 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Fri, 25 Jan 2008 01:16:35 +0000 (01:16 +0000)
lib/python/Plugins/SystemPlugins/VideoTune/VideoFinetune.py

index 7b64588e36f5aef96f4b402fc80fe941cd161651..85dd9660a9e4385eef99ff439abea1b710195aa1 100644 (file)
@@ -2,7 +2,7 @@ from Screens.Screen import Screen
 from Components.Sources.CanvasSource import CanvasSource
 from Components.ActionMap import ActionMap
 from enigma import gFont
 from Components.Sources.CanvasSource import CanvasSource
 from Components.ActionMap import ActionMap
 from enigma import gFont
-from enigma import RT_HALIGN_LEFT, RT_HALIGN_CENTER, RT_VALIGN_CENTER, RT_WRAP
+from enigma import RT_HALIGN_LEFT, RT_HALIGN_RIGHT, RT_VALIGN_CENTER, RT_WRAP
 
 def RGB(r,g,b):
        return (r<<16)|(g<<8)|b
 
 def RGB(r,g,b):
        return (r<<16)|(g<<8)|b
@@ -82,7 +82,7 @@ class VideoFinetune(Screen):
                c.writeText(xres / 10, yres / 6, xres * 4 / 7, yres / 6, RGB(255,255,255), RGB(0,0,0), gFont("Regular", 20),
                        ("If your TV has a brightness or contrast enhancement, disable it. If there is something called \"dynamic\", "
                                "set it to standard. Adjust the backlight level to your favourite value. "
                c.writeText(xres / 10, yres / 6, xres * 4 / 7, yres / 6, RGB(255,255,255), RGB(0,0,0), gFont("Regular", 20),
                        ("If your TV has a brightness or contrast enhancement, disable it. If there is something called \"dynamic\", "
                                "set it to standard. Adjust the backlight level to your favourite value. "
-                               "Turn down contrast on your TV as much as possible.\nThen turn the brightness setting as"
+                               "Turn down contrast on your TV as much as possible.\nThen turn the brightness setting as "
                                "low as possible, but make sure that the two lowermost shades of gray are still distinguishable.\n"
                                "Do not care for the bright shades now, they will be set up in the next step.\n"
                                "If you are happy with the result, press OK."),
                                "low as possible, but make sure that the two lowermost shades of gray are still distinguishable.\n"
                                "Do not care for the bright shades now, they will be set up in the next step.\n"
                                "If you are happy with the result, press OK."),
@@ -247,14 +247,17 @@ class VideoFinetune(Screen):
                        c.fill(offset_x, offset_y + y, width/2, 2, RGB(255,255,255))
 
                l = 0
                        c.fill(offset_x, offset_y + y, width/2, 2, RGB(255,255,255))
 
                l = 0
+               fnt = gFont("Regular", height / 14)
                import math
                import math
-               for i in xrange(1, 14):
+               for i in xrange(1, 15):
                        y = i * height / 14
                        h = y - l
                        y = i * height / 14
                        h = y - l
-                       l = y
                        gamma = 0.6 + i * 0.2
                        col = int(math.pow(.5, 1.0/gamma) * 256.0)
                        gamma = 0.6 + i * 0.2
                        col = int(math.pow(.5, 1.0/gamma) * 256.0)
-                       c.fill(offset_x + width/2, offset_y + y, width/2, h, RGB(col,col,col))
+                       c.fill(offset_x + width/2, offset_y + l, width/2, h, RGB(col,col,col))
+
+                       c.writeText(offset_x + width/2, offset_y + l, width/2, h, RGB(0,0,0), RGB(col,col,col), fnt, "%1.2f" % gamma, RT_WRAP|RT_HALIGN_RIGHT)
+                       l = y
 
                c.flush()
 
 
                c.flush()