generateCameraX.py 290 B

1234567891011
  1. # Script to precalculate cameraX values
  2. screenWidth = 160
  3. def doubleToFP16(x):
  4. return round(x * pow(2,16))
  5. print("fixed_point_t cameraX[" + str(screenWidth) + "] = {")
  6. for i in range(screenWidth):
  7. print(str(doubleToFP16(2*i / (screenWidth-1) - 1)) + ", ", end='')
  8. print("\n};\n")