HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ImfDeepScanLineInputPart.h
Go to the documentation of this file.
1 //
2 // SPDX-License-Identifier: BSD-3-Clause
3 // Copyright (c) Contributors to the OpenEXR Project.
4 //
5 
6 #ifndef IMFDEEPSCANLINEINPUTPART_H_
7 #define IMFDEEPSCANLINEINPUTPART_H_
8 
9 #include "ImfForward.h"
10 
11 #include <cstdint>
12 
14 
16 {
17 public:
19  DeepScanLineInputPart (MultiPartInputFile& file, int partNumber);
20 
21  //------------------------
22  // Access to the file name
23  //------------------------
24 
26  const char* fileName () const;
27 
28  //--------------------------
29  // Access to the file header
30  //--------------------------
31 
33  const Header& header () const;
34 
35  //----------------------------------
36  // Access to the file format version
37  //----------------------------------
38 
40  int version () const;
41 
42  //-----------------------------------------------------------
43  // Set the current frame buffer -- copies the FrameBuffer
44  // object into the InputFile object.
45  //
46  // The current frame buffer is the destination for the pixel
47  // data read from the file. The current frame buffer must be
48  // set at least once before readPixels() is called.
49  // The current frame buffer can be changed after each call
50  // to readPixels().
51  //-----------------------------------------------------------
52 
54  void setFrameBuffer (const DeepFrameBuffer& frameBuffer);
55 
56  //-----------------------------------
57  // Access to the current frame buffer
58  //-----------------------------------
59 
61  const DeepFrameBuffer& frameBuffer () const;
62 
63  //---------------------------------------------------------------
64  // Check if the file is complete:
65  //
66  // isComplete() returns true if all pixels in the data window are
67  // present in the input file, or false if any pixels are missing.
68  // (Another program may still be busy writing the file, or file
69  // writing may have been aborted prematurely.)
70  //---------------------------------------------------------------
71 
73  bool isComplete () const;
74 
75  //---------------------------------------------------------------
76  // Read pixel data:
77  //
78  // readPixels(s1,s2) reads all scan lines with y coordinates
79  // in the interval [min (s1, s2), max (s1, s2)] from the file,
80  // and stores them in the current frame buffer.
81  //
82  // Both s1 and s2 must be within the interval
83  // [header().dataWindow().min.y, header.dataWindow().max.y]
84  //
85  // The scan lines can be read from the file in random order, and
86  // individual scan lines may be skipped or read multiple times.
87  // For maximum efficiency, the scan lines should be read in the
88  // order in which they were written to the file.
89  //
90  // readPixels(s) calls readPixels(s,s).
91  //
92  // If threading is enabled, readPixels (s1, s2) tries to perform
93  // decopmression of multiple scanlines in parallel.
94  //
95  //---------------------------------------------------------------
96 
98  void readPixels (int scanLine1, int scanLine2);
100  void readPixels (int scanLine);
101  IMF_EXPORT
102  void readPixels (
103  const char* rawPixelData,
104  const DeepFrameBuffer& frameBuffer,
105  int scanLine1,
106  int scanLine2) const;
107 
108  //----------------------------------------------
109  // Read a block of raw pixel data from the file,
110  // without uncompressing it (this function is
111  // used to implement OutputFile::copyPixels()).
112  //----------------------------------------------
113 
114  IMF_EXPORT
115  void
116  rawPixelData (int firstScanLine, char* pixelData, uint64_t& pixelDataSize);
117 
118  //-----------------------------------------------------------
119  // Read pixel sample counts into a slice in the frame buffer.
120  //
121  // readPixelSampleCounts(s1, s2) reads all the counts of
122  // pixel samples with y coordinates in the interval
123  // [min (s1, s2), max (s1, s2)] from the file, and stores
124  // them in the slice naming "sample count".
125  //
126  // Both s1 and s2 must be within the interval
127  // [header().dataWindow().min.y, header.dataWindow().max.y]
128  //
129  // readPixelSampleCounts(s) calls readPixelSampleCounts(s,s).
130  //-----------------------------------------------------------
131 
132  IMF_EXPORT
133  void readPixelSampleCounts (int scanline1, int scanline2);
134  IMF_EXPORT
135  void readPixelSampleCounts (int scanline);
136 
137  IMF_EXPORT
138  void readPixelSampleCounts (
139  const char* rawdata,
140  const DeepFrameBuffer& frameBuffer,
141  int scanLine1,
142  int scanLine2) const;
143 
144  IMF_EXPORT
145  int firstScanLineInChunk (int y) const;
146  IMF_EXPORT
147  int lastScanLineInChunk (int y) const;
148 
149 private:
150  DeepScanLineInputFile* file;
151 
152  // needed for copyPixels
154 };
155 
157 
158 #endif /* IMFDEEPSCANLINEINPUTPART_H_ */
#define OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT
Definition: ImfNamespace.h:83
GLint y
Definition: glcorearb.h:103
class IMF_EXPORT_TYPE DeepScanLineInputPart
Definition: ImfForward.h:56
#define IMF_EXPORT
Definition: ImfExport.h:54
GT_API const UT_StringHolder version
#define OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER
Definition: ImfNamespace.h:80
#define IMF_EXPORT_TYPE
Definition: ImfExport.h:57