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:
Diffstat (limited to 'intern/cycles/render/session.cpp')
-rw-r--r--intern/cycles/render/session.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/intern/cycles/render/session.cpp b/intern/cycles/render/session.cpp
index 41156038558..bb636dd962a 100644
--- a/intern/cycles/render/session.cpp
+++ b/intern/cycles/render/session.cpp
@@ -55,7 +55,7 @@ Session::Session(const SessionParams& params_)
device = Device::create(params.device, stats, params.background);
- if(params.background && params.output_path.empty()) {
+ if(params.background && !params.write_render_cb) {
buffers = NULL;
display = NULL;
}
@@ -101,7 +101,7 @@ Session::~Session()
wait();
}
- if(!params.output_path.empty()) {
+ if(params.write_render_cb) {
/* tonemap and write out image if requested */
delete display;
@@ -109,8 +109,10 @@ Session::~Session()
display->reset(buffers->params);
tonemap(params.samples);
- progress.set_status("Writing Image", params.output_path);
- display->write(params.output_path);
+ int w = display->draw_width;
+ int h = display->draw_height;
+ uchar4 *pixels = display->rgba_byte.copy_from_device(0, w, h);
+ params.write_render_cb((uchar*)pixels, w, h, 4);
}
/* clean up */