2 // Copyright 2013 Christian Henning
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
8 //#define BOOST_TEST_MODULE tiff_tiled_miniblack_write_test_21_31_32_64_module
9 #include <boost/test/unit_test.hpp>
11 #include "tiff_tiled_write_macros.hpp"
13 BOOST_AUTO_TEST_SUITE( gil_io_tiff_tests )
15 #ifdef BOOST_GIL_IO_USE_TIFF_GRAPHICSMAGICK_TEST_SUITE_IMAGES
17 BOOST_PP_REPEAT_FROM_TO(21, 32, GENERATE_WRITE_TILE_BIT_ALIGNED_MINISBLACK, minisblack )
19 BOOST_AUTO_TEST_CASE( write_tile_and_compare_with_minisblack_strip_32 )
22 using namespace boost;
25 string filename_strip( tiff_in_GM + "tiger-minisblack-strip-32.tif" );
27 using gray32_pixel_t = pixel<unsigned int, gray_layout_t>;
28 image< gray32_pixel_t, false > img_strip, img_saved;
30 read_image( filename_strip, img_strip, tag_t() );
32 image_write_info<tag_t> info;
33 info._is_tiled = true;
34 info._tile_width = info._tile_length = 16;
36 #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
37 write_view( tiff_out + "write_minisblack_tile_and_compare_with_32.tif", view(img_strip), info );
38 read_image( tiff_out + "write_minisblack_tile_and_compare_with_32.tif", img_saved, tag_t() );
40 BOOST_CHECK_EQUAL( equal_pixels( const_view(img_strip), const_view(img_saved) ), true);
41 #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
44 BOOST_AUTO_TEST_CASE( write_tile_and_compare_with_minisblack_strip_64 )
47 using namespace boost;
50 string filename_strip( tiff_in_GM + "tiger-minisblack-strip-64.tif" );
52 using gray64_pixel_t = pixel<uint64_t, gray_layout_t>;
53 image< gray64_pixel_t, false > img_strip, img_saved;
55 read_image( filename_strip, img_strip, tag_t() );
57 image_write_info<tag_t> info;
58 info._is_tiled = true;
59 info._tile_width = info._tile_length = 16;
61 #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
62 write_view( tiff_out + "write_minisblack_tile_and_compare_with_64.tif", view(img_strip), info );
63 read_image( tiff_out + "write_minisblack_tile_and_compare_with_64.tif", img_saved, tag_t() );
65 BOOST_CHECK_EQUAL( equal_pixels( const_view(img_strip), const_view(img_saved) ), true);
66 #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
69 #endif // BOOST_GIL_IO_USE_TIFF_GRAPHICSMAGICK_TEST_SUITE_IMAGES
71 BOOST_AUTO_TEST_SUITE_END()