Blender V2.61 - r43446
|
#include <stdio.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "BKE_image.h"
#include "BKE_global.h"
#include "BKE_main.h"
#include "BKE_report.h"
#include "BKE_utildefines.h"
#include "BLI_fileops.h"
#include "BLI_listbase.h"
#include "BLI_path_util.h"
#include "BLI_string.h"
#include "BLI_threads.h"
#include "BLI_utildefines.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#include "intern/openexr/openexr_multi.h"
#include "render_result.h"
#include "render_types.h"
Go to the source code of this file.
Definition in file render_result.c.
static void do_merge_tile | ( | RenderResult * | rr, |
RenderResult * | rrpart, | ||
float * | target, | ||
float * | tile, | ||
int | pixsize | ||
) | [static] |
Definition at line 546 of file render_result.c.
References RenderResult::crop, RenderResult::rectx, RenderResult::recty, RenderResult::tilerect, ImBuf::tilex, ImBuf::tiley, rcti::xmin, ImBuf::y, and rcti::ymin.
Referenced by render_result_merge().
static const char* get_pass_name | ( | int | passtype, |
int | channel | ||
) | [static] |
Definition at line 114 of file render_result.c.
References SCE_PASS_AO, SCE_PASS_COMBINED, SCE_PASS_DIFFUSE, SCE_PASS_EMIT, SCE_PASS_ENVIRONMENT, SCE_PASS_INDEXMA, SCE_PASS_INDEXOB, SCE_PASS_INDIRECT, SCE_PASS_MIST, SCE_PASS_NORMAL, SCE_PASS_RAYHITS, SCE_PASS_REFLECT, SCE_PASS_REFRACT, SCE_PASS_RGBA, SCE_PASS_SHADOW, SCE_PASS_SPEC, SCE_PASS_UV, SCE_PASS_VECTOR, and SCE_PASS_Z.
Referenced by RE_WriteRenderResult(), render_layer_add_pass(), render_result_exr_file_read_path(), and save_render_result_tile().
static char* make_pass_name | ( | RenderPass * | rpass, |
int | chan | ||
) | [static] |
Definition at line 600 of file render_result.c.
References BLI_strncpy(), RenderPass::chan_id, EXR_PASS_MAXNAME, len(), RenderPass::name, ImBuf::name, and strlen().
Referenced by RE_WriteRenderResult().
static void* ml_addlayer_cb | ( | void * | base, |
char * | str | ||
) | [static] |
Definition at line 486 of file render_result.c.
References BLI_addtail(), BLI_strncpy(), EXR_LAY_MAXNAME, RenderResult::layers, MEM_callocN(), and RenderLayer::name.
Referenced by render_result_new_from_exr().
static void ml_addpass_cb | ( | void * | UNUSEDbase, |
void * | lay, | ||
char * | str, | ||
float * | rect, | ||
int | totchan, | ||
char * | chan_id | ||
) | [static] |
Definition at line 498 of file render_result.c.
References BLI_addtail(), BLI_strncpy(), RenderPass::chan_id, RenderPass::channels, EXR_PASS_MAXNAME, MEM_callocN(), RenderPass::name, RenderLayer::passes, RenderLayer::passflag, RenderPass::passtype, passtype_from_name(), and RenderPass::rect.
Referenced by render_result_new_from_exr().
static int passtype_from_name | ( | const char * | str | ) | [static] |
Definition at line 230 of file render_result.c.
References SCE_PASS_AO, SCE_PASS_COMBINED, SCE_PASS_DIFFUSE, SCE_PASS_EMIT, SCE_PASS_ENVIRONMENT, SCE_PASS_INDEXMA, SCE_PASS_INDEXOB, SCE_PASS_INDIRECT, SCE_PASS_MIST, SCE_PASS_NORMAL, SCE_PASS_RAYHITS, SCE_PASS_REFLECT, SCE_PASS_REFRACT, SCE_PASS_RGBA, SCE_PASS_SHADOW, SCE_PASS_SPEC, SCE_PASS_UV, SCE_PASS_VECTOR, and SCE_PASS_Z.
Referenced by ml_addpass_cb().
int RE_WriteRenderResult | ( | ReportList * | reports, |
RenderResult * | rr, | ||
const char * | filename, | ||
int | compress | ||
) |
Definition at line 616 of file render_result.c.
References BKE_report(), BLI_make_existing_file(), RenderPass::channels, FALSE, ListBase::first, get_pass_name(), IMB_exr_add_channel(), IMB_exr_begin_write(), IMB_exr_close(), IMB_exr_get_handle(), IMB_exr_write_channels(), RenderResult::layers, make_pass_name(), RenderLayer::name, RenderPass::next, RenderLayer::next, RenderLayer::passes, RenderPass::passtype, RenderPass::rect, RenderLayer::rectf, RenderResult::rectf, RenderResult::rectx, RenderResult::recty, RPT_ERROR, SCE_PASS_COMBINED, and TRUE.
Referenced by do_write_image_or_movie(), and save_image_doit().
static void render_layer_add_pass | ( | RenderResult * | rr, |
RenderLayer * | rl, | ||
int | channels, | ||
int | passtype | ||
) | [static] |
Definition at line 294 of file render_result.c.
References BLI_addtail(), BLI_strncpy(), RenderPass::channels, ImBuf::channels, RenderResult::exrhandle, get_pass_name(), IMB_exr_add_channel(), MEM_callocN(), MEM_mapallocN(), RenderLayer::name, RenderPass::name, NULL, PASS_VECTOR_MAX, RenderLayer::passes, RenderPass::passtype, RenderPass::rect, ImBuf::rect, RenderLayer::rectx, RenderPass::rectx, RenderResult::rectx, RenderLayer::recty, RenderPass::recty, RenderResult::recty, SCE_PASS_VECTOR, SCE_PASS_Z, and ImBuf::x.
Referenced by render_result_new().
void render_result_exr_file_begin | ( | Render * | re | ) |
Definition at line 790 of file render_result.c.
References RenderResult::exrhandle, FILE_MAX, IMB_exrtile_begin_write(), RenderResult::next, Render::partx, Render::party, RenderResult::rectx, RenderResult::recty, render_result_exr_file_path(), Render::result, RenderResult::sample_nr, Render::scene, and str.
Referenced by threaded_tile_processor().
void render_result_exr_file_end | ( | Render * | re | ) |
Definition at line 804 of file render_result.c.
References RenderResult::exrhandle, Render::fullresult, IMB_exr_close(), RenderResult::next, NULL, render_result_exr_file_read(), render_result_free_list(), Render::result, and save_empty_result_tiles().
Referenced by threaded_tile_processor().
void render_result_exr_file_merge | ( | RenderResult * | rr, |
RenderResult * | rrpart | ||
) |
Definition at line 822 of file render_result.c.
References RenderResult::next, and save_render_result_tile().
Referenced by do_part_thread().
void render_result_exr_file_path | ( | Scene * | scene, |
int | sample, | ||
char * | filepath | ||
) |
Definition at line 829 of file render_result.c.
References BLI_make_file_string(), BLI_snprintf(), BLI_splitdirstring(), BLI_strncpy(), BLI_temporary_dir(), FILE_MAX, FILE_MAXFILE, G, Scene::id, MAX_ID_NAME, ID::name, and ImBuf::name.
Referenced by RE_is_rendering_allowed(), render_result_exr_file_begin(), and render_result_exr_file_read().
int render_result_exr_file_read | ( | Render * | re, |
int | sample | ||
) |
Definition at line 845 of file render_result.c.
References Render::disprect, FALSE, FILE_MAX, RE_FreeRenderResult(), render_result_exr_file_path(), render_result_exr_file_read_path(), render_result_new(), Render::result, RR_USE_MEM, Render::scene, str, and TRUE.
Referenced by do_merge_fullsample(), RE_ReadRenderResult(), and render_result_exr_file_end().
int render_result_exr_file_read_path | ( | RenderResult * | rr, |
const char * | filepath | ||
) |
Definition at line 869 of file render_result.c.
References BLI_strncpy(), RenderPass::channels, ListBase::first, get_pass_name(), IMB_exr_begin_read(), IMB_exr_close(), IMB_exr_get_handle(), IMB_exr_read_channels(), IMB_exr_set_channel(), RenderResult::layers, RenderPass::name, RenderLayer::name, RenderPass::next, RenderLayer::next, NULL, RenderLayer::passes, RenderPass::passtype, RenderPass::rect, RenderLayer::rectf, RenderResult::rectx, RenderResult::recty, and SCE_PASS_COMBINED.
Referenced by RE_result_load_from_file(), and render_result_exr_file_read().
void render_result_free | ( | RenderResult * | res | ) |
Definition at line 61 of file render_result.c.
References RenderLayer::acolrect, BLI_remlink(), ListBase::first, RenderResult::layers, MEM_freeN(), NULL, RenderLayer::passes, RenderPass::rect, RenderResult::rect32, RenderResult::rectf, RenderLayer::rectf, RenderResult::rectz, RenderLayer::scolrect, and RenderResult::text.
Referenced by do_render_blur_3d(), do_render_composite_fields_blur_3d(), do_render_fields_3d(), do_render_fields_blur_3d(), RE_engine_render(), RE_FreeRender(), RE_FreeRenderResult(), RE_InitState(), render_result_free_list(), and threaded_tile_processor().
void render_result_free_list | ( | ListBase * | lb, |
RenderResult * | rr | ||
) |
Definition at line 96 of file render_result.c.
References BLI_remlink(), ListBase::first, RenderResult::next, and render_result_free().
Referenced by RE_engine_end_result(), RE_engine_render(), render_result_exr_file_end(), and threaded_tile_processor().
void render_result_merge | ( | RenderResult * | rr, |
RenderResult * | rrpart | ||
) |
Definition at line 581 of file render_result.c.
References RenderPass::channels, do_merge_tile(), ListBase::first, RenderResult::layers, RenderPass::next, RenderLayer::next, RenderLayer::passes, RenderPass::rect, and RenderLayer::rectf.
Referenced by do_part_thread(), do_render_fields_blur_3d(), and RE_engine_end_result().
RenderResult* render_result_new | ( | Render * | re, |
rcti * | partrct, | ||
int | crop, | ||
int | savebuffers | ||
) | [read] |
Definition at line 336 of file render_result.c.
References RenderData::actlay, BLI_addtail(), BLI_strncpy(), RenderResult::crop, Render::disprect, RenderResult::exrhandle, ListBase::first, IMB_exr_add_channel(), IMB_exr_get_handle(), SceneRenderLayer::lay, RenderLayer::lay, SceneRenderLayer::lay_zmask, RenderLayer::lay_zmask, RenderResult::layers, RenderData::layers, RenderLayer::layflag, SceneRenderLayer::layflag, SceneRenderLayer::light_override, RenderLayer::light_override, SceneRenderLayer::mat_override, RenderLayer::mat_override, MEM_callocN(), MEM_mapallocN(), SceneRenderLayer::name, RenderLayer::name, SceneRenderLayer::next, NULL, SceneRenderLayer::pass_xor, RenderLayer::pass_xor, SceneRenderLayer::passflag, RenderLayer::passflag, Render::r, R_SINGLE_LAYER, RenderLayer::rectf, RenderLayer::rectx, RenderResult::rectx, RenderLayer::recty, RenderResult::recty, render_layer_add_pass(), RenderResult::renrect, SCE_LAY_DISABLE, SCE_PASS_AO, SCE_PASS_COMBINED, SCE_PASS_DIFFUSE, SCE_PASS_EMIT, SCE_PASS_ENVIRONMENT, SCE_PASS_INDEXMA, SCE_PASS_INDEXOB, SCE_PASS_INDIRECT, SCE_PASS_MIST, SCE_PASS_NORMAL, SCE_PASS_RAYHITS, SCE_PASS_REFLECT, SCE_PASS_REFRACT, SCE_PASS_RGBA, SCE_PASS_SHADOW, SCE_PASS_SPEC, SCE_PASS_UV, SCE_PASS_VECTOR, SCE_PASS_Z, RenderData::scemode, RenderResult::tilerect, Render::winx, Render::winy, rcti::xmax, rcti::xmin, RenderResult::xof, rcti::ymax, rcti::ymin, and RenderResult::yof.
Referenced by do_part_thread(), do_render_blur_3d(), do_render_composite_fields_blur_3d(), do_render_fields_3d(), do_render_fields_blur_3d(), RE_engine_begin_result(), RE_engine_render(), render_result_exr_file_read(), render_result_new_full_sample(), and threaded_tile_processor().
RenderResult* render_result_new_from_exr | ( | void * | exrhandle, |
int | rectx, | ||
int | recty | ||
) | [read] |
Definition at line 520 of file render_result.c.
References ListBase::first, IMB_exr_multilayer_convert(), RenderResult::layers, MEM_callocN(), ml_addlayer_cb(), ml_addpass_cb(), RenderPass::next, RenderLayer::next, RenderLayer::passes, RenderLayer::rectx, RenderPass::rectx, RenderResult::rectx, RenderLayer::recty, RenderPass::recty, and RenderResult::recty.
Referenced by RE_MultilayerConvert().
RenderResult* render_result_new_full_sample | ( | Render * | re, |
ListBase * | lb, | ||
rcti * | partrct, | ||
int | crop, | ||
int | savebuffers | ||
) | [read] |
Definition at line 469 of file render_result.c.
References BLI_addtail(), ListBase::first, Render::osa, render_result_new(), and RenderResult::sample_nr.
Referenced by do_part_thread(), and threaded_tile_processor().
void render_result_rect_fill_zero | ( | RenderResult * | rr | ) |
Definition at line 993 of file render_result.c.
References MEM_callocN(), RenderResult::rect32, RenderResult::rectf, RenderResult::rectx, and RenderResult::recty.
Referenced by do_render_seq().
void render_result_rect_from_ibuf | ( | RenderResult * | rr, |
RenderData * | rd, | ||
ImBuf * | ibuf | ||
) |
Definition at line 956 of file render_result.c.
References RenderData::color_mgt_flag, IB_PROFILE_LINEAR_RGB, IB_PROFILE_SRGB, IMB_buffer_float_from_float(), MEM_freeN(), MEM_mallocN(), NULL, ImBuf::profile, R_COLOR_MANAGEMENT, R_COLOR_MANAGEMENT_PREDIVIDE, ImBuf::rect, RenderResult::rect32, ImBuf::rect_float, RenderResult::rectf, RenderResult::rectx, and RenderResult::recty.
Referenced by do_render_seq().
void render_result_rect_get_pixels | ( | RenderResult * | rr, |
RenderData * | rd, | ||
unsigned int * | rect, | ||
int | rectx, | ||
int | recty | ||
) |
Definition at line 1003 of file render_result.c.
References RenderData::color_mgt_flag, ImBuf::dither, IB_PROFILE_LINEAR_RGB, IB_PROFILE_SRGB, IMB_buffer_byte_from_float(), R_COLOR_MANAGEMENT, R_COLOR_MANAGEMENT_PREDIVIDE, RenderResult::rect32, RenderResult::rectf, RenderResult::rectx, and RenderResult::recty.
Referenced by RE_ResultGet32().
ImBuf* render_result_rect_to_ibuf | ( | RenderResult * | rr, |
RenderData * | rd | ||
) | [read] |
Definition at line 919 of file render_result.c.
References BKE_imtype_valid_depths(), RenderData::color_mgt_flag, ImBuf::dither, RenderData::dither_intensity, ImBuf::flags, IB_cm_predivide, IB_PROFILE_LINEAR_RGB, IB_PROFILE_SRGB, if(), RenderData::im_format, IMB_allocImBuf(), IMB_color_to_bw(), IMB_dupImBuf(), IMB_float_from_rect(), IMB_freeImBuf(), ImageFormatData::imtype, ImageFormatData::planes, ImBuf::profile, R_COLOR_MANAGEMENT, R_COLOR_MANAGEMENT_PREDIVIDE, R_IMF_CHAN_DEPTH_12, R_IMF_CHAN_DEPTH_16, R_IMF_CHAN_DEPTH_24, R_IMF_CHAN_DEPTH_32, R_IMF_PLANES_BW, ImBuf::rect, RenderResult::rect32, ImBuf::rect_float, RenderResult::rectf, RenderResult::rectx, RenderResult::recty, RenderResult::rectz, and ImBuf::zbuf_float.
Referenced by do_write_image_or_movie().
void render_result_single_layer_begin | ( | Render * | re | ) |
Definition at line 675 of file render_result.c.
References NULL, Render::pushedresult, RE_FreeRenderResult(), and Render::result.
Referenced by render_initialize_from_main().
void render_result_single_layer_end | ( | Render * | re | ) |
Definition at line 687 of file render_result.c.
References RenderData::actlay, BLI_addtail(), BLI_remlink(), ListBase::first, RenderData::layers, RenderResult::layers, SceneRenderLayer::name, SceneRenderLayer::next, NULL, Render::pushedresult, Render::r, Scene::r, RE_FreeRenderResult(), RE_GetRenderLayer(), RenderResult::rectx, RenderResult::recty, Render::result, and Render::scene.
Referenced by do_render_composite_fields_blur_3d().
static void save_empty_result_tiles | ( | Render * | re | ) | [static] |
Definition at line 771 of file render_result.c.
References RenderPart::crop, RenderPart::disprect, Render::disprect, RenderResult::exrhandle, ListBase::first, IMB_exrtile_clear_channels(), IMB_exrtile_write_channels(), RenderPart::next, RenderResult::next, Render::parts, RenderPart::ready, Render::result, rcti::xmin, and rcti::ymin.
Referenced by render_result_exr_file_end().
static void save_render_result_tile | ( | RenderResult * | rr, |
RenderResult * | rrpart | ||
) | [static] |
Definition at line 729 of file render_result.c.
References BLI_lock_thread(), BLI_unlock_thread(), RenderPass::channels, RenderResult::crop, RenderResult::exrhandle, ListBase::first, get_pass_name(), IMB_exr_set_channel(), IMB_exrtile_write_channels(), RenderResult::layers, LOCK_IMAGE, RenderLayer::name, RenderPass::next, RenderLayer::next, offs, RenderLayer::passes, RenderPass::passtype, RenderPass::rect, RenderLayer::rectf, RenderResult::rectx, SCE_PASS_COMBINED, RenderResult::tilerect, rcti::xmin, and rcti::ymin.
Referenced by render_result_exr_file_merge().