diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2020-05-15 20:26:02 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2020-05-15 20:26:02 +0300 |
commit | e1c2eba4dedcb59572d9022859b08d2633954bbd (patch) | |
tree | 29b794cfc3bdd24c83ea092118c55a8dc05911d4 /source/blender/imbuf | |
parent | a8fc3c88efda66bcd8bada24ec0c8eb1e76cc852 (diff) | |
parent | abcb23f5a3b6f49b9fae741ce788a9a4a2a8e24f (diff) |
Merge branch 'blender-v2.83-release'
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r-- | source/blender/imbuf/IMB_colormanagement.h | 1 | ||||
-rw-r--r-- | source/blender/imbuf/intern/colormanagement.c | 17 |
2 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/imbuf/IMB_colormanagement.h b/source/blender/imbuf/IMB_colormanagement.h index 1639fb4715f..3158e3419b0 100644 --- a/source/blender/imbuf/IMB_colormanagement.h +++ b/source/blender/imbuf/IMB_colormanagement.h @@ -56,6 +56,7 @@ void IMB_colormanagement_validate_settings( const char *IMB_colormanagement_role_colorspace_name_get(int role); void IMB_colormanagement_check_is_data(struct ImBuf *ibuf, const char *name); +void IMB_colormanagegent_copy_settings(struct ImBuf *ibuf_src, struct ImBuf *ibuf_dst); void IMB_colormanagement_assign_float_colorspace(struct ImBuf *ibuf, const char *name); void IMB_colormanagement_assign_rect_colorspace(struct ImBuf *ibuf, const char *name); diff --git a/source/blender/imbuf/intern/colormanagement.c b/source/blender/imbuf/intern/colormanagement.c index c57ab70f4e6..3f5a0f25cc5 100644 --- a/source/blender/imbuf/intern/colormanagement.c +++ b/source/blender/imbuf/intern/colormanagement.c @@ -1349,6 +1349,23 @@ void IMB_colormanagement_check_is_data(ImBuf *ibuf, const char *name) } } +void IMB_colormanagegent_copy_settings(ImBuf *ibuf_src, ImBuf *ibuf_dst) +{ + IMB_colormanagement_assign_rect_colorspace(ibuf_dst, + IMB_colormanagement_get_rect_colorspace(ibuf_src)); + IMB_colormanagement_assign_float_colorspace(ibuf_dst, + IMB_colormanagement_get_float_colorspace(ibuf_src)); + if (ibuf_src->flags & IB_alphamode_premul) { + ibuf_dst->flags |= IB_alphamode_premul; + } + else if (ibuf_src->flags & IB_alphamode_channel_packed) { + ibuf_dst->flags |= IB_alphamode_channel_packed; + } + else if (ibuf_src->flags & IB_alphamode_ignore) { + ibuf_dst->flags |= IB_alphamode_ignore; + } +} + void IMB_colormanagement_assign_float_colorspace(ImBuf *ibuf, const char *name) { ColorSpace *colorspace = colormanage_colorspace_get_named(name); |