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/nodes/composite/node_composite_util.c')
-rw-r--r--source/blender/nodes/composite/node_composite_util.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/nodes/composite/node_composite_util.c b/source/blender/nodes/composite/node_composite_util.c
index 3806cf4543a..ff223ac83cf 100644
--- a/source/blender/nodes/composite/node_composite_util.c
+++ b/source/blender/nodes/composite/node_composite_util.c
@@ -568,6 +568,22 @@ CompBuf *valbuf_from_rgbabuf(CompBuf *cbuf, int channel)
return valbuf;
}
+void valbuf_to_rgbabuf(CompBuf *valbuf, CompBuf *cbuf, int channel)
+{
+ float *valf, *rectf;
+ int tot;
+
+ valf= valbuf->rect;
+
+ /* defaults to returning alpha channel */
+ if ((channel < CHAN_R) || (channel > CHAN_A)) channel = CHAN_A;
+
+ rectf = cbuf->rect + channel;
+
+ for (tot= cbuf->x*cbuf->y; tot>0; tot--, valf++, rectf+=4)
+ *rectf = *valf;
+}
+
static CompBuf *generate_procedural_preview(CompBuf *cbuf, int newx, int newy)
{
CompBuf *outbuf;