(self, coords: np.ndarray)
| 89 | return coords |
| 90 | |
| 91 | def camera_rays(self, coords: np.ndarray) -> np.ndarray: |
| 92 | fracs = (coords / (np.array([self.width, self.height], dtype=np.float32) - 1)) * 2 - 1 |
| 93 | fracs = fracs * np.tan(np.array([self.x_fov, self.y_fov]) / 2) |
| 94 | directions = self.z + self.x * fracs[:, :1] + self.y * fracs[:, 1:] |
| 95 | directions = directions / np.linalg.norm(directions, axis=-1, keepdims=True) |
| 96 | return np.stack([np.broadcast_to(self.origin, directions.shape), directions], axis=1) |
| 97 | |
| 98 | def depth_directions(self, coords: np.ndarray) -> np.ndarray: |
| 99 | return np.tile((self.z / np.linalg.norm(self.z))[None], [len(coords), 1]) |
nothing calls this directly
no outgoing calls
no test coverage detected