1 //
2 // Copyright 2013 Christian Henning
3 //
4 // Distributed under the Boost Software License, Version 1.0
5 // See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt
7 //
8 #include <boost/gil.hpp>
9 #include <boost/gil/io/typedefs.hpp>
10 #include <boost/gil/extension/io/bmp.hpp>
11
12 #include <boost/core/lightweight_test.hpp>
13
14 #include "cmp_view.hpp"
15 #include "color_space_write_test.hpp"
16 #include "mandel_view.hpp"
17 #include "paths.hpp"
18
19 namespace gil = boost::gil;
20
test_write_rgb8()21 void test_write_rgb8()
22 {
23 gil::write_view(bmp_out + "rgb8_test.bmp", create_mandel_view(200, 200,
24 gil::rgb8_pixel_t(0, 0, 255), gil::rgb8_pixel_t(0, 255, 0)), gil::bmp_tag());
25 }
26
test_write_rgba8()27 void test_write_rgba8()
28 {
29 gil::write_view(bmp_out + "rgba8_test.bmp", create_mandel_view(200, 200,
30 gil::rgba8_pixel_t(0, 0, 255, 0), gil::rgba8_pixel_t(0, 255, 0, 0)), gil::bmp_tag());
31 }
32
test_rgb_color_space_write()33 void test_rgb_color_space_write()
34 {
35 color_space_write_test<gil::bmp_tag>(
36 bmp_out + "rgb_color_space_test.bmp",
37 bmp_out + "bgr_color_space_test.bmp");
38 }
39
main(int argc,char * argv[])40 int main(int argc, char *argv[])
41 {
42 try
43 {
44 test_write_rgb8();
45 test_write_rgba8();
46 test_rgb_color_space_write();
47 }
48 catch (std::exception const& e)
49 {
50 BOOST_ERROR(e.what());
51 }
52 return boost::report_errors();
53 }
54