28 #include <oln/core/2d/image2d.hh>
29 #include <oln/core/2d/window2d.hh>
30 #include <oln/debug/println.hh>
61 image2d<bool> img(4, 5);
63 for (
unsigned row = 0; row < img.nrows(); ++row)
64 for (
unsigned col = 0; col < img.ncols(); ++col)
66 (row > 0 and row < 3) and (col > 0 and col < 4);
90 std::cout <<
"row = " << p.row() << std::endl
91 <<
"col = " << p.col() << std::endl;
95 std::cout <<
"col = " << p.col() <<
" (new value!)" << std::endl;
135 std::cout <<
"p2 " << p2
137 <<
" + dp " << dp << std::endl;
167 std::cout <<
"win = " << win << std::endl;
171 std::cout <<
"around " << p
172 <<
" window points are ";
173 for (
unsigned i = 0; i < win.size(); ++i)
174 std::cout << (p + win[i])
176 std::cout << std::endl;
187 std::cout << std::endl
188 <<
"First version:" << std::endl
191 for (
unsigned row = 0; row < img.nrows(); ++row)
192 for (
unsigned col = 0; col < img.ncols(); ++col)
195 std::cout << p <<
": ";
196 for (
unsigned i = 0; i < win.size(); ++i)
204 std::cout << q <<
' ';
206 std::cout << std::endl;
299 std::cout << std::endl
300 <<
"Second version (same result):" << std::endl
303 box2d::piter p (img.points());
304 window2d::qiter q (win, p);
308 std::cout << p <<
": ";
311 std::cout << q << ' ';
312 std::cout << std::endl;
317 std::cout << std::endl;
344 box2d pts = img.points();
345 std::cout << "img points are " << pts << std::endl;