progs/demos: added RGB invert option
diff --git a/progs/demos/copypix.c b/progs/demos/copypix.c
index 51435ac..a13339e 100644
--- a/progs/demos/copypix.c
+++ b/progs/demos/copypix.c
@@ -26,6 +26,7 @@
 static float Xzoom, Yzoom;
 static GLboolean DrawFront = GL_FALSE;
 static GLboolean Dither = GL_TRUE;
+static GLboolean Invert = GL_FALSE;
 
 
 static void Reset( void )
@@ -59,6 +60,15 @@
    if (Scissor)
       glEnable(GL_SCISSOR_TEST);
 
+   if (Invert) {
+      glPixelTransferf(GL_RED_SCALE, -1.0);
+      glPixelTransferf(GL_GREEN_SCALE, -1.0);
+      glPixelTransferf(GL_BLUE_SCALE, -1.0);
+      glPixelTransferf(GL_RED_BIAS, 1.0);
+      glPixelTransferf(GL_GREEN_BIAS, 1.0);
+      glPixelTransferf(GL_BLUE_BIAS, 1.0);
+   }
+
    /* draw copy */
    glPixelZoom(Xzoom, Yzoom);
    glWindowPos2iARB(Xpos, Ypos);
@@ -67,6 +77,15 @@
 
    glDisable(GL_SCISSOR_TEST);
 
+   if (Invert) {
+      glPixelTransferf(GL_RED_SCALE, 1.0);
+      glPixelTransferf(GL_GREEN_SCALE, 1.0);
+      glPixelTransferf(GL_BLUE_SCALE, 1.0);
+      glPixelTransferf(GL_RED_BIAS, 0.0);
+      glPixelTransferf(GL_GREEN_BIAS, 0.0);
+      glPixelTransferf(GL_BLUE_BIAS, 0.0);
+   }
+
    if (DrawFront)
       glFinish();
    else
@@ -105,6 +124,9 @@
          else
             glDisable(GL_DITHER);
          break;
+      case 'i':
+         Invert = !Invert;
+         break;
       case 's':
          Scissor = !Scissor;
          break;