| 85 | |
| 86 | |
| 87 | class Point(NamedTuple): |
| 88 | y: int |
| 89 | x: int |
| 90 | |
| 91 | def norm(self, dims: tuple[int, int, int]) -> Point: |
| 92 | return type(self)( |
| 93 | int(self.y / NORM.y * dims[0]), |
| 94 | int(self.x / NORM.x * dims[1]), |
| 95 | ) |
| 96 | |
| 97 | def denorm(self, dims: tuple[int, int, int]) -> Point: |
| 98 | return type(self)( |
| 99 | int(self.y / dims[0] * NORM.y), |
| 100 | int(self.x / dims[1] * NORM.x), |
| 101 | ) |
| 102 | |
| 103 | |
| 104 | NORM = Point(y=720, x=1280) |
no outgoing calls
no test coverage detected