| 75 | |
| 76 | #if BLUE_WITH_PYTHON |
| 77 | static PyObject* PyTriColorFromKelvin( PyObject* self, PyObject* args ) |
| 78 | { |
| 79 | float temperature, tint; |
| 80 | int intWhiteBalance; |
| 81 | if( !PyArg_ParseTuple( args, "ffi", &temperature, &tint, &intWhiteBalance ) ) |
| 82 | { |
| 83 | PyErr_SetString( PyExc_TypeError, "Provided arguments do not match function signature of ( float, float, int )" ); |
| 84 | return NULL; |
| 85 | } |
| 86 | |
| 87 | Tr2StandardIlluminant stdIllum = (Tr2StandardIlluminant)intWhiteBalance; |
| 88 | Vector3d color = TriColorFromKelvin( temperature, tint, stdIllum ); |
| 89 | |
| 90 | PyObject* ret = PyTuple_New( 4 ); |
| 91 | PyTuple_SET_ITEM( ret, 0, PyFloat_FromDouble( color.x ) ); |
| 92 | PyTuple_SET_ITEM( ret, 1, PyFloat_FromDouble( color.y ) ); |
| 93 | PyTuple_SET_ITEM( ret, 2, PyFloat_FromDouble( color.z ) ); |
| 94 | PyTuple_SET_ITEM( ret, 3, PyFloat_FromDouble( 1.0 ) ); |
| 95 | |
| 96 | return ret; |
| 97 | } |
| 98 | |
| 99 | static PyObject* PyGetKelvinTemperatureBuffer( PyObject* self, PyObject* args ) |
| 100 | { |
nothing calls this directly
no test coverage detected