



"""simple docstring"""






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




class   a__			:





						def __init__(							self      :	Optional[int]     ,a__      :	Optional[Any]     ,a__      :	int     ,a__      :	int)						->       List[Any]:




											"""simple docstring"""







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

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

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

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





						def       __UpperCamelCase     (							self      :	Tuple)						->       List[str]:




											"""simple docstring"""







											for i in range(self.dst_h):
																for j in range(self.dst_w):
																					_lowerCAmelCase:List[Any]									=  self.img[self.get_y(a__)][self.get_x(a__)]





						def       __UpperCamelCase     (							self      :	Union[str, Any]     ,a__      :	int)						->       int:




											"""simple docstring"""







											return int(self.ratio_x * x)







						def       __UpperCamelCase     (							self      :	int     ,a__      :	int)						->       int:




											"""simple docstring"""







											return int(self.ratio_y * y)


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






# NOTE: This file is deprecated and will be removed in a future version.
# It only exists so that temporarely `from diffusers.pipelines import DiffusionPipeline` works

from ...utils import deprecate
from ..controlnet.pipeline_flax_controlnet import FlaxStableDiffusionControlNetPipeline  # noqa: F401


deprecate(
    '''stable diffusion controlnet''',
    '''0.22.0''',
    '''Importing `FlaxStableDiffusionControlNetPipeline` from diffusers.pipelines.stable_diffusion.flax_pipeline_stable_diffusion_controlnet is deprecated. Please import `from diffusers import FlaxStableDiffusionControlNetPipeline` instead.''',
    standard_warn=False,
    stacklevel=3,
)






