From bb673f4099bd6bc1ef90e6753876ae7486460514 Mon Sep 17 00:00:00 2001 From: Davis King Date: Tue, 9 Dec 2014 08:08:02 -0500 Subject: [PATCH] Added example of accessing individual pixels --- examples/image_ex.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/image_ex.cpp b/examples/image_ex.cpp index 8221c08aa..148682694 100644 --- a/examples/image_ex.cpp +++ b/examples/image_ex.cpp @@ -86,6 +86,13 @@ int main(int argc, char** argv) // terminate. win_hot.wait_until_closed(); my_window2.wait_until_closed(); + + + // Finally, note that you can access the elements of an image using the normal [row][column] + // operator like so: + cout << horz_gradient[0][3] << endl; + cout << "number of rows in image: " << horz_gradient.nr() << endl; + cout << "number of columns in image: " << horz_gradient.nc() << endl; } catch (exception& e) {