HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ImfMultiPartInputFile.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (c) 2011, 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 #ifndef IMFMULTIPARTINPUTFILE_H_
36 #define IMFMULTIPARTINPUTFILE_H_
37 
38 #include "ImfGenericInputFile.h"
39 #include "ImfNamespace.h"
40 #include "ImfForward.h"
41 #include "ImfThreading.h"
42 #include "ImfExport.h"
43 
45 
46 
48 {
49  public:
50  MultiPartInputFile(const char fileName[],
51  int numThreads = globalThreadCount(),
52  bool reconstructChunkOffsetTable = true);
53 
55  int numThreads = globalThreadCount(),
56  bool reconstructChunkOffsetTable = true);
57 
58  virtual ~MultiPartInputFile();
59 
60  // ----------------------
61  // Count of number of parts in file
62  // ---------------------
63  int parts() const;
64 
65 
66  //----------------------
67  // Access to the headers
68  //----------------------
69 
70  const Header & header(int n) const;
71 
72 
73  //----------------------------------
74  // Access to the file format version
75  //----------------------------------
76 
77  int version () const;
78 
79 
80  // =----------------------------------------
81  // Check whether the entire chunk offset
82  // table for the part is written correctly
83  // -----------------------------------------
84  bool partComplete(int part) const;
85 
86 
87 
88  struct Data;
89 
90 
91  private:
92  Data* _data;
93 
94  MultiPartInputFile(const MultiPartInputFile &); // not implemented
95 
96 
97  //
98  // used internally by 'Part' types to access individual parts of the multipart file
99  //
100  template<class T> T* getInputPart(int partNumber);
101  InputPartData* getPart(int);
102 
103  void initialize();
104 
105 
106 
107 
108  friend class InputPart;
109  friend class ScanLineInputPart;
110  friend class TiledInputPart;
111  friend class DeepScanLineInputPart;
112  friend class DeepTiledInputPart;
113 
114  //
115  // For backward compatibility.
116  //
117 
118  friend class InputFile;
119  friend class TiledInputFile;
120  friend class ScanLineInputFile;
121  friend class DeepScanLineInputFile;
122  friend class DeepTiledInputFile;
123 };
124 
125 
127 
128 #endif /* IMFMULTIPARTINPUTFILE_H_ */
Definition: ImfIO.h:58
#define OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT
Definition: ImfNamespace.h:109
GLdouble n
Definition: glcorearb.h:2007
#define IMF_EXPORT
Definition: ImfExport.h:59
OPENVDB_API void initialize()
Global registration of basic types.
Definition: logging.h:318
GT_API const UT_StringHolder version
OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER IMF_EXPORT int globalThreadCount()
#define OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER
Definition: ImfNamespace.h:108