HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ImfDeepScanLineOutputPart.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 IMFDEEPSCANLINEOUTPUTPART_H_
7 #define IMFDEEPSCANLINEOUTPUTPART_H_
8 
10 #include "ImfMultiPartOutputFile.h"
11 #include "ImfNamespace.h"
12 #include "ImfExport.h"
13 
15 
17 {
18  public:
19 
21  DeepScanLineOutputPart(MultiPartOutputFile& multiPartFile, int partNumber);
22 
23  //------------------------
24  // Access to the file name
25  //------------------------
26 
28  const char * fileName () const;
29 
30 
31  //--------------------------
32  // Access to the file header
33  //--------------------------
34 
36  const Header & header () const;
37 
38 
39  //-------------------------------------------------------
40  // Set the current frame buffer -- copies the FrameBuffer
41  // object into the OutputFile object.
42  //
43  // The current frame buffer is the source of the pixel
44  // data written to the file. The current frame buffer
45  // must be set at least once before writePixels() is
46  // called. The current frame buffer can be changed
47  // after each call to writePixels.
48  //-------------------------------------------------------
49 
52 
53 
54  //-----------------------------------
55  // Access to the current frame buffer
56  //-----------------------------------
57 
59  const DeepFrameBuffer & frameBuffer () const;
60 
61 
62  //-------------------------------------------------------------------
63  // Write pixel data:
64  //
65  // writePixels(n) retrieves the next n scan lines worth of data from
66  // the current frame buffer, starting with the scan line indicated by
67  // currentScanLine(), and stores the data in the output file, and
68  // progressing in the direction indicated by header.lineOrder().
69  //
70  // To produce a complete and correct file, exactly m scan lines must
71  // be written, where m is equal to
72  // header().dataWindow().max.y - header().dataWindow().min.y + 1.
73  //-------------------------------------------------------------------
74 
76  void writePixels (int numScanLines = 1);
77 
78 
79  //------------------------------------------------------------------
80  // Access to the current scan line:
81  //
82  // currentScanLine() returns the y coordinate of the first scan line
83  // that will be read from the current frame buffer during the next
84  // call to writePixels().
85  //
86  // If header.lineOrder() == INCREASING_Y:
87  //
88  // The current scan line before the first call to writePixels()
89  // is header().dataWindow().min.y. After writing each scan line,
90  // the current scan line is incremented by 1.
91  //
92  // If header.lineOrder() == DECREASING_Y:
93  //
94  // The current scan line before the first call to writePixels()
95  // is header().dataWindow().max.y. After writing each scan line,
96  // the current scan line is decremented by 1.
97  //
98  //------------------------------------------------------------------
99 
100  IMF_EXPORT
101  int currentScanLine () const;
102 
103 
104  //--------------------------------------------------------------
105  // Shortcut to copy all pixels from an InputFile into this file,
106  // without uncompressing and then recompressing the pixel data.
107  // This file's header must be compatible with the InputFile's
108  // header: The two header's "dataWindow", "compression",
109  // "lineOrder" and "channels" attributes must be the same.
110  //--------------------------------------------------------------
111 
112  IMF_EXPORT
114  IMF_EXPORT
116 
117 
118  //--------------------------------------------------------------
119  // Updating the preview image:
120  //
121  // updatePreviewImage() supplies a new set of pixels for the
122  // preview image attribute in the file's header. If the header
123  // does not contain a preview image, updatePreviewImage() throws
124  // an IEX_NAMESPACE::LogicExc.
125  //
126  // Note: updatePreviewImage() is necessary because images are
127  // often stored in a file incrementally, a few scan lines at a
128  // time, while the image is being generated. Since the preview
129  // image is an attribute in the file's header, it gets stored in
130  // the file as soon as the file is opened, but we may not know
131  // what the preview image should look like until we have written
132  // the last scan line of the main image.
133  //
134  //--------------------------------------------------------------
135 
136  IMF_EXPORT
137  void updatePreviewImage (const PreviewRgba newPixels[]);
138 
139  private:
141 };
142 
144 
145 
146 
147 
148 
149 #endif /* IMFDEEPSCANLINEOUTPUTPART_H_ */
IMF_EXPORT const Header & header() const
IMF_EXPORT DeepScanLineOutputPart(MultiPartOutputFile &multiPartFile, int partNumber)
#define OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT
Definition: ImfNamespace.h:80
IMF_EXPORT int currentScanLine() const
GLuint in
Definition: glew.h:11552
IMF_EXPORT void setFrameBuffer(const DeepFrameBuffer &frameBuffer)
IMF_EXPORT void copyPixels(DeepScanLineInputFile &in)
IMF_EXPORT void writePixels(int numScanLines=1)
#define IMF_EXPORT
Definition: ImfExport.h:54
IMF_EXPORT const DeepFrameBuffer & frameBuffer() const
#define OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER
Definition: ImfNamespace.h:79
IMF_EXPORT const char * fileName() const
IMF_EXPORT void updatePreviewImage(const PreviewRgba newPixels[])