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