|
Boost Users : |
Subject: Re: [Boost-users] [GIL] GIL and FreeImage interaction sample code suggestions ?
From: Christian Henning (chhenning_at_[hidden])
Date: 2009-09-02 11:35:23
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<rotoglup_at_[hidden]> wrote:
> 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_io/image_io.hpp
> http://code.google.com/p/rotoglup-scratchpad/source/browse/trunk/rtgu/image_io/image_io.cpp
>
> http://code.google.com/p/rotoglup-scratchpad/source/browse/trunk/rtgu/image_io/gil/borrowed_image.hpp
>
> 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_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
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