Visualize dense optical flow

I need to visualize a dense optical flow retrieved by Farnback’s algorithm.

My idea was to convert the algorithm’s output (2D coordinates) into color reprasenation (HSV) by mapping the angle between the vectors to hue, the length of the resulting vector to V and set saturation to 255 (just like in OpenCV’s example).

As I’m beginner in OpenCV, I’m very uncertain how to do it in C++.
The example is in Phyton, the python methods and classes (MatVector?) don’t all exist in C++.
Moreover in the documentation there are irritating hints on the costs of the ops.
So my question
about a good way to transfer the output of flow algorithm to HSV in C++?