openexr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Openexr-devel] Changing multipart reading


From: Peter Hillman
Subject: Re: [Openexr-devel] Changing multipart reading
Date: Wed, 23 Apr 2014 10:12:24 +1200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

I'm not clear what advantage you have doing this?

I tend not to store InputPart objects. Instead, when reading multiple parts I do something like this:

for(int partnum=0 ; partnum<muiltipartfile.parts() ; ++partnum )
{
InputPart(multipartfile,partnum).setFrameBuffer(...)
}

for(int partnum=0 ; partnum<muiltipartfile.parts() ; ++partnum )
{
InputPart(multipartfile,partnum).readPixels(...)
}

The '...Part' types are effectively shared pointers to hidden '...File' objects maintained in the MultiPart object, with one '..File' object per part. The '...File' object is created the first time a '...Part' object is initialized. Subsequent '...Part' objects constructed on the same part point to the same hidden File object, which makes the constructor fast, and also means that setFrameBuffer is persistent for each part in the file.

So it seems like instead of keeping an InputPart object around and modifying the part it is accessing, you could just keep the MultiPartInputFile object around, and create temporary InputPart objects as you need them.



On 23/04/14 02:29, Gonzalo Garramuno wrote:
I was wondering if there was a way to change the multipart being read from InputPart. Or can I make the request to have that added. Currently only the constructor receives the multipart to read and there's no way to change it other than instantiating another InputPart.

_______________________________________________
Openexr-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/openexr-devel




reply via email to

[Prev in Thread] Current Thread [Next in Thread]