2
0
mirror of https://github.com/boostorg/gil.git synced 2026-02-19 14:32:10 +00:00

GIL: fixed Ticket 784: Wrong initilization of data members in packed_pixel constructors

[SVN r51352]
This commit is contained in:
Hailin Jin
2009-02-20 19:10:33 +00:00
parent 7e540f5e1b
commit 74d43c6b41

View File

@@ -18,7 +18,7 @@
/// \brief A model of a heterogeneous pixel whose channels are bit ranges. For example 16-bit RGB in '565' format
/// \author Lubomir Bourdev and Hailin Jin \n
/// Adobe Systems Incorporated
/// \date 2005-2007 \n Last updated on September 28, 2006
/// \date 2005-2009 \n Last updated on February 20, 2009
///
////////////////////////////////////////////////////////////////////////////////////////
@@ -85,11 +85,11 @@ struct packed_pixel {
}
packed_pixel(int chan0, int chan1, int chan2, int chan3) : _bitfield(0) {
BOOST_STATIC_ASSERT((num_channels<packed_pixel>::value==4));
at_c<0>(*this)=chan0; at_c<1>(*this)=chan1; at_c<2>(*this)=chan2; at_c<2>(*this)=chan3;
at_c<0>(*this)=chan0; at_c<1>(*this)=chan1; at_c<2>(*this)=chan2; at_c<3>(*this)=chan3;
}
packed_pixel(int chan0, int chan1, int chan2, int chan3, int chan4) : _bitfield(0) {
BOOST_STATIC_ASSERT((num_channels<packed_pixel>::value==5));
at_c<0>(*this)=chan0; at_c<1>(*this)=chan1; at_c<2>(*this)=chan2; at_c<2>(*this)=chan3; at_c<3>(*this)=chan4;
at_c<0>(*this)=chan0; at_c<1>(*this)=chan1; at_c<2>(*this)=chan2; at_c<3>(*this)=chan3; at_c<4>(*this)=chan4;
}
packed_pixel& operator=(const packed_pixel& p) { _bitfield=p._bitfield; return *this; }