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 // saveImage (n, h, i, d) or
25 // saveImage (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. The file will be deep if the image
31 // is deep; otherwise the file will be flat.
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 // Note: USE_HEADER_DATA_WINDOW can only be used for images with
45 // level mode ONE_LEVEL.
46 //
47 
49 void saveImage (
50  const std::string& fileName,
51  const Header& hdr,
52  const Image& img,
54 
56 void saveImage (const std::string& fileName, const Image& img);
57 
58 //
59 // loadImage (n, h) or
60 // loadImage (n)
61 //
62 // Loads deep an image from the OpenEXR file with name n, and returns
63 // a pointer to the image. The caller owns the image and is responsible
64 // for deleting it.
65 //
66 // If header h is given, then the header of the file is copied into h.
67 //
68 
70 Image* loadImage (const std::string& fileName, Header& hdr);
71 
73 Image* loadImage (const std::string& fileName);
74 
76 
77 #endif
#define OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT
Definition: ImfNamespace.h:83
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:80
IMFUTIL_EXPORT Image * loadImage(const std::string &fileName, Header &hdr)