Imported Upstream version 1.72.0
[platform/upstream/boost.git] / libs / gil / test / extension / io / tiff_tiled_rgb_contig_write_test_11-20.cpp
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 //#define BOOST_TEST_MODULE tiff_tiled_rgb_contig_write_test_11_20_module
9 #include <boost/test/unit_test.hpp>
10
11 #include "tiff_tiled_write_macros.hpp"
12
13 BOOST_AUTO_TEST_SUITE( gil_io_tiff_tests )
14
15 #ifdef BOOST_GIL_IO_USE_TIFF_GRAPHICSMAGICK_TEST_SUITE_IMAGES
16
17 BOOST_PP_REPEAT_FROM_TO(11, 16, GENERATE_WRITE_TILE_BIT_ALIGNED_RGB, rgb )
18 BOOST_PP_REPEAT_FROM_TO(17, 21, GENERATE_WRITE_TILE_BIT_ALIGNED_RGB, rgb )
19
20 BOOST_AUTO_TEST_CASE( write_tile_and_compare_with_rgb_strip_contig_16 )
21 {
22     using namespace std;
23     using namespace boost;
24     using namespace gil;
25
26     string filename_strip( tiff_in_GM + "tiger-rgb-strip-contig-16.tif" );
27
28     rgb16_image_t img_strip, img_saved;
29
30     read_image( filename_strip, img_strip, tag_t() );
31
32     image_write_info<tag_t> info;
33     info._is_tiled = true;
34     info._tile_width = info._tile_length = 16;
35
36 #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
37     write_view( tiff_out + "write_tile_and_compare_with_rgb_strip_contig_16.tif", view(img_strip), info );
38     read_image( tiff_out + "write_tile_and_compare_with_rgb_strip_contig_16.tif", img_saved, tag_t() );
39
40     BOOST_CHECK_EQUAL( equal_pixels( const_view(img_strip), const_view(img_saved) ), true);
41 #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
42 }
43
44 #endif // BOOST_GIL_IO_USE_TIFF_GRAPHICSMAGICK_TEST_SUITE_IMAGES
45
46 BOOST_AUTO_TEST_SUITE_END()