| 17 | { |
| 18 | template <typename image_type> |
| 19 | bool is_binary_image ( |
| 20 | const image_type& img_ |
| 21 | ) |
| 22 | /*! |
| 23 | ensures |
| 24 | - returns true if img_ contains only on_pixel and off_pixel values. |
| 25 | - returns false otherwise |
| 26 | !*/ |
| 27 | { |
| 28 | const_image_view<image_type> img(img_); |
| 29 | for (long r = 0; r < img.nr(); ++r) |
| 30 | { |
| 31 | for (long c = 0; c < img.nc(); ++c) |
| 32 | { |
| 33 | if (img[r][c] != on_pixel && img[r][c] != off_pixel) |
| 34 | { |
| 35 | return false; |
| 36 | } |
| 37 | } |
| 38 | } |
| 39 | return true; |
| 40 | } |
| 41 | |
| 42 | template < |
| 43 | long M, |
no test coverage detected