| 1 | // |
| 2 | // Copyright 2022 Marco Langer <langer.m86@gmail.com> |
| 3 | // |
| 4 | // Use, modification and distribution are subject to the Boost Software License, |
| 5 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
| 6 | // http://www.boost.org/LICENSE_1_0.txt) |
| 7 | // |
| 8 | |
| 9 | #include <boost/gil.hpp> |
| 10 | #include <boost/gil/extension/rasterization/circle.hpp> |
| 11 | #include <boost/gil/extension/rasterization/ellipse.hpp> |
| 12 | #include <boost/gil/extension/rasterization/line.hpp> |
| 13 | |
| 14 | #include <boost/core/lightweight_test.hpp> |
| 15 | |
| 16 | namespace gil = boost::gil; |
| 17 | |
| 18 | template <typename Rasterizer> |
| 19 | void test_apply_rasterizers(Rasterizer const& rasterizer) |
| 20 | { |
| 21 | gil::rgb8_image_t image(200, 200); |
| 22 | gil::rgb8_pixel_t pixel{255, 0, 0}; |
| 23 | |
| 24 | apply_rasterizer(view(img&: image), rasterizer, pixel); |
| 25 | } |
| 26 | |
| 27 | int main() |
| 28 | { |
| 29 | test_apply_rasterizers(rasterizer: gil::midpoint_circle_rasterizer{{50, 50}, 30}); |
| 30 | test_apply_rasterizers(rasterizer: gil::trigonometric_circle_rasterizer{{50, 50}, 30}); |
| 31 | test_apply_rasterizers(rasterizer: gil::midpoint_ellipse_rasterizer{{50, 50}, {30, 20}}); |
| 32 | test_apply_rasterizers(rasterizer: gil::bresenham_line_rasterizer{{50, 50}, {30, 20}}); |
| 33 | |
| 34 | return boost::report_errors(); |
| 35 | } |
| 36 | |