


"""simple docstring"""



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







class _lowerCAmelCase    :







			def __init__(     self						,     UpperCamelCase__						,     UpperCamelCase__						,     UpperCamelCase__						)     ->		Optional[int]:

							'''simple docstring'''




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

							snake_case   :				List[Any]				 =   img
							snake_case   :				Dict				 =   img.shape[1]
							snake_case   :				Union[str, Any]				 =   img.shape[0]
							snake_case   :				Optional[Any]				 =   dst_width
							snake_case   :				List[Any]				 =   dst_height

							snake_case   :				int				 =   self.src_w / self.dst_w
							snake_case   :				Union[str, Any]				 =   self.src_h / self.dst_h

							snake_case   :				Dict				 =   (
							    np.ones((self.dst_h, self.dst_w, 3)						,     np.uinta						) * 255
							)







			def 			lowerCamelCase		(     self						)     ->		Dict:

							'''simple docstring'''




							for i in range(self.dst_h						):
											for j in range(self.dst_w						):
															snake_case   :				int				 =   self.img[self.get_y(UpperCamelCase__						)][self.get_x(UpperCamelCase__						)]







			def 			lowerCamelCase		(     self						,     UpperCamelCase__						)     ->		int:

							'''simple docstring'''




							return int(self.ratio_x * x						)







			def 			lowerCamelCase		(     self						,     UpperCamelCase__						)     ->		int:

							'''simple docstring'''




							return int(self.ratio_y * y						)


if __name__ == "__main__":
		__snake_case      ,		__snake_case             =   800, 600
		__snake_case             =   imread("""image_data/lena.jpg""", 1)
		__snake_case             =   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"""



def   __lowerCAmelCase						(						lowercase  :  int			)     ->						int:


    """simple docstring"""





    if not isinstance(lowercase						,							lowercase			):
        raise ValueError("Input must be an integer"			)
    if input_num <= 0:
        raise ValueError("Input must be positive"			)
    return sum(
        divisor for divisor in range(1						,							input_num // 2 + 1			) if input_num % divisor == 0			)


if __name__ == "__main__":
  import doctest

  doctest.testmod()





