My advice is to have an IBA function that computes the histogram and stores it 
in a std::vector<imagesize_t>.  This could be helpful to apps, and we know will 
be useful for other IBA functions that need histogram information.  Also, a 
function that takes a histogram and plots it in an ImageBuf (sized as we 
discussed before) can be handy for debugging, and I think that's fine to expose 
in oiiotool as well.

But I'd call it a day at that point.  It's not clear to me that there's a need 
to dump histograms as text files, and it's such a small matter to output the 
contents of a vector that we can leave such things to the app (and let them 
decide the formatting, which kind of I/O to do, etc.).

Unless somebody pipes up and says they need this particular functionality from 
oiiotool.


On Jul 20, 2012, at 6:37 AM, Stefan Stavrev wrote:

> I need opinions on how to output histograms.
> 
> A histogram can be saved as image or text.
> 
> We can save as text in simple format like:
> 
> 2
> 50
> ...
> 3
> 14
> 
> Should I use ofstream? Chris suggested we could just print to 
> standard output and then you could do: our_operation > file.txt
> 
> About saving the histogram as image, should there be one
> single function to both calculate and draw the histogram to ImageBuf.
> If I understood correctly then, Chris suggested we could have
> one function to compute histograms and save the data
> in an ImageBuf, not the picture of the histogram but the data.
> That way we can place histograms on stack for input to
> other operations. Then there would be a separate function
> to take that and draw a histogram, and save it as image.
> 
> Also the text output function can be separate from the
> histogram computation function. It would take a computed
> histogram from stack and save it as text file.
> 
> Chris sorry if I misinterpreted something you said ;) I am just
> starting a conversation on this.
> 
> Stefan
> 
> 
> _______________________________________________
> Oiio-dev mailing list
> [email protected]
> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

--
Larry Gritz
[email protected]


_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to