MCPcopy Create free account
hub / github.com/dcharatan/flowmap / render

Function render

flowmap/visualization/drawing/rendering.py:118–133  ·  view source on GitHub ↗
(
    shape: tuple[int, int],
    color_function: ColorFunction,
    device: torch.device,
    subdivision: int = 8,
    num_passes: int = 2,
)

Source from the content-addressed store, hash-verified

116
117@torch.no_grad()
118def render(
119 shape: tuple[int, int],
120 color_function: ColorFunction,
121 device: torch.device,
122 subdivision: int = 8,
123 num_passes: int = 2,
124) -> Float[Tensor, "4 height width"]: # color (RGBA with straight alpha)
125 xy = generate_sample_grid(shape, device)
126 return run_msaa_pass(
127 xy[None],
128 color_function,
129 1.0,
130 subdivision,
131 num_passes,
132 device,
133 )[0]
134
135
136def render_over_image(

Callers 1

render_over_imageFunction · 0.85

Calls 2

generate_sample_gridFunction · 0.85
run_msaa_passFunction · 0.85

Tested by

no test coverage detected