Color management: Cleanup, make function name more clear
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 6 Dec 2018 10:56:23 +0000 (11:56 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 6 Dec 2018 11:31:50 +0000 (12:31 +0100)
The idea is to reflect that the view settings are the best
for cases when one wants to see things as if they are a
render result.

source/blender/blenkernel/BKE_colortools.h
source/blender/blenkernel/intern/colortools.c
source/blender/blenkernel/intern/image.c
source/blender/blenkernel/intern/scene.c
source/blender/imbuf/intern/colormanagement.c

index 7c378bd3e063f72fbacb1c5af0c388a15c4b7a99..d509bf5eb6c0a6166b14cecca6f8405340e49515 100644 (file)
@@ -101,9 +101,12 @@ void BKE_color_managed_display_settings_copy(
         struct ColorManagedDisplaySettings *new_settings,
         const struct ColorManagedDisplaySettings *settings);
 
-void BKE_color_managed_view_settings_init(
+/* Initialize view settings to be best suitable for render type of viewing.
+ * This will use default view transform from the OCIO configuration. */
+void BKE_color_managed_view_settings_init_render(
         struct ColorManagedViewSettings *settings,
         const struct ColorManagedDisplaySettings *display_settings);
+
 void BKE_color_managed_view_settings_copy(
         struct ColorManagedViewSettings *new_settings,
         const struct ColorManagedViewSettings *settings);
index bd006c8b8324dab447289e0675933f866359912b..d86dddd4e399daee69d6ec5b3b00f87e048053c4 100644 (file)
@@ -1569,7 +1569,7 @@ void BKE_color_managed_display_settings_copy(ColorManagedDisplaySettings *new_se
        BLI_strncpy(new_settings->display_device, settings->display_device, sizeof(new_settings->display_device));
 }
 
-void BKE_color_managed_view_settings_init(
+void BKE_color_managed_view_settings_init_render(
         ColorManagedViewSettings *view_settings,
         const ColorManagedDisplaySettings *display_settings)
 {
index fc8e992915e1451238fc7f1059e8acdd150d6014..e08ca35aca8d61a8cf42d48f20bb21dab0a6f670 100644 (file)
@@ -1402,8 +1402,8 @@ void BKE_imformat_defaults(ImageFormatData *im_format)
        im_format->compress = 15;
 
        BKE_color_managed_display_settings_init(&im_format->display_settings);
-       BKE_color_managed_view_settings_init(&im_format->view_settings,
-                                            &im_format->display_settings);
+       BKE_color_managed_view_settings_init_render(&im_format->view_settings,
+                                                   &im_format->display_settings);
 }
 
 void BKE_imbuf_to_image_format(struct ImageFormatData *im_format, const ImBuf *imbuf)
index e8aebb2dbaaed8f70170f1458988cd518bb5e1ba..053ca38a57c0f39a22fc8cbd23335dea8f7b0e1f 100644 (file)
@@ -763,8 +763,8 @@ void BKE_scene_init(Scene *sce)
        colorspace_name = IMB_colormanagement_role_colorspace_name_get(COLOR_ROLE_DEFAULT_SEQUENCER);
 
        BKE_color_managed_display_settings_init(&sce->display_settings);
-       BKE_color_managed_view_settings_init(&sce->view_settings,
-                                            &sce->display_settings);
+       BKE_color_managed_view_settings_init_render(&sce->view_settings,
+                                                   &sce->display_settings);
        BLI_strncpy(sce->sequencer_colorspace_settings.name, colorspace_name,
                    sizeof(sce->sequencer_colorspace_settings.name));
 
index afba1c6a41a430efcc1b71972d61b36c487d1cf2..f9c0f6754478731221121ec98125c2f9fc30d67b 100644 (file)
@@ -930,8 +930,8 @@ static OCIO_ConstProcessorRcPtr *display_to_scene_linear_processor(ColorManagedD
        return (OCIO_ConstProcessorRcPtr *) display->to_scene_linear;
 }
 
-static void init_default_view_settings(const ColorManagedDisplaySettings *display_settings,
-                                       ColorManagedViewSettings *view_settings)
+static void init_render_view_settings(const ColorManagedDisplaySettings *display_settings,
+                                      ColorManagedViewSettings *view_settings)
 {
        ColorManagedDisplay *display;
        ColorManagedView *default_view = NULL;
@@ -2142,7 +2142,7 @@ unsigned char *IMB_display_buffer_acquire(ImBuf *ibuf, const ColorManagedViewSet
                 * this happens for images which don't want to be displayed with render settings
                 */
 
-               init_default_view_settings(display_settings,  &default_view_settings);
+               init_render_view_settings(display_settings,  &default_view_settings);
                applied_view_settings = &default_view_settings;
        }
 
@@ -3144,7 +3144,7 @@ ColormanageProcessor *IMB_colormanagement_display_processor_new(const ColorManag
                applied_view_settings = view_settings;
        }
        else {
-               init_default_view_settings(display_settings,  &default_view_settings);
+               init_render_view_settings(display_settings,  &default_view_settings);
                applied_view_settings = &default_view_settings;
        }
 
@@ -3445,7 +3445,7 @@ bool IMB_colormanagement_setup_glsl_draw_from_space(const ColorManagedViewSettin
                 * this happens for images which don't want to be displayed with render settings
                 */
 
-               init_default_view_settings(display_settings,  &default_view_settings);
+               init_render_view_settings(display_settings,  &default_view_settings);
                applied_view_settings = &default_view_settings;
        }