Color management: initialize input color space for newly opening images
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user