(
shape: tuple[int, int],
color_function: ColorFunction,
device: torch.device,
subdivision: int = 8,
num_passes: int = 2,
)
| 116 | |
| 117 | @torch.no_grad() |
| 118 | def 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 | |
| 136 | def render_over_image( |
no test coverage detected