From 847435c8589e9326df67a01dbd98bc093535f88a Mon Sep 17 00:00:00 2001 From: kramm Date: Thu, 30 Dec 2004 20:00:53 +0000 Subject: [PATCH] added getter for matrix entries. --- lib/python/primitives.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/python/primitives.c b/lib/python/primitives.c index cbd2442..008c84a 100644 --- a/lib/python/primitives.c +++ b/lib/python/primitives.c @@ -294,6 +294,17 @@ PyObject* f_Matrix(PyObject* _self, PyObject* args, PyObject* kwargs) static PyObject* matrix_getattr(PyObject * self, char* a) { PY_ASSERT_TYPE(self,&MatrixClass); + MatrixObject*matrix = (MatrixObject*)self; + if(!strcmp(a, "entries")) { + return Py_BuildValue("(ffffff)", + matrix->matrix.sx/65536.0, + matrix->matrix.r0/65536.0, + matrix->matrix.r1/65536.0, + matrix->matrix.sy/65536.0, + matrix->matrix.tx/20.0, + matrix->matrix.ty/20.0 + ); + } return NULL; } static int matrix_setattr(PyObject * self, char* a, PyObject* o) -- 1.7.10.4