replace y with l in luv2rgb to make more sense

This commit is contained in:
Dave Schmenk 2020-05-13 19:28:08 -07:00
parent cafcaae557
commit 5dcd880b7c
3 changed files with 17 additions and 17 deletions

View File

@ -23,12 +23,12 @@ def yuv2rgb(y, u, v):
b = max(0.0, y + 2.033 * u)
return (r, g, b)
def luv2rgb(y, u, v):
r = max(0.0, y + v)
g = max(0.0, y - 0.707 * u - 0.707 * v)
b = max(0.0, y + u)
def luv2rgb(l, u, v):
r = max(0.0, l + v)
g = max(0.0, l - 0.707 * u - 0.707 * v)
b = max(0.0, l + u)
return (r, g, b)
def ntscInitRGB(angle):
YScale = [0.0, 0.25, 0.50, 1.0]#[0.0, 0.3334, 0.6667, 1.0]
redSum = 0.0
@ -96,7 +96,7 @@ def ntscInitPixels():
def ntscMapRGB(rgb, x):
global shrPixels
nearest = 195075
nBest = 0
errRed = 0

View File

@ -22,10 +22,10 @@ def yuv2rgb(y, u, v):
b = max(0.0, y + 2.033 * u)
return (r, g, b)
def luv2rgb(y, u, v):
r = max(0.0, y + v)
g = max(0.0, y - 0.707 * u - 0.707 * v)
b = max(0.0, y + u)
def luv2rgb(l, u, v):
r = max(0.0, l + v)
g = max(0.0, l - 0.707 * u - 0.707 * v)
b = max(0.0, l + u)
return (r, g, b)
def ntscInitRGB(angle):
@ -96,7 +96,7 @@ def ntscInitPixels():
def ntscMapRGB(rgb, x):
global shrPixels
global ntscPrev
pix8 = x % 8
if pix8 == 0:
shrPixels = [0 for n in xrange(32)]

View File

@ -21,10 +21,10 @@ def yuv2rgb(y, u, v):
b = max(0.0, y + 2.033 * u)
return r, g, b
def luv2rgb(y, u, v):
r = max(0.0, y + v)
g = max(0.0, y - 0.707 * u - 0.707 * v)
b = max(0.0, y + u)
def luv2rgb(l, u, v):
r = max(0.0, l + v)
g = max(0.0, l - 0.707 * u - 0.707 * v)
b = max(0.0, l + u)
return r, g, b
def ntscInitRGB(angle):
@ -82,7 +82,7 @@ def ntscPrev():
grn += ntscOutput[p][1]
blu += ntscOutput[p][2]
return (min(255,red), min(255,grn), min(255,blu))
def ntscBest(ntsc, rgb):
nearest = 195075
lumBest = 0
@ -110,7 +110,7 @@ def ntscMapRGB(rgb):
blu = max(0, rgb[p][2] - prev[2])
shr.append(ntscBest(ntscRGB[p], (red, grn, blu)))
return shr
def displayBars():
for l in xrange(4):
for bar in xrange(len(ntscRGB)):