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

Method PyUpdateColor

trinity/TriPythonThunkers.cpp:65–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63/////////////////////////////////////////////////////////////////////////////////////////
64
65PyObject* ITriColorFunction_Thunk::PyUpdateColor( PyObject* args )
66{
67 PyObject* t;
68 if( !PyArg_ParseTuple( args, "O", &t ) )
69 return NULL;
70
71 ITriColorPtr q;
72 q.Attach( new OTriColor );
73
74 if( PyLong_Check( t ) )
75 {
76 Color tmpResult;
77 q->SetColor( Update( &tmpResult, Be::Time( PyLong_AsLongLong( t ) ) ) );
78 }
79 else if( PyFloat_Check( t ) )
80 {
81 Color tmpResult;
82 q->SetColor( Update( &tmpResult, PyFloat_AS_DOUBLE( t ) ) );
83 }
84 else
85 {
86 BeOS->SetError( BEDEF, Clsid(), "arg must be of type LongLong (Be::Time) or float" );
87 return nullptr;
88 }
89 return PyOS->WrapBlueObject( q );
90}
91
92
93PyObject* ITriColorFunction_Thunk::PyGetColorAt( PyObject* args )

Callers

nothing calls this directly

Calls 2

AttachMethod · 0.45
SetColorMethod · 0.45

Tested by

no test coverage detected