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 "ImfNamespace.h"
17 #include "ImfUtilExport.h"
18 
19 #include "ImfDeepImage.h"
20 #include "ImfImageDataWindow.h"
21 
23 
24 //
25 // saveDeepImage (n, h, i,d) or
26 // saveDeepImage (n, i)
27 //
28 // Saves image i in an OpenEXR file with name n. The file will be
29 // tiled if the image has more than one level, or if a header, h, is
30 // given and contains a tile description attribute; otherwise the
31 // file will be scan-line based.
32 //
33 // If header h is given, then the channel list in h is replaced with
34 // the channel list in i, and the levelMode and the levelRounding mode
35 // fields of the tile description are replaced with the level mode
36 // and the levelRounding mode of i. In addition, if the data window
37 // source flag, d, is set to USE_IMAGE_DATA_WINDOW, then the data
38 // window in the image is copied into the header; if d is set to
39 // USE_HEADER_DATA_WINDOW, then the data window in the header is
40 // replaced with the intersection of the original data window in the
41 // header and the data window in the image. The modified header then
42 // becomes the header of the image file.
43 //
44 
46 void saveDeepImage (
47  const std::string& fileName,
48  const Header& hdr,
49  const DeepImage& img,
51 
53 void saveDeepImage (const std::string& fileName, const DeepImage& img);
54 
55 //
56 // loadDeepImage (n, h, i) or
57 // loadDeepImage (n, i)
58 //
59 // Loads deep image i from the OpenEXR file with name n.
60 //
61 // If header h is given, then the header of the file is copied into h.
62 //
63 
65 void loadDeepImage (const std::string& fileName, Header& hdr, DeepImage& img);
66 
68 void loadDeepImage (const std::string& fileName, DeepImage& img);
69 
70 //
71 // saveDeepScanLineImage (n, h, i, d) or
72 // saveDeepScanLineImage (n, i)
73 //
74 // Saves image i in a scan-line based deep OpenEXR file with file name n.
75 //
76 // If header h is given, then the channel list in h is replaced with
77 // the channel list in i. In addition, if the data window source flag, d,
78 // is set to USE_IMAGE_DATA_WINDOW, then the data window in the image is
79 // copied into the header; if d is set to USE_HEADER_DATA_WINDOW, then
80 // the data window in the header is replaced with the intersection of
81 // the original data window in the header and the data window in the
82 // image. The modified header then becomes the header of the image file.
83 //
84 
87  const std::string& fileName,
88  const Header& hdr,
89  const DeepImage& img,
91 
93 void saveDeepScanLineImage (const std::string& fileName, const DeepImage& img);
94 
95 //
96 // loadDeepScanLineImage (n, h, i) or
97 // loadDeepScanLineImage (n, i)
98 //
99 // Loads image i from a scan-line based deep OpenEXR file with file name n.
100 // If header h is given, then the header of the file is copied into h.
101 //
102 
105  const std::string& fileName, Header& hdr, DeepImage& img);
106 
108 void loadDeepScanLineImage (const std::string& fileName, DeepImage& img);
109 
110 //
111 // saveDeepTiledImage (n, h, i, d) or
112 // saveDeepTiledImage (n, i)
113 //
114 // Saves image i in a tiled deep OpenEXR file with file name n.
115 //
116 // If header h is given, then the channel list in h is replaced with
117 // the channel list i, and the levelMode and the levelRounding mode
118 // fields of the tile description are replaced with the level mode
119 // and the levelRounding mode of i. In addition, if the data window
120 // source flag, d, is set to USE_IMAGE_DATA_WINDOW, then the data
121 // window in the image is copied into the header; if d is set to
122 // USE_HEADER_DATA_WINDOW, then the data window in the header is
123 // replaced with the intersection of the original data window in the
124 // header and the data window in the image. The modified header then
125 // becomes the header of the image file.
126 //
127 // Note: USE_HEADER_DATA_WINDOW can only be used for images with
128 // level mode ONE_LEVEL.
129 //
130 
132 void saveDeepTiledImage (
133  const std::string& fileName,
134  const Header& hdr,
135  const DeepImage& img,
137 
139 void saveDeepTiledImage (const std::string& fileName, const DeepImage& img);
140 
141 //
142 // loadDeepTiledImage (n, h, i) or
143 // loadDeepTiledImage (n, i)
144 //
145 // Loads image i from a tiled 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
151 loadDeepTiledImage (const std::string& fileName, Header& hdr, DeepImage& img);
152 
154 void loadDeepTiledImage (const std::string& fileName, DeepImage& img);
155 
157 
158 #endif
#define OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT
Definition: ImfNamespace.h:83
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:80