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 V2dAttribute
42 //	class V3iAttribute
43 //	class V3fAttribute
44 //	class V3dAttribute
45 //
46 //-----------------------------------------------------------------------------
47 
48 #include <ImfVecAttribute.h>
49 
50 
51 OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_ENTER
52 
53 using namespace OPENEXR_IMF_INTERNAL_NAMESPACE;
54 
55 template <>
56 const char *
staticTypeName()57 V2iAttribute::staticTypeName ()
58 {
59     return "v2i";
60 }
61 
62 
63 template <>
64 void
writeValueTo(OPENEXR_IMF_INTERNAL_NAMESPACE::OStream & os,int version) const65 V2iAttribute::writeValueTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &os, int version) const
66 {
67     Xdr::write <StreamIO> (os, _value.x);
68     Xdr::write <StreamIO> (os, _value.y);
69 }
70 
71 
72 template <>
73 void
readValueFrom(OPENEXR_IMF_INTERNAL_NAMESPACE::IStream & is,int size,int version)74 V2iAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &is, int size, int version)
75 {
76     Xdr::read <StreamIO> (is, _value.x);
77     Xdr::read <StreamIO> (is, _value.y);
78 }
79 
80 
81 template <>
82 const char *
staticTypeName()83 V2fAttribute::staticTypeName ()
84 {
85     return "v2f";
86 }
87 
88 
89 template <>
90 void
writeValueTo(OPENEXR_IMF_INTERNAL_NAMESPACE::OStream & os,int version) const91 V2fAttribute::writeValueTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &os, int version) const
92 {
93     Xdr::write <StreamIO> (os, _value.x);
94     Xdr::write <StreamIO> (os, _value.y);
95 }
96 
97 
98 template <>
99 void
readValueFrom(OPENEXR_IMF_INTERNAL_NAMESPACE::IStream & is,int size,int version)100 V2fAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &is, int size, int version)
101 {
102     Xdr::read <StreamIO> (is, _value.x);
103     Xdr::read <StreamIO> (is, _value.y);
104 }
105 
106 
107 template <>
108 const char *
staticTypeName()109 V2dAttribute::staticTypeName ()
110 {
111     return "v2d";
112 }
113 
114 
115 template <>
116 void
writeValueTo(OPENEXR_IMF_INTERNAL_NAMESPACE::OStream & os,int version) const117 V2dAttribute::writeValueTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &os, int version) const
118 {
119     Xdr::write <StreamIO> (os, _value.x);
120     Xdr::write <StreamIO> (os, _value.y);
121 }
122 
123 
124 template <>
125 void
readValueFrom(OPENEXR_IMF_INTERNAL_NAMESPACE::IStream & is,int size,int version)126 V2dAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &is, int size, int version)
127 {
128     Xdr::read <StreamIO> (is, _value.x);
129     Xdr::read <StreamIO> (is, _value.y);
130 }
131 
132 
133 template <>
134 const char *
staticTypeName()135 V3iAttribute::staticTypeName ()
136 {
137     return "v3i";
138 }
139 
140 
141 template <>
142 void
writeValueTo(OPENEXR_IMF_INTERNAL_NAMESPACE::OStream & os,int version) const143 V3iAttribute::writeValueTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &os, int version) const
144 {
145     Xdr::write <StreamIO> (os, _value.x);
146     Xdr::write <StreamIO> (os, _value.y);
147     Xdr::write <StreamIO> (os, _value.z);
148 }
149 
150 
151 template <>
152 void
readValueFrom(OPENEXR_IMF_INTERNAL_NAMESPACE::IStream & is,int size,int version)153 V3iAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &is, int size, int version)
154 {
155     Xdr::read <StreamIO> (is, _value.x);
156     Xdr::read <StreamIO> (is, _value.y);
157     Xdr::read <StreamIO> (is, _value.z);
158 }
159 
160 
161 template <>
162 const char *
staticTypeName()163 V3fAttribute::staticTypeName ()
164 {
165     return "v3f";
166 }
167 
168 
169 template <>
170 void
writeValueTo(OPENEXR_IMF_INTERNAL_NAMESPACE::OStream & os,int version) const171 V3fAttribute::writeValueTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &os, int version) const
172 {
173     Xdr::write <StreamIO> (os, _value.x);
174     Xdr::write <StreamIO> (os, _value.y);
175     Xdr::write <StreamIO> (os, _value.z);
176 }
177 
178 
179 template <>
180 void
readValueFrom(OPENEXR_IMF_INTERNAL_NAMESPACE::IStream & is,int size,int version)181 V3fAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &is, int size, int version)
182 {
183     Xdr::read <StreamIO> (is, _value.x);
184     Xdr::read <StreamIO> (is, _value.y);
185     Xdr::read <StreamIO> (is, _value.z);
186 }
187 
188 
189 template <>
190 const char *
staticTypeName()191 V3dAttribute::staticTypeName ()
192 {
193     return "v3d";
194 }
195 
196 
197 template <>
198 void
writeValueTo(OPENEXR_IMF_INTERNAL_NAMESPACE::OStream & os,int version) const199 V3dAttribute::writeValueTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &os, int version) const
200 {
201     Xdr::write <StreamIO> (os, _value.x);
202     Xdr::write <StreamIO> (os, _value.y);
203     Xdr::write <StreamIO> (os, _value.z);
204 }
205 
206 
207 template <>
208 void
readValueFrom(OPENEXR_IMF_INTERNAL_NAMESPACE::IStream & is,int size,int version)209 V3dAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &is, int size, int version)
210 {
211     Xdr::read <StreamIO> (is, _value.x);
212     Xdr::read <StreamIO> (is, _value.y);
213     Xdr::read <StreamIO> (is, _value.z);
214 }
215 
216 
217 OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_EXIT
218