






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




class 		UpperCAmelCase_						:


						'''simple docstring'''




						def __init__(	self		,				_SCREAMING_SNAKE_CASE		,				_SCREAMING_SNAKE_CASE		,				_SCREAMING_SNAKE_CASE				) ->				List[Any]:
								if dst_width < 0 or dst_height < 0:
										raise ValueError("Destination width/height should be > 0"				)

								snake_case_				:							Any						 =       img
								snake_case_				:							Dict						 =       img.shape[1]
								snake_case_				:							str						 =       img.shape[0]
								snake_case_				:							int						 =       dst_width
								snake_case_				:							Dict						 =       dst_height

								snake_case_				:							List[Any]						 =       self.src_w / self.dst_w
								snake_case_				:							List[str]						 =       self.src_h / self.dst_h

								snake_case_				:							Tuple						 =       (
								    np.ones((self.dst_h, self.dst_w, 3)		,				np.uinta				) * 255
								)






						def       _lowerCAmelCase       (	self				) ->				Optional[int]:
								for i in range(self.dst_h				):
										for j in range(self.dst_w				):
												snake_case_				:							Tuple						 =       self.img[self.get_y(_SCREAMING_SNAKE_CASE				)][self.get_x(_SCREAMING_SNAKE_CASE				)]






						def       _lowerCAmelCase       (	self		,				_SCREAMING_SNAKE_CASE				) ->				int:
								return int(self.ratio_x * x				)






						def       _lowerCAmelCase       (	self		,				_SCREAMING_SNAKE_CASE				) ->				int:
								return int(self.ratio_y * y				)


if __name__ == "__main__":
							lowercase  ,lowercase  :							Optional[int]			  =    8_00, 6_00
							lowercase  :							List[Any]			  =    imread('''image_data/lena.jpg''', 1)
							lowercase  :							List[str]			  =    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()








def      lowerCAmelCase__	(    _a       :			int    ):
		if num < 0:
				return False

		snake_case_				:							int						 =       num
		snake_case_				:							int						 =       0
		while num > 0:
				snake_case_				:							Union[str, Any]						 =       rev_num * 10 + (num % 10)
				num //= 10

		return num_copy == rev_num


if __name__ == "__main__":
							import doctest

							doctest.testmod()
