MCPcopy Create free account
hub / github.com/ICE27182/Python-3D-renderer / convert_depth_to_frame

Function convert_depth_to_frame

pyrender.py:3311–3318  ·  view source on GitHub ↗
(depth, z_near, z_far)

Source from the content-addressed store, hash-verified

3309
3310
3311def convert_depth_to_frame(depth, z_near, z_far):
3312 w = len(depth[0])
3313 h = len(depth)
3314 frame = [[None] * w for _ in range(h)]
3315 for y in range(h):
3316 for x in range(w):
3317 frame[y][x] = (int(255 * (z_far - depth[y][x]) / (z_far - z_near)),) * 3
3318 return frame
3319
3320
3321def fxaa(frame, threshold=0.1, channel=0) -> list:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected