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
Openexr-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/openexr-devel


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

Reply via email to