code: def on_mouse_move(self, event):
      x, y = event.pos
      w, h = self.size
  
      # Make sure the mouse isn't outside of the viewport.
      x = max(0, min(x, w - 1))
      y = max(0, min(y, h - 1))
  
      yf = 1 - y / (h / 2.0)
      xf = x / (w / 2.0) - 1
  
      x_norm = int((x * 512) // w)
      y_norm = int((y * 512) // h)
  
      P = np.zeros((4 + 4 + 514 + 514, 2), np.float32)
  
      x_baseline = P[:4]
      y_baseline = P[4:8]
      x_profile = P[8:522]
      y_profile = P[522:]
  
      x_baseline[...] = (-1, yf), (-1, yf), (1, yf), (1, yf)
      y_baseline[...] = (xf, -1), (xf, -1), (xf, 1), (xf, 1)
  
      x_profile[1:-1, 0] = np.linspace(-1, 1, 512)
      x_profile[1:-1, 1] = yf + 0.15 * idxs[y_norm, :]
      x_profile[0] = x_profile[1]
      x_profile[-1] = x_profile[-2]
  
      y_profile[1:-1, 0] = xf + 0.15 * idxs[:, x_norm]
      y_profile[1:-1, 1] = np.linspace(-1, 1, 512)
      y_profile[0] = y_profile[1]
      y_profile[-1] = y_profile[-2]
  
      self.lines["position"] = P
      self.update()
  
file_path: vispy/examples/demo/gloo/imshow_cuts.py
imports: import numpy
  from vispy import app
  from vispy.gloo import set_viewport, clear, set_state, Program
label_desc: Use image node_id 4 for calling the Canvas obj's underlying member method code with example usage: obj.on_mouse_move(event) without return types