MCPcopy Create free account
hub / github.com/carbonengine/trinity / PyTriColorFromKelvin

Function PyTriColorFromKelvin

trinity/Tr2KelvinColor_Blue.cpp:77–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75
76#if BLUE_WITH_PYTHON
77static 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
99static PyObject* PyGetKelvinTemperatureBuffer( PyObject* self, PyObject* args )
100{

Callers

nothing calls this directly

Calls 1

TriColorFromKelvinFunction · 0.85

Tested by

no test coverage detected