コード例 #1
0
void *OutputOpenExrMultiLayerMultiViewOperation::get_handle(const char *filename)
{
	unsigned int width = this->getWidth();
	unsigned int height = this->getHeight();

	if (width != 0 && height != 0) {

		void *exrhandle;
		SceneRenderView *srv;

		/* get a new global handle */
		exrhandle = IMB_exr_get_handle_name(filename);

		if (!BKE_scene_multiview_is_render_view_first(this->m_rd, this->m_viewName))
			return exrhandle;

		IMB_exr_clear_channels(exrhandle);

		/* check renderdata for amount of views */
		for (srv = (SceneRenderView *) this->m_rd->views.first; srv; srv = srv->next) {

			if (BKE_scene_multiview_is_render_view_active(this->m_rd, srv) == false)
				continue;

			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);
		}

		BLI_make_existing_file(filename);

		/* prepare the file with all the channels for the header */
		if (IMB_exr_begin_write(exrhandle, filename, width, height, this->m_exr_codec) == 0) {
			printf("Error Writing Multilayer Multiview Openexr\n");
			IMB_exr_close(exrhandle);
		}
		else {
			IMB_exr_clear_channels(exrhandle);
			return exrhandle;
		}
	}
	return NULL;
}
コード例 #2
0
void *OutputOpenExrSingleLayerMultiViewOperation::get_handle(const char *filename)
{
	size_t width = this->getWidth();
	size_t height = this->getHeight();
	SceneRenderView *srv;

	if (width != 0 && height != 0) {
		void *exrhandle;

		exrhandle = IMB_exr_get_handle_name(filename);

		if (!BKE_scene_multiview_is_render_view_first(this->m_rd, this->m_viewName))
			return exrhandle;

		IMB_exr_clear_channels(exrhandle);

		for (srv = (SceneRenderView *)this->m_rd->views.first; srv; srv = srv->next) {
			if (BKE_scene_multiview_is_render_view_active(this->m_rd, srv) == false)
				continue;

			IMB_exr_add_view(exrhandle, srv->name);
			add_exr_channels(exrhandle, NULL, this->m_datatype, srv->name, width, NULL);
		}

		BLI_make_existing_file(filename);

		/* prepare the file with all the channels */

		if (IMB_exr_begin_write(exrhandle, filename, width, height, this->m_format->exr_codec) == 0) {
			printf("Error Writing Singlelayer Multiview Openexr\n");
			IMB_exr_close(exrhandle);
		}
		else {
			IMB_exr_clear_channels(exrhandle);
			return exrhandle;
		}
	}
	return NULL;
}
コード例 #3
0
void render_result_save_empty_result_tiles(Render *re)
{
	RenderPart *pa;
	RenderResult *rr;
	RenderLayer *rl;
	
	for (rr = re->result; rr; rr = rr->next) {
		for (rl = rr->layers.first; rl; rl = rl->next) {
			IMB_exr_clear_channels(rl->exrhandle);
		
			for (pa = re->parts.first; pa; pa = pa->next) {
				if (pa->status != PART_STATUS_READY) {
					int party = pa->disprect.ymin - re->disprect.ymin + pa->crop;
					int partx = pa->disprect.xmin - re->disprect.xmin + pa->crop;
					IMB_exrtile_write_channels(rl->exrhandle, partx, party, 0, re->viewname);
				}
			}
		}
	}
}
コード例 #4
0
void *OutputStereoOperation::get_handle(const char *filename)
{
	size_t width = this->getWidth();
	size_t height = this->getHeight();
	const char *names[2] = {STEREO_LEFT_NAME, STEREO_RIGHT_NAME};
	size_t i;

	if (width != 0 && height != 0) {
		void *exrhandle;

		exrhandle = IMB_exr_get_handle_name(filename);

		if (!BKE_scene_multiview_is_render_view_first(this->m_rd, this->m_viewName))
			return exrhandle;

		IMB_exr_clear_channels(exrhandle);

		for (i = 0; i < 2; i++)
			IMB_exr_add_view(exrhandle, names[i]);

		return exrhandle;
	}
	return NULL;
}