• 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/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 
test_read_info_tile_minisblack_float()21 void test_read_info_tile_minisblack_float()
22 {
23     using backend_t = gil::get_reader_backend<std::string const, gil::tiff_tag>::type;
24     backend_t backend =
25         gil::read_image_info(tiff_in_GM + "tiger-minisblack-float-tile-16.tif", gil::tiff_tag());
26 
27     BOOST_TEST_EQ(backend._info._tile_width, 16);
28     BOOST_TEST_EQ(backend._info._tile_length, 16);
29 }
30 
test_read_info_tile_minisblack()31 void test_read_info_tile_minisblack()
32 {
33     using backend_t = gil::get_reader_backend<std::string const, gil::tiff_tag>::type;
34     backend_t backend =
35         gil::read_image_info(tiff_in_GM + "tiger-minisblack-tile-08.tif", gil::tiff_tag());
36 
37     BOOST_TEST_EQ(backend._info._tile_width, 16);
38     BOOST_TEST_EQ(backend._info._tile_length, 16);
39 }
40 
test_read_info_tile_palette()41 void test_read_info_tile_palette()
42 {
43     using backend_t = gil::get_reader_backend<std::string const, gil::tiff_tag>::type;
44     backend_t backend =
45         gil::read_image_info(tiff_in_GM + "tiger-palette-tile-08.tif", gil::tiff_tag());
46 
47     BOOST_TEST_EQ(backend._info._tile_width, 16);
48     BOOST_TEST_EQ(backend._info._tile_length, 16);
49 }
50 
test_read_info_tile_rgb()51 void test_read_info_tile_rgb()
52 {
53     using backend_t = gil::get_reader_backend<std::string const, gil::tiff_tag>::type;
54     backend_t backend =
55         gil::read_image_info(tiff_in_GM + "tiger-rgb-tile-contig-08.tif", gil::tiff_tag());
56 
57     BOOST_TEST_EQ(backend._info._tile_width, 16);
58     BOOST_TEST_EQ(backend._info._tile_length, 16);
59 }
60 
test_read_info_tile_planar()61 void test_read_info_tile_planar()
62 {
63     using backend_t = gil::get_reader_backend<std::string const, gil::tiff_tag>::type;
64     backend_t backend =
65         gil::read_image_info(tiff_in_GM + "tiger-rgb-tile-planar-08.tif", gil::tiff_tag());
66 
67     BOOST_TEST_EQ(backend._info._tile_width, 16);
68     BOOST_TEST_EQ(backend._info._tile_length, 16);
69 }
70 
main()71 int main()
72 {
73     test_read_info_tile_minisblack_float();
74     test_read_info_tile_minisblack();
75     test_read_info_tile_palette();
76     test_read_info_tile_rgb();
77     test_read_info_tile_planar();
78 
79     return boost::report_errors();
80 }
81 
82 #else
main()83 int main() {}
84 #endif  // BOOST_GIL_IO_USE_TIFF_GRAPHICSMAGICK_TEST_SUITE_IMAGES
85