Boost logo

Boost :

Subject: Re: [boost] best way to serialize a GIL image
From: Sohail Somani (sohail_at_[hidden])
Date: 2009-03-25 20:36:41


Kenny Riddile wrote:
> My question wasn't about how to write a GIL image to a file, it was
> about the most efficient way to serialize it to a boost archive. The
> class that owns the GIL image in my case also has other state and the
> entire class instance needs to be serializable. Obviously I can get the
> raw data and serialize that out, but when reading in from the archive
> wouldn't I have to read it in to a temporary buffer and then use that
> buffer to reconstruct the GIL image? I'd rather not perform extra
> copies of pixel data like that if I don't have to.

In recent versions of Boost, a save_array function is available. This
might be the most efficient way to do it. However, I don't know what
needs to be done when deserializing so you should look into it more :-)

-- 
Sohail Somani
http://uint32t.blogspot.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk