






"""simple docstring"""


_UpperCamelCase							:       Optional[Any]       					=		{hex(i)[2:]: i for i in range(16)}  # Use [:2] to strip off the leading '0x'




def      snake_case    (A_ :str ):







  '''simple docstring'''

  a	:     Optional[int]							=  hex_string.strip().lower()
  if not hex_string:
    raise ValueError('Empty string was passed to the function' )
  a	:     str							=  hex_string[0] == '-'
  if is_negative:
    a	:     Optional[int]							=  hex_string[1:]
  if not all(char in hex_table for char in hex_string ):
    raise ValueError('Non-hexadecimal value was passed to the function' )
  a	:     Optional[int]							=  0
  for char in hex_string:
    a	:     Tuple							=  1_6 * decimal_number + hex_table[char]
  return -decimal_number if is_negative else decimal_number


if __name__ == "__main__":
   from doctest import testmod

   testmod()












"""simple docstring"""


from cva import destroyAllWindows, imread, imshow, waitKey




def      snake_case    (A_ :Optional[int]      ,     A_ :int ):







  '''simple docstring'''

  a,	a	:     Tuple							=  img.shape[0], img.shape[1]

  def to_grayscale(A_ :Tuple      ,     A_ :List[str]      ,     A_ :Union[str, Any] ):
    return 0.2126 * red + 0.587 * green + 0.114 * blue

  def normalize(A_ :Union[str, Any] ):
    return min(A_      ,     2_5_5 )

  for i in range(A_ ):
    for j in range(A_ ):
      a	:     Union[str, Any]							=  int(to_grayscale(*img[i][j] ) )
      a	:     Any							=  [
          normalize(A_ ),
          normalize(greyscale + factor ),
          normalize(greyscale + 2 * factor ),
      ]

  return img


if __name__ == "__main__":
   # read original image
   _UpperCamelCase							:       List[str]       					=		{
       percentage: imread('image_data/lena.jpg', 1) for percentage in (10, 20, 30, 40)
   }

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




