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 //
3 // Copyright (c) 2014, Industrial Light & Magic, a division of Lucas
4 // Digital Ltd. LLC
5 //
6 // All rights reserved.
7 //
8 // Redistribution and use in source and binary forms, with or without
9 // modification, are permitted provided that the following conditions are
10 // met:
11 // * Redistributions of source code must retain the above copyright
12 // notice, this list of conditions and the following disclaimer.
13 // * Redistributions in binary form must reproduce the above
14 // copyright notice, this list of conditions and the following disclaimer
15 // in the documentation and/or other materials provided with the
16 // distribution.
17 // * Neither the name of Industrial Light & Magic nor the names of
18 // its contributors may be used to endorse or promote products derived
19 // from this software without specific prior written permission.
20 //
21 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 //
33 ///////////////////////////////////////////////////////////////////////////
34 
35 #ifndef INCLUDED_IMF_DEEP_IMAGE_IO_H
36 #define INCLUDED_IMF_DEEP_IMAGE_IO_H
37 
38 //----------------------------------------------------------------------------
39 //
40 // Functions to load deep images from OpenEXR files
41 // and to save deep images in OpenEXR files.
42 //
43 //----------------------------------------------------------------------------
44 
45 #include "ImfDeepImage.h"
46 #include "ImfImageDataWindow.h"
47 #include "ImfExport.h"
48 
50 
51 
52 //
53 // saveDeepImage (n, h, i,d) or
54 // saveDeepImage (n, i)
55 //
56 // Saves image i in an OpenEXR file with name n. The file will be
57 // tiled if the image has more than one level, or if a header, h, is
58 // given and contains a tile description attribute; otherwise the
59 // file will be scan-line based.
60 //
61 // If header h is given, then the channel list in h is replaced with
62 // the channel list in i, and the levelMode and the levelRounding mode
63 // fields of the tile description are replaced with the level mode
64 // and the levelRounding mode of i. In addition, if the data window
65 // source flag, d, is set to USE_IMAGE_DATA_WINDOW, then the data
66 // window in the image is copied into the header; if d is set to
67 // USE_HEADER_DATA_WINDOW, then the data window in the header is
68 // replaced with the intersection of the original data window in the
69 // header and the data window in the image. The modified header then
70 // becomes the header of the image file.
71 //
72 
74 void
76  (const std::string &fileName,
77  const Header &hdr,
78  const DeepImage &img,
80 
82 void
84  (const std::string &fileName,
85  const DeepImage &img);
86 
87 //
88 // loadDeepImage (n, h, i) or
89 // loadDeepImage (n, i)
90 //
91 // Loads deep image i from the OpenEXR file with name n.
92 //
93 // If header h is given, then the header of the file is copied into h.
94 //
95 
97 void
99  (const std::string &fileName,
100  Header &hdr,
101  DeepImage &img);
102 
103 
105 void
107  (const std::string &fileName,
108  DeepImage &img);
109 
110 
111 //
112 // saveDeepScanLineImage (n, h, i, d) or
113 // saveDeepScanLineImage (n, i)
114 //
115 // Saves image i in a scan-line based deep OpenEXR file with file name n.
116 //
117 // If header h is given, then the channel list in h is replaced with
118 // the channel list in i. In addition, if the data window source flag, d,
119 // is set to USE_IMAGE_DATA_WINDOW, then the data window in the image is
120 // copied into the header; if d is set to USE_HEADER_DATA_WINDOW, then
121 // the data window in the header is replaced with the intersection of
122 // the original data window in the header and the data window in the
123 // image. The modified header then becomes the header of the image file.
124 //
125 
127 void
129  (const std::string &fileName,
130  const Header &hdr,
131  const DeepImage &img,
133 
135 void
137  (const std::string &fileName,
138  const DeepImage &img);
139 
140 
141 //
142 // loadDeepScanLineImage (n, h, i) or
143 // loadDeepScanLineImage (n, i)
144 //
145 // Loads image i from a scan-line based deep OpenEXR file with file name n.
146 // If header h is given, then the header of the file is copied into h.
147 //
148 
150 void
152  (const std::string &fileName,
153  Header &hdr,
154  DeepImage &img);
155 
157 void
159  (const std::string &fileName,
160  DeepImage &img);
161 
162 //
163 // saveDeepTiledImage (n, h, i, d) or
164 // saveDeepTiledImage (n, i)
165 //
166 // Saves image i in a tiled deep OpenEXR file with file name n.
167 //
168 // If header h is given, then the channel list in h is replaced with
169 // the channel list i, and the levelMode and the levelRounding mode
170 // fields of the tile description are replaced with the level mode
171 // and the levelRounding mode of i. In addition, if the data window
172 // source flag, d, is set to USE_IMAGE_DATA_WINDOW, then the data
173 // window in the image is copied into the header; if d is set to
174 // USE_HEADER_DATA_WINDOW, then the data window in the header is
175 // replaced with the intersection of the original data window in the
176 // header and the data window in the image. The modified header then
177 // becomes the header of the image file.
178 //
179 // Note: USE_HEADER_DATA_WINDOW can only be used for images with
180 // level mode ONE_LEVEL.
181 //
182 
184 void
186  (const std::string &fileName,
187  const Header &hdr,
188  const DeepImage &img,
190 
192 void
194  (const std::string &fileName,
195  const DeepImage &img);
196 
197 //
198 // loadDeepTiledImage (n, h, i) or
199 // loadDeepTiledImage (n, i)
200 //
201 // Loads image i from a tiled deep OpenEXR file with file name n.
202 // If header h is given, then the header of the file is copied into h.
203 //
204 
206 void
208  (const std::string &fileName,
209  Header &hdr,
210  DeepImage &img);
211 
213 void
215  (const std::string &fileName,
216  DeepImage &img);
217 
219 
220 #endif
#define OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT
Definition: ImfNamespace.h:109
GLsizei const GLchar *const * string
Definition: glcorearb.h:813
DataWindowSource
IMF_EXPORT void loadDeepImage(const std::string &fileName, Header &hdr, DeepImage &img)
OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER IMF_EXPORT void saveDeepImage(const std::string &fileName, const Header &hdr, const DeepImage &img, DataWindowSource dws=USE_IMAGE_DATA_WINDOW)
IMF_EXPORT void saveDeepTiledImage(const std::string &fileName, const Header &hdr, const DeepImage &img, DataWindowSource dws=USE_IMAGE_DATA_WINDOW)
IMF_EXPORT void loadDeepTiledImage(const std::string &fileName, Header &hdr, DeepImage &img)
#define IMF_EXPORT
Definition: ImfExport.h:59
GLint void * img
Definition: glcorearb.h:555
IMF_EXPORT void loadDeepScanLineImage(const std::string &fileName, Header &hdr, DeepImage &img)
#define OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER
Definition: ImfNamespace.h:108
IMF_EXPORT void saveDeepScanLineImage(const std::string &fileName, const Header &hdr, const DeepImage &img, DataWindowSource dws=USE_IMAGE_DATA_WINDOW)