


import numpy as np
from cva import destroyAllWindows, imread, imshow, waitKey
class 	UpperCAmelCase_					:

   '''simple docstring'''




   def __init__(		self						,				__A						,				__A						,				__A ):






     """simple docstring"""





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

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

     lowerCamelCase :					List[str]    =				self.src_w / self.dst_w
     lowerCamelCase :					Dict    =				self.src_h / self.dst_h

     lowerCamelCase :					str    =				(
         np.ones((self.dst_h, self.dst_w, 3)						,				np.uinta ) * 255
     )






   def _snake_case    (		self ):






     """simple docstring"""





     for i in range(self.dst_h ):
       for j in range(self.dst_w ):
         lowerCamelCase :					Optional[int]    =				self.img[self.get_y(__A )][self.get_x(__A )]






   def _snake_case    (		self						,				__A ):






     """simple docstring"""





     return int(self.ratio_x * x )






   def _snake_case    (		self						,				__A ):






     """simple docstring"""





     return int(self.ratio_y * y )


if __name__ == "__main__":
   _snake_case      ,       _snake_case             =     8_00, 6_00
   _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()







import warnings

from ...utils import logging
from .image_processing_dpt import DPTImageProcessor


_snake_case             =     logging.get_logger(__name__)
class 	UpperCAmelCase_					(					UpperCamelCase    ):

   '''simple docstring'''




   def __init__(		self						,				*__A						,				**__A ):






     """simple docstring"""





     warnings.warn(
         "The class DPTFeatureExtractor is deprecated and will be removed in version 5 of Transformers. Please"
         " use DPTImageProcessor instead."						,				__A						,				)
     super().__init__(*__A						,				**__A )



