diff --git a/source/blender/blenkernel/BKE_colortools.h b/source/blender/blenkernel/BKE_colortools.h index 345ec68f457..d9b6e874c25 100644 --- a/source/blender/blenkernel/BKE_colortools.h +++ b/source/blender/blenkernel/BKE_colortools.h @@ -31,6 +31,7 @@ * \ingroup bke */ +struct ColorManagedColorspaceSettings; struct ColorManagedDisplaySettings; struct ColorManagedViewSettings; struct CurveMapping; @@ -90,4 +91,8 @@ void BKE_color_managed_view_settings_init(struct ColorManagedViewSettings *setti void BKE_color_managed_view_settings_copy(struct ColorManagedViewSettings *new_settings, const struct ColorManagedViewSettings *settings); +void BKE_color_managed_colorspace_settings_init(struct ColorManagedColorspaceSettings *colorspace_settings); +void BKE_color_managed_colorspace_settings_copy(struct ColorManagedColorspaceSettings *colorspace_settings, + const struct ColorManagedColorspaceSettings *settings); + #endif diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c index c489c08f4df..ec9198590ed 100644 --- a/source/blender/blenkernel/intern/colortools.c +++ b/source/blender/blenkernel/intern/colortools.c @@ -1244,3 +1244,14 @@ void BKE_color_managed_view_settings_copy(ColorManagedViewSettings *new_settings 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)); +} diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index fa0070de76b..e65099cc621 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -71,6 +71,7 @@ #include "BLI_bpath.h" #include "BKE_bmfont.h" +#include "BKE_colortools.h" #include "BKE_global.h" #include "BKE_icons.h" #include "BKE_image.h" @@ -245,6 +246,8 @@ static Image *image_alloc(const char *name, short source, short type) ima->source = source; ima->type = type; + + BKE_color_managed_colorspace_settings_init(&ima->colorspace_settings); } return ima; } @@ -327,6 +330,8 @@ Image *BKE_image_copy(Image *ima) nima->aspx = ima->aspx; nima->aspy = ima->aspy; + BKE_color_managed_colorspace_settings_copy(&nima->colorspace_settings, &ima->colorspace_settings); + return nima; }