Boost C++ Libraries: Ticket #1377: Add ability to save RGBA image as TIFF with associated-alpha (premultiplied) transparency channel. https://svn.boost.org/trac10/ticket/1377 <p> At the moment, GIL cannot save an image with an "A" channel to a TIFF file. This patch adds this ability. </p> <p> I added "GIL" as a keyword, since there's still no "GIL" component in the drop-down list. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1377 Trac 1.4.3 william@… Thu, 25 Oct 2007 14:09:34 GMT attachment set https://svn.boost.org/trac10/ticket/1377 https://svn.boost.org/trac10/ticket/1377 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">GIL-TIFF-SaveRGBA.patch</span> </li> </ul> <p> Patch which adds ability to save alpha channel as premultiplied alpha in TIFF file. </p> Ticket Marshall Clow Tue, 20 Nov 2007 23:32:38 GMT component changed; owner set https://svn.boost.org/trac10/ticket/1377#comment:1 https://svn.boost.org/trac10/ticket/1377#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Hailin Jin</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">GIL</span> </li> </ul> Ticket john.femiani@… Mon, 18 Aug 2008 05:13:55 GMT <link>https://svn.boost.org/trac10/ticket/1377#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1377#comment:2</guid> <description> <p> You can not read TIFF images with alpha either. </p> <p> I posted something to the mailing list: <a class="ext-link" href="http://lists.boost.org/boost-users/2008/08/39259.php"><span class="icon">​</span>http://lists.boost.org/boost-users/2008/08/39259.php</a> </p> </description> <category>Ticket</category> </item> <item> <author>john.femiani@…</author> <pubDate>Mon, 18 Aug 2008 05:15:11 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/1377 https://svn.boost.org/trac10/ticket/1377 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">test_read_tiff_rgba.cpp</span> </li> </ul> <p> A testcase for reading rgba </p> Ticket john.femiani@… Mon, 18 Aug 2008 05:15:43 GMT attachment set https://svn.boost.org/trac10/ticket/1377 https://svn.boost.org/trac10/ticket/1377 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">rgba.tif</span> </li> </ul> <p> A file to use with the testcase I attached </p> Ticket john.femiani@… Mon, 18 Aug 2008 05:21:56 GMT <link>https://svn.boost.org/trac10/ticket/1377#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1377#comment:3</guid> <description> <p> I could not attach the dang patch, "Akismet" says it is spam. </p> <p> Here is is cut-and-pasted into the wiki: </p> <div class="wiki-code"> <div class="diff"> <ul class="entries"> <li class="entry"> <h2> <a>png_io_private.hpp</a> </h2> <pre>=================================================================== </pre> <table class="trac-diff inline" cellspacing="0"> <colgroup> <col class="lineno"/><col class="lineno"/><col class="content"/> </colgroup> <thead> <tr> <th title="File png_io_private.hpp (revision 48136) "> </th> <th title="File png_io_private.hpp (working copy) "> </th> <td> <em> </em> &nbsp; </td> </tr> </thead> <tbody class="unmod"> <tr> <th>291</th><th>291</th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; default: io_error("png_reader_color_convert::apply(): unknown combination of color type and bit depth"); </span></td> </tr> <tr> <th>292</th><th>292</th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } </span></td> </tr> <tr> <th>293</th><th>293</th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break; </span></td> </tr> </tbody> <tbody class="add"> <tr class="first"> <th>&nbsp;</th><th>294</th><td class="r"><ins>&nbsp;case PNG_COLOR_TYPE_PALETTE: </ins></td> </tr> <tr class=""> <th>&nbsp;</th><th>295</th><td class="r"><ins>&nbsp;io_error("png_reader_color_convert::apply(): cannot read png images with a pallette (yet)"); </ins></td> </tr> <tr class="last"> <th>&nbsp;</th><th>296</th><td class="r"><ins>&nbsp;</ins></td> </tr> </tbody> <tbody class="unmod"> <tr> <th>294</th><th>297</th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; default: io_error("png_reader_color_convert::apply(): unknown color type"); </span></td> </tr> <tr> <th>295</th><th>298</th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; } </span></td> </tr> <tr> <th>296</th><th>299</th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; png_read_end(_png_ptr,NULL); </span></td> </tr> </tbody> </table> </li> <li class="entry"> <h2> <a>tiff_dynamic_io.hpp</a> </h2> <pre>=================================================================== </pre> <table class="trac-diff inline" cellspacing="0"> <colgroup> <col class="lineno"/><col class="lineno"/><col class="content"/> </colgroup> <thead> <tr> <th title="File tiff_dynamic_io.hpp (revision 48136) "> </th> <th title="File tiff_dynamic_io.hpp (working copy) "> </th> <td> <em> </em> &nbsp; </td> </tr> </thead> <tbody class="unmod"> <tr> <th>56</th><th>56</th><td class="l"><span>class tiff_type_format_checker { </span></td> </tr> <tr> <th>57</th><th>57</th><td class="l"><span>&nbsp; &nbsp; int _bit_depth; </span></td> </tr> <tr> <th>58</th><th>58</th><td class="l"><span>&nbsp; &nbsp; int _color_type; </span></td> </tr> </tbody> <tbody class="add"> <tr class="last first"> <th>&nbsp;</th><th>59</th><td class="r"><ins>&nbsp;unsigned short _samples_per_pixel; </ins></td> </tr> </tbody> <tbody class="unmod"> <tr> <th>59</th><th>60</th><td class="l"><span>public: </span></td> </tr> </tbody> <tbody class="mod"> <tr class="first"> <th>60</th><th>&nbsp;</th><td class="l"><span>&nbsp;tiff_type_format_checker(int bit_depth_in,int color_type_in) : </span></td> </tr> <tr> <th>61</th><th>&nbsp;</th><td class="l"><span>&nbsp;_bit_depth(bit_depth_in),_color_type(color_type_in) {} </span></td> </tr> <tr> <th>&nbsp;</th><th>61</th><td class="r"><span>&nbsp;tiff_type_format_checker( int bit_depth_in </span></td> </tr> <tr> <th>&nbsp;</th><th>62</th><td class="r"><span>&nbsp;, int color_type_in </span></td> </tr> <tr> <th>&nbsp;</th><th>63</th><td class="r"><span>&nbsp;, unsigned short samples_per_pixel_in </span></td> </tr> <tr> <th>&nbsp;</th><th>64</th><td class="r"><span>&nbsp;) </span></td> </tr> <tr> <th>&nbsp;</th><th>65</th><td class="r"><span>&nbsp;: _bit_depth(bit_depth_in) </span></td> </tr> <tr> <th>&nbsp;</th><th>66</th><td class="r"><span>&nbsp;, _color_type(color_type_in) </span></td> </tr> <tr> <th>&nbsp;</th><th>67</th><td class="r"><span>&nbsp;, _samples_per_pixel(samples_per_pixel_in) </span></td> </tr> <tr class="last"> <th>&nbsp;</th><th>68</th><td class="r"><span>&nbsp;{} </span></td> </tr> </tbody> <tbody class="unmod"> <tr> <th>62</th><th>69</th><td class="l"><span>&nbsp; &nbsp; template &lt;typename Image&gt; </span></td> </tr> <tr> <th>63</th><th>70</th><td class="l"><span>&nbsp; &nbsp; bool apply() { </span></td> </tr> </tbody> <tbody class="mod"> <tr class="first"> <th>64</th><th>&nbsp;</th><td class="l"><span>&nbsp;return tiff_read_support&lt;typename Image::view_t&gt;::bit_depth==_bit_depth &amp;&amp; </span></td> </tr> <tr> <th>65</th><th>&nbsp;</th><td class="l"><span>&nbsp;tiff_read_support&lt;typename Image::view_t&gt;::color_type==_color_type; </span></td> </tr> <tr> <th>&nbsp;</th><th>71</th><td class="r"><span>&nbsp;typedef tiff_read_support&lt;typename Image::view_t&gt; traits; </span></td> </tr> <tr> <th>&nbsp;</th><th>72</th><td class="r"><span>&nbsp;</span></td> </tr> <tr> <th>&nbsp;</th><th>73</th><td class="r"><span>&nbsp;int my_samples_per_pixel = size&lt;typename Image::value_type&gt;(); </span></td> </tr> <tr> <th>&nbsp;</th><th>74</th><td class="r"><span>&nbsp;</span></td> </tr> <tr> <th>&nbsp;</th><th>75</th><td class="r"><span>&nbsp;bool same_bit_depth = traits::bit_depth == _bit_depth; </span></td> </tr> <tr> <th>&nbsp;</th><th>76</th><td class="r"><span>&nbsp;bool same_color_type = traits::color_type == _color_type; </span></td> </tr> <tr> <th>&nbsp;</th><th>77</th><td class="r"><span>&nbsp;bool same_samples_per_pixel = my_samples_per_pixel == _samples_per_pixel; </span></td> </tr> <tr> <th>&nbsp;</th><th>78</th><td class="r"><span>&nbsp;</span></td> </tr> <tr> <th>&nbsp;</th><th>79</th><td class="r"><span>&nbsp;bool result = same_bit_depth &amp;&amp; same_color_type; </span></td> </tr> <tr> <th>&nbsp;</th><th>80</th><td class="r"><span>&nbsp;</span></td> </tr> <tr> <th>&nbsp;</th><th>81</th><td class="r"><span>&nbsp;if (_samples_per_pixel) </span></td> </tr> <tr> <th>&nbsp;</th><th>82</th><td class="r"><span>&nbsp;result = result &amp;&amp; same_samples_per_pixel; </span></td> </tr> <tr> <th>&nbsp;</th><th>83</th><td class="r"><span>&nbsp;</span></td> </tr> <tr class="last"> <th>&nbsp;</th><th>84</th><td class="r"><span>&nbsp;return result; </span></td> </tr> </tbody> <tbody class="unmod"> <tr> <th>66</th><th>85</th><td class="l"><span>&nbsp; &nbsp; } </span></td> </tr> <tr> <th>67</th><th>86</th><td class="l"><span>}; </span></td> </tr> <tr> <th>68</th><th>87</th><td class="l"><span>&nbsp;</span></td> </tr> </tbody> <tbody class="skipped"> <tr> <th><a href="#L77">&hellip;</a></th> <th><a href="#L96">&hellip;</a></th> <td> <em> </em> &nbsp; </td> </tr> </tbody> <tbody class="unmod"> <tr> <th>77</th><th>96</th><td class="l"><span>&nbsp;</span></td> </tr> <tr> <th>78</th><th>97</th><td class="l"><span>&nbsp; &nbsp; template &lt;typename Images&gt; </span></td> </tr> <tr> <th>79</th><th>98</th><td class="l"><span>&nbsp; &nbsp; void read_image(any_image&lt;Images&gt;&amp; im) { </span></td> </tr> </tbody> <tbody class="mod"> <tr class="first"> <th>80</th><th>&nbsp;</th><td class="l"><span>&nbsp;int width,height; </span></td> </tr> <tr> <th>81</th><th>&nbsp;</th><td class="l"><span>&nbsp;unsigned short bps,photometric; </span></td> </tr> <tr> <th>82</th><th>&nbsp;</th><td class="l"><span>&nbsp;TIFFGetField(_tp,TIFFTAG_IMAGEWIDTH,&amp;width); </span></td> </tr> <tr> <th>83</th><th>&nbsp;</th><td class="l"><span>&nbsp;TIFFGetField(_tp,TIFFTAG_IMAGELENGTH,&amp;height); </span></td> </tr> <tr> <th>84</th><th>&nbsp;</th><td class="l"><span>&nbsp;TIFFGetField(_tp,TIFFTAG_BITSPERSAMPLE,&amp;bps); </span></td> </tr> <tr> <th>85</th><th>&nbsp;</th><td class="l"><span>&nbsp;TIFFGetField(_tp,TIFFTAG_PHOTOMETRIC,&amp;photometric); </span></td> </tr> <tr> <th>86</th><th>&nbsp;</th><td class="l"><span>&nbsp;if (!construct_matched(im,tiff_type_format_checker(bps,photometric))) { </span></td> </tr> <tr> <th>&nbsp;</th><th>99</th><td class="r"><span>&nbsp;int width; </span></td> </tr> <tr> <th>&nbsp;</th><th>100</th><td class="r"><span>&nbsp;int height; </span></td> </tr> <tr> <th>&nbsp;</th><th>101</th><td class="r"><span>&nbsp;unsigned short bps=1; </span></td> </tr> <tr> <th>&nbsp;</th><th>102</th><td class="r"><span>&nbsp;unsigned short photometric = 1; </span></td> </tr> <tr> <th>&nbsp;</th><th>103</th><td class="r"><span>&nbsp;unsigned short samples_per_pixel = 0; </span></td> </tr> <tr> <th>&nbsp;</th><th>104</th><td class="r"><span>&nbsp;TIFFGetField(_tp, TIFFTAG_IMAGEWIDTH, &amp;width); </span></td> </tr> <tr> <th>&nbsp;</th><th>105</th><td class="r"><span>&nbsp;TIFFGetField(_tp, TIFFTAG_IMAGELENGTH, &amp;height); </span></td> </tr> <tr> <th>&nbsp;</th><th>106</th><td class="r"><span>&nbsp;TIFFGetField(_tp, TIFFTAG_BITSPERSAMPLE,&amp;bps); </span></td> </tr> <tr> <th>&nbsp;</th><th>107</th><td class="r"><span>&nbsp;TIFFGetField(_tp, TIFFTAG_PHOTOMETRIC, &amp;photometric); </span></td> </tr> <tr> <th>&nbsp;</th><th>108</th><td class="r"><span>&nbsp;TIFFGetField(_tp, TIFFTAG_SAMPLESPERPIXEL, &amp;samples_per_pixel); </span></td> </tr> <tr class="last"> <th>&nbsp;</th><th>109</th><td class="r"><span>&nbsp;if (!construct_matched(im, tiff_type_format_checker(bps,photometric, samples_per_pixel))) { </span></td> </tr> </tbody> <tbody class="unmod"> <tr> <th>87</th><th>110</th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; io_error("tiff_reader_dynamic::read_image(): no matching image type between those of the given any_image and that of the file"); </span></td> </tr> <tr> <th>88</th><th>111</th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; } else { </span></td> </tr> <tr> <th>89</th><th>112</th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; im.recreate(width,height); </span></td> </tr> </tbody> </table> </li> <li class="entry"> <h2> <a>tiff_io.hpp</a> </h2> <pre>=================================================================== </pre> <table class="trac-diff inline" cellspacing="0"> <colgroup> <col class="lineno"/><col class="lineno"/><col class="content"/> </colgroup> <thead> <tr> <th title="File tiff_io.hpp (revision 48136) "> </th> <th title="File tiff_io.hpp (working copy) "> </th> <td> <em> </em> &nbsp; </td> </tr> </thead> <tbody class="unmod"> <tr> <th>1</th><th>1</th><td class="l"><span>/* </span></td> </tr> <tr> <th>2</th><th>2</th><td class="l"><span>&nbsp; &nbsp; Copyright 2005-2007 Adobe Systems Incorporated </span></td> </tr> </tbody> <tbody class="mod"> <tr class="first"> <th>3</th><th>&nbsp;</th><td class="l"><span>&nbsp;<del></del></span></td> </tr> <tr class="last"> <th>&nbsp;</th><th>3</th><td class="r"><span>&nbsp;<ins></ins></span></td> </tr> </tbody> <tbody class="unmod"> <tr> <th>4</th><th>4</th><td class="l"><span>&nbsp; &nbsp; Use, modification and distribution are subject to the Boost Software License, </span></td> </tr> <tr> <th>5</th><th>5</th><td class="l"><span>&nbsp; &nbsp; Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at </span></td> </tr> <tr> <th>6</th><th>6</th><td class="l"><span>&nbsp; &nbsp; http://www.boost.org/LICENSE_1_0.txt). </span></td> </tr> </tbody> <tbody class="skipped"> <tr> <th><a href="#L51">&hellip;</a></th> <th><a href="#L51">&hellip;</a></th> <td> <em> </em> &nbsp; </td> </tr> </tbody> <tbody class="unmod"> <tr> <th>51</th><th>51</th><td class="l"><span>&nbsp; &nbsp; BOOST_STATIC_CONSTANT(int,color_type=PHOTOMETRIC_RGB); </span></td> </tr> <tr> <th>52</th><th>52</th><td class="l"><span>}; </span></td> </tr> <tr> <th>53</th><th>53</th><td class="l"><span>template &lt;&gt; </span></td> </tr> </tbody> <tbody class="add"> <tr class="first"> <th>&nbsp;</th><th>54</th><td class="r"><ins>struct tiff_read_support_private&lt;bits8,rgba_t&gt; { </ins></td> </tr> <tr class=""> <th>&nbsp;</th><th>55</th><td class="r"><ins>&nbsp;BOOST_STATIC_CONSTANT(bool,is_supported=true); </ins></td> </tr> <tr class=""> <th>&nbsp;</th><th>56</th><td class="r"><ins>&nbsp;BOOST_STATIC_CONSTANT(int,bit_depth=8); </ins></td> </tr> <tr class=""> <th>&nbsp;</th><th>57</th><td class="r"><ins>&nbsp;BOOST_STATIC_CONSTANT(int,color_type=PHOTOMETRIC_RGB); </ins></td> </tr> <tr class=""> <th>&nbsp;</th><th>58</th><td class="r"><ins>}; </ins></td> </tr> <tr class="last"> <th>&nbsp;</th><th>59</th><td class="r"><ins>template &lt;&gt; </ins></td> </tr> </tbody> <tbody class="unmod"> <tr> <th>54</th><th>60</th><td class="l"><span>struct tiff_read_support_private&lt;bits16,gray_t&gt; { </span></td> </tr> <tr> <th>55</th><th>61</th><td class="l"><span>&nbsp; &nbsp; BOOST_STATIC_CONSTANT(bool,is_supported=true); </span></td> </tr> <tr> <th>56</th><th>62</th><td class="l"><span>&nbsp; &nbsp; BOOST_STATIC_CONSTANT(int,bit_depth=16); </span></td> </tr> </tbody> <tbody class="skipped"> <tr> <th><a href="#L94">&hellip;</a></th> <th><a href="#L100">&hellip;</a></th> <td> <em> </em> &nbsp; </td> </tr> </tbody> <tbody class="unmod"> <tr> <th>94</th><th>100</th><td class="l"><span>&nbsp; &nbsp; BOOST_STATIC_CONSTANT(int,color_type=PHOTOMETRIC_RGB); </span></td> </tr> <tr> <th>95</th><th>101</th><td class="l"><span>}; </span></td> </tr> <tr> <th>96</th><th>102</th><td class="l"><span>template &lt;&gt; </span></td> </tr> </tbody> <tbody class="add"> <tr class="first"> <th>&nbsp;</th><th>103</th><td class="r"><ins>struct tiff_write_support_private&lt;bits8,rgba_t&gt; { </ins></td> </tr> <tr class=""> <th>&nbsp;</th><th>104</th><td class="r"><ins>&nbsp;BOOST_STATIC_CONSTANT(bool,is_supported=true); </ins></td> </tr> <tr class=""> <th>&nbsp;</th><th>105</th><td class="r"><ins>&nbsp;BOOST_STATIC_CONSTANT(int,bit_depth=8); </ins></td> </tr> <tr class=""> <th>&nbsp;</th><th>106</th><td class="r"><ins>&nbsp;BOOST_STATIC_CONSTANT(int,color_type=PHOTOMETRIC_RGB); </ins></td> </tr> <tr class=""> <th>&nbsp;</th><th>107</th><td class="r"><ins>}; </ins></td> </tr> <tr class="last"> <th>&nbsp;</th><th>108</th><td class="r"><ins>template &lt;&gt; </ins></td> </tr> </tbody> <tbody class="unmod"> <tr> <th>97</th><th>109</th><td class="l"><span>struct tiff_write_support_private&lt;bits16,gray_t&gt; { </span></td> </tr> <tr> <th>98</th><th>110</th><td class="l"><span>&nbsp; &nbsp; BOOST_STATIC_CONSTANT(bool,is_supported=true); </span></td> </tr> <tr> <th>99</th><th>111</th><td class="l"><span>&nbsp; &nbsp; BOOST_STATIC_CONSTANT(int,bit_depth=16); </span></td> </tr> </tbody> <tbody class="skipped"> <tr> <th><a href="#L129">&hellip;</a></th> <th><a href="#L141">&hellip;</a></th> <td> <em> </em> &nbsp; </td> </tr> </tbody> <tbody class="unmod"> <tr> <th>129</th><th>141</th><td class="l"><span>&nbsp; &nbsp; ~tiff_reader() { TIFFClose(_tp); } </span></td> </tr> <tr> <th>130</th><th>142</th><td class="l"><span>&nbsp; &nbsp; template &lt;typename View&gt; </span></td> </tr> <tr> <th>131</th><th>143</th><td class="l"><span>&nbsp; &nbsp; void apply(const View&amp; view) { </span></td> </tr> </tbody> <tbody class="mod"> <tr class="first"> <th>132</th><th>&nbsp;</th><td class="l"><span>&nbsp;unsigned short bps,<del></del>photometric; </span></td> </tr> <tr class="last"> <th>&nbsp;</th><th>144</th><td class="r"><span>&nbsp;unsigned short bps,<ins>spp, </ins>photometric; </span></td> </tr> </tbody> <tbody class="unmod"> <tr> <th>133</th><th>145</th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; point2&lt;std::ptrdiff_t&gt; dims=get_dimensions(); </span></td> </tr> <tr> <th>134</th><th>146</th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; io_error_if(TIFFGetField(_tp,TIFFTAG_BITSPERSAMPLE,&amp;bps)!=1); </span></td> </tr> <tr> <th>135</th><th>147</th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; io_error_if(TIFFGetField(_tp,TIFFTAG_PHOTOMETRIC,&amp;photometric)!=1); </span></td> </tr> </tbody> <tbody class="add"> <tr class="last first"> <th>&nbsp;</th><th>148</th><td class="r"><ins>&nbsp;io_error_if(TIFFGetField(_tp,TIFFTAG_SAMPLESPERPIXEL,&amp;spp)!=1); </ins></td> </tr> </tbody> <tbody class="unmod"> <tr> <th>136</th><th>149</th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; io_error_if(dims!=view.dimensions(), </span></td> </tr> <tr> <th>137</th><th>150</th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "tiff_read_view: input view size does not match TIFF file size"); </span></td> </tr> <tr> <th>138</th><th>151</th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; io_error_if(tiff_read_support_private&lt;typename channel_type&lt;View&gt;::type, </span></td> </tr> <tr> <th>139</th><th>152</th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; typename color_space_type&lt;View&gt;::type&gt;::bit_depth!=bps || </span></td> </tr> <tr> <th>140</th><th>153</th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tiff_read_support_private&lt;typename channel_type&lt;View&gt;::type, </span></td> </tr> </tbody> <tbody class="mod"> <tr class="first"> <th>141</th><th>&nbsp;</th><td class="l"><span>&nbsp;typename color_space_type&lt;View&gt;::type&gt;::color_type!=photometric, </span></td> </tr> <tr> <th>&nbsp;</th><th>154</th><td class="r"><span>&nbsp;typename color_space_type&lt;View&gt;::type&gt;::color_type!=photometric || </span></td> </tr> <tr class="last"> <th>&nbsp;</th><th>155</th><td class="r"><span>&nbsp;mpl::size&lt;typename color_space_type&lt;View&gt;::type&gt;::value != spp, </span></td> </tr> </tbody> <tbody class="unmod"> <tr> <th>142</th><th>156</th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "tiff_read_view: input view type is incompatible with the image type"); </span></td> </tr> <tr> <th>143</th><th>157</th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; std::size_t element_size=sizeof(pixel&lt;typename channel_type&lt;View&gt;::type, </span></td> </tr> <tr> <th>144</th><th>158</th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; layout&lt;typename color_space_type&lt;View&gt;::type&gt; &gt;); </span></td> </tr> </tbody> <tbody class="skipped"> <tr> <th><a href="#L166">&hellip;</a></th> <th><a href="#L180">&hellip;</a></th> <td> <em> </em> &nbsp; </td> </tr> </tbody> <tbody class="unmod"> <tr> <th>166</th><th>180</th><td class="l"><span>}; </span></td> </tr> <tr> <th>167</th><th>181</th><td class="l"><span>&nbsp;</span></td> </tr> <tr> <th>168</th><th>182</th><td class="l"><span>// This code will be simplified... </span></td> </tr> </tbody> <tbody class="mod"> <tr class="first"> <th>169</th><th>&nbsp;</th><td class="l"><span>template &lt;typename CC&gt; <del></del></span></td> </tr> <tr class="last"> <th>&nbsp;</th><th>183</th><td class="r"><span>template &lt;typename CC&gt; <ins></ins></span></td> </tr> </tbody> <tbody class="unmod"> <tr> <th>170</th><th>184</th><td class="l"><span>class tiff_reader_color_convert : public tiff_reader { </span></td> </tr> <tr> <th>171</th><th>185</th><td class="l"><span>private: </span></td> </tr> <tr> <th>172</th><th>186</th><td class="l"><span>&nbsp; &nbsp; CC _cc; </span></td> </tr> <tr> <th>173</th><th>187</th><td class="l"><span>public: </span></td> </tr> </tbody> <tbody class="mod"> <tr class="first"> <th>174</th><th>&nbsp;</th><td class="l"><span>&nbsp;tiff_reader_color_convert(const char* filename) : <del></del></span></td> </tr> <tr class="last"> <th>&nbsp;</th><th>188</th><td class="r"><span>&nbsp;tiff_reader_color_convert(const char* filename) : <ins></ins></span></td> </tr> </tbody> <tbody class="unmod"> <tr> <th>175</th><th>189</th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; tiff_reader(filename) {} </span></td> </tr> </tbody> <tbody class="mod"> <tr class="first"> <th>176</th><th>&nbsp;</th><td class="l"><span>&nbsp;tiff_reader_color_convert(const char* filename,CC cc_in) : <del></del></span></td> </tr> <tr class="last"> <th>&nbsp;</th><th>190</th><td class="r"><span>&nbsp;tiff_reader_color_convert(const char* filename,CC cc_in) : <ins></ins></span></td> </tr> </tbody> <tbody class="unmod"> <tr> <th>177</th><th>191</th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; tiff_reader(filename),_cc(cc_in) {} </span></td> </tr> <tr> <th>178</th><th>192</th><td class="l"><span>&nbsp; &nbsp; template &lt;typename View&gt; </span></td> </tr> <tr> <th>179</th><th>193</th><td class="l"><span>&nbsp; &nbsp; void apply(const View&amp; view) { </span></td> </tr> </tbody> <tbody class="skipped"> <tr> <th><a href="#L273">&hellip;</a></th> <th><a href="#L287">&hellip;</a></th> <td> <em> </em> &nbsp; </td> </tr> </tbody> <tbody class="unmod"> <tr> <th>273</th><th>287</th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; default: { </span></td> </tr> <tr> <th>274</th><th>288</th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // reads an image in incompatible format via TIFFReadRGBAImage </span></td> </tr> <tr> <th>275</th><th>289</th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rgba8_image_t rgbaImg(dims); </span></td> </tr> </tbody> <tbody class="mod"> <tr class="first"> <th>276</th><th>&nbsp;</th><td class="l"><span>&nbsp;io_error_if(!TIFFReadRGBAImage(_tp, dims.x, dims.y, (uint32*)&amp;gil::view(rgbaImg)(0,0), 0), <del></del></span></td> </tr> <tr class="last"> <th>&nbsp;</th><th>290</th><td class="r"><span>&nbsp;io_error_if(!TIFFReadRGBAImage(_tp, dims.x, dims.y, (uint32*)&amp;gil::view(rgbaImg)(0,0), 0), <ins></ins></span></td> </tr> </tbody> <tbody class="unmod"> <tr> <th>277</th><th>291</th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "tiff_reader_color_convert::unsupported image format"); </span></td> </tr> <tr> <th>278</th><th>292</th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; copy_and_convert_pixels(flipped_up_down_view(const_view(rgbaImg)), view, _cc); </span></td> </tr> <tr> <th>279</th><th>293</th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; } </span></td> </tr> </tbody> <tbody class="skipped"> <tr> <th><a href="#L353">&hellip;</a></th> <th><a href="#L367">&hellip;</a></th> <td> <em> </em> &nbsp; </td> </tr> </tbody> <tbody class="unmod"> <tr> <th>353</th><th>367</th><td class="l"><span>/// \ingroup TIFF_IO </span></td> </tr> <tr> <th>354</th><th>368</th><td class="l"><span>/// \brief Loads the image specified by the given tiff image file name into the given view. </span></td> </tr> <tr> <th>355</th><th>369</th><td class="l"><span>/// Triggers a compile assert if the view color space and channel depth are not supported by the TIFF library or by the I/O extension. </span></td> </tr> </tbody> <tbody class="mod"> <tr class="first"> <th>356</th><th>&nbsp;</th><td class="l"><span>/// Throws std::ios_base::failure if the file is not a valid TIFF file, or if its color space or channel depth are not <del></del></span></td> </tr> <tr class="last"> <th>&nbsp;</th><th>370</th><td class="r"><span>/// Throws std::ios_base::failure if the file is not a valid TIFF file, or if its color space or channel depth are not <ins></ins></span></td> </tr> </tbody> <tbody class="unmod"> <tr> <th>357</th><th>371</th><td class="l"><span>/// compatible with the ones specified by View, or if its dimensions don't match the ones of the view. </span></td> </tr> <tr> <th>358</th><th>372</th><td class="l"><span>template &lt;typename View&gt; </span></td> </tr> <tr> <th>359</th><th>373</th><td class="l"><span>inline void tiff_read_view(const char* filename,const View&amp; view) { </span></td> </tr> </tbody> <tbody class="skipped"> <tr> <th><a href="#L372">&hellip;</a></th> <th><a href="#L386">&hellip;</a></th> <td> <em> </em> &nbsp; </td> </tr> </tbody> <tbody class="unmod"> <tr> <th>372</th><th>386</th><td class="l"><span>/// \ingroup TIFF_IO </span></td> </tr> <tr> <th>373</th><th>387</th><td class="l"><span>/// \brief Allocates a new image whose dimensions are determined by the given tiff image file, and loads the pixels into it. </span></td> </tr> <tr> <th>374</th><th>388</th><td class="l"><span>/// Triggers a compile assert if the image color space or channel depth are not supported by the TIFF library or by the I/O extension. </span></td> </tr> </tbody> <tbody class="mod"> <tr class="first"> <th>375</th><th>&nbsp;</th><td class="l"><span>/// Throws std::ios_base::failure if the file is not a valid TIFF file, or if its color space or channel depth are not <del></del></span></td> </tr> <tr class="last"> <th>&nbsp;</th><th>389</th><td class="r"><span>/// Throws std::ios_base::failure if the file is not a valid TIFF file, or if its color space or channel depth are not <ins></ins></span></td> </tr> </tbody> <tbody class="unmod"> <tr> <th>376</th><th>390</th><td class="l"><span>/// compatible with the ones specified by Image </span></td> </tr> <tr> <th>377</th><th>391</th><td class="l"><span>template &lt;typename Image&gt; </span></td> </tr> <tr> <th>378</th><th>392</th><td class="l"><span>void tiff_read_image(const char* filename,Image&amp; im) {</span></td> </tr> </tbody> </table> </li> </ul> </div></div> </description> <category>Ticket</category> </item> <item> <author>mloskot <mateusz@…></author> <pubDate>Sat, 03 Oct 2009 21:38:06 GMT</pubDate> <title>cc set https://svn.boost.org/trac10/ticket/1377#comment:4 https://svn.boost.org/trac10/ticket/1377#comment:4 <ul> <li><strong>cc</strong> <span class="trac-author">mateusz@…</span> added </li> </ul> Ticket chhenning Thu, 05 Aug 2010 15:07:40 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/1377#comment:5 https://svn.boost.org/trac10/ticket/1377#comment:5 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">wontfix</span> </li> </ul> <p> Please ise the new io extension. It provides you with all the features asked for in this ticket. </p> Ticket