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_float_test_module
9
10 #include <boost/gil/extension/io/tiff.hpp>
11
12 #include <boost/test/unit_test.hpp>
13
14 #include "paths.hpp"
15
16 using namespace std;
17 using namespace boost;
18 using namespace gil;
19
20 using tag_t = tiff_tag;
21
22 BOOST_AUTO_TEST_SUITE( gil_io_tiff_tests )
23
24 #ifdef BOOST_GIL_IO_USE_TIFF_GRAPHICSMAGICK_TEST_SUITE_IMAGES
25
BOOST_AUTO_TEST_CASE(read_minisblack_float_tile_and_strip32)26 BOOST_AUTO_TEST_CASE( read_minisblack_float_tile_and_strip32 )
27 {
28 std::string filename_strip( tiff_in_GM + "tiger-minisblack-float-strip-32.tif" );
29 std::string filename_tile ( tiff_in_GM + "tiger-minisblack-float-tile-32.tif" );
30
31 gray32f_image_t img_strip, img_tile;
32
33 read_image( filename_strip, img_strip, tag_t() );
34 read_image( filename_tile, img_tile, tag_t() );
35
36 BOOST_CHECK_EQUAL( equal_pixels( const_view(img_strip), const_view(img_tile) ), true);
37 }
38
BOOST_AUTO_TEST_CASE(read_minisblack_float_tile_and_strip64)39 BOOST_AUTO_TEST_CASE( read_minisblack_float_tile_and_strip64 )
40 {
41 std::string filename_strip( tiff_in_GM + "tiger-minisblack-float-strip-64.tif" );
42 std::string filename_tile ( tiff_in_GM + "tiger-minisblack-float-tile-64.tif" );
43
44 gray64f_image_t img_strip, img_tile;
45
46 read_image( filename_strip, img_strip, tag_t() );
47 read_image( filename_tile, img_tile, tag_t() );
48
49 BOOST_CHECK_EQUAL( equal_pixels( const_view(img_strip), const_view(img_tile) ), true);
50 }
51
BOOST_AUTO_TEST_CASE(read_rgb_float_tile_and_strip_planar32)52 BOOST_AUTO_TEST_CASE( read_rgb_float_tile_and_strip_planar32 )
53 {
54 std::string filename_strip( tiff_in_GM + "tiger-rgb-float-strip-planar-32.tif" );
55 std::string filename_tile ( tiff_in_GM + "tiger-rgb-float-tile-planar-32.tif" );
56
57 rgb32f_image_t img_strip, img_tile;
58
59 read_image( filename_strip, img_strip, tag_t() );
60 read_image( filename_tile, img_tile, tag_t() );
61
62 BOOST_CHECK_EQUAL( equal_pixels( const_view(img_strip), const_view(img_tile) ), true);
63 }
64
BOOST_AUTO_TEST_CASE(read_rgb_float_tile_and_strip_contig32)65 BOOST_AUTO_TEST_CASE( read_rgb_float_tile_and_strip_contig32 )
66 {
67 std::string filename_strip( tiff_in_GM + "tiger-rgb-float-strip-contig-32.tif" );
68 std::string filename_tile ( tiff_in_GM + "tiger-rgb-float-tile-contig-32.tif" );
69
70 rgb32f_image_t img_strip, img_tile;
71
72 read_image( filename_strip, img_strip, tag_t() );
73 read_image( filename_tile, img_tile, tag_t() );
74
75 BOOST_CHECK_EQUAL( equal_pixels( const_view(img_strip), const_view(img_tile) ), true);
76 }
77
BOOST_AUTO_TEST_CASE(read_rgb_float_tile_and_strip64)78 BOOST_AUTO_TEST_CASE( read_rgb_float_tile_and_strip64 )
79 {
80 std::string filename_strip( tiff_in_GM + "tiger-rgb-float-strip-planar-64.tif" );
81 std::string filename_tile ( tiff_in_GM + "tiger-rgb-float-tile-planar-64.tif" );
82
83 rgb64f_image_t img_strip, img_tile;
84
85 read_image( filename_strip, img_strip, tag_t() );
86 read_image( filename_tile, img_tile, tag_t() );
87
88 BOOST_CHECK_EQUAL( equal_pixels( const_view(img_strip), const_view(img_tile) ), true);
89 }
90
BOOST_AUTO_TEST_CASE(read_rgb_float_tile_and_strip_contig64)91 BOOST_AUTO_TEST_CASE( read_rgb_float_tile_and_strip_contig64 )
92 {
93 std::string filename_strip( tiff_in_GM + "tiger-rgb-float-strip-contig-64.tif" );
94 std::string filename_tile ( tiff_in_GM + "tiger-rgb-float-tile-contig-64.tif" );
95
96 rgb64f_image_t img_strip, img_tile;
97
98 read_image( filename_strip, img_strip, tag_t() );
99 read_image( filename_tile, img_tile, tag_t() );
100
101 BOOST_CHECK_EQUAL( equal_pixels( const_view(img_strip), const_view(img_tile) ), true);
102 }
103
104 #endif // BOOST_GIL_IO_USE_TIFF_GRAPHICSMAGICK_TEST_SUITE_IMAGES
105
106 BOOST_AUTO_TEST_SUITE_END()
107