Boost logo

Boost Users :

Subject: Re: [Boost-users] serialization of an dynamic array to read/write a image in xml
From: Robert Ramey (ramey_at_[hidden])
Date: 2009-09-24 12:27:33


Damien R wrote:
> Markus Bader wrote:
>> Hello
>>
>> I like to store and load images from a xml file.
>> My problem is now the dynamic array which keeps the image data. I do
>> not want to copy it into a container and I do not want to go in a for
>> loop over every pixel.
>> Any suggestions?
> ar & make_nvp("data", make_array(mpData, mWidth*mHeight)) ?

also you could try

ar & make_nvp("data", binary_object(sizeof(mpData), & mpData))

the cost of xml archiving is going to dominate even if you were to use
the default serialization method whch loops over every pixel. XML
just has a lot of extra characters and requires parsing - it has to be
much slower then a binary format.

Robert Ramey


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