


from cva import destroyAllWindows, imread, imshow, waitKey







def SCREAMING_SNAKE_CASE	(			__lowerCAmelCase				)    ->				Any:
  # getting number of pixels in the image
  snake_case__				,				snake_case__						= img.shape[0], img.shape[1]

  # converting each pixel's color to its negative
  for i in range(__lowerCAmelCase				):
    for j in range(__lowerCAmelCase				):
      snake_case__						= [255, 255, 255] - img[i][j]

  return img


if __name__ == "__main__":
   # read original image
   lowerCamelCase__							:						Any							     =   imread("""image_data/lena.jpg""", 1)

   # convert to its negative
   lowerCamelCase__							:						str							     =   convert_to_negative(img)

   # show result image
   imshow("""negative of original image""", img)
   waitKey(0)
   destroyAllWindows()



from __future__ import annotations

def a__       (			A_,	A_,	A_,	A_   ):






  '''simple docstring'''





  if (direction == 1 and array[indexa] > array[indexa]) or (
      direction == 0 and array[indexa] < array[indexa]
  ):
    __magic_name__	,       __magic_name__								=			array[indexa], array[indexa]

def a__       (			A_,	A_,	A_,	A_   ):






  '''simple docstring'''





  if length > 1:
    __magic_name__								=			int(length / 2   )
    for i in range(A_,	low + middle   ):
      comp_and_swap(A_,	A_,	i + middle,	A_   )
    bitonic_merge(A_,	A_,	A_,	A_   )
    bitonic_merge(A_,	low + middle,	A_,	A_   )

def a__       (			A_,	A_,	A_,	A_   ):






  '''simple docstring'''





  if length > 1:
    __magic_name__								=			int(length / 2   )
    bitonic_sort(A_,	A_,	A_,	1   )
    bitonic_sort(A_,	low + middle,	A_,	0   )
    bitonic_merge(A_,	A_,	A_,	A_   )


if __name__ == "__main__":
    __lowerCAmelCase     :	Optional[Any]       			=  input('Enter numbers separated by a comma:\n').strip()
    __lowerCAmelCase     :	List[Any]       			=  [int(item.strip()) for item in user_input.split(',')]

    bitonic_sort(unsorted, 0, len(unsorted), 1)
    print('\nSorted array in ascending order is: ', end='')
    print(*unsorted, sep=', ')

    bitonic_merge(unsorted, 0, len(unsorted), 0)
    print('Sorted array in descending order is: ', end='')
    print(*unsorted, sep=', ')

