HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ImfImageIO.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_IMAGE_IO_H
36 #define INCLUDED_IMF_IMAGE_IO_H
37 
38 //----------------------------------------------------------------------------
39 //
40 // Functions to load flat or deep images from OpenEXR files
41 // and to save flat or deep images in OpenEXR files.
42 //
43 //----------------------------------------------------------------------------
44 
45 #include "ImfImage.h"
46 #include "ImfImageDataWindow.h"
47 #include "ImfExport.h"
48 
50 
51 
52 //
53 // saveImage (n, h, i, d) or
54 // saveImage (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. The file will be deep if the image
60 // is deep; otherwise the file will be flat.
61 //
62 // If header h is given, then the channel list in h is replaced with
63 // the channel list in i, and the levelMode and the levelRounding mode
64 // fields of the tile description are replaced with the level mode
65 // and the levelRounding mode of i. In addition, if the data window
66 // source flag, d, is set to USE_IMAGE_DATA_WINDOW, then the data
67 // window in the image is copied into the header; if d is set to
68 // USE_HEADER_DATA_WINDOW, then the data window in the header is
69 // replaced with the intersection of the original data window in the
70 // header and the data window in the image. The modified header then
71 // becomes the header of the image file.
72 //
73 // Note: USE_HEADER_DATA_WINDOW can only be used for images with
74 // level mode ONE_LEVEL.
75 //
76 
78 void
80  (const std::string &fileName,
81  const Header &hdr,
82  const Image &img,
84 
86 void
88  (const std::string &fileName,
89  const Image &img);
90 
91 //
92 // loadImage (n, h) or
93 // loadImage (n)
94 //
95 // Loads deep an image from the OpenEXR file with name n, and returns
96 // a pointer to the image. The caller owns the image and is responsible
97 // for deleting it.
98 //
99 // If header h is given, then the header of the file is copied into h.
100 //
101 
103 Image *
104 loadImage
105  (const std::string &fileName,
106  Header &hdr);
107 
109 Image *
110 loadImage
111  (const std::string &fileName);
112 
113 
115 
116 #endif
#define OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT
Definition: ImfNamespace.h:109
GLsizei const GLchar *const * string
Definition: glcorearb.h:813
DataWindowSource
#define IMF_EXPORT
Definition: ImfExport.h:59
GLint void * img
Definition: glcorearb.h:555
OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER IMF_EXPORT void saveImage(const std::string &fileName, const Header &hdr, const Image &img, DataWindowSource dws=USE_IMAGE_DATA_WINDOW)
#define OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER
Definition: ImfNamespace.h:108
IMF_EXPORT Image * loadImage(const std::string &fileName, Header &hdr)