1///////////////////////////////////////////////////////////////////////////
2//
3// Copyright (c) 2004, 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//
39//	class V2iAttribute
40//	class V2fAttribute
41//	class V3iAttribute
42//	class V3fAttribute
43//
44//-----------------------------------------------------------------------------
45
46#include <ImfVecAttribute.h>
47
48
49namespace Imf {
50
51
52template <>
53const char *
54V2iAttribute::staticTypeName ()
55{
56    return "v2i";
57}
58
59
60template <>
61void
62V2iAttribute::writeValueTo (OStream &os, int version) const
63{
64    Xdr::write <StreamIO> (os, _value.x);
65    Xdr::write <StreamIO> (os, _value.y);
66}
67
68
69template <>
70void
71V2iAttribute::readValueFrom (IStream &is, int size, int version)
72{
73    Xdr::read <StreamIO> (is, _value.x);
74    Xdr::read <StreamIO> (is, _value.y);
75}
76
77
78template <>
79const char *
80V2fAttribute::staticTypeName ()
81{
82    return "v2f";
83}
84
85
86template <>
87void
88V2fAttribute::writeValueTo (OStream &os, int version) const
89{
90    Xdr::write <StreamIO> (os, _value.x);
91    Xdr::write <StreamIO> (os, _value.y);
92}
93
94
95template <>
96void
97V2fAttribute::readValueFrom (IStream &is, int size, int version)
98{
99    Xdr::read <StreamIO> (is, _value.x);
100    Xdr::read <StreamIO> (is, _value.y);
101}
102
103
104template <>
105const char *
106V3iAttribute::staticTypeName ()
107{
108    return "v3i";
109}
110
111
112template <>
113void
114V3iAttribute::writeValueTo (OStream &os, int version) const
115{
116    Xdr::write <StreamIO> (os, _value.x);
117    Xdr::write <StreamIO> (os, _value.y);
118    Xdr::write <StreamIO> (os, _value.z);
119}
120
121
122template <>
123void
124V3iAttribute::readValueFrom (IStream &is, int size, int version)
125{
126    Xdr::read <StreamIO> (is, _value.x);
127    Xdr::read <StreamIO> (is, _value.y);
128    Xdr::read <StreamIO> (is, _value.z);
129}
130
131
132template <>
133const char *
134V3fAttribute::staticTypeName ()
135{
136    return "v3f";
137}
138
139
140template <>
141void
142V3fAttribute::writeValueTo (OStream &os, int version) const
143{
144    Xdr::write <StreamIO> (os, _value.x);
145    Xdr::write <StreamIO> (os, _value.y);
146    Xdr::write <StreamIO> (os, _value.z);
147}
148
149
150template <>
151void
152V3fAttribute::readValueFrom (IStream &is, int size, int version)
153{
154    Xdr::read <StreamIO> (is, _value.x);
155    Xdr::read <StreamIO> (is, _value.y);
156    Xdr::read <StreamIO> (is, _value.z);
157}
158
159
160} // namespace Imf
161