Created
August 17, 2015 17:47
-
-
Save arturoc/8cc3bd84afb60d29b162 to your computer and use it in GitHub Desktop.
ofPixels range based loops
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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