Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r--source/blender/imbuf/IMB_colormanagement.h1
-rw-r--r--source/blender/imbuf/intern/allocimbuf.c2
-rw-r--r--source/blender/imbuf/intern/cache.c4
-rw-r--r--source/blender/imbuf/intern/colormanagement.c17
-rw-r--r--source/blender/imbuf/intern/divers.c2
-rw-r--r--source/blender/imbuf/intern/openexr/openexr_api.cpp4
6 files changed, 24 insertions, 6 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/allocimbuf.c b/source/blender/imbuf/intern/allocimbuf.c
index 6c17254e697..4b3858e6d5a 100644
--- a/source/blender/imbuf/intern/allocimbuf.c
+++ b/source/blender/imbuf/intern/allocimbuf.c
@@ -380,7 +380,7 @@ void *imb_alloc_pixels(
}
size_t size = (size_t)x * (size_t)y * (size_t)channels * typesize;
- return MEM_mapallocN(size, name);
+ return MEM_callocN(size, name);
}
bool imb_addrectfloatImBuf(ImBuf *ibuf)
diff --git a/source/blender/imbuf/intern/cache.c b/source/blender/imbuf/intern/cache.c
index 176b41d2706..23ce9bd7818 100644
--- a/source/blender/imbuf/intern/cache.c
+++ b/source/blender/imbuf/intern/cache.c
@@ -427,8 +427,8 @@ void IMB_tiles_to_rect(ImBuf *ibuf)
/* don't call imb_addrectImBuf, it frees all mipmaps */
if (!mipbuf->rect) {
- if ((mipbuf->rect = MEM_mapallocN(ibuf->x * ibuf->y * sizeof(unsigned int),
- "imb_addrectImBuf"))) {
+ if ((mipbuf->rect = MEM_callocN(ibuf->x * ibuf->y * sizeof(unsigned int),
+ "imb_addrectImBuf"))) {
mipbuf->mall |= IB_rect;
mipbuf->flags |= IB_rect;
}
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);
diff --git a/source/blender/imbuf/intern/divers.c b/source/blender/imbuf/intern/divers.c
index e068a84aab0..bcc8488089d 100644
--- a/source/blender/imbuf/intern/divers.c
+++ b/source/blender/imbuf/intern/divers.c
@@ -788,7 +788,7 @@ void IMB_float_from_rect(ImBuf *ibuf)
size = size * 4 * sizeof(float);
ibuf->channels = 4;
- rect_float = MEM_mapallocN(size, "IMB_float_from_rect");
+ rect_float = MEM_callocN(size, "IMB_float_from_rect");
if (rect_float == NULL) {
return;
diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp
index 62cc2e605e5..882808cbc14 100644
--- a/source/blender/imbuf/intern/openexr/openexr_api.cpp
+++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp
@@ -1598,8 +1598,8 @@ static ExrHandle *imb_exr_begin_read_mem(IStream &file_stream,
for (lay = (ExrLayer *)data->layers.first; lay; lay = lay->next) {
for (pass = (ExrPass *)lay->passes.first; pass; pass = pass->next) {
if (pass->totchan) {
- pass->rect = (float *)MEM_mapallocN(width * height * pass->totchan * sizeof(float),
- "pass rect");
+ pass->rect = (float *)MEM_callocN(width * height * pass->totchan * sizeof(float),
+ "pass rect");
if (pass->totchan == 1) {
echan = pass->chan[0];
echan->rect = pass->rect;