Get parent Y coordinate for destination Y :param y: Destination X coordinate :return: Parent X coordinate based on `y ratio` >>> nn = NearestNeighbour(imread("digital_image_processing/image_data/lena.jpg", ... 1), 100, 100)
(self, y: int)
| 46 | return int(self.ratio_x * x) |
| 47 | |
| 48 | def get_y(self, y: int) -> int: |
| 49 | """ |
| 50 | Get parent Y coordinate for destination Y |
| 51 | :param y: Destination X coordinate |
| 52 | :return: Parent X coordinate based on `y ratio` |
| 53 | >>> nn = NearestNeighbour(imread("digital_image_processing/image_data/lena.jpg", |
| 54 | ... 1), 100, 100) |
| 55 | >>> nn.ratio_y = 0.5 |
| 56 | >>> nn.get_y(4) |
| 57 | 2 |
| 58 | """ |
| 59 | return int(self.ratio_y * y) |
| 60 | |
| 61 | |
| 62 | if __name__ == "__main__": |