HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ImfImageIO.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_IMAGE_IO_H
7 #define INCLUDED_IMF_IMAGE_IO_H
8 
9 //----------------------------------------------------------------------------
10 //
11 // Functions to load flat or deep images from OpenEXR files
12 // and to save flat or deep images in OpenEXR files.
13 //
14 //----------------------------------------------------------------------------
15 
16 #include "ImfUtilExport.h"
17 
18 #include "ImfImage.h"
19 #include "ImfImageDataWindow.h"
20 
22 
23 
24 //
25 // saveImage (n, h, i, d) or
26 // saveImage (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. The file will be deep if the image
32 // is deep; otherwise the file will be flat.
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 // Note: USE_HEADER_DATA_WINDOW can only be used for images with
46 // level mode ONE_LEVEL.
47 //
48 
50 void
52  (const std::string &fileName,
53  const Header &hdr,
54  const Image &img,
56 
58 void
60  (const std::string &fileName,
61  const Image &img);
62 
63 //
64 // loadImage (n, h) or
65 // loadImage (n)
66 //
67 // Loads deep an image from the OpenEXR file with name n, and returns
68 // a pointer to the image. The caller owns the image and is responsible
69 // for deleting it.
70 //
71 // If header h is given, then the header of the file is copied into h.
72 //
73 
75 Image *
77  (const std::string &fileName,
78  Header &hdr);
79 
81 Image *
83  (const std::string &fileName);
84 
85 
87 
88 #endif
#define OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT
Definition: ImfNamespace.h:80
GLsizei const GLchar *const * string
Definition: glcorearb.h:814
Definition: Image.h:45
OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER enum IMFUTIL_EXPORT_ENUM DataWindowSource
OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER IMFUTIL_EXPORT void saveImage(const std::string &fileName, const Header &hdr, const Image &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
#define OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER
Definition: ImfNamespace.h:79
IMFUTIL_EXPORT Image * loadImage(const std::string &fileName, Header &hdr)