



"""simple docstring"""






from cva import destroyAllWindows, imread, imshow, waitKey






def 	snake_case__  (						__lowerCamelCase							:       List[Any]				,						__lowerCamelCase							:       int      ):
			"""simple docstring"""
			lowerCamelCase__      ,  lowerCamelCase__						:						Union[str, Any]						      =img.shape[0], img.shape[1]

			def to_grayscale(__lowerCamelCase							:       Union[str, Any]				,						__lowerCamelCase							:       List[str]				,						__lowerCamelCase							:       Optional[Any]      ):
						return 0.21_26 * red + 0.5_87 * green + 0.1_14 * blue

			def normalize(__lowerCamelCase							:       Tuple      ):
						return min(__lowerCamelCase				,						255      )

			for i in range(__lowerCamelCase      ):
						for j in range(__lowerCamelCase      ):
									lowerCamelCase__						:						str						      =int(to_grayscale(*img[i][j]      )      )
									lowerCamelCase__						:						Tuple						      =[
									    normalize(__lowerCamelCase      ),
									    normalize(greyscale + factor      ),
									    normalize(greyscale + 2 * factor      ),
									]

			return img


if __name__ == "__main__":
		# read original image
		_lowercase					:					List[str] 		=		{
		    percentage: imread("image_data/lena.jpg", 1) for percentage in (1_0, 2_0, 3_0, 4_0)
		}

		for percentage, img in images.items():
				make_sepia(img, percentage)

		for percentage, img in images.items():
				imshow(f'Original image with sepia (factor: {percentage})', img)

		waitKey(0)
		destroyAllWindows()









"""simple docstring"""






def 	snake_case__  (						__lowerCamelCase							:       str				,						__lowerCamelCase							:       int = 13      ):
			"""simple docstring"""
			lowerCamelCase__						:						List[str]						      =''''''
			for c in s:
						if "A" <= c <= "Z":
									out += chr(ord('''A'''      ) + (ord(__lowerCamelCase      ) - ord('''A'''      ) + n) % 26      )
						elif "a" <= c <= "z":
									out += chr(ord('''a'''      ) + (ord(__lowerCamelCase      ) - ord('''a'''      ) + n) % 26      )
						else:
									out += c
			return out






def 	snake_case__  (						):
			"""simple docstring"""
			lowerCamelCase__						:						List[str]						      =input('''Enter message: '''      )

			lowerCamelCase__						:						str						      =dencrypt(__lowerCamelCase				,						13      )
			print('''Encryption:'''				,						__lowerCamelCase      )

			lowerCamelCase__						:						Any						      =dencrypt(__lowerCamelCase				,						13      )
			print('''Decryption: '''				,						__lowerCamelCase      )


if __name__ == "__main__":
		import doctest

		doctest.testmod()
		main()




