tiff_file_format_test.cpp 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954
  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_file_format_test_module
  9. #include <boost/gil/extension/io/tiff.hpp>
  10. #include <boost/test/unit_test.hpp>
  11. #include "paths.hpp"
  12. #include "scanline_read_test.hpp"
  13. using namespace std;
  14. using namespace boost::gil;
  15. using tag_t = tiff_tag;
  16. BOOST_AUTO_TEST_SUITE( gil_io_tiff_tests )
  17. #ifdef BOOST_GIL_IO_USE_TIFF_LIBTIFF_TEST_SUITE_IMAGES
  18. template< typename Image >
  19. void test_tiff_scanline_reader( string filename )
  20. {
  21. test_scanline_reader<Image, tag_t>( filename.c_str() );
  22. }
  23. // 73x43 2-bit minisblack gray image
  24. BOOST_AUTO_TEST_CASE( two_bit_minisblack_gray_image_test )
  25. {
  26. std::string filename( tiff_in + "libtiffpic/depth/flower-minisblack-02.tif" );
  27. {
  28. using image_t = bit_aligned_image1_type<2, gray_layout_t>::type;
  29. image_t img;
  30. read_image( filename
  31. , img
  32. , tag_t()
  33. );
  34. #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  35. write_view( tiff_out + "test4.tif"
  36. , view( img )
  37. , tiff_tag()
  38. );
  39. #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  40. }
  41. }
  42. // flower-minisblack-04.tif 73x43 4-bit minisblack gray image
  43. BOOST_AUTO_TEST_CASE( four_bit_minisblack_gray_image_test )
  44. {
  45. std::string filename( tiff_in + "libtiffpic/depth/flower-minisblack-04.tif" );
  46. {
  47. using image_t = bit_aligned_image1_type<4, gray_layout_t>::type;
  48. image_t img;
  49. read_image( filename
  50. , img
  51. , tag_t()
  52. );
  53. #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  54. write_view( tiff_out + "test5.tif"
  55. , view( img )
  56. , tiff_tag()
  57. );
  58. #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  59. }
  60. }
  61. // flower-minisblack-06.tif 73x43 6-bit minisblack gray image
  62. BOOST_AUTO_TEST_CASE( six_bit_minisblack_gray_image_test )
  63. {
  64. std::string filename( tiff_in + "libtiffpic/depth/flower-minisblack-06.tif" );
  65. {
  66. using image_t = bit_aligned_image1_type<6, gray_layout_t>::type;
  67. image_t img;
  68. read_image( filename
  69. , img
  70. , tag_t()
  71. );
  72. #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  73. write_view( tiff_out + "test6.tif"
  74. , view( img )
  75. , tiff_tag()
  76. );
  77. #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  78. }
  79. }
  80. // flower-minisblack-08.tif 73x43 8-bit minisblack gray image
  81. BOOST_AUTO_TEST_CASE( eight_bit_minisblack_gray_image_test )
  82. {
  83. std::string filename( tiff_in + "libtiffpic/depth/flower-minisblack-08.tif" );
  84. {
  85. using image_t = gray8_image_t;
  86. image_t img;
  87. read_image( filename
  88. , img
  89. , tag_t()
  90. );
  91. #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  92. write_view( tiff_out + "test7.tif"
  93. , view( img )
  94. , tiff_tag()
  95. );
  96. #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  97. }
  98. }
  99. // flower-minisblack-10.tif 73x43 10-bit minisblack gray image
  100. BOOST_AUTO_TEST_CASE( ten_bit_minisblack_gray_image_test )
  101. {
  102. std::string filename( tiff_in + "libtiffpic/depth/flower-minisblack-10.tif" );
  103. {
  104. using image_t = bit_aligned_image1_type<10, gray_layout_t>::type;
  105. image_t img;
  106. read_image( filename
  107. , img
  108. , tag_t()
  109. );
  110. #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  111. write_view( tiff_out + "test8.tif"
  112. , view( img )
  113. , tiff_tag()
  114. );
  115. #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  116. }
  117. }
  118. // flower-minisblack-12.tif 73x43 12-bit minisblack gray image
  119. BOOST_AUTO_TEST_CASE( twelve_bit_minisblack_gray_image_test )
  120. {
  121. std::string filename( tiff_in + "libtiffpic/depth/flower-minisblack-12.tif" );
  122. {
  123. using image_t = bit_aligned_image1_type<12, gray_layout_t>::type;
  124. image_t img;
  125. read_image( filename
  126. , img
  127. , tag_t()
  128. );
  129. #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  130. write_view( tiff_out + "test9.tif"
  131. , view( img )
  132. , tiff_tag()
  133. );
  134. #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  135. }
  136. }
  137. // flower-minisblack-14.tif 73x43 14-bit minisblack gray image
  138. BOOST_AUTO_TEST_CASE( fourteen_bit_minisblack_gray_image_test )
  139. {
  140. std::string filename( tiff_in + "libtiffpic/depth/flower-minisblack-14.tif" );
  141. {
  142. using image_t = bit_aligned_image1_type<14, gray_layout_t>::type;
  143. image_t img;
  144. read_image( filename
  145. , img
  146. , tag_t()
  147. );
  148. #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  149. write_view( tiff_out + "test10.tif"
  150. , view( img )
  151. , tiff_tag()
  152. );
  153. #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  154. }
  155. }
  156. // flower-minisblack-16.tif 73x43 16-bit minisblack gray image
  157. BOOST_AUTO_TEST_CASE( sixteen_bit_minisblack_gray_image_test )
  158. {
  159. std::string filename( tiff_in + "libtiffpic/depth/flower-minisblack-16.tif" );
  160. {
  161. using image_t = gray16_image_t;
  162. image_t img;
  163. read_image( filename
  164. , img
  165. , tag_t()
  166. );
  167. #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  168. write_view( tiff_out + "test11.tif"
  169. , view( img )
  170. , tiff_tag()
  171. );
  172. #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  173. }
  174. }
  175. // flower-minisblack-24.tif 73x43 24-bit minisblack gray image
  176. BOOST_AUTO_TEST_CASE( twentyfour_bit_minisblack_gray_image_test )
  177. {
  178. std::string filename( tiff_in + "libtiffpic/depth/flower-minisblack-24.tif" );
  179. {
  180. using image_t = bit_aligned_image1_type<24, gray_layout_t>::type;
  181. image_t img;
  182. read_image( filename
  183. , img
  184. , tag_t()
  185. );
  186. #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  187. write_view( tiff_out + "test12.tif"
  188. , view( img )
  189. , tiff_tag()
  190. );
  191. #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  192. }
  193. }
  194. // flower-minisblack-32.tif 73x43 32-bit minisblack gray image
  195. BOOST_AUTO_TEST_CASE( thirtytwo_bit_minisblack_gray_image_test )
  196. {
  197. std::string filename( tiff_in + "libtiffpic/depth/flower-minisblack-32.tif" );
  198. {
  199. using image_t = gray32_image_t;
  200. image_t img;
  201. read_image( filename
  202. , img
  203. , tag_t()
  204. );
  205. #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  206. write_view( tiff_out + "test13.tif"
  207. , view( img )
  208. , tiff_tag()
  209. );
  210. #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  211. }
  212. }
  213. // flower-palette-02.tif 73x43 4-entry colormapped image
  214. BOOST_AUTO_TEST_CASE( four_entry_colormapped_image_test )
  215. {
  216. std::string filename( tiff_in + "libtiffpic/depth/flower-palette-02.tif" );
  217. {
  218. using image_t = rgb16_image_t;
  219. image_t img;
  220. read_image( filename
  221. , img
  222. , tag_t()
  223. );
  224. #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  225. write_view( tiff_out + "test14.tif"
  226. , view( img )
  227. , tiff_tag()
  228. );
  229. #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  230. }
  231. }
  232. // flower-palette-04.tif 73x43 16-entry colormapped image
  233. BOOST_AUTO_TEST_CASE( sixteen_entry_colormapped_image_test )
  234. {
  235. std::string filename( tiff_in + "libtiffpic/depth/flower-palette-04.tif" );
  236. {
  237. using image_t = rgb16_image_t;
  238. image_t img;
  239. read_image( filename
  240. , img
  241. , tag_t()
  242. );
  243. #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  244. write_view( tiff_out + "test15.tif"
  245. , view( img )
  246. , tiff_tag()
  247. );
  248. #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  249. }
  250. }
  251. // flower-palette-08.tif 73x43 256-entry colormapped image
  252. BOOST_AUTO_TEST_CASE( twohundred_twenty_five_entry_colormapped_image_test )
  253. {
  254. std::string filename( tiff_in + "libtiffpic/depth/flower-palette-08.tif" );
  255. {
  256. using image_t = rgb16_image_t;
  257. image_t img;
  258. read_image( filename
  259. , img
  260. , tag_t()
  261. );
  262. #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  263. write_view( tiff_out + "test16.tif"
  264. , view( img )
  265. , tiff_tag()
  266. );
  267. #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  268. }
  269. }
  270. // flower-palette-16.tif 73x43 65536-entry colormapped image
  271. BOOST_AUTO_TEST_CASE( sixtyfive_thousand_entry_colormapped_image_test )
  272. {
  273. std::string filename( tiff_in + "libtiffpic/depth/flower-palette-16.tif" );
  274. {
  275. using image_t = rgb16_image_t;
  276. image_t img;
  277. read_image( filename
  278. , img
  279. , tag_t()
  280. );
  281. #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  282. write_view( tiff_out + "test17.tif"
  283. , view( img )
  284. , tiff_tag()
  285. );
  286. #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  287. }
  288. }
  289. // flower-rgb-contig-02.tif 73x43 2-bit contiguous RGB image
  290. BOOST_AUTO_TEST_CASE( two_bit_contiguous_RGB_image_test )
  291. {
  292. std::string filename( tiff_in + "libtiffpic/depth/flower-rgb-contig-02.tif" );
  293. {
  294. using image_t = bit_aligned_image3_type<2, 2, 2, rgb_layout_t>::type;
  295. image_t img;
  296. read_image( filename
  297. , img
  298. , tag_t()
  299. );
  300. #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  301. write_view( tiff_out + "test18.tif"
  302. , view( img )
  303. , tiff_tag()
  304. );
  305. #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  306. }
  307. }
  308. // flower-rgb-contig-04.tif 73x43 4-bit contiguous RGB image
  309. BOOST_AUTO_TEST_CASE( four_bit_contiguous_RGB_image_test )
  310. {
  311. std::string filename( tiff_in + "libtiffpic/depth/flower-rgb-contig-04.tif" );
  312. {
  313. using image_t = bit_aligned_image3_type<4, 4, 4, rgb_layout_t>::type;
  314. image_t img;
  315. read_image( filename
  316. , img
  317. , tag_t()
  318. );
  319. #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  320. write_view( tiff_out + "test19.tif"
  321. , view( img )
  322. , tiff_tag()
  323. );
  324. #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  325. }
  326. }
  327. // flower-rgb-contig-08.tif 73x43 8-bit contiguous RGB image
  328. BOOST_AUTO_TEST_CASE( eight_bit_contiguous_RGB_image_test )
  329. {
  330. std::string filename( tiff_in + "libtiffpic/depth/flower-rgb-contig-08.tif" );
  331. {
  332. using image_t = rgb8_image_t;
  333. image_t img;
  334. read_image( filename
  335. , img
  336. , tag_t()
  337. );
  338. #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  339. write_view( tiff_out + "test20.tif"
  340. , view( img )
  341. , tiff_tag()
  342. );
  343. #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  344. }
  345. }
  346. // flower-rgb-contig-10.tif 73x43 10-bit contiguous RGB image
  347. BOOST_AUTO_TEST_CASE( ten_bit_contiguous_RGB_image_test )
  348. {
  349. std::string filename( tiff_in + "libtiffpic/depth/flower-rgb-contig-10.tif" );
  350. {
  351. using image_t = bit_aligned_image3_type<10, 10, 10, rgb_layout_t>::type;
  352. image_t img;
  353. read_image( filename
  354. , img
  355. , tag_t()
  356. );
  357. #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  358. write_view( tiff_out + "test21.tif"
  359. , view( img )
  360. , tiff_tag()
  361. );
  362. #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  363. }
  364. }
  365. // flower-rgb-contig-12.tif 73x43 12-bit contiguous RGB image
  366. BOOST_AUTO_TEST_CASE( twelve_bit_contiguous_RGB_image_test )
  367. {
  368. std::string filename( tiff_in + "libtiffpic/depth/flower-rgb-contig-12.tif" );
  369. {
  370. using image_t = bit_aligned_image3_type<12, 12, 12, rgb_layout_t>::type;
  371. image_t img;
  372. read_image( filename
  373. , img
  374. , tag_t()
  375. );
  376. #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  377. write_view( tiff_out + "test22.tif"
  378. , view( img )
  379. , tiff_tag()
  380. );
  381. #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  382. }
  383. }
  384. // flower-rgb-contig-14.tif 73x43 14-bit contiguous RGB image
  385. BOOST_AUTO_TEST_CASE( fourteen_bit_contiguous_RGB_image_test )
  386. {
  387. std::string filename( tiff_in + "libtiffpic/depth/flower-rgb-contig-14.tif" );
  388. {
  389. using image_t = bit_aligned_image3_type<14, 14, 14, rgb_layout_t>::type;
  390. image_t img;
  391. read_image( filename
  392. , img
  393. , tag_t()
  394. );
  395. #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  396. write_view( tiff_out + "test23.tif"
  397. , view( img )
  398. , tiff_tag()
  399. );
  400. #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  401. }
  402. }
  403. // flower-rgb-contig-16.tif 73x43 16-bit contiguous RGB image
  404. BOOST_AUTO_TEST_CASE( sixteen_bit_contiguous_RGB_image_test )
  405. {
  406. std::string filename( tiff_in + "libtiffpic/depth/flower-rgb-contig-16.tif" );
  407. {
  408. using image_t = rgb16_image_t;
  409. image_t img;
  410. read_image( filename
  411. , img
  412. , tag_t()
  413. );
  414. #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  415. write_view( tiff_out + "test24.tif"
  416. , view( img )
  417. , tiff_tag()
  418. );
  419. #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  420. }
  421. }
  422. // flower-rgb-contig-24.tif 73x43 24-bit contiguous RGB image
  423. BOOST_AUTO_TEST_CASE( twenty_four_bit_contiguous_RGB_image_test )
  424. {
  425. std::string filename( tiff_in + "libtiffpic/depth/flower-rgb-contig-24.tif" );
  426. {
  427. using image_t = bit_aligned_image3_type<24, 24, 24, rgb_layout_t>::type;
  428. image_t img;
  429. read_image( filename
  430. , img
  431. , tag_t()
  432. );
  433. #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  434. write_view( tiff_out + "test25.tif"
  435. , view( img )
  436. , tiff_tag()
  437. );
  438. #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  439. }
  440. }
  441. // flower-rgb-contig-32.tif 73x43 32-bit contiguous RGB image
  442. BOOST_AUTO_TEST_CASE( thirty_two_bit_contiguous_RGB_image_test )
  443. {
  444. std::string filename( tiff_in + "libtiffpic/depth/flower-rgb-contig-32.tif" );
  445. {
  446. using image_t = rgb32_image_t;
  447. image_t img;
  448. read_image( filename
  449. , img
  450. , tag_t()
  451. );
  452. #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  453. write_view( tiff_out + "test26.tif"
  454. , view( img )
  455. , tiff_tag()
  456. );
  457. #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  458. }
  459. }
  460. // flower-rgb-planar-02.tif 73x43 2-bit seperated RGB image
  461. BOOST_AUTO_TEST_CASE( two_bit_seperated_RGB_image_test )
  462. {
  463. std::string filename( tiff_in + "libtiffpic/depth/flower-rgb-planar-02.tif" );
  464. {
  465. using image_t = bit_aligned_image3_type<2, 2, 2, rgb_layout_t>::type;
  466. image_t img;
  467. read_image( filename
  468. , img
  469. , tag_t()
  470. );
  471. #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  472. write_view( tiff_out + "test27.tif"
  473. , view( img )
  474. , tiff_tag()
  475. );
  476. #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  477. }
  478. }
  479. // flower-rgb-planar-04.tif 73x43 4-bit seperated RGB image
  480. BOOST_AUTO_TEST_CASE( four_bit_seperated_RGB_image_test )
  481. {
  482. std::string filename( tiff_in + "libtiffpic/depth/flower-rgb-planar-04.tif" );
  483. {
  484. using image_t = bit_aligned_image3_type<4, 4, 4, rgb_layout_t>::type;
  485. image_t img;
  486. read_image( filename
  487. , img
  488. , tag_t()
  489. );
  490. #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  491. write_view( tiff_out + "test28.tif"
  492. , view( img )
  493. , tiff_tag()
  494. );
  495. #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  496. }
  497. }
  498. // flower-rgb-planar-08.tif 73x43 8-bit seperated RGB image
  499. BOOST_AUTO_TEST_CASE( eight_bit_seperated_RGB_image_test )
  500. {
  501. std::string filename( tiff_in + "libtiffpic/depth/flower-rgb-planar-08.tif" );
  502. {
  503. using image_t = rgb8_planar_image_t;
  504. image_t img;
  505. read_image( filename
  506. , img
  507. , tag_t()
  508. );
  509. #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  510. write_view( tiff_out + "test29.tif"
  511. , view( img )
  512. , tiff_tag()
  513. );
  514. #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  515. }
  516. }
  517. // flower-rgb-planar-10.tif 73x43 10-bit seperated RGB image
  518. BOOST_AUTO_TEST_CASE( ten_bit_seperated_RGB_image_test )
  519. {
  520. std::string filename( tiff_in + "libtiffpic/depth/flower-rgb-planar-10.tif" );
  521. {
  522. using image_t = bit_aligned_image3_type<10, 10, 10, rgb_layout_t>::type;
  523. image_t img;
  524. read_image( filename
  525. , img
  526. , tag_t()
  527. );
  528. #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  529. write_view( tiff_out + "test30.tif"
  530. , view( img )
  531. , tiff_tag()
  532. );
  533. #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  534. }
  535. }
  536. // flower-rgb-planar-12.tif 73x43 12-bit seperated RGB image
  537. BOOST_AUTO_TEST_CASE( twelve_bit_seperated_RGB_image_test )
  538. {
  539. std::string filename( tiff_in + "libtiffpic/depth/flower-rgb-planar-12.tif" );
  540. {
  541. using image_t = bit_aligned_image3_type<12, 12, 12, rgb_layout_t>::type;
  542. image_t img;
  543. read_image( filename
  544. , img
  545. , tag_t()
  546. );
  547. #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  548. write_view( tiff_out + "test31.tif"
  549. , view( img )
  550. , tiff_tag()
  551. );
  552. #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  553. }
  554. }
  555. // flower-rgb-planar-14.tif 73x43 14-bit seperated RGB image
  556. BOOST_AUTO_TEST_CASE( fourteen_bit_seperated_RGB_image_test )
  557. {
  558. std::string filename( tiff_in + "libtiffpic/depth/flower-rgb-planar-14.tif" );
  559. {
  560. using image_t = bit_aligned_image3_type<14, 14, 14, rgb_layout_t>::type;
  561. image_t img;
  562. read_image( filename
  563. , img
  564. , tag_t()
  565. );
  566. #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  567. write_view( tiff_out + "test32.tif"
  568. , view( img )
  569. , tiff_tag()
  570. );
  571. #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  572. }
  573. }
  574. // flower-rgb-planar-16.tif 73x43 16-bit seperated RGB image
  575. BOOST_AUTO_TEST_CASE( sixteen_bit_seperated_RGB_image_test )
  576. {
  577. std::string filename( tiff_in + "libtiffpic/depth/flower-rgb-planar-16.tif" );
  578. {
  579. using image_t = rgb16_planar_image_t;
  580. image_t img;
  581. read_image( filename
  582. , img
  583. , tag_t()
  584. );
  585. #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  586. write_view( tiff_out + "test33.tif"
  587. , view( img )
  588. , tiff_tag()
  589. );
  590. #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  591. }
  592. }
  593. // flower-rgb-planar-24.tif 73x43 24-bit seperated RGB image
  594. BOOST_AUTO_TEST_CASE( twenty_four_bit_seperated_RGB_image_test )
  595. {
  596. std::string filename( tiff_in + "libtiffpic/depth/flower-rgb-planar-24.tif" );
  597. {
  598. using image_t = bit_aligned_image3_type<24, 24, 24, rgb_layout_t>::type;
  599. image_t img;
  600. read_image( filename
  601. , img
  602. , tag_t()
  603. );
  604. #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  605. write_view( tiff_out + "test34.tif"
  606. , view( img )
  607. , tiff_tag()
  608. );
  609. #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  610. }
  611. }
  612. // flower-rgb-planar-32.tif 73x43 32-bit seperated RGB image
  613. BOOST_AUTO_TEST_CASE( thirty_two_bit_seperated_RGB_image_test )
  614. {
  615. std::string filename( tiff_in + "libtiffpic/depth/flower-rgb-planar-32.tif" );
  616. {
  617. using image_t = rgb32_planar_image_t;
  618. image_t img;
  619. read_image( filename
  620. , img
  621. , tag_t()
  622. );
  623. #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  624. write_view( tiff_out + "test35.tif"
  625. , view( img )
  626. , tiff_tag()
  627. );
  628. #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  629. }
  630. }
  631. // flower-separated-contig-08.tif 73x43 8-bit contiguous CMYK image
  632. BOOST_AUTO_TEST_CASE( eight_bit_contiguous_CMYK_image_test )
  633. {
  634. std::string filename( tiff_in + "libtiffpic/depth/flower-separated-contig-08.tif" );
  635. {
  636. using image_t = cmyk8_image_t;
  637. image_t img;
  638. read_image( filename
  639. , img
  640. , tag_t()
  641. );
  642. #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  643. write_view( tiff_out + "test36.tif"
  644. , view( img )
  645. , tiff_tag()
  646. );
  647. #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  648. }
  649. }
  650. // flower-separated-contig-16.tif 73x43 16-bit contiguous CMYK image
  651. BOOST_AUTO_TEST_CASE( sixteen_bit_contiguous_CMYK_image_test )
  652. {
  653. std::string filename( tiff_in + "libtiffpic/depth/flower-separated-contig-16.tif" );
  654. {
  655. using image_t = cmyk16_image_t;
  656. image_t img;
  657. read_image( filename
  658. , img
  659. , tag_t()
  660. );
  661. #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  662. write_view( tiff_out + "test37.tif"
  663. , view( img )
  664. , tiff_tag()
  665. );
  666. #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  667. }
  668. }
  669. // flower-separated-planar-08.tif 73x43 8-bit separated CMYK image
  670. BOOST_AUTO_TEST_CASE( eight_bit_separated_CMYK_image_test )
  671. {
  672. std::string filename( tiff_in + "libtiffpic/depth/flower-separated-planar-08.tif" );
  673. {
  674. using image_t = cmyk8_planar_image_t;
  675. image_t img;
  676. read_image( filename
  677. , img
  678. , tag_t()
  679. );
  680. #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  681. write_view( tiff_out + "test38.tif"
  682. , view( img )
  683. , tiff_tag()
  684. );
  685. #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  686. }
  687. }
  688. // flower-separated-planar-16.tif 73x43 16-bit separated CMYK image
  689. BOOST_AUTO_TEST_CASE( sixteen_bit_separated_CMYK_image_test )
  690. {
  691. std::string filename( tiff_in + "libtiffpic/depth/flower-separated-planar-16.tif" );
  692. {
  693. using image_t = cmyk16_planar_image_t;
  694. image_t img;
  695. read_image( filename
  696. , img
  697. , tag_t()
  698. );
  699. #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  700. write_view( tiff_out + "test39.tif"
  701. , view( img )
  702. , tiff_tag()
  703. );
  704. #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  705. }
  706. }
  707. #endif // BOOST_GIL_IO_USE_TIFF_LIBTIFF_TEST_SUITE_IMAGES
  708. #ifdef BOOST_GIL_IO_USE_TIFF_GRAPHICSMAGICK_TEST_SUITE_IMAGES
  709. BOOST_AUTO_TEST_CASE( tiger_separated_strip_contig_08 )
  710. {
  711. std::string filename( tiff_in_GM + "tiger-separated-strip-contig-08.tif" );
  712. {
  713. using image_t = cmyk8_planar_image_t;
  714. image_t img;
  715. read_image( filename
  716. , img
  717. , tag_t()
  718. );
  719. #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  720. write_view( tiff_out + "test40.tif"
  721. , view( img )
  722. , tiff_tag()
  723. );
  724. #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  725. }
  726. }
  727. BOOST_AUTO_TEST_CASE( tiger_separated_strip_contig_16 )
  728. {
  729. std::string filename( tiff_in_GM + "tiger-separated-strip-contig-16.tif" );
  730. {
  731. using image_t = cmyk16_planar_image_t;
  732. image_t img;
  733. read_image( filename
  734. , img
  735. , tag_t()
  736. );
  737. #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  738. write_view( tiff_out + "test41.tif"
  739. , view( img )
  740. , tiff_tag()
  741. );
  742. #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  743. }
  744. }
  745. BOOST_AUTO_TEST_CASE( tiger_separated_strip_planar_08 )
  746. {
  747. std::string filename( tiff_in_GM + "tiger-separated-strip-planar-08.tif" );
  748. {
  749. using image_t = cmyk8_planar_image_t;
  750. image_t img;
  751. read_image( filename
  752. , img
  753. , tag_t()
  754. );
  755. #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  756. write_view( tiff_out + "test42.tif"
  757. , view( img )
  758. , tiff_tag()
  759. );
  760. #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  761. }
  762. }
  763. BOOST_AUTO_TEST_CASE( tiger_separated_strip_planar_16 )
  764. {
  765. std::string filename( tiff_in_GM + "tiger-separated-strip-planar-16.tif" );
  766. {
  767. using image_t = cmyk16_planar_image_t;
  768. image_t img;
  769. read_image( filename
  770. , img
  771. , tag_t()
  772. );
  773. #ifdef BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  774. write_view( tiff_out + "test43.tif"
  775. , view( img )
  776. , tiff_tag()
  777. );
  778. #endif // BOOST_GIL_IO_TEST_ALLOW_WRITING_IMAGES
  779. }
  780. }
  781. #endif // BOOST_GIL_IO_USE_TIFF_GRAPHICSMAGICK_TEST_SUITE_IMAGES
  782. BOOST_AUTO_TEST_SUITE_END()