Menu

define my own view(bgr565)

2012-05-28
2013-04-29
  • stereoMatching

    stereoMatching - 2012-05-28

    I define a view of bgr565 and have some questions about them

    typedef boost::gil::packed_channel_reference<boost::gil::bits16, 0,  5, true> channel16_0_5_reference_t;
    typedef boost::gil::packed_channel_reference<boost::gil::bits16, 5, 6, true> channel16_5_6_reference_t;
    typedef boost::gil::packed_channel_reference<boost::gil::bits16, 11, 5, true> channel16_11_5_reference_t;
    typedef boost::mpl::vector<channel16_0_5_reference_t, channel16_5_6_reference_t, channel16_11_5_reference_t> bgr565_channels_t;
    typedef boost::gil::packed_pixel<boost::gil::bits16, bgr565_channels_t, boost::gil::bgr_layout_t> bgr565_pixel_t;
    typedef boost::gil::view_type_from_pixel<bgr565_pixel_t>::type bgr565_view_t;
    

    1 : What do I lack?
    2 : How could I define an image rather than view(because I could define view from the image in a fly)
    3 : I can't define an image by the codes like this

    typedef boost::gil::image<bgr565_view_t::value_type, boost::gil::is_planar<bgr565_view_t>::value> bgr565_image_t;
    

    Thanks a lot

     
  • Anonymous

    Anonymous - 2012-05-28

    Hi there,

    I didn't try your code but defining bit aligned image types is rather easy.

    typedef packed_pixel_type< uint16_t, mpl::vector3_c< unsigned, 5, 6, 5 >, bgr_layout_t >::type bgr565_pixel_t;
    typedef image< bgr565_pixel_t, false > image_t;
    image_t img(640, 480);
    typedef bit_aligned_image3_type< 5, 6, 5, rgb_layout_t >::type image2_t;
    image2_t img2(640, 480);
    

    Does that help you?

     
  • stereoMatching

    stereoMatching - 2012-05-29

    Thanks, this is a big help

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.