I am writing a C++ program which generates a tree with graphviz. I am producing the dot file but I would like to produce the png file directly in my script without using terminal or system(command)
.
Is there a function in boost which can do this? It would be something like
write_png(Graph g, string filename)
Well, no. Boost has:
but the former produces the structure of a graph, while the latter requires a raster image, not some structured representation. The rendering of a .dot file into a vector or raster image is what the GraphViz library is about, and you would need to use it directly. I'd look at at what the sources of the dot
utility do, and basically reproduce the relevant parts into your own source.