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