Boost logo

Boost Users :

Subject: Re: [Boost-users] [gil] get raw data from picture
From: Stephan Menzel (stephan.menzel_at_[hidden])
Date: 2009-02-18 14:43:02


Am Mittwoch, 18. Februar 2009 16:41:46 schrieb Stephan Menzel:
> Hi there,
>
> is there any way to get the raw YCbCr data out of a gil Image that has been
> read with jpeg_read_image()?

perhaps I should be a little more verbose.
I intented to use gil to read images (in that case jpeg, or from raw RGB in
Mem) to iterate over the pixels and convert them into yuv planes.
I wanted to use a conversion formula for this.
Those yuv planes shall be plain mem blocks where I need to store the data to
feed them into a C function that expects such. So I need a way to either
iterate over the pixels and get the red green and blue values to use the
conversion algo upon them (or I was actually hoping GIL can do this job) and
offer me a view where I can access those panes and simply copy them. Studying
the docs I see this is not possible but maybe someone can give me some advice
on how to access those RGB pixel iterators.
I think the way to start is this:

boost::gil::any_image< rgb16_image_t> img;
boost::gil::jpeg_read_image("image.jpg", img);
boost::gil::any_image< rgb16_image_t>::view_t view(img);

but what next?

Thanks!

Stephan


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net