Skip to content

Instantly share code, notes, and snippets.

@arturoc
Created August 17, 2015 17:47
Show Gist options
  • Save arturoc/8cc3bd84afb60d29b162 to your computer and use it in GitHub Desktop.
Save arturoc/8cc3bd84afb60d29b162 to your computer and use it in GitHub Desktop.
ofPixels range based loops
for(auto line: pixels.getLines()){
for(auto pixel: line.getPixels()){
pixel[0] // -> red channel or gray in a grayscale image
auto lineAbovePixel = pixel - pixels.getWidth();
lineAbovePixel[0] // read channel in pixel one line above
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment