[Bf-blender-cvs] [73a6fcfa800] master: ImBuf: add planes, channels attributes
Campbell Barton
noreply at git.blender.org
Mon Sep 23 01:57:06 CEST 2019
Commit: 73a6fcfa80020615f081b75aeb6a6ed90405097a
Author: Campbell Barton
Date: Mon Sep 23 09:36:20 2019 +1000
Branches: master
https://developer.blender.org/rB73a6fcfa80020615f081b75aeb6a6ed90405097a
ImBuf: add planes, channels attributes
D5857 by @cmbasnett
===================================================================
M source/blender/python/generic/imbuf_py_api.c
===================================================================
diff --git a/source/blender/python/generic/imbuf_py_api.c b/source/blender/python/generic/imbuf_py_api.c
index 0b595987d73..593145476ad 100644
--- a/source/blender/python/generic/imbuf_py_api.c
+++ b/source/blender/python/generic/imbuf_py_api.c
@@ -256,6 +256,22 @@ static int py_imbuf_filepath_set(Py_ImBuf *self, PyObject *value, void *UNUSED(c
return 0;
}
+PyDoc_STRVAR(py_imbuf_planes_doc, "Number of bits associated with this image.\n\n:type: int");
+static PyObject *py_imbuf_planes_get(Py_ImBuf *self, void *UNUSED(closure))
+{
+ PY_IMBUF_CHECK_OBJ(self);
+ ImBuf *imbuf = self->ibuf;
+ return PyLong_FromLong(imbuf->planes);
+}
+
+PyDoc_STRVAR(py_imbuf_channels_doc, "Number of bit-planes.\n\n:type: int");
+static PyObject *py_imbuf_channels_get(Py_ImBuf *self, void *UNUSED(closure))
+{
+ PY_IMBUF_CHECK_OBJ(self);
+ ImBuf *imbuf = self->ibuf;
+ return PyLong_FromLong(imbuf->channels);
+}
+
static PyGetSetDef Py_ImBuf_getseters[] = {
{(char *)"size", (getter)py_imbuf_size_get, (setter)NULL, (char *)py_imbuf_size_doc, NULL},
{(char *)"ppm",
@@ -268,6 +284,8 @@ static PyGetSetDef Py_ImBuf_getseters[] = {
(setter)py_imbuf_filepath_set,
(char *)py_imbuf_filepath_doc,
NULL},
+ {(char *)"planes", (getter)py_imbuf_planes_get, NULL, (char *)py_imbuf_planes_doc, NULL},
+ {(char *)"channels", (getter)py_imbuf_channels_get, NULL, (char *)py_imbuf_channels_doc, NULL},
{NULL, NULL, NULL, NULL, NULL} /* Sentinel */
};
More information about the Bf-blender-cvs
mailing list