1
///////////////////////////////////////////////////////////////////////////
3
// Copyright (c) 2003, Industrial Light & Magic, a division of Lucas
6
// All rights reserved.
8
// Redistribution and use in source and binary forms, with or without
9
// modification, are permitted provided that the following conditions are
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
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.
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.
33
///////////////////////////////////////////////////////////////////////////
36
//-----------------------------------------------------------------------------
38
// Optional Standard Attributes
40
//-----------------------------------------------------------------------------
42
#include <ImfStandardAttributes.h>
45
#define IMF_STRING(name) #name
47
#define IMF_STD_ATTRIBUTE_IMP(name,suffix,type) \
50
add##suffix (Header &header, const type &value) \
52
header.insert (IMF_STRING (name), TypedAttribute<type> (value)); \
56
has##suffix (const Header &header) \
58
return header.findTypedAttribute <TypedAttribute <type> > \
59
(IMF_STRING (name)) != 0; \
62
const TypedAttribute<type> & \
63
name##Attribute (const Header &header) \
65
return header.typedAttribute <TypedAttribute <type> > \
66
(IMF_STRING (name)); \
69
TypedAttribute<type> & \
70
name##Attribute (Header &header) \
72
return header.typedAttribute <TypedAttribute <type> > \
73
(IMF_STRING (name)); \
77
name (const Header &header) \
79
return name##Attribute(header).value(); \
83
name (Header &header) \
85
return name##Attribute(header).value(); \
92
IMF_STD_ATTRIBUTE_IMP (chromaticities, Chromaticities, Chromaticities)
93
IMF_STD_ATTRIBUTE_IMP (whiteLuminance, WhiteLuminance, float)
94
IMF_STD_ATTRIBUTE_IMP (adoptedNeutral, AdoptedNeutral, Imath::V2f)
95
IMF_STD_ATTRIBUTE_IMP (renderingTransform, RenderingTransform, std::string)
96
IMF_STD_ATTRIBUTE_IMP (lookModTransform, LookModTransform, std::string)
97
IMF_STD_ATTRIBUTE_IMP (xDensity, XDensity, float)
98
IMF_STD_ATTRIBUTE_IMP (owner, Owner, std::string)
99
IMF_STD_ATTRIBUTE_IMP (comments, Comments, std::string)
100
IMF_STD_ATTRIBUTE_IMP (capDate, CapDate, std::string)
101
IMF_STD_ATTRIBUTE_IMP (utcOffset, UtcOffset, float)
102
IMF_STD_ATTRIBUTE_IMP (longitude, Longitude, float)
103
IMF_STD_ATTRIBUTE_IMP (latitude, Latitude, float)
104
IMF_STD_ATTRIBUTE_IMP (altitude, Altitude, float)
105
IMF_STD_ATTRIBUTE_IMP (focus, Focus, float)
106
IMF_STD_ATTRIBUTE_IMP (expTime, ExpTime, float)
107
IMF_STD_ATTRIBUTE_IMP (aperture, Aperture, float)
108
IMF_STD_ATTRIBUTE_IMP (isoSpeed, IsoSpeed, float)
109
IMF_STD_ATTRIBUTE_IMP (envmap, Envmap, Envmap)
110
IMF_STD_ATTRIBUTE_IMP (keyCode, KeyCode, KeyCode)
111
IMF_STD_ATTRIBUTE_IMP (timeCode, TimeCode, TimeCode)
112
IMF_STD_ATTRIBUTE_IMP (wrapmodes, Wrapmodes, std::string)
113
IMF_STD_ATTRIBUTE_IMP (framesPerSecond, FramesPerSecond, Rational)