Nicolas, glad you like using boost::gil. Did you notice that gil comes
with an io extension? Also, what image formats can your extension read
and write?
Regards,
Christian
On Wed, Sep 2, 2009 at 11:16 AM, Nicolas Lelong
Hi,
FWIW I'm considering boost GIL to implement the few image algorithms I need, and I need proper image I/O on top of that.
As I'm using FreeImage in my current codebase, I thought about exposing FreeImage image memory layout to GIL. You can find the, quite simplistic, source code here :
http://code.google.com/p/rotoglup-scratchpad/source/browse/trunk/rtgu/image_... http://code.google.com/p/rotoglup-scratchpad/source/browse/trunk/rtgu/image_...
http://code.google.com/p/rotoglup-scratchpad/source/browse/trunk/rtgu/image_...
I created a 'borrowed_image' class that mimics the behaviour of gil::image : it is not allocating memory itself, it takes an existing memory buffer and a 'deleter' (under the form of a boost::shared_ptr<void>) as input. This allows to use directly the memory allocated by FreeImage, avoiding extra copy, in case of file input.
Feel free to use the code as a starting point, if you have similar needs, and I'd be glad to have comments about the concept of 'borrowed_image' class, and about its interface, as I feel I'm missing something.
Cheers,
Nicolas.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users