Labelling cells within components using mouse?


Hello all!
I’m using Juce as a graphical analysis backend for a project I am working on and I currently have a component that plots 2D position data at between 40-50Hz. The image is binary, an (x,y) position is either occupied (1), or isn’t (0). I’d like to be able to do the following:

  • Break the plot into NxM grid cells (I think I can do this piece with Rectangle objects)
  • Apply non-zero labels to cells that I mouse-click and zero to cells that I don’t click. Once I’m finished labeling the current scene, I’m thinking I could exit with space-bar or button click.
  • Save each labeled cell (along with its label) as a binary image.

This seems straightforward, but I’m having difficulty getting started. Any help would be greatly appreciated! Thanks!