• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/targa.hpp>
11 
12 #include <boost/core/lightweight_test.hpp>
13 
14 #include "color_space_write_test.hpp"
15 #include "mandel_view.hpp"
16 #include "paths.hpp"
17 
18 namespace gil = boost::gil;
19 
test_write()20 void test_write()
21 {
22     // test writing all supported image types
23     {
24         gil::write_view(
25             targa_out + "rgb8_test.tga",
26             create_mandel_view(200, 200, gil::rgb8_pixel_t(0, 0, 255), gil::rgb8_pixel_t(0, 255, 0)),
27             gil::targa_tag());
28     }
29     {
30         gil::write_view(
31             targa_out + "rgba8_test.tga",
32             create_mandel_view(
33                 200, 200, gil::rgba8_pixel_t(0, 0, 255, 0), gil::rgba8_pixel_t(0, 255, 0, 0)),
34             gil::targa_tag());
35     }
36 }
37 
test_rgb_color_space_write()38 void test_rgb_color_space_write()
39 {
40     color_space_write_test<gil::targa_tag>(
41         targa_out + "rgb_color_space_test.tga", targa_out + "bgr_color_space_test.tga");
42 }
43 
main()44 int main()
45 {
46     test_rgb_color_space_write();
47     test_write();
48 
49     return boost::report_errors();
50 }
51