


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







class 		_snake_case  :




 def __init__(		self					,  _lowerCamelCase					,  _lowerCamelCase					,  _lowerCamelCase    ):
       if dst_width < 0 or dst_height < 0:
             raise ValueError('''Destination width/height should be > 0'''    )

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

       a						:Optional[int] 							=       self.src_w / self.dst_w
       a						:Dict 							=       self.src_h / self.dst_h

       a						:Optional[Any] 							=       (
           np.ones((self.dst_h, self.dst_w, 3)					,  np.uinta    ) * 255
       )




 def        SCREAMING_SNAKE_CASE__				(		self    ):
       for i in range(self.dst_h    ):
             for j in range(self.dst_w    ):
                   a						:Dict 							=       self.img[self.get_y(_lowerCamelCase    )][self.get_x(_lowerCamelCase    )]




 def        SCREAMING_SNAKE_CASE__				(		self					,  _lowerCamelCase    ):
       return int(self.ratio_x * x    )




 def        SCREAMING_SNAKE_CASE__				(		self					,  _lowerCamelCase    ):
       return int(self.ratio_y * y    )


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









from maths.prime_factors import prime_factors
def 				__lowerCamelCase						( UpperCAmelCase_						:		int						):




      """simple docstring"""





      if not isinstance(UpperCAmelCase_ ,  UpperCAmelCase_						):
            a						:Dict 							=       F'''Input value of [number={number}] must be an integer'''
            raise TypeError(UpperCAmelCase_						)
      if number < 1:
            raise ValueError('''Input must be a positive integer'''						)
      return -1 if len(prime_factors(UpperCAmelCase_						)						) % 2 else 1


if __name__ == "__main__":
     import doctest

     doctest.testmod()





