Hi all, Sorry to bother you with my problems but I am experiencing a new probable bug: I am trying to manage with data that are set as follow: P;P;P;P;...... Where P is a rgb pixel (10 bits per components) packed on an uint32 as follow: 00RGB;00RGB;00RGB;00RGB........ I mean there is two bits unused on each 32 bits pixel. So I tried to set up a view using packed_pixel and a bug occurs when using copy_and_convert_pixels... The very strange thing is that it is working when using color_convert on two pixels... I think there may exist something I didn't understood... Anyway, I give you the buggy code: /// 10 bits rgb packed to uint32_t starting at the 2nd bit typedef const packed_channel_reference<uint32_t, 22, 10, true> rgb10_packed_channel0_t; typedef const packed_channel_reference<uint32_t, 12, 10, true> rgb10_packed_channel1_t; typedef const packed_channel_reference<uint32_t, 02, 10, true> rgb10_packed_channel2_t; typedef mpl::vector3<rgb10_packed_channel0_t, rgb10_packed_channel1_t, rgb10_packed_channel2_t> rgb10_packed_channels_t; typedef packed_pixel<uint32_t, rgb10_packed_channels_t, rgb_layout_t> rgb10_packed_pixel_t; typedef view_type_from_pixel<rgb10_packed_pixel_t>::type rgb10_packed_view_t; // image data of dimension: {w,h} = {1,0} uint32_t *data=new uint32_t[1]; data[0] = 0xFFFFF00C; rgb10_packed_view_t vw10 = interleaved_view( 1, 0, (rgb10_packed_pixel_t*)( data ), sizeof( uint32_t ) ); rgb10_packed_pixel_t pix10 = *vw10.row_begin(0); rgb16_pixel_t pix16; // This is working color_convert(pix10, pix16); std::cout << "Right {R,G,B}={" << get_color(pix16, red_t()) << "," << get_color(pix16, green_t()) << "," << get_color(pix16, blue_t()) << "}" << std::endl; // Assert that are ok assert( get_color( pix16, red_t() ) == 0xFFFF ); assert( get_color( pix16, green_t() ) == 0xFFFF ); assert( get_color( pix16, blue_t() ) == 0x00C0 ); rgb16_image_t img16(vw10.width(), vw10.height()); rgb16_view_t vw16(view(img16)); // This isn't working with packed_view copy_and_convert_pixels(vw10, vw16); pix16 = *vw16.row_begin(0); std::cout << "Wrong {R,G,B}={" << get_color(pix16, red_t()) << "," << get_color(pix16, green_t()) << "," << get_color(pix16, blue_t()) << "}" << std::endl; // Assert that doesn't pass assert( get_color( pix16, red_t() ) == 0xFFFF ); assert( get_color( pix16, green_t() ) == 0xFFFF ); assert( get_color( pix16, blue_t() ) == 0x00C0 ); Hope this will help, Eloi.
Hi Eloi, You are constructing a view whose height is zero. Could that be the problem? Lubomir On 12/15/09 5:01 AM, "Eloi Du Bois" <eloi.du.bois@gmail.com> wrote: rgb10_packed_view_t vw10 = interleaved_view( 1, 0, (rgb10_packed_pixel_t*)( data ), sizeof( uint32_t ) );
Ouups... I think that *may* be a problem, but it is a typing error, I tried on views of a bigger size. I will retry this later. Thanks :) 2009/12/15 Lubomir Bourdev <lbourdev@adobe.com>
Hi Eloi,
You are constructing a view whose height is zero. Could that be the problem?
Lubomir
On 12/15/09 5:01 AM, "Eloi Du Bois" <eloi.du.bois@gmail.com> wrote:
rgb10_packed_view_t vw10 = interleaved_view( 1, 0, (rgb10_packed_pixel_t*)( data ), sizeof( uint32_t ) );
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Okay, sorry... You are right: the code is now working :) I have to look deeper why is there something wrong when converting colors... 2009/12/15 Eloi Du Bois <eloi.du.bois@gmail.com>
Ouups... I think that *may* be a problem, but it is a typing error, I tried on views of a bigger size. I will retry this later.
Thanks :)
2009/12/15 Lubomir Bourdev <lbourdev@adobe.com>
Hi Eloi,
You are constructing a view whose height is zero. Could that be the problem?
Lubomir
On 12/15/09 5:01 AM, "Eloi Du Bois" <eloi.du.bois@gmail.com> wrote:
rgb10_packed_view_t vw10 = interleaved_view( 1, 0, (rgb10_packed_pixel_t*)( data ), sizeof( uint32_t ) );
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Eloi, it would be best when you can create a very small code sample that exhibits a problem. The smaller the better. ;-) Christian On Wed, Dec 16, 2009 at 4:45 AM, Eloi Du Bois <eloi.du.bois@gmail.com> wrote:
Okay, sorry... You are right: the code is now working :) I have to look deeper why is there something wrong when converting colors...
2009/12/15 Eloi Du Bois <eloi.du.bois@gmail.com>
Ouups... I think that *may* be a problem, but it is a typing error, I tried on views of a bigger size. I will retry this later.
Thanks :)
2009/12/15 Lubomir Bourdev <lbourdev@adobe.com>
Hi Eloi,
You are constructing a view whose height is zero. Could that be the problem?
Lubomir
On 12/15/09 5:01 AM, "Eloi Du Bois" <eloi.du.bois@gmail.com> wrote:
rgb10_packed_view_t vw10 = interleaved_view( 1, 0, (rgb10_packed_pixel_t*)( data ), sizeof( uint32_t ) );
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Ok, I will do my best... I am tracking the problem... Work in progress... 2009/12/16 Christian Henning <chhenning@gmail.com>
Eloi, it would be best when you can create a very small code sample that exhibits a problem. The smaller the better. ;-)
Christian
On Wed, Dec 16, 2009 at 4:45 AM, Eloi Du Bois <eloi.du.bois@gmail.com> wrote:
Okay, sorry... You are right: the code is now working :) I have to look deeper why is there something wrong when converting
colors... > > 2009/12/15 Eloi Du Bois <eloi.du.bois@gmail.com> >> >> Ouups... I think that *may* be a problem, but it is a typing error, I >> tried on views of a bigger size. I will retry this later. >> >> Thanks :) >> >> 2009/12/15 Lubomir Bourdev <lbourdev@adobe.com> >>> >>> Hi Eloi, >>> >>> You are constructing a view whose height is zero. Could that be the >>> problem? >>> >>> Lubomir >>> >>> >>> On 12/15/09 5:01 AM, "Eloi Du Bois" <eloi.du.bois@gmail.com> wrote: >>> >>> rgb10_packed_view_t vw10 = >>> interleaved_view( 1, 0, (rgb10_packed_pixel_t*)( data ), >>> sizeof( uint32_t ) ); >>> >>> _______________________________________________ >>> Boost-users mailing list >>> Boost-users@lists.boost.org >>> http://lists.boost.org/mailman/listinfo.cgi/boost-users >> > > > _______________________________________________ > Boost-users mailing list > Boost-users@lists.boost.org > http://lists.boost.org/mailman/listinfo.cgi/boost-users > _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (3)
-
Christian Henning
-
Eloi Du Bois
-
Lubomir Bourdev