Merging r50248 through r50264 from trunk into soc-2011-tomato
[blender-staging.git] / source / blender / blenkernel / intern / colortools.c
index d65c81b4f9befabe21a60cc883722b888a8a5ae2..252add2c4233bbee3db482ec9c96045b9cc3e32b 100644 (file)
@@ -49,6 +49,7 @@
 #include "BKE_fcurve.h"
 
 
+#include "IMB_colormanagement.h"
 #include "IMB_imbuf.h"
 #include "IMB_imbuf_types.h"
 
@@ -1257,3 +1258,48 @@ void scopes_new(Scopes *scopes)
        scopes->waveform_3 = NULL;
        scopes->vecscope = NULL;
 }
+
+void BKE_color_managed_display_settings_init(ColorManagedDisplaySettings *settings)
+{
+       const char *display_name = IMB_colormanagement_display_get_default_name();
+
+       BLI_strncpy(settings->display_device, display_name, sizeof(settings->display_device));
+}
+
+void BKE_color_managed_display_settings_copy(ColorManagedDisplaySettings *new_settings,
+                                             const ColorManagedDisplaySettings *settings)
+{
+       BLI_strncpy(new_settings->display_device, settings->display_device, sizeof(new_settings->display_device));
+}
+
+void BKE_color_managed_view_settings_init(ColorManagedViewSettings *settings)
+{
+       /* OCIO_TODO: use default view transform here when OCIO is completely integrated
+       *             and proper versioning stuff is added.
+       *             for now use NONE to be compatible with all current files
+       */
+       BLI_strncpy(settings->view_transform, "NONE", sizeof(settings->view_transform));
+
+       settings->gamma = 1.0f;
+       settings->exposure = 0.0f;
+}
+
+void BKE_color_managed_view_settings_copy(ColorManagedViewSettings *new_settings,
+                                          const ColorManagedViewSettings *settings)
+{
+       BLI_strncpy(new_settings->view_transform, settings->view_transform, sizeof(new_settings->view_transform));
+
+       new_settings->exposure = settings->exposure;
+       new_settings->gamma = settings->gamma;
+}
+
+void BKE_color_managed_colorspace_settings_init(ColorManagedColorspaceSettings *colorspace_settings)
+{
+       BLI_strncpy(colorspace_settings->name, "NONE", sizeof(colorspace_settings->name));
+}
+
+void BKE_color_managed_colorspace_settings_copy(ColorManagedColorspaceSettings *colorspace_settings,
+                                                const ColorManagedColorspaceSettings *settings)
+{
+       BLI_strncpy(colorspace_settings->name, settings->name, sizeof(colorspace_settings->name));
+}