Yes, if your goal is to modify the video display. In this case you can let the GPU of your graphics card do the work. For this you have to learn how to program the GPU, which is done with shaders. This is not so straightforward to begin with, but this is really powerfull. Have a look to https://openframeworks.cc/ofBook/chapters/shaders.html
You can also check the examples, see examples\gl\shaderExample in your OF directory.
Thank you for the sample code. I had to add vec4 color; in order to make it work.
// this is how we receive the texture
uniform sampler2DRect tex0;
in vec2 texCoordVarying;
out vec4 outputColor;
color = texture(tex0, texCoordVarying);
outputColor = vec4( vec3(1.0) - color.rgb, color.a);
Indeed. Sorry for this mistake.
I’ve corrected the code in my previous post, for future reference. I’m not sure about the best place to declare the variable but I choose to do it within the main function, it seems better for the compilation to me.