




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




class 						__lowercase		:




      """simple docstring"""





      def __init__(      self				,      A				,      A				,      A	)		->				str:






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

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

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

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

      def 	UpperCAmelCase      (      self	)		->				List[Any]:






         for i in range(self.dst_h	):
            for j in range(self.dst_w	):
               snake_case      :				List[str]				=       self.img[self.get_y(_A	)][self.get_x(_A	)]

      def 	UpperCAmelCase      (      self				,      A	)		->				str:
         return int(self.ratio_x * x	)

      def 	UpperCAmelCase      (      self				,      A	)		->				Dict:
         return int(self.ratio_y * y	)


if __name__ == "__main__":
       lowerCamelCase       :       Dict        =    8_0_0, 6_0_0
       lowerCamelCase       :       Dict        =    imread('image_data/lena.jpg', 1)
       lowerCamelCase       :       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()






def       _snake_case	(   lowerCAmelCase							:   int	):
		"""simple docstring"""







		SCREAMING_SNAKE_CASE_  :		Tuple				      =    int(lowerCAmelCase	)
		if decimal in (0, 1):  # Exit cases for the recursion
				return str(lowerCAmelCase	)
		SCREAMING_SNAKE_CASE_      ,    SCREAMING_SNAKE_CASE_  :		Dict				      =    divmod(lowerCAmelCase   , 2	)
		return binary_recursive(lowerCAmelCase	) + str(lowerCAmelCase	)




def       _snake_case	(   lowerCAmelCase							:   str	):
		"""simple docstring"""







		SCREAMING_SNAKE_CASE_  :		str				      =    str(lowerCAmelCase	).strip()
		if not number:
				raise ValueError("No input value was provided"	)
		SCREAMING_SNAKE_CASE_  :		List[str]				      =    "-" if number.startswith("-"	) else ""
		SCREAMING_SNAKE_CASE_  :		Optional[Any]				      =    number.lstrip("-"	)
		if not number.isnumeric():
				raise ValueError("Input value is not an integer"	)
		return f'{negative}0b{binary_recursive(int(lowerCAmelCase	)	)}'


if __name__ == "__main__":
		from doctest import testmod

		testmod()
