]>
Commit | Line | Data |
---|---|---|
4ec3633d JR |
1 | Index: blender-2.93.3/source/blender/imbuf/intern/openexr/openexr_api.cpp |
2 | =================================================================== | |
3 | --- blender-2.93.3.orig/source/blender/imbuf/intern/openexr/openexr_api.cpp | |
4 | +++ blender-2.93.3/source/blender/imbuf/intern/openexr/openexr_api.cpp | |
5 | @@ -32,30 +32,31 @@ | |
6 | #include <stdexcept> | |
7 | #include <string> | |
8 | ||
9 | -#include <Iex.h> | |
10 | +#include <OpenEXR/Iex.h> | |
11 | #include <ImathBox.h> | |
12 | -#include <ImfArray.h> | |
13 | -#include <ImfChannelList.h> | |
14 | -#include <ImfCompression.h> | |
15 | -#include <ImfCompressionAttribute.h> | |
16 | -#include <ImfIO.h> | |
17 | -#include <ImfInputFile.h> | |
18 | -#include <ImfOutputFile.h> | |
19 | -#include <ImfPixelType.h> | |
20 | -#include <ImfStandardAttributes.h> | |
21 | -#include <ImfStringAttribute.h> | |
22 | -#include <ImfVersion.h> | |
23 | -#include <half.h> | |
24 | +#include <OpenEXR/ImfArray.h> | |
25 | +#include <OpenEXR/ImfFrameBuffer.h> | |
26 | +#include <OpenEXR/ImfChannelList.h> | |
27 | +#include <OpenEXR/ImfCompression.h> | |
28 | +#include <OpenEXR/ImfCompressionAttribute.h> | |
29 | +#include <OpenEXR/ImfIO.h> | |
30 | +#include <OpenEXR/ImfInputFile.h> | |
31 | +#include <OpenEXR/ImfOutputFile.h> | |
32 | +#include <OpenEXR/ImfPixelType.h> | |
33 | +#include <OpenEXR/ImfStandardAttributes.h> | |
34 | +#include <OpenEXR/ImfStringAttribute.h> | |
35 | +#include <OpenEXR/ImfVersion.h> | |
36 | +#include <Imath/half.h> | |
37 | ||
38 | /* multiview/multipart */ | |
39 | -#include <ImfInputPart.h> | |
40 | -#include <ImfMultiPartInputFile.h> | |
41 | -#include <ImfMultiPartOutputFile.h> | |
42 | -#include <ImfMultiView.h> | |
43 | -#include <ImfOutputPart.h> | |
44 | -#include <ImfPartHelper.h> | |
45 | -#include <ImfPartType.h> | |
46 | -#include <ImfTiledOutputPart.h> | |
47 | +#include <OpenEXR/ImfInputPart.h> | |
48 | +#include <OpenEXR/ImfMultiPartInputFile.h> | |
49 | +#include <OpenEXR/ImfMultiPartOutputFile.h> | |
50 | +#include <OpenEXR/ImfMultiView.h> | |
51 | +#include <OpenEXR/ImfOutputPart.h> | |
52 | +#include <OpenEXR/ImfPartHelper.h> | |
53 | +#include <OpenEXR/ImfPartType.h> | |
54 | +#include <OpenEXR/ImfTiledOutputPart.h> | |
55 | ||
56 | #include "DNA_scene_types.h" /* For OpenEXR compression constants */ | |
57 | ||
58 | @@ -131,12 +132,12 @@ class IMemStream : public Imf::IStream { | |
59 | return false; | |
60 | } | |
61 | ||
62 | - Int64 tellg() override | |
63 | + uint64_t tellg() override | |
64 | { | |
65 | return _exrpos; | |
66 | } | |
67 | ||
68 | - void seekg(Int64 pos) override | |
69 | + void seekg(uint64_t pos) override | |
70 | { | |
71 | _exrpos = pos; | |
72 | } | |
73 | @@ -146,8 +147,8 @@ class IMemStream : public Imf::IStream { | |
74 | } | |
75 | ||
76 | private: | |
77 | - Int64 _exrpos; | |
78 | - Int64 _exrsize; | |
79 | + uint64_t _exrpos; | |
80 | + uint64_t _exrsize; | |
81 | unsigned char *_exrbuf; | |
82 | }; | |
83 | ||
84 | @@ -182,12 +183,12 @@ class IFileStream : public Imf::IStream | |
85 | return check_error(); | |
86 | } | |
87 | ||
88 | - Int64 tellg() override | |
89 | + uint64_t tellg() override | |
90 | { | |
91 | return std::streamoff(ifs.tellg()); | |
92 | } | |
93 | ||
94 | - void seekg(Int64 pos) override | |
95 | + void seekg(uint64_t pos) override | |
96 | { | |
97 | ifs.seekg(pos); | |
98 | check_error(); | |
99 | @@ -231,19 +232,19 @@ class OMemStream : public OStream { | |
100 | ibuf->encodedsize += n; | |
101 | } | |
102 | ||
103 | - Int64 tellp() override | |
104 | + uint64_t tellp() override | |
105 | { | |
106 | return offset; | |
107 | } | |
108 | ||
109 | - void seekp(Int64 pos) override | |
110 | + void seekp(uint64_t pos) override | |
111 | { | |
112 | offset = pos; | |
113 | ensure_size(offset); | |
114 | } | |
115 | ||
116 | private: | |
117 | - void ensure_size(Int64 size) | |
118 | + void ensure_size(uint64_t size) | |
119 | { | |
120 | /* if buffer is too small increase it. */ | |
121 | while (size > ibuf->encodedbuffersize) { | |
122 | @@ -254,7 +255,7 @@ class OMemStream : public OStream { | |
123 | } | |
124 | ||
125 | ImBuf *ibuf; | |
126 | - Int64 offset; | |
127 | + uint64_t offset; | |
128 | }; | |
129 | ||
130 | /* File Output Stream */ | |
131 | @@ -284,12 +285,12 @@ class OFileStream : public OStream { | |
132 | check_error(); | |
133 | } | |
134 | ||
135 | - Int64 tellp() override | |
136 | + uint64_t tellp() override | |
137 | { | |
138 | return std::streamoff(ofs.tellp()); | |
139 | } | |
140 | ||
141 | - void seekp(Int64 pos) override | |
142 | + void seekp(uint64_t pos) override | |
143 | { | |
144 | ofs.seekp(pos); | |
145 | check_error(); | |
146 | Index: blender-2.93.3/build_files/cmake/Modules/FindOpenEXR.cmake | |
147 | =================================================================== | |
148 | --- blender-2.93.3.orig/build_files/cmake/Modules/FindOpenEXR.cmake | |
149 | +++ blender-2.93.3/build_files/cmake/Modules/FindOpenEXR.cmake | |
150 | @@ -25,6 +25,7 @@ | |
151 | # see accompanying file BSD-3-Clause-license.txt for details. | |
152 | #============================================================================= | |
153 | ||
154 | + | |
155 | # If OPENEXR_ROOT_DIR was defined in the environment, use it. | |
156 | IF(NOT OPENEXR_ROOT_DIR AND NOT $ENV{OPENEXR_ROOT_DIR} STREQUAL "") | |
157 | SET(OPENEXR_ROOT_DIR $ENV{OPENEXR_ROOT_DIR}) | |
158 | @@ -33,6 +34,16 @@ ENDIF() | |
159 | # Old versions (before 2.0?) do not have any version string, just assuming this should be fine though. | |
160 | SET(_openexr_libs_ver_init "2.0") | |
161 | ||
162 | +find_package(Imath CONFIG QUIET) | |
163 | +if(TARGET Imath::Imath) | |
164 | +SET(_openexr_FIND_COMPONENTS | |
165 | + Imath | |
166 | + Iex | |
167 | + OpenEXR | |
168 | + IlmThread | |
169 | +) | |
170 | + | |
171 | +else() | |
172 | SET(_openexr_FIND_COMPONENTS | |
173 | Half | |
174 | Iex | |
175 | @@ -40,6 +51,7 @@ SET(_openexr_FIND_COMPONENTS | |
176 | IlmThread | |
177 | Imath | |
178 | ) | |
179 | +endif() | |
180 | ||
181 | SET(_openexr_SEARCH_DIRS | |
182 | ${OPENEXR_ROOT_DIR} | |
183 | @@ -121,6 +133,9 @@ IF(OPENEXR_FOUND) | |
184 | SET(OPENEXR_LIBRARIES ${_openexr_LIBRARIES}) | |
185 | # Both include paths are needed because of dummy OSL headers mixing #include <OpenEXR/foo.h> and #include <foo.h> :( | |
186 | SET(OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_DIR} ${OPENEXR_INCLUDE_DIR}/OpenEXR) | |
187 | + if(TARGET Imath::Imath) | |
188 | + list(APPEND OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_DIR}/Imath) | |
189 | + endif() | |
190 | ENDIF() | |
191 | ||
192 | MARK_AS_ADVANCED( |