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