Agreed.
Modifying the height of the histogram will be easy, but variable
width asks for two different scenarios:
1. User can specify width of the histogram and number of bins.
In that case he won't have much freedom in specifying number of bins.
Example, width is 100 and number of bins is 70. You can't create 70 bins
in width 100, you will have to make some bins width 2 and some 1, and
it just makes no sense. So, if you specify width 100, live with the
fact that you can only have number of bins that is divisor of 100,
some of these {1,2,4,5,10,20,25,50,100}. Now, given that the user
wants 70 bins, I will snap 70 to the closest of these, 50. He still
has "freedom" to specify number of bins, but we will help him
by snapping that to the closest valid value.
2. User can specify a number X and number of bins,
which means draw each bin X times. In this case the width will adapt.
So, number of bins 70 and X = 1 means width of histogram 70 and I draw
each bin once. Same width and X = 2 means width of 140 and I draw each
bin twice, so they are more visible, wider.
In summary, the two cases are:
1. User specifies width and number of bins, but we modify number of
bins to fit width.
2. User specifies number of bins and X, and we decide about the width.
So, if you want a fixed histogram window like in Photoshop use
option 1. If you want variable width window like in Matlab I think,
use option 2.
I think there is no escape from snapping the number of bins in case 1,
it is just the nature of the drawing logic. But I also think these two
options
allow the user all the creativity he will ever need to create histograms.
Stefan
_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org