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 // saveFlatImage (n, h, i, d) or
24 // saveFlatImage (n, i)
25 //
26 // Saves image i in an OpenEXR file with name n. The file will be
27 // tiled if the image has more than one level, or if a header, h, is
28 // given and contains a tile description attribute; otherwise the
29 // file will be scan-line based.
30 //
31 // If header h is given, then the channel list in h is replaced with
32 // the channel list in i, and the levelMode and the levelRounding mode
33 // fields of the tile description are replaced with the level mode
34 // and the levelRounding mode of i. In addition, if the data window
35 // source flag, d, is set to USE_IMAGE_DATA_WINDOW, then the data
36 // window in the image is copied into the header; if d is set to
37 // USE_HEADER_DATA_WINDOW, then the data window in the header is
38 // replaced with the intersection of the original data window in the
39 // header and the data window in the image. The modified header then
40 // becomes the header of the image file.
41 //
42 
44 void saveFlatImage (
45  const std::string& fileName,
46  const Header& hdr,
47  const FlatImage& img,
49 
51 void saveFlatImage (const std::string& fileName, const FlatImage& img);
52 
53 //
54 // loadFlatImage (n, h, i) or
55 // loadFlatImage (n, i)
56 //
57 // Loads flat image i from the OpenEXR file with name n.
58 //
59 // If header h is given, then the header of the file is copied into h.
60 //
61 
63 void loadFlatImage (const std::string& fileName, Header& hdr, FlatImage& img);
64 
66 void loadFlatImage (const std::string& fileName, FlatImage& img);
67 
68 //
69 // saveFlatScanLineImage (n, h, i, d) or
70 // saveFlatScanLineImage (n, i)
71 //
72 // Saves image i in a scan-line based flat OpenEXR file with file name n.
73 //
74 // If header h is given, then the channel list in h is replaced with
75 // the channel list in i. In addition, if the data window source flag, d,
76 // is set to USE_IMAGE_DATA_WINDOW, then the data window in the image is
77 // copied into the header; if d is set to USE_HEADER_DATA_WINDOW, then
78 // the data window in the header is replaced with the intersection of
79 // the original data window in the header and the data window in the
80 // image. The modified header then becomes the header of the image file.
81 //
82 
85  const std::string& fileName,
86  const Header& hdr,
87  const FlatImage& img,
89 
91 void saveFlatScanLineImage (const std::string& fileName, const FlatImage& img);
92 
93 //
94 // loadFlatScanLineImage (n, h, i) or
95 // loadFlatScanLineImage (n, i)
96 //
97 // Loads image i from a scan-line based flat OpenEXR file with file name n.
98 // If header h is given, then the header of the file is copied into h.
99 //
100 
103  const std::string& fileName, Header& hdr, FlatImage& img);
104 
106 void loadFlatScanLineImage (const std::string& fileName, FlatImage& img);
107 
108 //
109 // saveFlatTiledImage (n, h, i, d) or
110 // saveFlatTiledImage (n, i)
111 //
112 // Saves image i in a tiled flat OpenEXR file with file name n.
113 //
114 // If header h is given, then the channel list in h is replaced with
115 // the channel list i, and the levelMode and the levelRounding mode
116 // fields of the tile description are replaced with the level mode
117 // and the levelRounding mode of i. In addition, if the data window
118 // source flag, d, is set to USE_IMAGE_DATA_WINDOW, then the data
119 // window in the image is copied into the header; if d is set to
120 // USE_HEADER_DATA_WINDOW, then the data window in the header is
121 // replaced with the intersection of the original data window in the
122 // header and the data window in the image. The modified header then
123 // becomes the header of the image file.
124 //
125 // Note: USE_HEADER_DATA_WINDOW can only be used for images with
126 // level mode ONE_LEVEL.
127 //
128 
130 void saveFlatTiledImage (
131  const std::string& fileName,
132  const Header& hdr,
133  const FlatImage& img,
135 
137 void saveFlatTiledImage (const std::string& fileName, const FlatImage& img);
138 
139 //
140 // loadFlatTiledImage (n, h, i) or
141 // loadFlatTiledImage (n, i)
142 //
143 // Loads image i from a tiled flat OpenEXR file with file name n.
144 // If header h is given, then the header of the file is copied into h.
145 //
146 
148 void
149 loadFlatTiledImage (const std::string& fileName, Header& hdr, FlatImage& img);
150 
152 void loadFlatTiledImage (const std::string& fileName, FlatImage& img);
153 
155 
156 #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 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:80
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)