| 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 | #ifndef INCLUDED_IMF_KEY_CODE_H |
| 37 | #define INCLUDED_IMF_KEY_CODE_H |
| 38 | |
| 39 | //----------------------------------------------------------------------------- |
| 40 | // |
| 41 | // class KeyCode |
| 42 | // |
| 43 | // A KeyCode object uniquely identifies a motion picture film frame. |
| 44 | // The following fields specifiy film manufacturer, film type, film |
| 45 | // roll and the frame's position within the roll: |
| 46 | // |
| 47 | // filmMfcCode film manufacturer code |
| 48 | // range: 0 - 99 |
| 49 | // |
| 50 | // filmType film type code |
| 51 | // range: 0 - 99 |
| 52 | // |
| 53 | // prefix prefix to identify film roll |
| 54 | // range: 0 - 999999 |
| 55 | // |
| 56 | // count count, increments once every perfsPerCount |
| 57 | // perforations (see below) |
| 58 | // range: 0 - 9999 |
| 59 | // |
| 60 | // perfOffset offset of frame, in perforations from |
| 61 | // zero-frame reference mark |
| 62 | // range: 0 - 119 |
| 63 | // |
| 64 | // perfsPerFrame number of perforations per frame |
| 65 | // range: 1 - 15 |
| 66 | // |
| 67 | // typical values: |
| 68 | // |
| 69 | // 1 for 16mm film |
| 70 | // 3, 4, or 8 for 35mm film |
| 71 | // 5, 8 or 15 for 65mm film |
| 72 | // |
| 73 | // perfsPerCount number of perforations per count |
| 74 | // range: 20 - 120 |
| 75 | // |
| 76 | // typical values: |
| 77 | // |
| 78 | // 20 for 16mm film |
| 79 | // 64 for 35mm film |
| 80 | // 80 or 120 for 65mm film |
| 81 | // |
| 82 | // For more information about the interpretation of those fields see |
| 83 | // the following standards and recommended practice publications: |
| 84 | // |
| 85 | // SMPTE 254 Motion-Picture Film (35-mm) - Manufacturer-Printed |
| 86 | // Latent Image Identification Information |
| 87 | // |
| 88 | // SMPTE 268M File Format for Digital Moving-Picture Exchange (DPX) |
| 89 | // (section 6.1) |
| 90 | // |
| 91 | // SMPTE 270 Motion-Picture Film (65-mm) - Manufacturer- Printed |
| 92 | // Latent Image Identification Information |
| 93 | // |
| 94 | // SMPTE 271 Motion-Picture Film (16-mm) - Manufacturer- Printed |
| 95 | // Latent Image Identification Information |
| 96 | // |
| 97 | //----------------------------------------------------------------------------- |
| 98 | #include "ImfNamespace.h" |
| 99 | #include "ImfExport.h" |
| 100 | |
| 101 | OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER |
| 102 | |
| 103 | |
| 104 | class KeyCode |
| 105 | { |
| 106 | public: |
| 107 | |
| 108 | //------------------------------------- |
| 109 | // Constructors and assignment operator |
| 110 | //------------------------------------- |
| 111 | |
| 112 | IMF_EXPORT |
| 113 | KeyCode (int filmMfcCode = 0, |
| 114 | int filmType = 0, |
| 115 | int prefix = 0, |
| 116 | int count = 0, |
| 117 | int perfOffset = 0, |
| 118 | int perfsPerFrame = 4, |
| 119 | int perfsPerCount = 64); |
| 120 | |
| 121 | IMF_EXPORT |
| 122 | KeyCode (const KeyCode &other); |
| 123 | IMF_EXPORT |
| 124 | ~KeyCode() = default; |
| 125 | IMF_EXPORT |
| 126 | KeyCode & operator = (const KeyCode &other); |
| 127 | |
| 128 | |
| 129 | //---------------------------- |
| 130 | // Access to individual fields |
| 131 | //---------------------------- |
| 132 | |
| 133 | IMF_EXPORT |
| 134 | int filmMfcCode () const; |
| 135 | IMF_EXPORT |
| 136 | void setFilmMfcCode (int filmMfcCode); |
| 137 | |
| 138 | IMF_EXPORT |
| 139 | int filmType () const; |
| 140 | IMF_EXPORT |
| 141 | void setFilmType (int filmType); |
| 142 | |
| 143 | IMF_EXPORT |
| 144 | int prefix () const; |
| 145 | IMF_EXPORT |
| 146 | void setPrefix (int prefix); |
| 147 | |
| 148 | IMF_EXPORT |
| 149 | int count () const; |
| 150 | IMF_EXPORT |
| 151 | void setCount (int count); |
| 152 | |
| 153 | IMF_EXPORT |
| 154 | int perfOffset () const; |
| 155 | IMF_EXPORT |
| 156 | void setPerfOffset (int perfOffset); |
| 157 | |
| 158 | IMF_EXPORT |
| 159 | int perfsPerFrame () const; |
| 160 | IMF_EXPORT |
| 161 | void setPerfsPerFrame (int perfsPerFrame); |
| 162 | |
| 163 | IMF_EXPORT |
| 164 | int perfsPerCount () const; |
| 165 | IMF_EXPORT |
| 166 | void setPerfsPerCount (int perfsPerCount); |
| 167 | |
| 168 | private: |
| 169 | |
| 170 | int _filmMfcCode; |
| 171 | int _filmType; |
| 172 | int _prefix; |
| 173 | int _count; |
| 174 | int _perfOffset; |
| 175 | int _perfsPerFrame; |
| 176 | int _perfsPerCount; |
| 177 | }; |
| 178 | |
| 179 | |
| 180 | OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT |
| 181 | |
| 182 | |
| 183 | |
| 184 | |
| 185 | |
| 186 | #endif |
| 187 | |