mirror of
https://github.com/colaclanth/sstv.git
synced 2025-12-06 02:41:59 +01:00
Condensed down calc_lum function
This commit is contained in:
parent
1b4cef1460
commit
8034ae6747
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Reference in a new issue