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