diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-10-15 23:18:40 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-10-15 23:18:40 +0400 |
commit | 5fff9cf6603d4d3d78c0edccc4d6661795c1a1e4 (patch) | |
tree | 41b95042d637b7f6a12e76dfe80df5f0408cb1ef /source/blender/blenkernel/intern/image.c | |
parent | 66725a189e277744f134e4c098c6dbecd979689f (diff) |
stamp font size and added rendertime stamp option
Diffstat (limited to 'source/blender/blenkernel/intern/image.c')
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 09d150341b2..efe53f6f8ef 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -964,6 +964,7 @@ typedef struct StampData { char camera[64]; char scene[64]; char strip[64]; + char rendertime[64]; } StampData; static void stampdata(Scene *scene, StampData *stamp_data, int do_prefix) @@ -1087,6 +1088,20 @@ static void stampdata(Scene *scene, StampData *stamp_data, int do_prefix) } else { stamp_data->strip[0] = '\0'; } + + { + Render *re= RE_GetRender(scene->id.name); + RenderStats *stats= re ? RE_GetStats(re):NULL; + + if (stats && (scene->r.stamp & R_STAMP_RENDERTIME)) { + BLI_timestr(stats->lastframetime, text); + + if (do_prefix) sprintf(stamp_data->rendertime, "RenderTime %s", text); + else sprintf(stamp_data->rendertime, "%s", text); + } else { + stamp_data->rendertime[0] = '\0'; + } + } } // XXX - Bad level call. @@ -1116,7 +1131,12 @@ void BKE_stamp_buf(Scene *scene, unsigned char *rect, float *rectf, int width, i return; stampdata(scene, &stamp_data, 1); - stamp_font_begin(12); + + /* TODO, do_versions */ + if(scene->r.stamp_font_id < 8) + scene->r.stamp_font_id= 12; + + stamp_font_begin(scene->r.stamp_font_id); BLF_buffer(rectf, rect, width, height, channels); BLF_buffer_col(scene->r.fg_stamp[0], scene->r.fg_stamp[1], scene->r.fg_stamp[2], 1.0); @@ -1166,6 +1186,21 @@ void BKE_stamp_buf(Scene *scene, unsigned char *rect, float *rectf, int width, i BLF_position(x, y, 0.0); BLF_draw_buffer(stamp_data.date); + + /* the extra pixel for background. */ + y -= 4; + } + + /* Top left corner, below File, Date or Note */ + if (stamp_data.rendertime[0]) { + BLF_width_and_height(stamp_data.rendertime, &w, &h); + y -= h; + + /* and space for background. */ + buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, 0, y-3, w+3, y+h+3); + + BLF_position(x, y, 0.0); + BLF_draw_buffer(stamp_data.rendertime); } x= 0; |