Have you tried clicking and holding the mouse button in the window and moving the mouse to change contrast and brightness?
// print usage println( "Drag mouse on X-axis inside this sketch window to change contrast" ); println( "Drag mouse on Y-axis inside this sketch window to change brightness" );
were these initialized properly?
int contrastvalue = 0; int brightnessvalue = 0;