PyAPI: disable IMB color management methods for stand-alone mathutils

Allow building a standalone mathutils without including imbuf.
This commit is contained in:
2022-09-21 23:52:10 +10:00
parent 1b95784aad
commit 78b7a1c3a8

View File

@@ -14,7 +14,9 @@
#include "../generic/py_capi_utils.h"
#include "../generic/python_utildefines.h"
#include "IMB_colormanagement.h"
#ifndef MATH_STANDALONE
# include "IMB_colormanagement.h"
#endif
#ifndef MATH_STANDALONE
# include "BLI_dynstr.h"
@@ -92,6 +94,8 @@ static PyObject *Color_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
/** \name Color Methods: Color Space Conversion
* \{ */
#ifndef MATH_STANDALONE
PyDoc_STRVAR(Color_from_scene_linear_to_srgb_doc,
".. function:: from_scene_linear_to_srgb()\n"
"\n"
@@ -204,6 +208,8 @@ static PyObject *Color_from_rec709_linear_to_scene_linear(ColorObject *self)
return Color_CreatePyObject(col, Py_TYPE(self));
}
#endif /* MATH_STANDALONE */
/** \} */
/* -------------------------------------------------------------------- */
@@ -1050,7 +1056,8 @@ static struct PyMethodDef Color_methods[] = {
/* base-math methods */
{"freeze", (PyCFunction)BaseMathObject_freeze, METH_NOARGS, BaseMathObject_freeze_doc},
/* Color-space methods. */
/* Color-space methods. */
#ifndef MATH_STANDALONE
{"from_scene_linear_to_srgb",
(PyCFunction)Color_from_scene_linear_to_srgb,
METH_NOARGS,
@@ -1083,6 +1090,8 @@ static struct PyMethodDef Color_methods[] = {
(PyCFunction)Color_from_rec709_linear_to_scene_linear,
METH_NOARGS,
Color_from_rec709_linear_to_scene_linear_doc},
#endif /* MATH_STANDALONE */
{NULL, NULL, 0, NULL},
};