/src/openexr/src/lib/OpenEXR/ImfTimeCodeAttribute.cpp
Line | Count | Source |
1 | | // |
2 | | // SPDX-License-Identifier: BSD-3-Clause |
3 | | // Copyright (c) Contributors to the OpenEXR Project. |
4 | | // |
5 | | |
6 | | //----------------------------------------------------------------------------- |
7 | | // |
8 | | // class TimeCodeAttribute |
9 | | // |
10 | | //----------------------------------------------------------------------------- |
11 | | |
12 | | #define COMPILING_IMF_TIMECODE_ATTRIBUTE |
13 | | |
14 | | #include "ImfTimeCodeAttribute.h" |
15 | | |
16 | | #if defined(_MSC_VER) |
17 | | // suppress warning about non-exported base classes |
18 | | # pragma warning(disable : 4251) |
19 | | # pragma warning(disable : 4275) |
20 | | #endif |
21 | | |
22 | | OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_ENTER |
23 | | |
24 | | using namespace OPENEXR_IMF_INTERNAL_NAMESPACE; |
25 | | |
26 | | template <> |
27 | | IMF_EXPORT const char* |
28 | | TimeCodeAttribute::staticTypeName () |
29 | 1 | { |
30 | 1 | return "timecode"; |
31 | 1 | } |
32 | | |
33 | | template <> |
34 | | IMF_EXPORT void |
35 | | TimeCodeAttribute::writeValueTo ( |
36 | | OPENEXR_IMF_INTERNAL_NAMESPACE::OStream& os, int version) const |
37 | 0 | { |
38 | 0 | Xdr::write<StreamIO> (os, _value.timeAndFlags ()); |
39 | 0 | Xdr::write<StreamIO> (os, _value.userData ()); |
40 | 0 | } |
41 | | |
42 | | template <> |
43 | | IMF_EXPORT void |
44 | | TimeCodeAttribute::readValueFrom ( |
45 | | OPENEXR_IMF_INTERNAL_NAMESPACE::IStream& is, int size, int version) |
46 | 0 | { |
47 | 0 | unsigned int tmp; |
48 | |
|
49 | 0 | Xdr::read<StreamIO> (is, tmp); |
50 | 0 | _value.setTimeAndFlags (tmp); |
51 | |
|
52 | 0 | Xdr::read<StreamIO> (is, tmp); |
53 | 0 | _value.setUserData (tmp); |
54 | 0 | } |
55 | | |
56 | | template class IMF_EXPORT_TEMPLATE_INSTANCE |
57 | | TypedAttribute<OPENEXR_IMF_INTERNAL_NAMESPACE::TimeCode>; |
58 | | |
59 | | OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_EXIT |