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:
51  MultiPartInputFile(const char fileName[],
52  int numThreads = globalThreadCount(),
53  bool reconstructChunkOffsetTable = true);
54 
57  int numThreads = globalThreadCount(),
58  bool reconstructChunkOffsetTable = true);
59 
61  virtual ~MultiPartInputFile();
62 
63  // ----------------------
64  // Count of number of parts in file
65  // ---------------------
67  int parts() const;
68 
69 
70  //----------------------
71  // Access to the headers
72  //----------------------
73 
75  const Header & header(int n) const;
76 
77 
78  //----------------------------------
79  // Access to the file format version
80  //----------------------------------
81 
83  int version () const;
84 
85 
86  // =----------------------------------------
87  // Check whether the entire chunk offset
88  // table for the part is written correctly
89  // -----------------------------------------
91  bool partComplete(int part) const;
92 
93 
94  struct Data;
95 
96 
97  private:
98  Data* _data;
99 
100  MultiPartInputFile(const MultiPartInputFile &); // not implemented
101 
102 
103  //
104  // used internally by 'Part' types to access individual parts of the multipart file
105  //
106  template<class T> T* getInputPart(int partNumber);
107  InputPartData* getPart(int);
108 
109  void initialize();
110 
111 
112 
113 
114  friend class InputPart;
115  friend class ScanLineInputPart;
116  friend class TiledInputPart;
117  friend class DeepScanLineInputPart;
118  friend class DeepTiledInputPart;
119 
120  //
121  // For backward compatibility.
122  //
123 
124  friend class InputFile;
125  friend class TiledInputFile;
126  friend class ScanLineInputFile;
127  friend class DeepScanLineInputFile;
128  friend class DeepTiledInputFile;
129 };
130 
131 
133 
134 #endif /* IMFMULTIPARTINPUTFILE_H_ */
IMF_EXPORT int version() const
Definition: ImfIO.h:58
#define OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT
Definition: ImfNamespace.h:109
IMF_EXPORT MultiPartInputFile(const char fileName[], int numThreads=globalThreadCount(), bool reconstructChunkOffsetTable=true)
GLsizei n
Definition: glew.h:4040
virtual IMF_EXPORT ~MultiPartInputFile()
#define IMF_EXPORT
Definition: ImfExport.h:44
OPENVDB_API void initialize()
Global registration of basic types.
Definition: logging.h:291
OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER IMF_EXPORT int globalThreadCount()
#define OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER
Definition: ImfNamespace.h:108
IMF_EXPORT const Header & header(int n) const
IMF_EXPORT int parts() const
IMF_EXPORT bool partComplete(int part) const