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

Method PyGetColorAt

trinity/TriPythonThunkers.cpp:93–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91
92
93PyObject* ITriColorFunction_Thunk::PyGetColorAt( PyObject* args )
94{
95 PyObject* t;
96 if( !PyArg_ParseTuple( args, "O", &t ) )
97 return NULL;
98
99 ITriColorPtr q;
100 q.Attach( new OTriColor );
101
102 if( PyLong_Check( t ) )
103 {
104 Color tmpResult;
105 q->SetColor( GetValueAt( &tmpResult, Be::Time( PyLong_AsLongLong( t ) ) ) );
106 }
107 else if( PyFloat_Check( t ) )
108 {
109 Color tmpResult;
110 q->SetColor( GetValueAt( &tmpResult, PyFloat_AS_DOUBLE( t ) ) );
111 }
112 else
113 {
114 BeOS->SetError( BEDEF, Clsid(), "arg must be of type LongLong (Be::Time) or float" );
115 return nullptr;
116 }
117 return PyOS->WrapBlueObject( q );
118}
119
120
121/////////////////////////////////////////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls 2

AttachMethod · 0.45
SetColorMethod · 0.45

Tested by

no test coverage detected