using glDrawPixels with separated R G B

I am using glReadPixels to read each component of the color (R G B) separatly. Now i want to manipulate each one of the component and then, combine them again and use glDrawPixels to update the color buffer. Is anyone know how to combine the component again?

thank you.

You can try to write separated R G B by
using glColorMask.

For instance:
glColorMask(GL_TRUE,GL_FALSE,GL_FALSE,GL_FALSE);
glDrawPixels(…
glColorMask(GL_FALSE,GL_TRUE,GL_FALSE,GL_FALSE);
glDrawPixels(…
glColorMask(GL_FALSE,GL_FALSE,GL_TRUE,GL_FALSE);
glDrawPixels(…
glColorMask(GL_TRUE,GL_TRUE,GL_TRUE,GL_TRUE);