[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48632] branches/soc-2011-tomato/source/ blender: Color management: skip generating byte buffers in verify_buffer_float
Sergey Sharybin
sergey.vfx at gmail.com
Thu Jul 5 11:41:12 CEST 2012
Revision: 48632
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48632
Author: nazgul
Date: 2012-07-05 09:41:12 +0000 (Thu, 05 Jul 2012)
Log Message:
-----------
Color management: skip generating byte buffers in verify_buffer_float
This saves some time in cases color management is used by sipping
generating non-color managed buffers.
Modified Paths:
--------------
branches/soc-2011-tomato/source/blender/editors/space_clip/clip_draw.c
branches/soc-2011-tomato/source/blender/editors/space_image/image_draw.c
branches/soc-2011-tomato/source/blender/imbuf/intern/colormanagement.c
Modified: branches/soc-2011-tomato/source/blender/editors/space_clip/clip_draw.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/space_clip/clip_draw.c 2012-07-05 09:41:07 UTC (rev 48631)
+++ branches/soc-2011-tomato/source/blender/editors/space_clip/clip_draw.c 2012-07-05 09:41:12 UTC (rev 48632)
@@ -245,12 +245,18 @@
ED_region_info_draw(ar, str, block, 0.6f);
}
+/* OCIO_TODO: after finishing proper color management pipeline integration
+ * this wouldn't be needed -- color managed display buffer
+ * would be used unstead
+ */
+#if 0
static void verify_buffer_float(ImBuf *ibuf)
{
if (ibuf->rect_float && (ibuf->rect == NULL || (ibuf->userflags & IB_RECT_INVALID))) {
IMB_rect_from_float(ibuf);
}
}
+#endif
static void draw_movieclip_buffer(wmWindow *win, SpaceClip *sc, ARegion *ar, ImBuf *ibuf,
int width, int height, float zoomx, float zoomy)
@@ -270,7 +276,8 @@
unsigned char *display_buffer;
void *cache_handle;
- verify_buffer_float(ibuf);
+ /* OCIO_TODO: finally get rid of this stuff */
+ /* verify_buffer_float(ibuf); */
view_settings = IMB_view_settings_get_effective(win, &sc->view_settings);
display_buffer = IMB_display_buffer_acquire(ibuf, view_settings, &win->display_settings, &cache_handle);
Modified: branches/soc-2011-tomato/source/blender/editors/space_image/image_draw.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/space_image/image_draw.c 2012-07-05 09:41:07 UTC (rev 48631)
+++ branches/soc-2011-tomato/source/blender/editors/space_image/image_draw.c 2012-07-05 09:41:12 UTC (rev 48632)
@@ -79,6 +79,10 @@
#define HEADER_HEIGHT 18
+/* OCIO_TODO: after finishing proper color management pipeline integration
+ * this wouldn't be needed -- color managed display buffer
+ * would be used unstead
+ */
static void image_verify_buffer_float(Image *ima, ImBuf *ibuf, int color_manage)
{
/* detect if we need to redo the curve map.
@@ -96,7 +100,12 @@
else
ibuf->profile = IB_PROFILE_NONE;
- IMB_rect_from_float(ibuf);
+ /* OCIO_TODO: currently only get rid of old-style color managed byte
+ * buffer calculation to save some time on buffer display,
+ * but still need to set image buffer's profile to prevent
+ * comatibility breackage
+ */
+ /* IMB_rect_from_float(ibuf); */
}
}
Modified: branches/soc-2011-tomato/source/blender/imbuf/intern/colormanagement.c
===================================================================
--- branches/soc-2011-tomato/source/blender/imbuf/intern/colormanagement.c 2012-07-05 09:41:07 UTC (rev 48631)
+++ branches/soc-2011-tomato/source/blender/imbuf/intern/colormanagement.c 2012-07-05 09:41:12 UTC (rev 48632)
@@ -702,6 +702,13 @@
static void display_buffer_apply_tonemap(ImBuf *ibuf, unsigned char *display_buffer,
imb_tonecurveCb tonecurve_func)
{
+ /* XXX: IMB_buffer_byte_from_float_tonecurve isn't thread-safe because of
+ * possible non-initialized sRGB conversion stuff. Make sure it's properly
+ * initialized before starting threads, but likely this stuff should be
+ * initialized somewhere before to avoid possible issues in other issues.
+ */
+ BLI_init_srgb_conversion();
+
display_buffer_apply_threaded(ibuf, ibuf->rect_float, display_buffer, tonecurve_func,
do_display_buffer_apply_tonemap_thread);
}
More information about the Bf-blender-cvs
mailing list