ROPO
Loading...
Searching...
No Matches
pyfmiimage.h
Go to the documentation of this file.
1/* --------------------------------------------------------------------
2Copyright (C) 2011 Swedish Meteorological and Hydrological Institute, SMHI,
3
4This file is part of bRopo.
5
6bRopo is free software: you can redistribute it and/or modify
7it under the terms of the GNU Lesser General Public License as published by
8the Free Software Foundation, either version 3 of the License, or
9(at your option) any later version.
10
11bRopo is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU Lesser General Public License for more details.
15
16You should have received a copy of the GNU Lesser General Public License
17along with bRopo. If not, see <http://www.gnu.org/licenses/>.
18------------------------------------------------------------------------*/
25#ifndef PYFMIIMAGE_H
26#define PYFMIIMAGE_H
27#include "rave_fmi_image.h"
28
29
33typedef struct {
34 PyObject_HEAD /*Always have to be on top*/
37
38#define PyFmiImage_Type_NUM 0
40#define PyFmiImage_GetNative_NUM 1
41#define PyFmiImage_GetNative_RETURN RaveFmiImage_t*
42#define PyFmiImage_GetNative_PROTO (PyFmiImage*)
44#define PyFmiImage_New_NUM 2
45#define PyFmiImage_New_RETURN PyFmiImage*
46#define PyFmiImage_New_PROTO (RaveFmiImage_t*, int, int)
48#define PyFmiImage_API_pointers 3
50#define PyFmiImage_CAPSULE_NAME "_fmiimage._C_API"
51
52#ifdef PYFMIIMAGE_MODULE
53
55extern PyTypeObject PyFmiImage_Type;
56
58#define PyFmiImage_Check(op) ((op)->ob_type == &PyFmiImage_Type)
59
62
65
66#else
68static void **PyFmiImage_API;
69
74#define PyFmiImage_GetNative \
75 (*(PyFmiImage_GetNative_RETURN (*)PyFmiImage_GetNative_PROTO) PyFmiImage_API[PyFmiImage_GetNative_NUM])
76
86#define PyFmiImage_New \
87 (*(PyFmiImage_New_RETURN (*)PyFmiImage_New_PROTO) PyFmiImage_API[PyFmiImage_New_NUM])
88
92#define PyFmiImage_Check(op) \
93 (Py_TYPE(op) == &PyFmiImage_Type)
94
95
96#define PyFmiImage_Type (*(PyTypeObject*)PyFmiImage_API[PyFmiImage_Type_NUM])
97
101#define import_fmiimage() \
102 PyFmiImage_API = (void **)PyCapsule_Import(PyFmiImage_CAPSULE_NAME, 1);
103
104#endif
105
106#endif /* PYFMIIMAGE_H */
#define PyFmiImage_New_PROTO
Definition pyfmiimage.h:46
#define PyFmiImage_New
Definition pyfmiimage.h:86
#define PyFmiImage_GetNative
Definition pyfmiimage.h:74
#define PyFmiImage_New_RETURN
Definition pyfmiimage.h:45
#define PyFmiImage_GetNative_PROTO
Definition pyfmiimage.h:42
#define PyFmiImage_GetNative_RETURN
Definition pyfmiimage.h:41
PyObject_HEAD RaveFmiImage_t * image
Definition pyfmiimage.h:35