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/intern/allocimbuf.c')
-rw-r--r--source/blender/imbuf/intern/allocimbuf.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/source/blender/imbuf/intern/allocimbuf.c b/source/blender/imbuf/intern/allocimbuf.c
index 556c4beeae7..b28d19e3e15 100644
--- a/source/blender/imbuf/intern/allocimbuf.c
+++ b/source/blender/imbuf/intern/allocimbuf.c
@@ -362,6 +362,30 @@ bool imb_addrectImBuf(ImBuf *ibuf)
return false;
}
+struct ImBuf *IMB_allocFromBuffer(const unsigned int *rect, const float *rectf,
+ unsigned int w, unsigned int h)
+{
+ ImBuf *ibuf = NULL;
+
+ if (!(rect || rectf))
+ return NULL;
+
+ ibuf = IMB_allocImBuf(w, h, 32, 0);
+
+ if (rectf) {
+ ibuf->rect_float = MEM_dupallocN(rectf);
+ ibuf->flags |= IB_rectfloat;
+ ibuf->mall |= IB_rectfloat;
+ }
+ if (rect) {
+ ibuf->rect = MEM_dupallocN(rect);
+ ibuf->flags |= IB_rect;
+ ibuf->mall |= IB_rect;
+ }
+
+ return ibuf;
+}
+
bool imb_addtilesImBuf(ImBuf *ibuf)
{
if (ibuf == NULL) return false;