Fix float literal syntax in autonomous kernel
This commit is contained in:
@@ -454,19 +454,19 @@ void autonomous_pipeline(
|
||||
}}
|
||||
'''
|
||||
elif op == 'ripple':
|
||||
amp = effect.get('amplitude', 10)
|
||||
freq = effect.get('frequency', 8)
|
||||
decay = effect.get('decay', 2)
|
||||
rcx = effect.get('center_x', width/2)
|
||||
rcy = effect.get('center_y', height/2)
|
||||
amp = float(effect.get('amplitude', 10))
|
||||
freq = float(effect.get('frequency', 8))
|
||||
decay = float(effect.get('decay', 2))
|
||||
rcx = float(effect.get('center_x', width/2))
|
||||
rcy = float(effect.get('center_y', height/2))
|
||||
code += f'''
|
||||
// Ripple {i}
|
||||
{{
|
||||
float amplitude = {amp}f;
|
||||
float frequency = {freq}f;
|
||||
float decay_val = {decay}f;
|
||||
float rcx = {rcx}f;
|
||||
float rcy = {rcy}f;
|
||||
float amplitude = {amp:.1f}f;
|
||||
float frequency = {freq:.1f}f;
|
||||
float decay_val = {decay:.1f}f;
|
||||
float rcx = {rcx:.1f}f;
|
||||
float rcy = {rcy:.1f}f;
|
||||
|
||||
float rdx = src_x - rcx;
|
||||
float rdy = src_y - rcy;
|
||||
@@ -529,11 +529,11 @@ void autonomous_pipeline(
|
||||
op = effect['op']
|
||||
|
||||
if op == 'hue_shift':
|
||||
degrees = effect.get('degrees', 0)
|
||||
degrees = float(effect.get('degrees', 0))
|
||||
code += f'''
|
||||
// Hue shift {i}
|
||||
{{
|
||||
float shift = {degrees}f;
|
||||
float shift = {degrees:.1f}f;
|
||||
float rf = r / 255.0f;
|
||||
float gf = g / 255.0f;
|
||||
float bf = b / 255.0f;
|
||||
|
||||
Reference in New Issue
Block a user