openexr-devel
[Top][All Lists]
Advanced

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

Re: [Openexr-devel] Changing the Header


From: Florian Kainz
Subject: Re: [Openexr-devel] Changing the Header
Date: Wed, 19 Oct 2005 11:03:44 -0700
User-agent: Mozilla Thunderbird 1.0 (X11/20041207)

Hi Barnaby,

every Header object has a "compression" attribute; you don't
have to insert a new one.  You can change the value of the
compression attribute like this:

    header.compression() = PXR24_COMPRESSION;

Your way of setting the attribute,

header.insert ("compression", Imf::CompressionAttribute (Imf::PIZ_COMPRESSION));

should work, too.

Regarding the Visual C++ compiler warnings: the compiler is
right, you have to use /GR to enable run-time type information;
otherwise OpenEXR will not work.

According to a Visual C++ expert from LucasArts, /GR does not
degrade performance.  (Enabling run-time type information did
affect performance in VC6, but this was fixed in VC7.)

Florian



Barnaby Robson wrote:
I noticed how easy it is to get the compression attribute from the header with the Imf::Header function compression() but there seems to be an issue when setting compression
in a pre-existing header.
I am using the insert function like so to set Piz Compression (which, by the way, is amazing) header.insert ("compression", Imf::CompressionAttribute (Imf::PIZ_COMPRESSION)); which is really just shorthand for saying this ... // const Imf::Compression comp = Imf::PIZ_COMPRESSION;
// Imf::TypedAttribute<Imf::Compression> attr(comp);
// header.insert("compression", attr);
if I type it either way I get a long warning in .NET about a dynamic cast C:\dev\rd\libs\3rdparty\OpenEXR\vc\vc7\include\IlmImf\ImfAttribute.h(355) : warning C4541: 'dynamic_cast' used on polymorphic type 'Imf::Attribute' with /GR-; unpredictable behavior may result C:\dev\rd\libs\3rdparty\OpenEXR\vc\vc7\include\Imath\ImathVec.h(234) : while compiling class-template member function 'const Imf::TypedAttribute<T> *Imf::TypedAttribute<T>::cast(const Imf::Attribute *)'
with
[
T=Imf::Compression
]
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xstring(521) : while compiling class-template member function 'Imf::TypedAttribute<T>::TypedAttribute(void)'
with
[
T=Imf::Compression
]
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xmemory(156) : while compiling class-template member function 'Imf::TypedAttribute<T>::~TypedAttribute(void)'
with
[
T=Imf::Compression
]
C:\dev\rd\libs\3rdparty\OpenEXR\vc\vc7\include\IlmImf\ImfCompressionAttribute.h(54) : see reference to class template instantiation 'Imf::TypedAttribute<T>' being compiled
with
[
T=Imf::Compression
]
-----------------------------------------
I can stop this warning by adding the /GR flag to my compiler. The option (/GR) adds code to check object types at run time.
I was worried that this might slow down the code though ..
What do you guys do and what do you suggest ? Thanks barnaby

------------------------------------------------------------------------

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




reply via email to

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