Hi Sander,
A neat and useful tool - congratulations!
Niall has been faster than me in proposing a feature that is very necessary in my opinion. Actually, this task is easy to implement. You already have a drawing routine that plots the profile on a
graphics context: either a Graphics or a VectorGraphics instance. You can associate a graphics context to a Bitmap, then render the Bitmap on a Generic2DImage<P>, which can be a window's MainView().Image(). In fact, I am planning to do exactly this with HistogramTransformation, or perhaps a new lightweight histogram visualization tool a la Statistics.
Another suggestion is saving the graphic as a SVG file. Again, PCL provides you with all the necessary tools: you can associate a graphics context to a SVG instance, so once more you can reuse your current drawing routine. SVG is great to embed graphics in documents.
I have more ideas. Currently when an instance of DynamicProfile is executed on a view nothing happens (e.g., when an icon is dragged to a view). I don't know if you have plans to implement a specific behavior, but if you implement Niall's suggestion, then a nice way to deal with view execution (your .ExecuteOn( View& ) member function) would creating a new 8-bit image with the profile graphic.
And now something that I think is really important. Currently you always rescale the profile to fit the available graphics port on the interface. This is a nice default behavior because it maximizes detail visibility. However, this has an important drawback: comparison of several profiles is difficult due to the varying vertical scales. I would add an option to "fix" the vertical scale so a set of profiles can be plotted with the same units in samples/pixel. Or you could allow the user to define three scaling modes:
- Auto: profiles are automatically scaled to fit the graph's height (current mode).
- Normalized: the graph's height represents the normalized [0,1] range.
- Custom: the user specifies a custom plotting range in [0,1]. In this mode some profiles can get clipped, depending on the specified minimum and maximum plotting bounds and the sampled pixel values.
That's all, for now. As you see I'm good at figuring ways to make others work