Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2015-06-19 14:00:18 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-06-19 14:34:11 +0300
commit9d796df4f6376809f14ca0dd0484f63df9c72494 (patch)
tree2a01240bcdd82af1bc6c1507f41abf5df20c95a7 /source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cpp
parent0d3555fe2ea39e896a4679598723add20609f0c8 (diff)
Support half float file format storage for Multilayer EXR
Quite straightforward implementation -- all the conversion magic is happening in IMB_exr_write_channels() and remained changes are only needed to pass information whether channels is to be converted to half float or not. Regular file output will use full-float for Z pass, which matches behavior of the single layer EXR files. But when saving happens with File Output node then all the passes are respecting half float settings because it's not possible to distinguish whether we're saving Z pass or not. Reviewers: juicyfruit, campbellbarton Reviewed By: campbellbarton Subscribers: maxon, effstops, fsiddi Differential Revision: https://developer.blender.org/D1353
Diffstat (limited to 'source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cpp')
-rw-r--r--source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cpp b/source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cpp
index e89af9cc15b..7786359c06a 100644
--- a/source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cpp
+++ b/source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cpp
@@ -74,7 +74,7 @@ void *OutputOpenExrSingleLayerMultiViewOperation::get_handle(const char *filenam
continue;
IMB_exr_add_view(exrhandle, srv->name);
- add_exr_channels(exrhandle, NULL, this->m_datatype, srv->name, width, NULL);
+ add_exr_channels(exrhandle, NULL, this->m_datatype, srv->name, width, false, NULL);
}
BLI_make_existing_file(filename);
@@ -108,7 +108,8 @@ void OutputOpenExrSingleLayerMultiViewOperation::deinitExecution()
(this->m_rd->scemode & R_EXTENSION) != 0, true, NULL);
exrhandle = this->get_handle(filename);
- add_exr_channels(exrhandle, NULL, this->m_datatype, this->m_viewName, width, this->m_outputBuffer);
+ add_exr_channels(exrhandle, NULL, this->m_datatype, this->m_viewName, width,
+ this->m_format->depth == R_IMF_CHAN_DEPTH_16, this->m_outputBuffer);
/* memory can only be freed after we write all views to the file */
this->m_outputBuffer = NULL;
@@ -130,8 +131,9 @@ void OutputOpenExrSingleLayerMultiViewOperation::deinitExecution()
/************************************ OpenEXR Multilayer Multiview *****************************************/
OutputOpenExrMultiLayerMultiViewOperation::OutputOpenExrMultiLayerMultiViewOperation(
- const RenderData *rd, const bNodeTree *tree, const char *path, char exr_codec, const char *viewName)
- : OutputOpenExrMultiLayerOperation(rd, tree, path, exr_codec, viewName)
+ const RenderData *rd, const bNodeTree *tree, const char *path,
+ char exr_codec, bool exr_half_float, const char *viewName)
+ : OutputOpenExrMultiLayerOperation(rd, tree, path, exr_codec, exr_half_float, viewName)
{
}
@@ -162,7 +164,8 @@ void *OutputOpenExrMultiLayerMultiViewOperation::get_handle(const char *filename
IMB_exr_add_view(exrhandle, srv->name);
for (unsigned int i = 0; i < this->m_layers.size(); ++i)
- add_exr_channels(exrhandle, this->m_layers[i].name, this->m_layers[i].datatype, srv->name, width, NULL);
+ add_exr_channels(exrhandle, this->m_layers[i].name, this->m_layers[i].datatype,
+ srv->name, width, this->m_exr_half_float, NULL);
}
BLI_make_existing_file(filename);
@@ -197,7 +200,8 @@ void OutputOpenExrMultiLayerMultiViewOperation::deinitExecution()
exrhandle = this->get_handle(filename);
for (unsigned int i = 0; i < this->m_layers.size(); ++i)
- add_exr_channels(exrhandle, this->m_layers[i].name, this->m_layers[i].datatype, this->m_viewName, width, this->m_layers[i].outputBuffer);
+ add_exr_channels(exrhandle, this->m_layers[i].name, this->m_layers[i].datatype, this->m_viewName,
+ width, this->m_exr_half_float, this->m_layers[i].outputBuffer);
for (unsigned int i = 0; i < this->m_layers.size(); ++i) {
/* memory can only be freed after we write all views to the file */
@@ -269,7 +273,8 @@ void OutputStereoOperation::deinitExecution()
float *buf = this->m_outputBuffer;
/* populate single EXR channel with view data */
- IMB_exr_add_channel(exrhandle, NULL, this->m_name, this->m_viewName, 1, this->m_channels * width * height, buf);
+ IMB_exr_add_channel(exrhandle, NULL, this->m_name, this->m_viewName, 1, this->m_channels * width * height, buf,
+ this->m_format->depth == R_IMF_CHAN_DEPTH_16);
this->m_imageInput = NULL;
this->m_outputBuffer = NULL;