Pixmap saturating/hue

BlitzMax Forums/BlitzMax Programming/Pixmap saturating/hue

I recommend looking at and reading at least some of the OpenGL Red Book, which is available for free online as html pages in various places. It will help you to understand how OpenGL is working and what it is able to do, or at least the basics of it.

The accumulation buffer is only really intended for one purpose - to `accumulate` the contents of the backbuffer over several frames. All you can really do with it is either copy the backbuffer to the accumulation buffer, or add the backbuffer to the accumulation buffer with a scale factor. So if you wanted to add up the values of 10 backbuffers you'd add their contents to the accumulation buffer by multiplying their values by 0.1 - then once it's all added together you can copy it back to the backbuffer and you'll see motion blur, for example. You can do some other things like depth of field, jittered antialiasing etc, but you can't really do any of the kind of processing operations that you're talking about. All you can do is add values by the same amount across the board.

There are a few ways to do grayscale - you can get your data into a pixmap and convert the R G and B components to a percentage of 0.333 and then add them together, or add different weighting to each component. You can also use glReadPixels to read the backbuffer into a pixmap - you can read just one of the components if you like, such as the red channel, and then pretend that it's grayscale. Also you can try working with GL_INTENSITY format pixmaps. And maybe use a shader. ;-)

Similarly if you wanna change individual pixel values on a pixel-by-pixel basis you really have to use something that does per-pixel changes, which would be the alpha channel, stencils, blending, texturing, or shaders. Or work with pixmaps and write a software-based image processing function.