Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/image.c
| Show First 20 Lines • Show All 1,729 Lines • ▼ Show 20 Lines | if (scene->r.stamp & R_STAMP_SEQSTRIP) { | ||||
| BLI_snprintf(stamp_data->strip, sizeof(stamp_data->strip), do_prefix ? "Strip %s" : "%s", text); | BLI_snprintf(stamp_data->strip, sizeof(stamp_data->strip), do_prefix ? "Strip %s" : "%s", text); | ||||
| } | } | ||||
| else { | else { | ||||
| stamp_data->strip[0] = '\0'; | stamp_data->strip[0] = '\0'; | ||||
| } | } | ||||
| { | { | ||||
| Render *re = RE_GetRender(scene->id.name); | Render *re = RE_GetSceneRender(scene); | ||||
| RenderStats *stats = re ? RE_GetStats(re) : NULL; | RenderStats *stats = re ? RE_GetStats(re) : NULL; | ||||
| if (stats && (scene->r.stamp & R_STAMP_RENDERTIME)) { | if (stats && (scene->r.stamp & R_STAMP_RENDERTIME)) { | ||||
| BLI_timecode_string_from_time_simple(text, sizeof(text), stats->lastframetime); | BLI_timecode_string_from_time_simple(text, sizeof(text), stats->lastframetime); | ||||
| BLI_snprintf(stamp_data->rendertime, sizeof(stamp_data->rendertime), do_prefix ? "RenderTime %s" : "%s", text); | BLI_snprintf(stamp_data->rendertime, sizeof(stamp_data->rendertime), do_prefix ? "RenderTime %s" : "%s", text); | ||||
| } | } | ||||
| else { | else { | ||||
| ▲ Show 20 Lines • Show All 1,177 Lines • ▼ Show 20 Lines | |||||
| RenderResult *BKE_image_acquire_renderresult(Scene *scene, Image *ima) | RenderResult *BKE_image_acquire_renderresult(Scene *scene, Image *ima) | ||||
| { | { | ||||
| RenderResult *rr = NULL; | RenderResult *rr = NULL; | ||||
| if (ima->rr) { | if (ima->rr) { | ||||
| rr = ima->rr; | rr = ima->rr; | ||||
| } | } | ||||
| else if (ima->type == IMA_TYPE_R_RESULT) { | else if (ima->type == IMA_TYPE_R_RESULT) { | ||||
| if (ima->render_slot == ima->last_render_slot) | if (ima->render_slot == ima->last_render_slot) | ||||
| rr = RE_AcquireResultRead(RE_GetRender(scene->id.name)); | rr = RE_AcquireResultRead(RE_GetSceneRender(scene)); | ||||
| else | else | ||||
| rr = ima->renders[ima->render_slot]; | rr = ima->renders[ima->render_slot]; | ||||
| /* set proper views */ | /* set proper views */ | ||||
| image_init_multilayer_multiview(ima, rr); | image_init_multilayer_multiview(ima, rr); | ||||
| } | } | ||||
| return rr; | return rr; | ||||
| } | } | ||||
| void BKE_image_release_renderresult(Scene *scene, Image *ima) | void BKE_image_release_renderresult(Scene *scene, Image *ima) | ||||
| { | { | ||||
| if (ima->rr) { | if (ima->rr) { | ||||
| /* pass */ | /* pass */ | ||||
| } | } | ||||
| else if (ima->type == IMA_TYPE_R_RESULT) { | else if (ima->type == IMA_TYPE_R_RESULT) { | ||||
| if (ima->render_slot == ima->last_render_slot) | if (ima->render_slot == ima->last_render_slot) | ||||
| RE_ReleaseResult(RE_GetRender(scene->id.name)); | RE_ReleaseResult(RE_GetSceneRender(scene)); | ||||
| } | } | ||||
| } | } | ||||
| bool BKE_image_is_openexr(struct Image *ima) | bool BKE_image_is_openexr(struct Image *ima) | ||||
| { | { | ||||
| #ifdef WITH_OPENEXR | #ifdef WITH_OPENEXR | ||||
| if (ELEM(ima->source, IMA_SRC_FILE, IMA_SRC_SEQUENCE)) { | if (ELEM(ima->source, IMA_SRC_FILE, IMA_SRC_SEQUENCE)) { | ||||
| return BLI_testextensie(ima->name, ".exr"); | return BLI_testextensie(ima->name, ".exr"); | ||||
| } | } | ||||
| #else | #else | ||||
| UNUSED_VARS(ima); | UNUSED_VARS(ima); | ||||
| #endif | #endif | ||||
| return false; | return false; | ||||
| } | } | ||||
| void BKE_image_backup_render(Scene *scene, Image *ima, bool free_current_slot) | void BKE_image_backup_render(Scene *scene, Image *ima, bool free_current_slot) | ||||
| { | { | ||||
| /* called right before rendering, ima->renders contains render | /* called right before rendering, ima->renders contains render | ||||
| * result pointers for everything but the current render */ | * result pointers for everything but the current render */ | ||||
| Render *re = RE_GetRender(scene->id.name); | Render *re = RE_GetSceneRender(scene); | ||||
| int slot = ima->render_slot, last = ima->last_render_slot; | int slot = ima->render_slot, last = ima->last_render_slot; | ||||
| if (slot != last) { | if (slot != last) { | ||||
| ima->renders[last] = NULL; | ima->renders[last] = NULL; | ||||
| RE_SwapResult(re, &ima->renders[last]); | RE_SwapResult(re, &ima->renders[last]); | ||||
| if (ima->renders[slot]) { | if (ima->renders[slot]) { | ||||
| if (free_current_slot) { | if (free_current_slot) { | ||||
| ▲ Show 20 Lines • Show All 708 Lines • ▼ Show 20 Lines | static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser, void **r_lock) | ||||
| if (!(iuser && iuser->scene)) | if (!(iuser && iuser->scene)) | ||||
| return NULL; | return NULL; | ||||
| /* if we the caller is not going to release the lock, don't give the image */ | /* if we the caller is not going to release the lock, don't give the image */ | ||||
| if (!r_lock) | if (!r_lock) | ||||
| return NULL; | return NULL; | ||||
| re = RE_GetRender(iuser->scene->id.name); | re = RE_GetSceneRender(iuser->scene); | ||||
| channels = 4; | channels = 4; | ||||
| layer = iuser->layer; | layer = iuser->layer; | ||||
| pass = iuser->pass; | pass = iuser->pass; | ||||
| actview = iuser->view; | actview = iuser->view; | ||||
| if (BKE_image_is_stereo(ima) && (iuser->flag & IMA_SHOW_STEREO)) | if (BKE_image_is_stereo(ima) && (iuser->flag & IMA_SHOW_STEREO)) | ||||
| actview = iuser->multiview_eye; | actview = iuser->multiview_eye; | ||||
| ▲ Show 20 Lines • Show All 1,035 Lines • Show Last 20 Lines | |||||