Skip to content

Commit

Permalink
Added example of accessing individual pixels
Browse files Browse the repository at this point in the history
  • Loading branch information
davisking committed Dec 9, 2014
1 parent ca68fc8 commit bb673f4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions examples/image_ex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit bb673f4

Please sign in to comment.