


"""simple docstring"""







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






class 						_A  :







    """simple docstring"""




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

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

      a						:		str      							=			self.src_w / self.dst_w
      a						:		Dict      							=			self.src_h / self.dst_h

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






    def 	__snake_case							(					self				:    Tuple):
      for i in range(self.dst_h):
        for j in range(self.dst_w):
          a						:		List[str]      							=			self.img[self.get_y(__UpperCAmelCase)][self.get_x(__UpperCAmelCase)]






    def 	__snake_case							(					self				:    Dict				, __UpperCAmelCase				:    int):
      return int(self.ratio_x * x)






    def 	__snake_case							(					self				:    Optional[int]				, __UpperCAmelCase				:    int):
      return int(self.ratio_y * y)


if __name__ == "__main__":
 __lowercase					,							__lowercase    					=      800, 600
 __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()










"""simple docstring"""







def      lowercase			(				A_  ,   A_       )->      float:
  '''simple docstring'''







  if mass < 0:
    raise ValueError("The mass of a body cannot be negative"       )
  return 0.5 * mass * abs(A_       ) * abs(A_       )


if __name__ == "__main__":
 import doctest

 doctest.testmod(verbose=True)






