






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


   def __init__(   self      :    List[str]      ,					a      :    str      ,					a      :    int      ,					a      :    int	)->       str:





     """simple docstring"""







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

     lowercase__           =  img
     lowercase__           =  img.shape[1]
     lowercase__           =  img.shape[0]
     lowercase__           =  dst_width
     lowercase__           =  dst_height

     lowercase__           =  self.src_w / self.dst_w
     lowercase__           =  self.src_h / self.dst_h

     lowercase__           =  lowercase__           =  (
         np.ones((self.dst_h, self.dst_w, 3)      ,					np.uinta	) * 255
     )


   def 	SCREAMING_SNAKE_CASE_							(   self      :    List[Any]	)->       Optional[Any]:





     """simple docstring"""







     for i in range(self.dst_h	):
       for j in range(self.dst_w	):
         lowercase__           =  self.img[self.get_y(a	)][self.get_x(a	)]


   def 	SCREAMING_SNAKE_CASE_							(   self      :    List[Any]      ,					a      :    int	)->       int:





     """simple docstring"""







     return int(self.ratio_x * x	)


   def 	SCREAMING_SNAKE_CASE_							(   self      :    Optional[Any]      ,					a      :    int	)->       int:





     """simple docstring"""







     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()









from typing import TYPE_CHECKING

from ..utils import _LazyModule


lowercase_          =		{
    """config""": [
        """EXTERNAL_DATA_FORMAT_SIZE_LIMIT""",
        """OnnxConfig""",
        """OnnxConfigWithPast""",
        """OnnxSeq2SeqConfigWithPast""",
        """PatchingSpec""",
    ],
    """convert""": ["""export""", """validate_model_outputs"""],
    """features""": ["""FeaturesManager"""],
    """utils""": ["""ParameterFormat""", """compute_serialized_parameters_size"""],
}


if TYPE_CHECKING:
      from .config import (
          EXTERNAL_DATA_FORMAT_SIZE_LIMIT,
          OnnxConfig,
          OnnxConfigWithPast,
          OnnxSeqaSeqConfigWithPast,
          PatchingSpec,
      )
      from .convert import export, validate_model_outputs
      from .features import FeaturesManager
      from .utils import ParameterFormat, compute_serialized_parameters_size

else:
      import sys

      lowercase_          =		_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)


