Skip to content

Instantly share code, notes, and snippets.

@AbinashBishoyi
Forked from anandkunal/pixel_inversion.cpp
Created February 14, 2012 10:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AbinashBishoyi/1825526 to your computer and use it in GitHub Desktop.
Save AbinashBishoyi/1825526 to your computer and use it in GitHub Desktop.
// Invert the color spectrum
Surface::Iter iter(newSurface.getIter());
while(iter.line()) {
while(iter.pixel()) {
iter.r() = 255 - iter.r();
iter.g() = 255 - iter.g();
iter.b() = 255 - iter.b();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment