| 1 | // |
| 2 | // SPDX-License-Identifier: BSD-3-Clause |
| 3 | // Copyright (c) Contributors to the OpenEXR Project. |
| 4 | // |
| 5 | |
| 6 | #ifndef INCLUDED_IMF_KEY_CODE_H |
| 7 | #define INCLUDED_IMF_KEY_CODE_H |
| 8 | |
| 9 | //----------------------------------------------------------------------------- |
| 10 | // |
| 11 | // class KeyCode |
| 12 | // |
| 13 | // A KeyCode object uniquely identifies a motion picture film frame. |
| 14 | // The following fields specifiy film manufacturer, film type, film |
| 15 | // roll and the frame's position within the roll: |
| 16 | // |
| 17 | // filmMfcCode film manufacturer code |
| 18 | // range: 0 - 99 |
| 19 | // |
| 20 | // filmType film type code |
| 21 | // range: 0 - 99 |
| 22 | // |
| 23 | // prefix prefix to identify film roll |
| 24 | // range: 0 - 999999 |
| 25 | // |
| 26 | // count count, increments once every perfsPerCount |
| 27 | // perforations (see below) |
| 28 | // range: 0 - 9999 |
| 29 | // |
| 30 | // perfOffset offset of frame, in perforations from |
| 31 | // zero-frame reference mark |
| 32 | // range: 0 - 119 |
| 33 | // |
| 34 | // perfsPerFrame number of perforations per frame |
| 35 | // range: 1 - 15 |
| 36 | // |
| 37 | // typical values: |
| 38 | // |
| 39 | // 1 for 16mm film |
| 40 | // 3, 4, or 8 for 35mm film |
| 41 | // 5, 8 or 15 for 65mm film |
| 42 | // |
| 43 | // perfsPerCount number of perforations per count |
| 44 | // range: 20 - 120 |
| 45 | // |
| 46 | // typical values: |
| 47 | // |
| 48 | // 20 for 16mm film |
| 49 | // 64 for 35mm film |
| 50 | // 80 or 120 for 65mm film |
| 51 | // |
| 52 | // For more information about the interpretation of those fields see |
| 53 | // the following standards and recommended practice publications: |
| 54 | // |
| 55 | // SMPTE 254 Motion-Picture Film (35-mm) - Manufacturer-Printed |
| 56 | // Latent Image Identification Information |
| 57 | // |
| 58 | // SMPTE 268M File Format for Digital Moving-Picture Exchange (DPX) |
| 59 | // (section 6.1) |
| 60 | // |
| 61 | // SMPTE 270 Motion-Picture Film (65-mm) - Manufacturer- Printed |
| 62 | // Latent Image Identification Information |
| 63 | // |
| 64 | // SMPTE 271 Motion-Picture Film (16-mm) - Manufacturer- Printed |
| 65 | // Latent Image Identification Information |
| 66 | // |
| 67 | //----------------------------------------------------------------------------- |
| 68 | #include "ImfExport.h" |
| 69 | #include "ImfNamespace.h" |
| 70 | |
| 71 | OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER |
| 72 | |
| 73 | |
| 74 | class IMF_EXPORT_TYPE KeyCode |
| 75 | { |
| 76 | public: |
| 77 | |
| 78 | //------------------------------------- |
| 79 | // Constructors and assignment operator |
| 80 | //------------------------------------- |
| 81 | |
| 82 | IMF_EXPORT |
| 83 | KeyCode (int filmMfcCode = 0, |
| 84 | int filmType = 0, |
| 85 | int prefix = 0, |
| 86 | int count = 0, |
| 87 | int perfOffset = 0, |
| 88 | int perfsPerFrame = 4, |
| 89 | int perfsPerCount = 64); |
| 90 | |
| 91 | IMF_EXPORT |
| 92 | KeyCode (const KeyCode &other); |
| 93 | ~KeyCode() = default; |
| 94 | IMF_EXPORT |
| 95 | KeyCode & operator = (const KeyCode &other); |
| 96 | |
| 97 | |
| 98 | //---------------------------- |
| 99 | // Access to individual fields |
| 100 | //---------------------------- |
| 101 | |
| 102 | IMF_EXPORT |
| 103 | int filmMfcCode () const; |
| 104 | IMF_EXPORT |
| 105 | void setFilmMfcCode (int filmMfcCode); |
| 106 | |
| 107 | IMF_EXPORT |
| 108 | int filmType () const; |
| 109 | IMF_EXPORT |
| 110 | void setFilmType (int filmType); |
| 111 | |
| 112 | IMF_EXPORT |
| 113 | int prefix () const; |
| 114 | IMF_EXPORT |
| 115 | void setPrefix (int prefix); |
| 116 | |
| 117 | IMF_EXPORT |
| 118 | int count () const; |
| 119 | IMF_EXPORT |
| 120 | void setCount (int count); |
| 121 | |
| 122 | IMF_EXPORT |
| 123 | int perfOffset () const; |
| 124 | IMF_EXPORT |
| 125 | void setPerfOffset (int perfOffset); |
| 126 | |
| 127 | IMF_EXPORT |
| 128 | int perfsPerFrame () const; |
| 129 | IMF_EXPORT |
| 130 | void setPerfsPerFrame (int perfsPerFrame); |
| 131 | |
| 132 | IMF_EXPORT |
| 133 | int perfsPerCount () const; |
| 134 | IMF_EXPORT |
| 135 | void setPerfsPerCount (int perfsPerCount); |
| 136 | |
| 137 | private: |
| 138 | |
| 139 | int _filmMfcCode; |
| 140 | int _filmType; |
| 141 | int _prefix; |
| 142 | int _count; |
| 143 | int _perfOffset; |
| 144 | int _perfsPerFrame; |
| 145 | int _perfsPerCount; |
| 146 | }; |
| 147 | |
| 148 | |
| 149 | OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT |
| 150 | |
| 151 | |
| 152 | |
| 153 | |
| 154 | |
| 155 | #endif |
| 156 | |