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





class       __A:

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

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

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

												lowerCamelCase_							  =					lowerCamelCase_							  =					(
												    np.ones((self.dst_h, self.dst_w, 3)   ,					np.uinta   ) * 2_5_5
												)

					def    lowercase__      (	self					:     Tuple   ):
												for i in range(self.dst_h   ):
																			for j in range(self.dst_w   ):
																										lowerCamelCase_							  =					self.img[self.get_y(__UpperCamelCase   )][self.get_x(__UpperCamelCase   )]

					def    lowercase__      (	self					:     List[Any]   ,					__UpperCamelCase					:     int   ):
												return int(self.ratio_x * x   )



					def    lowercase__      (	self					:     Dict   ,					__UpperCamelCase					:     int   ):
												return int(self.ratio_y * y   )


if __name__ == "__main__":
		lowercase   ,						lowercase        =  8_0_0, 6_0_0
		lowercase        =  imread('''image_data/lena.jpg''', 1)
		lowercase        =  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						(							UpperCAmelCase__				:      int			,				UpperCAmelCase__				:      float			,				UpperCAmelCase__				:      float       )  ->    float:
							return round(float(moles / volume       ) * nfactor       )



def      __lowerCAmelCase						(							UpperCAmelCase__				:      float			,				UpperCAmelCase__				:      float			,				UpperCAmelCase__				:      float       )  ->    float:
							return round(float((moles * 0.0_8_2_1 * temperature) / (volume)       )       )



def      __lowerCAmelCase						(							UpperCAmelCase__				:      float			,				UpperCAmelCase__				:      float			,				UpperCAmelCase__				:      float       )  ->    float:
							return round(float((moles * 0.0_8_2_1 * temperature) / (pressure)       )       )



def      __lowerCAmelCase						(							UpperCAmelCase__				:      float			,				UpperCAmelCase__				:      float			,				UpperCAmelCase__				:      float       )  ->    float:
							return round(float((pressure * volume) / (0.0_8_2_1 * moles)       )       )


if __name__ == "__main__":
		import doctest

		doctest.testmod()





