1 ///////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (c) 2003, Industrial Light & Magic, a division of Lucas
4 // Digital Ltd. LLC
5 //
6 // All rights reserved.
7 //
8 // Redistribution and use in source and binary forms, with or without
9 // modification, are permitted provided that the following conditions are
10 // met:
11 // *       Redistributions of source code must retain the above copyright
12 // notice, this list of conditions and the following disclaimer.
13 // *       Redistributions in binary form must reproduce the above
14 // copyright notice, this list of conditions and the following disclaimer
15 // in the documentation and/or other materials provided with the
16 // distribution.
17 // *       Neither the name of Industrial Light & Magic nor the names of
18 // its contributors may be used to endorse or promote products derived
19 // from this software without specific prior written permission.
20 //
21 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 //
33 ///////////////////////////////////////////////////////////////////////////
34 
35 
36 //-----------------------------------------------------------------------------
37 //
38 //	Optional Standard Attributes
39 //
40 //-----------------------------------------------------------------------------
41 
42 #include <ImfStandardAttributes.h>
43 
44 
45 #define IMF_STRING(name) #name
46 
47 #define IMF_STD_ATTRIBUTE_IMP(name,suffix,type)				 \
48 									 \
49     void								 \
50     add##suffix (Header &header, const type &value)			 \
51     {									 \
52 	header.insert (IMF_STRING (name), TypedAttribute<type> (value)); \
53     }									 \
54 									 \
55     bool								 \
56     has##suffix (const Header &header)					 \
57     {									 \
58 	return header.findTypedAttribute <TypedAttribute <type> >	 \
59 		(IMF_STRING (name)) != 0;				 \
60     }									 \
61 									 \
62     const TypedAttribute<type> &					 \
63     name##Attribute (const Header &header)				 \
64     {									 \
65 	return header.typedAttribute <TypedAttribute <type> >		 \
66 		(IMF_STRING (name));					 \
67     }									 \
68 									 \
69     TypedAttribute<type> &						 \
70     name##Attribute (Header &header)					 \
71     {									 \
72 	return header.typedAttribute <TypedAttribute <type> >		 \
73 		(IMF_STRING (name));					 \
74     }									 \
75 									 \
76     const type &							 \
77     name (const Header &header)						 \
78     {									 \
79 	return name##Attribute(header).value();				 \
80     }									 \
81 									 \
82     type &								 \
83     name (Header &header)						 \
84     {									 \
85 	return name##Attribute(header).value();				 \
86     }
87 
88 #include "ImfNamespace.h"
89 
90 using namespace IMATH_NAMESPACE;
91 using namespace std;
92 
93 OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_ENTER
94 
95 
96 IMF_STD_ATTRIBUTE_IMP (chromaticities, Chromaticities, Chromaticities)
97 IMF_STD_ATTRIBUTE_IMP (whiteLuminance, WhiteLuminance, float)
98 IMF_STD_ATTRIBUTE_IMP (adoptedNeutral, AdoptedNeutral, V2f)
99 IMF_STD_ATTRIBUTE_IMP (renderingTransform, RenderingTransform, string)
100 IMF_STD_ATTRIBUTE_IMP (lookModTransform, LookModTransform, string)
101 IMF_STD_ATTRIBUTE_IMP (xDensity, XDensity, float)
102 IMF_STD_ATTRIBUTE_IMP (owner, Owner, string)
103 IMF_STD_ATTRIBUTE_IMP (comments, Comments, string)
104 IMF_STD_ATTRIBUTE_IMP (capDate, CapDate, string)
105 IMF_STD_ATTRIBUTE_IMP (utcOffset, UtcOffset, float)
106 IMF_STD_ATTRIBUTE_IMP (longitude, Longitude, float)
107 IMF_STD_ATTRIBUTE_IMP (latitude, Latitude, float)
108 IMF_STD_ATTRIBUTE_IMP (altitude, Altitude, float)
109 IMF_STD_ATTRIBUTE_IMP (focus, Focus, float)
110 IMF_STD_ATTRIBUTE_IMP (expTime, ExpTime, float)
111 IMF_STD_ATTRIBUTE_IMP (aperture, Aperture, float)
112 IMF_STD_ATTRIBUTE_IMP (isoSpeed, IsoSpeed, float)
113 IMF_STD_ATTRIBUTE_IMP (envmap, Envmap, Envmap)
114 IMF_STD_ATTRIBUTE_IMP (keyCode, KeyCode, KeyCode)
115 IMF_STD_ATTRIBUTE_IMP (timeCode, TimeCode, TimeCode)
116 IMF_STD_ATTRIBUTE_IMP (wrapmodes, Wrapmodes, string)
117 IMF_STD_ATTRIBUTE_IMP (framesPerSecond, FramesPerSecond, Rational)
118 IMF_STD_ATTRIBUTE_IMP (multiView, MultiView, StringVector)
119 IMF_STD_ATTRIBUTE_IMP (worldToCamera, WorldToCamera, M44f)
120 IMF_STD_ATTRIBUTE_IMP (worldToNDC, WorldToNDC, M44f)
121 IMF_STD_ATTRIBUTE_IMP (deepImageState, DeepImageState, DeepImageState)
122 IMF_STD_ATTRIBUTE_IMP (originalDataWindow, OriginalDataWindow, Box2i)
123 IMF_STD_ATTRIBUTE_IMP (dwaCompressionLevel, DwaCompressionLevel, float)
124 
125 OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_EXIT
126