/src/freeimage-svn/FreeImage/trunk/Source/OpenEXR/IlmImf/ImfMatrixAttribute.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /////////////////////////////////////////////////////////////////////////// |
2 | | // |
3 | | // Copyright (c) 2002, 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 M33fAttribute |
40 | | // class M33dAttribute |
41 | | // class M44fAttribute |
42 | | // class M44dAttribute |
43 | | // |
44 | | //----------------------------------------------------------------------------- |
45 | | |
46 | | #include <ImfMatrixAttribute.h> |
47 | | |
48 | | |
49 | | OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_ENTER |
50 | | |
51 | | |
52 | | using namespace OPENEXR_IMF_INTERNAL_NAMESPACE; |
53 | | |
54 | | |
55 | | template <> |
56 | | const char * |
57 | | M33fAttribute::staticTypeName () |
58 | 2 | { |
59 | 2 | return "m33f"; |
60 | 2 | } |
61 | | |
62 | | |
63 | | template <> |
64 | | void |
65 | | M33fAttribute::writeValueTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &os, int version) const |
66 | 0 | { |
67 | 0 | Xdr::write <StreamIO> (os, _value[0][0]); |
68 | 0 | Xdr::write <StreamIO> (os, _value[0][1]); |
69 | 0 | Xdr::write <StreamIO> (os, _value[0][2]); |
70 | |
|
71 | 0 | Xdr::write <StreamIO> (os, _value[1][0]); |
72 | 0 | Xdr::write <StreamIO> (os, _value[1][1]); |
73 | 0 | Xdr::write <StreamIO> (os, _value[1][2]); |
74 | |
|
75 | 0 | Xdr::write <StreamIO> (os, _value[2][0]); |
76 | 0 | Xdr::write <StreamIO> (os, _value[2][1]); |
77 | 0 | Xdr::write <StreamIO> (os, _value[2][2]); |
78 | 0 | } |
79 | | |
80 | | |
81 | | template <> |
82 | | void |
83 | | M33fAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &is, int size, int version) |
84 | 0 | { |
85 | 0 | Xdr::read <StreamIO> (is, _value[0][0]); |
86 | 0 | Xdr::read <StreamIO> (is, _value[0][1]); |
87 | 0 | Xdr::read <StreamIO> (is, _value[0][2]); |
88 | |
|
89 | 0 | Xdr::read <StreamIO> (is, _value[1][0]); |
90 | 0 | Xdr::read <StreamIO> (is, _value[1][1]); |
91 | 0 | Xdr::read <StreamIO> (is, _value[1][2]); |
92 | |
|
93 | 0 | Xdr::read <StreamIO> (is, _value[2][0]); |
94 | 0 | Xdr::read <StreamIO> (is, _value[2][1]); |
95 | 0 | Xdr::read <StreamIO> (is, _value[2][2]); |
96 | 0 | } |
97 | | |
98 | | |
99 | | template <> |
100 | | const char * |
101 | | M33dAttribute::staticTypeName () |
102 | 2 | { |
103 | 2 | return "m33d"; |
104 | 2 | } |
105 | | |
106 | | |
107 | | template <> |
108 | | void |
109 | | M33dAttribute::writeValueTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &os, int version) const |
110 | 0 | { |
111 | 0 | Xdr::write <StreamIO> (os, _value[0][0]); |
112 | 0 | Xdr::write <StreamIO> (os, _value[0][1]); |
113 | 0 | Xdr::write <StreamIO> (os, _value[0][2]); |
114 | |
|
115 | 0 | Xdr::write <StreamIO> (os, _value[1][0]); |
116 | 0 | Xdr::write <StreamIO> (os, _value[1][1]); |
117 | 0 | Xdr::write <StreamIO> (os, _value[1][2]); |
118 | |
|
119 | 0 | Xdr::write <StreamIO> (os, _value[2][0]); |
120 | 0 | Xdr::write <StreamIO> (os, _value[2][1]); |
121 | 0 | Xdr::write <StreamIO> (os, _value[2][2]); |
122 | 0 | } |
123 | | |
124 | | |
125 | | template <> |
126 | | void |
127 | | M33dAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &is, int size, int version) |
128 | 0 | { |
129 | 0 | Xdr::read <StreamIO> (is, _value[0][0]); |
130 | 0 | Xdr::read <StreamIO> (is, _value[0][1]); |
131 | 0 | Xdr::read <StreamIO> (is, _value[0][2]); |
132 | |
|
133 | 0 | Xdr::read <StreamIO> (is, _value[1][0]); |
134 | 0 | Xdr::read <StreamIO> (is, _value[1][1]); |
135 | 0 | Xdr::read <StreamIO> (is, _value[1][2]); |
136 | |
|
137 | 0 | Xdr::read <StreamIO> (is, _value[2][0]); |
138 | 0 | Xdr::read <StreamIO> (is, _value[2][1]); |
139 | 0 | Xdr::read <StreamIO> (is, _value[2][2]); |
140 | 0 | } |
141 | | |
142 | | |
143 | | template <> |
144 | | const char * |
145 | | M44fAttribute::staticTypeName () |
146 | 2 | { |
147 | 2 | return "m44f"; |
148 | 2 | } |
149 | | |
150 | | |
151 | | template <> |
152 | | void |
153 | | M44fAttribute::writeValueTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &os, int version) const |
154 | 0 | { |
155 | 0 | Xdr::write <StreamIO> (os, _value[0][0]); |
156 | 0 | Xdr::write <StreamIO> (os, _value[0][1]); |
157 | 0 | Xdr::write <StreamIO> (os, _value[0][2]); |
158 | 0 | Xdr::write <StreamIO> (os, _value[0][3]); |
159 | |
|
160 | 0 | Xdr::write <StreamIO> (os, _value[1][0]); |
161 | 0 | Xdr::write <StreamIO> (os, _value[1][1]); |
162 | 0 | Xdr::write <StreamIO> (os, _value[1][2]); |
163 | 0 | Xdr::write <StreamIO> (os, _value[1][3]); |
164 | |
|
165 | 0 | Xdr::write <StreamIO> (os, _value[2][0]); |
166 | 0 | Xdr::write <StreamIO> (os, _value[2][1]); |
167 | 0 | Xdr::write <StreamIO> (os, _value[2][2]); |
168 | 0 | Xdr::write <StreamIO> (os, _value[2][3]); |
169 | |
|
170 | 0 | Xdr::write <StreamIO> (os, _value[3][0]); |
171 | 0 | Xdr::write <StreamIO> (os, _value[3][1]); |
172 | 0 | Xdr::write <StreamIO> (os, _value[3][2]); |
173 | 0 | Xdr::write <StreamIO> (os, _value[3][3]); |
174 | 0 | } |
175 | | |
176 | | |
177 | | template <> |
178 | | void |
179 | | M44fAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &is, int size, int version) |
180 | 0 | { |
181 | 0 | Xdr::read <StreamIO> (is, _value[0][0]); |
182 | 0 | Xdr::read <StreamIO> (is, _value[0][1]); |
183 | 0 | Xdr::read <StreamIO> (is, _value[0][2]); |
184 | 0 | Xdr::read <StreamIO> (is, _value[0][3]); |
185 | |
|
186 | 0 | Xdr::read <StreamIO> (is, _value[1][0]); |
187 | 0 | Xdr::read <StreamIO> (is, _value[1][1]); |
188 | 0 | Xdr::read <StreamIO> (is, _value[1][2]); |
189 | 0 | Xdr::read <StreamIO> (is, _value[1][3]); |
190 | |
|
191 | 0 | Xdr::read <StreamIO> (is, _value[2][0]); |
192 | 0 | Xdr::read <StreamIO> (is, _value[2][1]); |
193 | 0 | Xdr::read <StreamIO> (is, _value[2][2]); |
194 | 0 | Xdr::read <StreamIO> (is, _value[2][3]); |
195 | |
|
196 | 0 | Xdr::read <StreamIO> (is, _value[3][0]); |
197 | 0 | Xdr::read <StreamIO> (is, _value[3][1]); |
198 | 0 | Xdr::read <StreamIO> (is, _value[3][2]); |
199 | 0 | Xdr::read <StreamIO> (is, _value[3][3]); |
200 | 0 | } |
201 | | |
202 | | |
203 | | template <> |
204 | | const char * |
205 | | M44dAttribute::staticTypeName () |
206 | 2 | { |
207 | 2 | return "m44d"; |
208 | 2 | } |
209 | | |
210 | | |
211 | | template <> |
212 | | void |
213 | | M44dAttribute::writeValueTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &os, int version) const |
214 | 0 | { |
215 | 0 | Xdr::write <StreamIO> (os, _value[0][0]); |
216 | 0 | Xdr::write <StreamIO> (os, _value[0][1]); |
217 | 0 | Xdr::write <StreamIO> (os, _value[0][2]); |
218 | 0 | Xdr::write <StreamIO> (os, _value[0][3]); |
219 | |
|
220 | 0 | Xdr::write <StreamIO> (os, _value[1][0]); |
221 | 0 | Xdr::write <StreamIO> (os, _value[1][1]); |
222 | 0 | Xdr::write <StreamIO> (os, _value[1][2]); |
223 | 0 | Xdr::write <StreamIO> (os, _value[1][3]); |
224 | |
|
225 | 0 | Xdr::write <StreamIO> (os, _value[2][0]); |
226 | 0 | Xdr::write <StreamIO> (os, _value[2][1]); |
227 | 0 | Xdr::write <StreamIO> (os, _value[2][2]); |
228 | 0 | Xdr::write <StreamIO> (os, _value[2][3]); |
229 | |
|
230 | 0 | Xdr::write <StreamIO> (os, _value[3][0]); |
231 | 0 | Xdr::write <StreamIO> (os, _value[3][1]); |
232 | 0 | Xdr::write <StreamIO> (os, _value[3][2]); |
233 | 0 | Xdr::write <StreamIO> (os, _value[3][3]); |
234 | 0 | } |
235 | | |
236 | | |
237 | | template <> |
238 | | void |
239 | | M44dAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &is, int size, int version) |
240 | 0 | { |
241 | 0 | Xdr::read <StreamIO> (is, _value[0][0]); |
242 | 0 | Xdr::read <StreamIO> (is, _value[0][1]); |
243 | 0 | Xdr::read <StreamIO> (is, _value[0][2]); |
244 | 0 | Xdr::read <StreamIO> (is, _value[0][3]); |
245 | |
|
246 | 0 | Xdr::read <StreamIO> (is, _value[1][0]); |
247 | 0 | Xdr::read <StreamIO> (is, _value[1][1]); |
248 | 0 | Xdr::read <StreamIO> (is, _value[1][2]); |
249 | 0 | Xdr::read <StreamIO> (is, _value[1][3]); |
250 | |
|
251 | 0 | Xdr::read <StreamIO> (is, _value[2][0]); |
252 | 0 | Xdr::read <StreamIO> (is, _value[2][1]); |
253 | 0 | Xdr::read <StreamIO> (is, _value[2][2]); |
254 | 0 | Xdr::read <StreamIO> (is, _value[2][3]); |
255 | |
|
256 | 0 | Xdr::read <StreamIO> (is, _value[3][0]); |
257 | 0 | Xdr::read <StreamIO> (is, _value[3][1]); |
258 | 0 | Xdr::read <StreamIO> (is, _value[3][2]); |
259 | 0 | Xdr::read <StreamIO> (is, _value[3][3]); |
260 | 0 | } |
261 | | |
262 | | |
263 | | OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_EXIT |