Get parent X coordinate for destination X :param x: Destination X coordinate :return: Parent X coordinate based on `x ratio` >>> nn = NearestNeighbour(imread("digital_image_processing/image_data/lena.jpg", ... 1), 100, 100)
(self, x: int)
| 33 | self.output[i][j] = self.img[self.get_y(i)][self.get_x(j)] |
| 34 | |
| 35 | def get_x(self, x: int) -> int: |
| 36 | """ |
| 37 | Get parent X coordinate for destination X |
| 38 | :param x: Destination X coordinate |
| 39 | :return: Parent X coordinate based on `x ratio` |
| 40 | >>> nn = NearestNeighbour(imread("digital_image_processing/image_data/lena.jpg", |
| 41 | ... 1), 100, 100) |
| 42 | >>> nn.ratio_x = 0.5 |
| 43 | >>> nn.get_x(4) |
| 44 | 2 |
| 45 | """ |
| 46 | return int(self.ratio_x * x) |
| 47 | |
| 48 | def get_y(self, y: int) -> int: |
| 49 | """ |