HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ImfDeepImageIO.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 INCLUDED_IMF_DEEP_IMAGE_IO_H
7 #define INCLUDED_IMF_DEEP_IMAGE_IO_H
8 
9 //----------------------------------------------------------------------------
10 //
11 // Functions to load deep images from OpenEXR files
12 // and to save deep images in OpenEXR files.
13 //
14 //----------------------------------------------------------------------------
15 
16 #include "ImfUtilExport.h"
17 #include "ImfNamespace.h"
18 
19 #include "ImfDeepImage.h"
20 #include "ImfImageDataWindow.h"
21 
23 
24 
25 //
26 // saveDeepImage (n, h, i,d) or
27 // saveDeepImage (n, i)
28 //
29 // Saves image i in an OpenEXR file with name n. The file will be
30 // tiled if the image has more than one level, or if a header, h, is
31 // given and contains a tile description attribute; otherwise the
32 // file will be scan-line based.
33 //
34 // If header h is given, then the channel list in h is replaced with
35 // the channel list in i, and the levelMode and the levelRounding mode
36 // fields of the tile description are replaced with the level mode
37 // and the levelRounding mode of i. In addition, if the data window
38 // source flag, d, is set to USE_IMAGE_DATA_WINDOW, then the data
39 // window in the image is copied into the header; if d is set to
40 // USE_HEADER_DATA_WINDOW, then the data window in the header is
41 // replaced with the intersection of the original data window in the
42 // header and the data window in the image. The modified header then
43 // becomes the header of the image file.
44 //
45 
47 void
49  (const std::string &fileName,
50  const Header &hdr,
51  const DeepImage &img,
53 
55 void
57  (const std::string &fileName,
58  const DeepImage &img);
59 
60 //
61 // loadDeepImage (n, h, i) or
62 // loadDeepImage (n, i)
63 //
64 // Loads deep image i from the OpenEXR file with name n.
65 //
66 // If header h is given, then the header of the file is copied into h.
67 //
68 
70 void
72  (const std::string &fileName,
73  Header &hdr,
74  DeepImage &img);
75 
76 
78 void
80  (const std::string &fileName,
81  DeepImage &img);
82 
83 
84 //
85 // saveDeepScanLineImage (n, h, i, d) or
86 // saveDeepScanLineImage (n, i)
87 //
88 // Saves image i in a scan-line based deep OpenEXR file with file name n.
89 //
90 // If header h is given, then the channel list in h is replaced with
91 // the channel list in i. In addition, if the data window source flag, d,
92 // is set to USE_IMAGE_DATA_WINDOW, then the data window in the image is
93 // copied into the header; if d is set to USE_HEADER_DATA_WINDOW, then
94 // the data window in the header is replaced with the intersection of
95 // the original data window in the header and the data window in the
96 // image. The modified header then becomes the header of the image file.
97 //
98 
100 void
102  (const std::string &fileName,
103  const Header &hdr,
104  const DeepImage &img,
106 
108 void
110  (const std::string &fileName,
111  const DeepImage &img);
112 
113 
114 //
115 // loadDeepScanLineImage (n, h, i) or
116 // loadDeepScanLineImage (n, i)
117 //
118 // Loads image i from a scan-line based deep OpenEXR file with file name n.
119 // If header h is given, then the header of the file is copied into h.
120 //
121 
123 void
125  (const std::string &fileName,
126  Header &hdr,
127  DeepImage &img);
128 
130 void
132  (const std::string &fileName,
133  DeepImage &img);
134 
135 //
136 // saveDeepTiledImage (n, h, i, d) or
137 // saveDeepTiledImage (n, i)
138 //
139 // Saves image i in a tiled deep OpenEXR file with file name n.
140 //
141 // If header h is given, then the channel list in h is replaced with
142 // the channel list i, and the levelMode and the levelRounding mode
143 // fields of the tile description are replaced with the level mode
144 // and the levelRounding mode of i. In addition, if the data window
145 // source flag, d, is set to USE_IMAGE_DATA_WINDOW, then the data
146 // window in the image is copied into the header; if d is set to
147 // USE_HEADER_DATA_WINDOW, then the data window in the header is
148 // replaced with the intersection of the original data window in the
149 // header and the data window in the image. The modified header then
150 // becomes the header of the image file.
151 //
152 // Note: USE_HEADER_DATA_WINDOW can only be used for images with
153 // level mode ONE_LEVEL.
154 //
155 
157 void
159  (const std::string &fileName,
160  const Header &hdr,
161  const DeepImage &img,
163 
165 void
167  (const std::string &fileName,
168  const DeepImage &img);
169 
170 //
171 // loadDeepTiledImage (n, h, i) or
172 // loadDeepTiledImage (n, i)
173 //
174 // Loads image i from a tiled deep OpenEXR file with file name n.
175 // If header h is given, then the header of the file is copied into h.
176 //
177 
179 void
181  (const std::string &fileName,
182  Header &hdr,
183  DeepImage &img);
184 
186 void
188  (const std::string &fileName,
189  DeepImage &img);
190 
192 
193 #endif
#define OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT
Definition: ImfNamespace.h:80
GLsizei const GLchar *const * string
Definition: glcorearb.h:814
OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER IMFUTIL_EXPORT void saveDeepImage(const std::string &fileName, const Header &hdr, const DeepImage &img, DataWindowSource dws=USE_IMAGE_DATA_WINDOW)
IMFUTIL_EXPORT void loadDeepScanLineImage(const std::string &fileName, Header &hdr, DeepImage &img)
OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER enum IMFUTIL_EXPORT_ENUM DataWindowSource
IMFUTIL_EXPORT void saveDeepScanLineImage(const std::string &fileName, const Header &hdr, const DeepImage &img, DataWindowSource dws=USE_IMAGE_DATA_WINDOW)
IMFUTIL_EXPORT void loadDeepImage(const std::string &fileName, Header &hdr, DeepImage &img)
IMFUTIL_EXPORT void saveDeepTiledImage(const std::string &fileName, const Header &hdr, const DeepImage &img, DataWindowSource dws=USE_IMAGE_DATA_WINDOW)
#define IMFUTIL_EXPORT
Definition: ImfUtilExport.h:51
GLint void * img
Definition: glcorearb.h:556
USE_IMAGE_DATA_WINDOW
IMFUTIL_EXPORT void loadDeepTiledImage(const std::string &fileName, Header &hdr, DeepImage &img)
#define OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER
Definition: ImfNamespace.h:79