~ubuntu-branches/ubuntu/trusty/blender/trusty

« back to all changes in this revision

Viewing changes to source/gameengine/VideoTexture/blendVideoTex.cpp

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
-----------------------------------------------------------------------------
3
 
This source file is part of VideoTexture library
4
 
 
5
 
Copyright (c) 2006 The Zdeno Ash Miklas
6
 
 
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
10
 
version.
11
 
 
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.
15
 
 
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
 
-----------------------------------------------------------------------------
21
 
*/
 
2
 * ***** BEGIN GPL LICENSE BLOCK *****
 
3
 *
 
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.
 
8
 *
 
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.
 
13
 *
 
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.
 
17
 *
 
18
 * Copyright (c) 2006 The Zdeno Ash Miklas
 
19
 *
 
20
 * This source file is part of VideoTexture library
 
21
 *
 
22
 * Contributor(s):
 
23
 *
 
24
 * ***** END GPL LICENSE BLOCK *****
 
25
 */
22
26
 
23
27
/** \file gameengine/VideoTexture/blendVideoTex.cpp
24
28
 *  \ingroup bgevideotex
25
29
 */
26
30
 
27
 
#include <PyObjectPlus.h>
 
31
#include "PyObjectPlus.h"
 
32
 
 
33
#include "KX_PythonInit.h"
28
34
 
29
35
#include <RAS_GLExtensionManager.h>
30
36
 
46
52
 
47
53
 
48
54
// get material id
49
 
static PyObject * getMaterialID (PyObject *self, PyObject *args)
 
55
static PyObject *getMaterialID (PyObject *self, PyObject *args)
50
56
{
51
57
        // parameters - game object with video texture
52
 
        PyObject * obj = NULL;
 
58
        PyObject *obj = NULL;
53
59
        // material name
54
60
        char * matName;
55
61
 
70
76
 
71
77
 
72
78
// get last error description
73
 
static PyObject * getLastError (PyObject *self, PyObject *args)
 
79
static PyObject *getLastError (PyObject *self, PyObject *args)
74
80
{
75
81
        return PyUnicode_FromString(Exception::m_lastError.c_str());
76
82
}
77
83
 
78
84
// set log file
79
 
static PyObject * setLogFile (PyObject *self, PyObject *args)
 
85
static PyObject *setLogFile (PyObject *self, PyObject *args)
80
86
{
81
87
        // get parameters
82
88
        if (!PyArg_ParseTuple(args, "s:setLogFile", &Exception::m_logFile))
87
93
 
88
94
 
89
95
// image to numpy array
90
 
static PyObject * imageToArray (PyObject * self, PyObject *args)
 
96
static PyObject *imageToArray(PyObject *self, PyObject *args)
91
97
{
92
98
        // parameter is Image object
93
 
        PyObject * pyImg;
 
99
        PyObject *pyImg;
94
100
        char *mode = NULL;
95
101
        if (!PyArg_ParseTuple(args, "O|s:imageToArray", &pyImg, &mode) || !pyImageTypes.in(Py_TYPE(pyImg)))
96
102
        {
168
174
        0,  /* m_free */
169
175
};
170
176
 
171
 
PyObject* initVideoTexture(void) 
 
177
PyObject *initVideoTexture(void)
172
178
{
173
 
        PyObject * m;
 
179
        PyObject *m;
174
180
        
175
181
        // initialize GL extensions
176
182
        //bgl::InitExtensions(0);
208
214
        pyFilterTypes.reg(m);
209
215
 
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);