Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
alta
alta
Commits
95b068de
Commit
95b068de
authored
Jan 24, 2017
by
Laurent Belcour
Browse files
[EXR] Working EXR plugin, need to clean code now
parent
c7b32de9
Changes
2
Hide whitespace changes
Inline
Side-by-side
SConstruct
View file @
95b068de
...
...
@@ -73,7 +73,7 @@ vars.Add('INSTALL_PREFIX', 'Parent installation directory',
vars
.
Add
(
'CXX'
,
'C++ compiler'
,
default
=
program_file_name
(
cxx_compilers
))
vars
.
Add
(
'CCFLAGS'
,
'Compiler
\'
s flags'
,
default
=
'-std=c++11 -g
-O2
-Wall'
)
default
=
'-std=c++11 -g -Wall'
)
vars
.
Add
(
'LINKFLAGS'
,
'Linker
\'
s flags'
,
default
=
''
)
vars
.
Add
(
'EIGEN_INC'
,
'Eigen include directory (mandatory)'
)
...
...
sources/plugins/data_io/EXR_IO.h
View file @
95b068de
...
...
@@ -111,7 +111,7 @@ class t_EXR_IO
/* Set the requested pixel types */
for
(
int
i
=
0
;
i
<
_header
.
num_channels
;
++
i
)
{
_header
.
pixel_types
[
i
]
=
TINYEXR_PIXELTYPE_FLOAT
;
_header
.
requested_
pixel_types
[
i
]
=
TINYEXR_PIXELTYPE_FLOAT
;
}
/* Load the EXR image */
...
...
@@ -135,11 +135,9 @@ class t_EXR_IO
W
=
_image
.
width
;
H
=
_image
.
height
;
pix
=
new
FType
[
W
*
H
*
3
];
for
(
int
k
=
0
;
k
<
_header
.
num_channels
;
++
k
)
{
float
*
img
=
reinterpret_cast
<
float
*>
(
_image
.
images
[
k
]);
for
(
int
k
=
0
;
k
<
_image
.
num_channels
;
++
k
)
{
for
(
int
i
=
0
;
i
<
W
*
H
;
++
i
)
{
const
doubl
e
val
=
(
FType
)(
img
[
i
]);
const
FTyp
e
val
=
(
FType
)(
reinterpret_cast
<
float
**>
(
_image
.
images
)[
k
]
[
i
]);
switch
(
_header
.
channels
[
k
].
name
[
0
])
{
case
'R'
:
pix
[
3
*
i
+
0
]
=
val
;
...
...
@@ -156,6 +154,9 @@ class t_EXR_IO
}
}
// Check: saver the file
SaveEXR
(
"dump.exr"
,
W
,
H
,
pix
);
/*! \todo Free TinyEXR memory : _image, _header and _version */
#endif
return
true
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment