
'''simple docstring'''







import numpy as np
from cva import destroyAllWindows, imread, imshow, waitKey


class 		__UpperCAmelCase   :


							def __init__( self					,     lowerCAmelCase_					,     lowerCAmelCase_					,     lowerCAmelCase_						):





								"""simple docstring"""






								if dst_width < 0 or dst_height < 0:
									raise ValueError('Destination width/height should be > 0'						)

								_snake_case     		=	img
								_snake_case     		=	img.shape[1]
								_snake_case     		=	img.shape[0]
								_snake_case     		=	dst_width
								_snake_case     		=	dst_height

								_snake_case     		=	self.src_w / self.dst_w
								_snake_case     		=	self.src_h / self.dst_h

								_snake_case     		=	(
								    np.ones((self.dst_h, self.dst_w, 3)					,     np.uinta						) * 2_55
								)


							def 				lowerCamelCase       ( self						):





								"""simple docstring"""






								for i in range(self.dst_h						):
									for j in range(self.dst_w						):
										_snake_case     		=	self.img[self.get_y(lowerCAmelCase__						)][self.get_x(lowerCAmelCase__						)]


							def 				lowerCamelCase       ( self					,     lowerCAmelCase_						):





								"""simple docstring"""






								return int(self.ratio_x * x						)




							def 				lowerCamelCase       ( self					,     lowerCAmelCase_						):





								"""simple docstring"""






								return int(self.ratio_y * y						)


if __name__ == "__main__":
					lowercase					:							Any   =      800, 600
					lowercase					:							Union[str, Any]   =      imread("image_data/lena.jpg", 1)
					lowercase					:							List[Any]   =      NearestNeighbour(im, dst_w, dst_h)
					n.process()

					imshow(
					    F'''Image resized from: {im.shape[1]}x{im.shape[0]} to {dst_w}x{dst_h}''', n.output
					)
					waitKey(0)
					destroyAllWindows()



'''simple docstring'''







from abc import ABC, abstractmethod
from argparse import ArgumentParser


class 		__UpperCAmelCase   (      _lowerCamelCase		):


							@staticmethod
							@abstractmethod
							def 				lowerCamelCase       ( lowerCAmelCase_						):





								"""simple docstring"""






								raise NotImplementedError()




							@abstractmethod
							def 				lowerCamelCase       ( self						):





								"""simple docstring"""






								raise NotImplementedError()

