1
0
Fork 0

Condensed down calc_lum function

master
colaclanth 2019-07-18 20:49:24 +01:00
parent 1b4cef1460
commit 8034ae6747
1 changed files with 1 additions and 6 deletions

View File

@ -12,12 +12,7 @@ def calc_lum(freq):
"""Converts SSTV pixel frequency range into 0-255 luminance byte"""
lum = int(round((freq - 1500) / 3.1372549))
if lum > 255:
return 255
elif lum < 0:
return 0
else:
return lum
return 255 if lum > 255 else 0 if lum < 0 else lum
def barycentric_peak_interp(bins, x):