MCPcopy Create free account
hub / github.com/OpenImageDebugger/OpenImageDebugger / _gen_color

Function _gen_color

resources/oidscripts/test.py:49–56  ·  view source on GitHub ↗

Generates a color for the pixel at (pos[0], pos[1]) with coefficients k[0] and k[1], and colouring functions f_a and f_b that map R->[-1, 1].

(pos, k, f_a, f_b)

Source from the content-addressed store, hash-verified

47
48
49def _gen_color(pos, k, f_a, f_b):
50 """
51 Generates a color for the pixel at (pos[0], pos[1]) with coefficients k[0]
52 and k[1], and colouring functions f_a and f_b that map R->[-1, 1].
53 """
54 p0 = float(pos[0])
55 p1 = float(pos[1])
56 return (f_a(p0 * f_b(p1/k[0])/k[1]) + 1.0) * 255.0 / 2.0
57
58
59def _gen_buffers(width, height):

Callers 1

_gen_buffersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected