RAVE
pybitmapgenerator.h
Go to the documentation of this file.
1/* --------------------------------------------------------------------
2Copyright (C) 2009 Swedish Meteorological and Hydrological Institute, SMHI,
3
4This file is part of RAVE.
5
6RAVE 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
11RAVE 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 RAVE. If not, see <http://www.gnu.org/licenses/>.
18------------------------------------------------------------------------*/
25#ifndef PYBITMAP_GENERATOR_H
26#define PYBITMAP_GENERATOR_H
27#include "bitmap_generator.h"
28
32typedef struct {
33 PyObject_HEAD /*Always has to be on top*/
36
37#define PyBitmapGenerator_Type_NUM 0
39#define PyBitmapGenerator_GetNative_NUM 1
40#define PyBitmapGenerator_GetNative_RETURN BitmapGenerator_t*
41#define PyBitmapGenerator_GetNative_PROTO (PyBitmapGenerator*)
43#define PyBitmapGenerator_New_NUM 2
44#define PyBitmapGenerator_New_RETURN PyBitmapGenerator*
45#define PyBitmapGenerator_New_PROTO (BitmapGenerator_t*)
47#define PyBitmapGenerator_API_pointers 3
49#define PyBitmapGenerator_CAPSULE_NAME "_bitmapgenerator._C_API"
50
51#ifdef PYBITMAP_GENERATOR_MODULE
53extern PyTypeObject PyBitmapGenerator_Type;
54
56#define PyBitmapGenerator_Check(op) ((op)->ob_type == &PyBitmapGenerator_Type)
57
60
63
64#else
66static void **PyBitmapGenerator_API;
67
72#define PyBitmapGenerator_GetNative \
73 (*(PyBitmapGenerator_GetNative_RETURN (*)PyBitmapGenerator_GetNative_PROTO) PyBitmapGenerator_API[PyBitmapGenerator_GetNative_NUM])
74
80#define PyBitmapGenerator_New \
81 (*(PyBitmapGenerator_New_RETURN (*)PyBitmapGenerator_New_PROTO) PyBitmapGenerator_API[PyBitmapGenerator_New_NUM])
82
86#define PyBitmapGenerator_Check(op) \
87 (Py_TYPE(op) == &PyBitmapGenerator_Type)
88
89#define PyBitmapGenerator_Type (*(PyTypeObject*)PyBitmapGenerator_API[PyBitmapGenerator_Type_NUM])
90
94#define import_pybitmapgenerator() \
95 PyBitmapGenerator_API = (void **)PyCapsule_Import(PyBitmapGenerator_CAPSULE_NAME, 1);
96
97#endif
98
99#endif /* PYBITMAP_GENERATOR_H */
Provides functionallity for creating a surrounding bitmap on a composite.
#define PyBitmapGenerator_New_RETURN
Return type for New.
Definition pybitmapgenerator.h:44
#define PyBitmapGenerator_GetNative
Returns a pointer to the internal polar scan, remember to release the reference when done with the ob...
Definition pybitmapgenerator.h:72
#define PyBitmapGenerator_GetNative_PROTO
Argument prototype for GetNative.
Definition pybitmapgenerator.h:41
#define PyBitmapGenerator_New
Creates a new polar scan instance.
Definition pybitmapgenerator.h:80
#define PyBitmapGenerator_GetNative_RETURN
Return type for GetNative.
Definition pybitmapgenerator.h:40
#define PyBitmapGenerator_New_PROTO
Argument prototype for New.
Definition pybitmapgenerator.h:45
The definition.
Definition pybitmapgenerator.h:32
PyObject_HEAD BitmapGenerator_t * generator
the c-api bitmap generator
Definition pybitmapgenerator.h:34
Represents the functionality for creating bitmaps.
Definition bitmap_generator.c:34