Boost logo

Boost Users :

Subject: Re: [Boost-users] [GIL] wrapper for QImage
From: Tomas Van Verrewegen (tomasvanverrewegen_at_[hidden])
Date: 2009-02-21 16:48:43


Thanks for the swift reply, Christian.

> This wrapper made it possible to use the OpenCV algorithms. It's uses
> shared_ptr to provide value semantics. I would think you can do
> something similar with QImage. Unfortunately, I know nothing about
> QImage. But I can offer more help with more informations.

I quickly glanced your code. Unfortunately it seems to take the opposite
approach of what I had in mind:
You copy the GIL pixel data into an IPL image, then you do some cool stuff to
these pixels I suppose, and at the end you might copy everything back to a GIL
image to finish up...
What I want to do is provide GIL with a way of directly accessing the pixel
data owned by a QImage, so all GIL algorithms can work on this data, no
copying back and forth.
I haven't dug my way to the bottom of the GIL code yet, but it seems to me GIL
is designed not to care about the representation of a pixel/an image, so it
should be quite straightforward to provide some sort of qimage_iterator and
create a view on a qimage.

from the GIL design guide:
> Standard image views can be constructed from raw data of any supported color
> space, bit depth, channel ordering or planar vs. interleaved structure.
> Interleaved views are constructed using interleaved_view, supplying the
> image dimensions, number of bytes per row, and a pointer to the first pixel:
> template <typename Iterator>
> image_view<...>
> interleaved_view(ptrdiff_t width, ptrdiff_t height, Iterator pixels,
> ptrdiff_t rowsize);


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