thedmd / imgui-node-editor

Node Editor built using Dear ImGui
MIT License
3.64k stars 537 forks source link

How to use it In image processing project? #289

Closed Roger8 closed 5 months ago

Roger8 commented 5 months ago

I have a idea, assume each node is an image or an image processing operator , then by connecting them using nodes of different types, i can get different output image. How to realize the node ?

otto-link commented 5 months ago

I used imgui-node-editor for an heightmap generation tool (heightmap are basically images...), you can have a look there https://github.com/otto-link/Hesiod/tree/v.imgui-based

GengGode commented 5 months ago
8d36c23f03268c0c63b016f7556d4a52

demo

I am working on this kind of work, as shown in the picture, which is very interesting. The UI work is not very good, but the overall process is still good. Run the operators on all nodes through a deep traversal strategy, and the code just completed today enables it to run normally

Roger8 commented 5 months ago

@otto-link Great work ,bro. I think it may help me a lot. Thanks very much. I'll keep on watching.

Roger8 commented 5 months ago

Very nice work, @GengGode . You did well , looking forward to your updates.

thedmd commented 5 months ago

You got great answers here. Nicely done.

My take on the problem is to build processing pipeline and use node editor mearly as a way to represent them in ImGui. That does keep visualization code separate from bits doing heavy lifting. It is more work, line separating two isn't always obvious but I think it is worth the effort in the long run. This is how I usualy think about any editor integration.

Mixing your processing solution with ImGui code is ok too. Everything depends on your intent and how do you like your library to look after you built it.


Bit of trivia. Node is just like child window in ImGui. An rectangle you can put your images in. You can show intermediate textures with ImGui::Image() just fine. Code that produce/update those textures is something that you write and fit your idea.