Exemple #1
0
 def on_button(window,button, action, mods):
     if not atb.TwEventMouseButtonGLFW(button,action):
         pos = glfwGetCursorPos(window)
         pos = normalize(pos,glfwGetWindowSize(world_window))
         pos = denormalize(pos,(frame.img.shape[1],frame.img.shape[0]) ) # Position in img pixels
         for p in g.plugins:
             p.on_click(pos,button,action)
Exemple #2
0
 def on_button(window, button, action, mods):
     if not atb.TwEventMouseButtonGLFW(button, int(action == GLFW_PRESS)):
         if action == GLFW_PRESS:
             pos = glfwGetCursorPos(window)
             pos = normalize(pos, glfwGetWindowSize(window))
             pos = denormalize(
                 pos, (frame.img.shape[1],
                       frame.img.shape[0]))  # pos in frame.img pixels
             u_r.setStart(pos)
             bar.draw_roi.value = 1
         else:
             bar.draw_roi.value = 0