openexr-devel
[Top][All Lists]
Advanced

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

RE: [Openexr-devel] previews...


From: wcoles
Subject: RE: [Openexr-devel] previews...
Date: Tue, 24 Jun 2003 11:16:59 +0100

Hi Florian,

> I would prefer to use a single attribute with three fields:

Yes, that's a neater way. I get worried when I see fixed structures because
of versioning problems. But if the preview format ever changed (probably
unlikely, but I've assumed that before... :)), it could just use a different
attribute name.

> attributes are specified when an image file is opened, but if a program
> generates an image incrementally, one scan line at a time, and each scan
> line is written as soon as it is available, then the preview image is not
> known when the file is opened for writing.  We will have to come up a way
> to store the preview image pixels in the file later, after the header, and
> possibly some or all of the pixel data have been written.

Ack, that's a good point, I'm currently generating my images in memory and
didn't think of that :-/

Perhaps the application can 'reserve' the preview space (ie. Create a
preview attribute with a specified width\height but with black pixels) when
opening the file and fill in the required data later.

ImfHeader
{
        bool reservePreview( int width, int height );
        bool writePreviewImage( byte *pPixels, int length );
};

If 'reservePreview' is not called, no preview is written. If it is called
and a preview image is not written using 'writePreviewImage' the file fails.
If the length parameter passed to writePreviewImage does not match the image
size, the file fails. If 'reservePreview' is not called but
'writePreviewImage' is, then 'writePreviewImage' returns false but the file
is still written.

'reservePreview' could store the position within the stream for the preview
as well as the image size allowing a direct seek and write when
'writePreviewImage' is called.

Seems a bit hacky to me though, sorry, just putting it out there :)

As an aside, could anyone tell me what 'exr' is short for? I've looked at
the documentation and not found anything, taking a stab at it I'd guess
'EXtended Resolution' or something, but probably miles away?

Thanks,
Wayney

-Virus scanned and cleared ok




reply via email to

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