2
-----------------------------------------------------------------------------
3
This source file is part of VideoTexture library
5
Copyright (c) 2006 The Zdeno Ash Miklas
7
This program is free software; you can redistribute it and/or modify it under
8
the terms of the GNU Lesser General Public License as published by the Free Software
9
Foundation; either version 2 of the License, or (at your option) any later
12
This program is distributed in the hope that it will be useful, but WITHOUT
13
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16
You should have received a copy of the GNU Lesser General Public License along with
17
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
18
Place - Suite 330, Boston, MA 02111-1307, USA, or go to
19
http://www.gnu.org/copyleft/lesser.txt.
20
-----------------------------------------------------------------------------
2
* ***** BEGIN GPL LICENSE BLOCK *****
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public License
6
* as published by the Free Software Foundation; either version 2
7
* of the License, or (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software Foundation,
16
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18
* Copyright (c) 2006 The Zdeno Ash Miklas
20
* This source file is part of VideoTexture library
24
* ***** END GPL LICENSE BLOCK *****
23
27
/** \file gameengine/VideoTexture/blendVideoTex.cpp
24
28
* \ingroup bgevideotex
27
#include <PyObjectPlus.h>
31
#include "PyObjectPlus.h"
33
#include "KX_PythonInit.h"
29
35
#include <RAS_GLExtensionManager.h>
72
78
// get last error description
73
static PyObject * getLastError (PyObject *self, PyObject *args)
79
static PyObject *getLastError (PyObject *self, PyObject *args)
75
81
return PyUnicode_FromString(Exception::m_lastError.c_str());
79
static PyObject * setLogFile (PyObject *self, PyObject *args)
85
static PyObject *setLogFile (PyObject *self, PyObject *args)
82
88
if (!PyArg_ParseTuple(args, "s:setLogFile", &Exception::m_logFile))
89
95
// image to numpy array
90
static PyObject * imageToArray (PyObject * self, PyObject *args)
96
static PyObject *imageToArray(PyObject *self, PyObject *args)
92
98
// parameter is Image object
94
100
char *mode = NULL;
95
101
if (!PyArg_ParseTuple(args, "O|s:imageToArray", &pyImg, &mode) || !pyImageTypes.in(Py_TYPE(pyImg)))
208
214
pyFilterTypes.reg(m);
210
216
Py_INCREF(&TextureType);
211
PyModule_AddObject(m, (char*)"Texture", (PyObject*)&TextureType);
217
PyModule_AddObject(m, (char*)"Texture", (PyObject *)&TextureType);
212
218
PyModule_AddIntConstant(m, (char*)"SOURCE_ERROR", SourceError);
213
219
PyModule_AddIntConstant(m, (char*)"SOURCE_EMPTY", SourceEmpty);
214
220
PyModule_AddIntConstant(m, (char*)"SOURCE_READY", SourceReady);