Skip to content

Instantly share code, notes, and snippets.

void ImageProcessingClassApp::reduceIntensity(int n)
{
int reduce = 2 << n;
// myImage is a object variable that starts as a grayscale copy of the original image
Surface::Iter iter = myImage.getIter();
while(iter.line()) {
while(iter.pixel()) {
int orig = iter.r();
int next = orig/reduce;
next *= reduce;