directly when reading this code I cannot help myself but to get into review-mode. It is an awesome example, which i will probably use myself one day.
However...
inc.cpp:27
Gray is not the average of RGB, it is usally approximated with `Y = 0.299 R + 0.587 G + 0.114 B`.