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/extension/io/tiff.hpp>
10 
11 #include <boost/core/lightweight_test.hpp>
12 
13 #include <string>
14 
15 #include "tiff_tiled_read_macros.hpp"
16 
17 namespace gil = boost::gil;
18 
19 #ifdef BOOST_GIL_IO_USE_TIFF_GRAPHICSMAGICK_TEST_SUITE_IMAGES
20 
21 // FIXME: The (rgb, planar) construct does not seem to work! ~mloskot
22 BOOST_PP_REPEAT_FROM_TO(1, 8, GENERATE_TILE_STRIP_COMPARISON_BIT_ALIGNED_RGB, (rgb, planar))
23 BOOST_PP_REPEAT_FROM_TO(9, 11, GENERATE_TILE_STRIP_COMPARISON_BIT_ALIGNED_RGB, (rgb, planar))
24 
test_read_tile_and_compare_with_rgb_planar_strip_8()25 void test_read_tile_and_compare_with_rgb_planar_strip_8()
26 {
27     std::string filename_strip(tiff_in_GM + "tiger-rgb-strip-planar-08.tif");
28     std::string filename_tile(tiff_in_GM + "tiger-rgb-tile-planar-08.tif");
29 
30     gil::rgb8_image_t img_strip, img_tile;
31 
32     gil::read_image(filename_strip, img_strip, gil::tiff_tag());
33     gil::read_image(filename_tile, img_tile, gil::tiff_tag());
34 
35     BOOST_TEST(gil::equal_pixels(gil::const_view(img_strip), gil::const_view(img_tile)));
36 }
37 
main()38 int main()
39 {
40     test_read_tile_and_compare_with_rgb_planar_strip_8();
41 
42     // TODO: Make sure generated test cases are executed. See tiff_subimage_test.cpp. ~mloskot
43 
44     return boost::report_errors();
45 }
46 
47 #else
main()48 int main() {}
49 #endif  // BOOST_GIL_IO_USE_TIFF_GRAPHICSMAGICK_TEST_SUITE_IMAGES
50