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:
authorBenoit Bolsee <benoit.bolsee@online.be>2015-08-30 23:37:13 +0300
committerBenoit Bolsee <benoit.bolsee@online.be>2015-08-30 23:37:13 +0300
commit02c618fb9453df2754a03c9f7aba1455c5317384 (patch)
treee85bf5281d267f8d09ba5868dbc5c90e90f278a7 /source/gameengine/VideoTexture/ImageMix.cpp
parent6c7358a7e90d000999f0d66752af70ca2db18c4a (diff)
VideoTexture: Add an optional parameter to the refresh method of image sources.
If provided, the parameter must be an object that supports the buffer protocol (bytearray, memoryview, etc) otherwise a runtime error is generated. If the buffer is sufficiently large, the image is copied in the buffer before being refreshed (i.e. invalidated). If the image was not already available, it will be updated first. In the later case, it is possible that the image is loaded directly in the user's buffer wihtout an intermediate copy in the internal image buffer. This is currently the case for ImageViewport and ImageRender sources when the OGL format matches the buffer format (alpha, no filter, no flip, no scaling). Note that the image format in the buffer is always RGBA. If no parameter is provided, the method works as before: the image is invalidated without any attempt to updated it first. The function returns False if a buffer was provided but could not be updated for any reason (source not ready, buffer too small). It returns True in all other situations. The purpose of this function is to efficiently retrieve the OGL frame buffer directly into a user buffer by skiping an extra copy to the internal image buffer if it's not needed.
Diffstat (limited to 'source/gameengine/VideoTexture/ImageMix.cpp')
-rw-r--r--source/gameengine/VideoTexture/ImageMix.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/gameengine/VideoTexture/ImageMix.cpp b/source/gameengine/VideoTexture/ImageMix.cpp
index dc93bf03423..df8419112e7 100644
--- a/source/gameengine/VideoTexture/ImageMix.cpp
+++ b/source/gameengine/VideoTexture/ImageMix.cpp
@@ -156,7 +156,7 @@ static PyMethodDef imageMixMethods[] = {
{"getWeight", (PyCFunction)getWeight, METH_VARARGS, "get image source weight"},
{"setWeight", (PyCFunction)setWeight, METH_VARARGS, "set image source weight"},
// methods from ImageBase class
- {"refresh", (PyCFunction)Image_refresh, METH_NOARGS, "Refresh image - invalidate its current content"},
+ {"refresh", (PyCFunction)Image_refresh, METH_VARARGS, "Refresh image - invalidate its current content"},
{NULL}
};
// attributes structure