diff options
-rw-r--r-- | source/blender/blenkernel/BKE_image.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 54 | ||||
-rw-r--r-- | source/blender/editors/render/render_opengl.c | 2 | ||||
-rw-r--r-- | source/blender/render/intern/source/pipeline.c | 10 |
4 files changed, 62 insertions, 6 deletions
diff --git a/source/blender/blenkernel/BKE_image.h b/source/blender/blenkernel/BKE_image.h index aec5b0afa45..894ccae0dc8 100644 --- a/source/blender/blenkernel/BKE_image.h +++ b/source/blender/blenkernel/BKE_image.h @@ -68,7 +68,7 @@ void BKE_imbuf_stamp_info(struct RenderResult *rr, struct ImBuf *ibuf); void BKE_stamp_info_from_imbuf(struct RenderResult *rr, struct ImBuf *ibuf); void BKE_stamp_info_callback(void *data, struct StampData *stamp_data, StampCallback callback, bool noskip); void BKE_image_stamp_buf( - struct Scene *scene, struct Object *camera, + struct Scene *scene, struct Object *camera, const struct StampData *stamp_data_template, unsigned char *rect, float *rectf, int width, int height, int channels); bool BKE_imbuf_alpha_test(struct ImBuf *ibuf); int BKE_imbuf_write_stamp( diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index d48b455ae81..cfed3716dcf 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -1865,8 +1865,45 @@ static void stampdata(Scene *scene, Object *camera, StampData *stamp_data, int d } } +static void stampdata_reset(const Scene *scene, StampData *stamp_data) +{ + if ((scene->r.stamp & R_STAMP_FILENAME) == 0) { + stamp_data->file[0] = '\0'; + } + if ((scene->r.stamp & R_STAMP_NOTE) == 0) { + stamp_data->note[0] = '\0'; + } + if ((scene->r.stamp & R_STAMP_DATE) == 0) { + stamp_data->date[0] = '\0'; + } + if ((scene->r.stamp & R_STAMP_MARKER) == 0) { + stamp_data->marker[0] = '\0'; + } + if ((scene->r.stamp & R_STAMP_TIME) == 0) { + stamp_data->time[0] = '\0'; + } + if ((scene->r.stamp & R_STAMP_FRAME) == 0) { + stamp_data->frame[0] = '\0'; + } + if ((scene->r.stamp & R_STAMP_CAMERA) == 0) { + stamp_data->camera[0] = '\0'; + } + if ((scene->r.stamp & R_STAMP_CAMERALENS) == 0) { + stamp_data->cameralens[0] = '\0'; + } + if ((scene->r.stamp & R_STAMP_SCENE) == 0) { + stamp_data->scene[0] = '\0'; + } + if ((scene->r.stamp & R_STAMP_SEQSTRIP) == 0) { + stamp_data->strip[0] = '\0'; + } + if ((scene->r.stamp & R_STAMP_RENDERTIME) == 0) { + stamp_data->rendertime[0] = '\0'; + } +} + void BKE_image_stamp_buf( - Scene *scene, Object *camera, + Scene *scene, Object *camera, const StampData *stamp_data_template, unsigned char *rect, float *rectf, int width, int height, int channels) { struct StampData stamp_data; @@ -1903,7 +1940,13 @@ void BKE_image_stamp_buf( display_device = scene->display_settings.display_device; display = IMB_colormanagement_display_get_named(display_device); - stampdata(scene, camera, &stamp_data, 1); + if (stamp_data_template == NULL) { + stampdata(scene, camera, &stamp_data, 1); + } + else { + stamp_data = *stamp_data_template; + stampdata_reset(scene, &stamp_data); + } /* TODO, do_versions */ if (scene->r.stamp_font_id < 8) @@ -2146,7 +2189,12 @@ static void metadata_change_field(void *data, const char *propname, char *propva static void metadata_get_field(void *data, const char *propname, char *propvalue, int len) { - IMB_metadata_get_field(data, propname, propvalue, len); + char buffer[1024]; + if (STREQ(propname, "Strip")) { + IMB_metadata_get_field(data, propname, buffer, sizeof(buffer)); + } + IMB_metadata_get_field(data, propname, buffer, sizeof(buffer)); + BLI_snprintf(propvalue, len, "%s %s", propname, buffer); } void BKE_imbuf_stamp_info(RenderResult *rr, struct ImBuf *ibuf) diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index 5268afae270..12fed3fc128 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -392,7 +392,7 @@ static void screen_opengl_render_doit(OGLRender *oglrender, RenderResult *rr) /* rr->rectf is now filled with image data */ if ((scene->r.stamp & R_STAMP_ALL) && (scene->r.stamp & R_STAMP_DRAW)) - BKE_image_stamp_buf(scene, camera, rect, rectf, rr->rectx, rr->recty, 4); + BKE_image_stamp_buf(scene, camera, NULL, rect, rectf, rr->rectx, rr->recty, 4); MEM_freeN(rect); } diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 3f7cfa8c690..21b0d70dd75 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -448,6 +448,8 @@ void RE_AcquireResultImage(Render *re, RenderResult *rr, const int view_id) rr->xof = re->disprect.xmin; rr->yof = re->disprect.ymin; + + rr->stamp_data = re->result->stamp_data; } } } @@ -2596,7 +2598,13 @@ static void renderresult_stampinfo(Render *re) for (rv = re->result->views.first;rv;rv = rv->next, nr++) { RE_SetActiveRenderView(re, rv->name); RE_AcquireResultImage(re, &rres, nr); - BKE_image_stamp_buf(re->scene, RE_GetCamera(re), (unsigned char *)rres.rect32, rres.rectf, rres.rectx, rres.recty, 4); + BKE_image_stamp_buf(re->scene, + RE_GetCamera(re), + (re->r.stamp & R_STAMP_STRIPMETA) ? rres.stamp_data : NULL, + (unsigned char *)rres.rect32, + rres.rectf, + rres.rectx, rres.recty, + 4); RE_ReleaseResultImage(re); } } |